Climate change, energy saving and access to water are issues of great interest to society. Now, thanks to the advent of the Internet of Things and microcontrollers, numerous potential applications have opened up. This paper proposes the design of a pump control system and monitoring of drinking water quality. This system is usually applied in the industrial area, however, here it seeks to incorporate it in rural and urban areas, for use in buildings or homes. This manuscript describes the automation of the process of filling water tanks. Unlike other similar systems, this one can automatically fill the tank and monitor the water quality in real time to anticipate its respective maintenance. The ESP32 was used as the main controller, which acquires the values measured by each of the sensors. Sensor data can be viewed from a mobile app via a Bluetooth connection.Finally, the implementation of this automated system is described through a prototype, where the data is shown in real time.