Nowadays environmental protection is one of the most important problems. Industrial firms are expected to reduce continuously the environmental load, meanwhile enhancing their productivity. In our study a procedure was developed for the management of the waste water of a pharmaceutical process. The parameters of the waste water, which is flowing into the sewerage system, are generally below the permitted threshold value but occasionally exceeded the limit. To improve this situation an on-line measuring equipment set was applied, by which the chemical oxygen demand (later CODcr) can be estimated on the basis of BRIX refractometric method. A mathematical model was developed for the estimation of the CODcr value and its integral, and the standard deviation. Furthermore a real time control module was developed, which tries to adjust the parameters of the waste water to keep it continuously under the threshold value. It works with three collecting tanks and controls the flow of the water into the tanks and afterwards lets down the water into the drain, or suggests the transportation of it for CODcr removal. The equipment was tested for 45 days, and the measured data were used for the simulation of the control module. During the test period it was established, that the volume of the water which needs transport for CODcr removal became less by 50 percent, while no water, the parameters of which were above the threshold value, flowed into the sewerage system.