Pengembangan Sensor Pengukuran pH Virtual untuk Sistem Hidroponik Biaya Rendah Berbasis IoT dengan KNN dan
Abstract
Intelligent hydroponics systems, incorporating IoT and machine learning, can become a precision agriculture solution. However, physical water pH sensors are expensive, and a low-cost solution can be proposed using virtual sensors. Our research propose a pH virtual sensor for Hydroponics IoT using secondary data from Kaggle. We employ decision tree, Extreme Gradient Boosting (XGBoost), and K-Nearest Neighbors (KNN) regression algorithms for prediction using data from the TDS meter and temperature sensor as input features. Some metrics for testing are Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R² score. Moving average method to enhance the model performance and validate the data using Pearson correlation coefficient (PCC) matrix. Test results show that moving average with a window size of 181 reduces the RMSE of the KNN model from 0.98 to 0.30. KNN achieves a more optimal R² score (0.91) than the decision tree (0.90) and XGBoost (0.57). Virtual pH sensors with KNN are the most valid, as the correlation values of pH with TDS and water temperature are-0.34 to-0.35 and- 0.44 to-0.31, compared to the secondary dataset. This virtual sensor can be a low-cost solution in IoT hydroponics because can reduce product costs from USD 400 to USD 10. Keywords: virtual sensors, pH sensor, low-cost, Internet of Things, hydroponic
Downloads
References
[1] Researcher Jizzakh State Pedagogical Institute Jizzakh, Uzbekistan, B. Y. Zikirov, I. Y. Zikirov, and Researcher Gulistan State University Gulistan, Uzbekistan, “WATER AS AN IMPORTANT NATURAL RESOURCE AND ECOLOGICAL FACTOR,” jgnr, vol. 02, no. 01, pp. 10–16, Feb. 2022, doi: 10.37547/supsci-jgnr-02-01-02.
[2] Mustaq Shaikh and Farjana Birajdar, “GROUNDWATER AND ECOSYSTEMS: UNDERSTANDING THE CRITICAL INTERPLAY FOR SUSTAINABILITY AND CONSERVATION,” EPRA, pp. 181–186, Mar. 2024, doi: 10.36713/epra16111.
[3] T. M. T. - and V. K. P. -, “A Review on Physico-chemical Parameters of the Quality of Water,” IJFMR, vol. 5, no. 1, p. 1717, Feb. 2023, doi: 10.36948/ijfmr.2023.v05i01.1717.
[4] V. Lakshmikantha, A. Hiriyannagowda, A. Manjunath, A. Patted, J. Basavaiah, and A. A. Anthony, “IoT based smart water quality monitoring system,” Global Transitions Proceedings, vol. 2, no. 2, pp. 181–186, Nov. 2021, doi: 10.1016/j.gltp.2021.08.062.
[5] Md. A. A. M. Hridoy, C. Bordin, A. Masood, and K. Masood, “Predictive modelling of aquaculture water quality using IoT and advanced machine learning algorithms,” Results in Chemistry, vol. 16, p. 102456, Jul. 2025, doi: 10.1016/j.rechem.2025.102456.
[6] M. Vermanen, J. Naskali, V. Harkke, and J. Koskinen, “PAPA for IoT - Role of Data Accuracy in IoT Deployment and Data-centric Decision-Making,” in 2023 46th MIPRO ICT and Electronics Convention (MIPRO), Opatija, Croatia: IEEE, May 2023, pp. 500–505. doi: 10.23919/MIPRO57284.2023.10159749.
[7] Aleefia .A. Khurshid, “IoT-Enabled Embedded Virtual Sensor for Energy-Efficient Scalable Online Water Quality Monitoring System,” jes, vol. 20, no. 2, pp. 2458–2466, Apr. 2024, doi: 10.52783/jes.2019.
[8] A. Juna et al., “Water Quality Prediction Using KNN Imputer and Multilayer Perceptron,” Water, vol. 14, no. 17, p. 2592, Aug. 2022, doi: 10.3390/w14172592.
[9] J. Wekalao, A. Baz, and S. K. Patel, “Design and analysis of high-sensitivity hormone sensor with KNN behavior prediction for healthcare and biomedical applications,” Measurement, vol. 242, p. 116172, Jan. 2025, doi: 10.1016/j.measurement.2024.116172.
[10] S. Dinesh, N. R. R, S. P. Anusha, and S. R, “Prediction of Trends in Stock Market using Moving Averages and Machine Learning,” in 2021 6th International Conference for Convergence in Technology (I2CT), Maharashtra, India: IEEE, Apr. 2021, pp. 1–5. doi: 10.1109/I2CT51068.2021.9418097.
[11] G. N. Vande Kamp and S. Jordan, “The Necessity of Moving Averages in Dynamic Linear Regression Models,” American J Political Sci, vol. 69, no. 1, pp. 176–193, Jan. 2025, doi: 10.1111/ajps.12825.
[12] N. Jävergård, R. Lyons, A. Muntean, and J. Forsman, “Tunable correlation retention: A statistical method for generating synthetic data,” 2024, arXiv. doi: 10.48550/ARXIV.2403.01471.
[13] M. Endres, A. Mannarapotta Venugopal, and T. S. Tran, “Synthetic Data Generation: A Comparative Study,” in Proceedings of the 26th International Database Engineered Applications Symposium, Budapest Hungary: ACM, Aug. 2022, pp. 94–102. doi: 10.1145/3548785.3548793.
[14] P. Nando, A. G. Putrada, and M. Abdurohman, “Increasing The Precision Of Noise Source Detection System using KNN Method,” KINETIK, pp. 157–168, May 2019, doi: 10.22219/kinetik.v4i2.757.
Downloads
Published
Versions
- 2026-08-01 (2)
- 2026-08-01 (1)



