An Intelligent IoT-Based Water Quality Monitoring and STORET Index Prediction System Using Random Forest
Abstract
Hygiene sanitation water quality fluctuates due to environmental dynamics, yet conventional monitoring systems generally lack the predictive capabilities compliance with health standards (Permenkes No. 2 of 2023). This study aims to develop an intelligent Water Quality Monitoring System (WQMS) capable of predicting water quality status based on the STORET index using the Random Forest algorithm. [Methods] The proposed system integrates an ESP32-S3 microcontroller with calibrated low-cost sensors for real-time data acquisition. To ensure data integrity, regression was applied for sensor calibration, while the STORET method was utilized to determine pollution levels and water feasibility. A Random Forest regression model was then trained using these processed datasets to classify water quality status. Experimental results demonstrated high hardware precision, achieving Mean Absolute Percentage Error (MAPE) values of 5.38% for pH, 2.24% for TDS, and 0.22% for the Flow Meter. Furthermore, the Random Forest model exhibited superior predictive performance, yielding a Coefficient of Determination () of 0.9977, a Mean Absolute Error (MAE) of 0.2213, and a Root Mean Squared Error (RMSE) of 0.5144. These findings indicate that the integrated system effectively combines accurate sensing with robust predictive modeling. Consequently, the system is categorized as highly capable of providing real-time insights and early warnings, offering a significant improvement over traditional monitoring methods for public health safety.





