The high salinity of water negatively affects soil fertility up to yield loss. In regions with high salinity, unorthodox methods and devices are used to lower the level of mineralization. This article discusses the use of an automatic decision-making system for a device to lower the level of mineralization by diffusion mixing. Construction able to filter water to irrigation rates up to 3 grams per liter and extent the operating period of reverse osmosis. The article provides a detailed description algorithm of a program for automatic control of the water purification process based on the Atmega 328 processor.