Comparative Evaluation of Moving Average Filtering and Linear ‎Regression Calibration in an ESP32-Based Water pH Sensor

  • Mukhammad Indra Ukasya Universitas Negeri Surabaya, Indonesia
  • Farid Baskoro Universitas Negeri Surabaya, Indonesia
  • Rifqi Firmansyah Universitas Negeri Surabaya, Indonesia
  • Lilik Anifah Universitas Negeri Surabaya, Indonesia
  • Lusia Rakhmawati Universitas Negeri Surabaya, Indonesia
Keywords: ESP32, pH sensor, Moving Average Filter, Linear Regression, sensor calibration

Abstract

This study compared Moving Average filtering and Linear Regression calibration in an ESP32-based low-cost pH measurement system using nominal buffers of pH 4.01, 6.86, and 9.18. One ESP32–PH-4502C sensor unit was evaluated through 60 repeated measurement cycles per buffer under approximately 25 °C room conditions. Performance was assessed using MAE, MSE, RMSE, bias, standard deviation, 95% confidence interval, drift slope, and lag-1 autocorrelation. Moving Average filtering did not reduce measurement error, and MAE generally increased with larger window sizes. Linear Regression reduced MAE by 25.2% at pH 4.01 but increased MAE by 158.9% at pH 6.86 and 42.4% at pH 9.18. The recorded Linear Regression condition also showed lower dispersion, drift slopes closer to zero, and lower lag-1 autocorrelation. However, because the processing conditions were not evaluated as paired transformations of the same underlying voltage sequence, these stability differences cannot be attributed solely to the regression transformation. The findings show that smoothing did not improve accuracy, while regression performance varied across buffer values. The results are device-specific and do not establish field performance or generalization across sensor units.

Downloads

Download data is not yet available.

References

Ardyansyah, H., Pradana, R., & Puspasari Handayani, I. (2022). Fuzzy logic dalam sistem kualitas air ‎kolam Betta splendens berdasarkan pH dan suhu. Jurnal Ticom: Technology of Information and ‎Communication, 10(2), 78–86. https://doi.org/10.70309/ticom.v10i2.21‎

Chacón-Mateos, M., García-Salamero, H., Laquai, B., & Vogt, U. (2025). Calibration and performance ‎evaluation of PM2.5 and NO2 air quality sensors for environmental epidemiology. Atmospheric ‎Measurement Techniques, 18, 4061–4085. https://doi.org/10.5194/amt-18-4061-2025‎

Chen, C.-H., Wu, Y.-C., Zhang, J.-X., & Chen, Y.-H. (2022). IoT-based fish farm water quality monitoring ‎system. Sensors, 22(17), Article 6700. https://doi.org/10.3390/s22176700‎

de Camargo, E. T., Spanhol, F. A., Slongo, J. S., da Silva, M. V. R., Pazinato, J., de Lima Lobo, A. V., ‎Coutinho, F. R., Pfrimer, F. W. D., Lindino, C. A., Oyamada, M. S., & Martins, L. D. (2023). Low-cost ‎water quality sensors for IoT: A systematic review. Sensors, 23(9), Article 4424. ‎https://doi.org/10.3390/s23094424‎

de Jong, T., Linn, M. C., & Zacharia, Z. C. (2013). Physical and virtual laboratories in science and ‎engineering education. Science, 340(6130), 305–308. https://doi.org/10.1126/science.1230579‎

Espinosa-Gavira, M. J., Agüera-Pérez, A., Palomares-Salas, J. C., Sierra-Fernandez, J. M., Remigio-‎Carmona, P., & González de-la-Rosa, J. J. (2024). Characterization and performance evaluation of ‎ESP32 for real-time synchronized sensor networks. Procedia Computer Science, 237, 261–268. ‎https://doi.org/10.1016/j.procs.2024.05.104‎

Faghir Hagh, S., Amngostar, P., Chen, W., Sheridan, J., Williams, C. J., Morales-Williams, A. M., Huston, D., ‎& Xia, T. (2024). A low-cost LoRa optical fluorometer–nephelometer for wireless monitoring of ‎water quality parameters in real time. IEEE Sensors Journal, 24(13), 21511–21519. ‎https://doi.org/10.1109/JSEN.2024.3403416‎

Febriani, E., Woods, R., Madkur, A., & Hasanah, U. (2026). Implementation of the Sustainable ‎Development Goals (SDGs) in the education and environmental sectors: A comparative study of ‎Indonesia and Australia. Gender, Islamic Law, and Sustainability, 1(2), 102–116. ‎https://doi.org/10.70211/gils.v1i2.547‎

