A LoRa-Based Wireless Sensor Network for Urban Water Quality Monitoring with Real-Time Machine Learning and Energy Analysis
This paper presents a LoRa-based system for real-time urban water quality monitoring. The proposed platform integrates several sensors, including ultraviolet (UV), infrared (IR), red-green-blue (RGB), pH, turbidity, and temperature sensors, to monitor different water quality parameters. A total of 1443 sensor records were collected during the experiments. Among these records, 75 UV measurements, corresponding to approximately 5.2% of the dataset, were missing or invalid while the Red, Green, and Blue (RGB) and IR measurements were available. Several regression and machine learning models were evaluated to reconstruct these UV values. Multiple Linear Regression showed limited performance in the initial random train–test evaluation (R2 = 0.12), while second-order Polynomial Regression achieved a considerably higher R2 of 0.963. Support Vector Regression (SVR), k-Nearest Neighbors (KNN), Multi-Layer Perceptron (MLP), and Random Forest (RF) were also evaluated. Random Forest obtained the highest R2 in the random train–test evaluation (R2 = 0.991). However, the results were less consistent when the models were evaluated using Leave-One-Session-Out (LOSO) validation. In this evaluation, KNN obtained the lowest mean absolute error (MAE) and root mean squared error (RMSE), while the mean R2 values were negative for all evaluated models, showing limited generalization between experimental sessions. The possible energy benefit of UV reconstruction was also estimated. Based on an active power of 2.995 W and an acquisition time of 10 s, avoiding 75 additional acquisition cycles would correspond to approximately 0.624 Wh of acquisition energy, or 4.94% under the assumptions used in the energy analysis. These results show that machine learning can be useful for reconstructing individual missing or invalid UV measurements when the corresponding optical measurements are available. At the same time, the differences observed between experimental sessions show that further experiments with more independent sessions and longer field deployments are needed.
Authors
- Lorena Parra (ORCID: https://orcid.org/0000-0001-9215-8734)
- Jaime Lloret (ORCID: https://orcid.org/0000-0002-0862-0533)
- Iman Valizadeh
Institutions
- Universitat Politècnica de València (ES)
- Universidad Politécnica de Madrid (ES)
Publication Details
- Journal
- Sensors
- Published
- 2026-09-29
- DOI
- https://doi.org/10.3390/s26196159
- Primary Topic
- Water Quality Monitoring Technologies
- Type
- article
- Field-Weighted Citation Impact
- 0.00