Access to safe drinking water remains a global challenge, worsened by pollution and delays in traditional lab analysis. This paper presents a low-cost (under 80), real-time Smart Water Quality Monitoring System utilizing the ESP32 microcontroller. The system measures four crucial parameters, specifically pH, TDS, temperature, and turbidity, and transmits data to a cloud backend for remote visualization on a dynamic web dashboard. A key innovation is the integration of an on-device machine learning model (TinyML) for intelligent, real-time categorization of water impurity events. A neural network, trained on a custom 6, 000-point dataset and deployed using the TensorFlow Lite for Microcontrollers framework, distinguishes between ‘Normal’, ‘Rainwater Runoff’, and ‘Chemical’ impurity profiles with 99. 28% accuracy. This approach enables independent anomaly detection without reliance on cloud connectivity for decision making. To address hardware constraints, an intelligent fluctuation-based logging algorithm was implemented, demonstrating a 98. 2% reduction in SD card write operations during a 24-hour stability test (1, 520 writes versus 86, 400 in continuous mode). Combined with an automated pump control mechanism, this approach provides an autonomous, resource-efficient solution for decentralized water safety monitoring.
Sharma et al. (Thu,) studied this question.