Fernandes, S., Fialho, A., Santos, J. M., Ferreira, T., & Filipe, A. F. (2025). Development of a cost-effective ‎multiparametric probe for continuous real-time monitoring of aquatic environments. Sensors, ‎‎25(23), Article 7110. https://doi.org/10.3390/s25237110‎

Fiddariani, A. S., & Sumanto, B. (2024). Studi penerapan filter digital pada sistem pemantau parameter ‎di kolam ikan. Jurnal Listrik, Instrumentasi, dan Elektronika Terapan, 5(1), 30–37. ‎https://doi.org/10.22146/juliet.v5i1.87377‎

Hariandini, Y., Yuda, I. B., & Ahmed, W. (2026). Implementing digital integrated learning in schools: ‎Evidence from classroom practices. Digital Learning, Social Science, and Life-course Studies, 2(1), ‎‎46–56. https://doi.org/10.70211/disolife.v2i1.348‎

Hofstein, A., & Lunetta, V. N. (2004). The laboratory in science education: Foundations for the twenty-‎first century. Science Education, 88(1), 28–54. https://doi.org/10.1002/sce.10106‎

Jan, F., Min-Allah, N., & Düştegör, D. (2021). IoT based smart water quality monitoring: Recent ‎techniques, trends and challenges for domestic applications. Water, 13(13), Article 1729. ‎https://doi.org/10.3390/w13131729‎

Kureshi, R. R., Mishra, B. K., Thakker, D., John, R., Walker, A., Simpson, S., Thakkar, N., & Wante, A. K. ‎‎(2022). Data-driven techniques for low-cost sensor selection and calibration for the use case of ‎air quality monitoring. Sensors, 22(3), Article 1093. https://doi.org/10.3390/s22031093‎

Lakshmikantha, V., Hiriyannagowda, A., Manjunath, A., Patted, A., Basavaiah, J., & Anthony, A. A. (2021). ‎IoT based smart water quality monitoring system. Global Transitions Proceedings, 2(2), 181–186. ‎https://doi.org/10.1016/j.gltp.2021.08.062‎

Lal, K., Menon, S., Noble, F., & Arif, K. M. (2024). Low-cost IoT based system for lake water quality ‎monitoring. PLOS ONE, 19(3), Article e0299089. https://doi.org/10.1371/journal.pone.0299089‎

Liang, L., & Daniels, J. (2022). What influences low-cost sensor data calibration? A systematic ‎assessment of algorithms, duration, and predictor selection. Aerosol and Air Quality Research, 22, ‎Article 220076. https://doi.org/10.4209/aaqr.220076‎

Mahajan, S., & Helbing, D. (2025). Dynamic calibration of low-cost PM2.5 sensors using trust-based ‎consensus mechanisms. npj Climate and Atmospheric Science, 8, Article 257. ‎https://doi.org/10.1038/s41612-025-01145-2‎

Mahfud, N. B. A., Indana, S., & Isnawati. (2026). Development of a problem based learning science e-‎module integrating Ledre local wisdom to foster junior high school students’ critical thinking ‎skills. JPI: Jurnal Pustaka Indonesia, 6(2), 452–472. https://doi.org/10.62159/jpi.v6i2.2586‎

Miller, M., Kisiel, A., Cembrowska-Lech, D., Durlik, I., & Miller, T. (2023). IoT in water quality ‎monitoring—Are we really here? Sensors, 23(2), Article 960. https://doi.org/10.3390/s23020960‎

Mohd Jais, N. A., Abdullah, A. F., Mohd Kassim, M. S., Abd Karim, M. M., Abdulsalam, M., & Muhadi, N. ‘A. ‎‎(2024). Improved accuracy in IoT-based water quality monitoring for aquaculture tanks using ‎low-cost sensors: Asian seabass fish farming. Heliyon, 10(8), Article e29022. ‎https://doi.org/10.1016/j.heliyon.2024.e29022‎

Nalakurthi, N. V. S. R., Abimbola, I., Ahmed, T., Anton, I., Riaz, K., Ibrahim, Q., Banerjee, A., Tiwari, A., & ‎Gharbia, S. (2024). Challenges and opportunities in calibrating low-cost environmental sensors. ‎Sensors, 24(11), Article 3650. https://doi.org/10.3390/s24113650‎

