Despite the strict requirements for wastewater quality, intensive pollution and accumulation of industrial pollution, potentially hazardous substances, continues in the places of wastewater discharge. Therefore, the aim of the study is to improve the operation of biological wastewater treatment plants to ensure compliance with environmental requirements. To achieve this goal, the features of wastewater treatment are analyzed and it is found that the treatment process depends on the concentration of activated sludge, the amount of air and the properties of the wastewater entering the treatment. With this in mind, it is proposed to adjust the ratio of "sewage active sludge air" to ensure compliance with environmental requirements. Factors influencing the cleaning process are also identified. Such factors are the consumption of wastewater coming for treatment, oxygen saturation of the mixture of activated sludge and wastewater, the quantity and quality of activated sludge fed into the aeration tank. In addition, the peculiarities of the processes occurring in different parts of the buildings are taken into account, and it is proposed to divide the cleaning process into two stages. The first stage takes place in the first corridor of the aeration tank (regenerator), where the activated sludge enters for regeneration. The second stage covers the second or third corridors of the aeration tank and the secondary settling tank, where the wastewater is first mixed with activated sludge, then the mixture is discharged to the secondary settling tank. An experimental study of the cleaning process was carried out, as a result of which the necessary data for the mathematical description of the processes were obtained. After processing the experimental data, regression equations were obtained that describe the purification processes in the system "aeration tank-displacer - secondary settling tank", namely the change in the concentration of activated sludge at the outlet of the regenerator and the change in the concentration of contaminants in the purified water. The adequacy of the equations was checked according to Fisher's test. It was found that the equations are adequate to real processes within the accepted conditions and assumptions. Analytical solutions of the obtained equations allow to analyze the course of purification processes at different stages, to determine the influence of factors on the process. A procedure for the use of equations is proposed, which allows without additional experiments to choose the mode of operation of biological treatment facilities, which will ensure compliance with environmental requirements.