The objective of this study is to develop an automatic control system for dissolved oxygen (DO) and pH of the activated sludge process in a coke wastewater treatment plant. A discrete type autotuned proportional-integral (PI) controller using an auto-regressive exogenous (ARX) model as a process model was developed to maintain the DO concentration in aerators by controlling the speed of surface aerators. Also a nonlinear pH controller using the titration curve was used to control the pH of influent wastewater. This control system was tested in a pilot scale plant During this pilot plant experiment, there was small deviation of pH and the electric power consumption of surface aerators was reduced up to 70% with respect to the full operation when the DO set point was 2 mg/l. For real plant operation with this system, the discrete PI controller showed good tracking for set point change. The electricity saving was more than 40% of the electricity consumption when considering surface aerators. As a result of maintaining the DO constantly at the set point by the automatic control system, the fluctuation of effluent quality was decreased and overall improvement of the effluent water quality was achieved. (C) 1998 Published by Elsevier Science Ltd All rights reserved.