Naloufi, M., Abreu, T., Souihi, S., Therial, C., Rodrigues, N. A. d. P., Le Goff, A. G., Saad, M., Vinçon-Leite, ‎B., Dubois, P., Delarbre, M., Kennouche, P., & Lucas, F. S. (2024). Long-term stability of low-cost ‎IoT system for monitoring water quality in urban rivers. Water, 16(12), Article 1708. ‎https://doi.org/10.3390/w16121708‎

Nan, F., Zeng, C., Shen, H., & Lin, L. (2025). Calibration of integrated low-cost environmental sensors for ‎urban air temperature based on machine learning. Sensors, 25(11), Article 3398. ‎https://doi.org/10.3390/s25113398‎

Olanubi, O. O., Akano, T. T., & Asaolu, O. S. (2024). Design and development of an IoT-based intelligent ‎water quality management system for aquaculture. Journal of Electrical Systems and Information ‎Technology, 11(1), Article 15. https://doi.org/10.1186/s43067-024-00139-z

Oppenheim, A. V., & Schafer, R. W. (2010). Discrete-time signal processing (3rd ed.). Pearson.‎

Prapti, D. R., Mohamed Shariff, A. R., Che Man, H., Ramli, N. M., Perumal, T., & Shariff, M. (2022). ‎Internet of Things (IoT)-based aquaculture: An overview of IoT application on water quality ‎monitoring. Reviews in Aquaculture, 14(2), 979–992. https://doi.org/10.1111/raq.12637‎

Qian, J., Wynn, T., Liu, B., Shan, Y., Bartington, S. E., Pope, F. D., Dai, Y., & Shi, Z. (2026). Enhancing ‎accuracy of indoor air quality sensors via automated machine learning calibration. Atmospheric ‎Measurement Techniques, 19, 603–615. https://doi.org/10.5194/amt-19-603-2026‎

Ranjan, R., Shin, D., Jung, Y., Kim, S., Yun, J.-H., Kim, C.-H., Lee, S., & Kye, J. (2024). Comparative analysis ‎of integrated filtering methods using UWB localization in indoor environment. Sensors, 24(4), ‎Article 1052. https://doi.org/10.3390/s24041052‎

Singh, Y., & Walingo, T. (2024). Smart water quality monitoring with IoT wireless sensor networks. ‎Sensors, 24(9), Article 2871. https://doi.org/10.3390/s24092871‎

Slongo, J., Lindino, C., Martins, L. D., Spanhol, F. A., Carneiro, E., & Camargo, E. T. (2024). Evaluation of ‎low-cost sensors to integrate in a water quality monitor for real-time measurements. ‎Environmental Monitoring and Assessment, 196(8), Article 716. https://doi.org/10.1007/s10661-‎‎024-12884-9‎

Vogel, S., Gebbers, M., Schröter, I., Schwanghart, W., Bönecke, E., Rühlmann, J., Kramer, E., & Gebbers, ‎R. (2025). Towards site-independent calibration of in situ soil pH sensor data: Relevance of ‎spatial and temporal proximity, sample size and data spread for calibration model performance. ‎Geoderma, 456, Article 117261. https://doi.org/10.1016/j.geoderma.2025.117261‎

Wang, J. (2023). Analytical electrochemistry (4th ed.). John Wiley & Sons.‎

Wijayanti, A., Marwoto, P., Wiyanto, W., Ridlo, S., & Parmin, P. (2022). Contextual science learning using ‎smartphone audio sensor application (Phyphox) on restitution coefficient measurement. Jurnal ‎Penelitian dan Pembelajaran IPA, 8(2), 256. https://doi.org/10.30870/jppi.v8i2.13400‎

Zeta, B. M. A., Alam, S. U., Rahman, G. M. A. E. U., & Ahmed, K. I. U. (2025). A low-cost pH sensor for real-‎time monitoring of aquaculture systems in a multi-layer wireless sensor network. Sensors, 25(9), ‎Article 2824. https://doi.org/10.3390/s25092824‎

Zhu, Q., Cherqui, F., & Bertrand-Krajewski, J.-L. (2023). End-user perspective of low-cost sensors for ‎urban stormwater monitoring: A review. Water Science & Technology, 87(11), 2648–2684. ‎https://doi.org/10.2166/wst.2023.142‎

Published
2026-09-30
How to Cite
Ukasya, M. I., Farid Baskoro, Rifqi Firmansyah, Lilik Anifah, & Lusia Rakhmawati. (2026). Comparative Evaluation of Moving Average Filtering and Linear ‎Regression Calibration in an ESP32-Based Water pH Sensor. ISEJ : Indonesian Science Education Journal, 7(3), 359-377. https://doi.org/10.62159/isej.v7i3.2193