Klasifikasi Status Banjir Menggunakan Random Forest pada Sistem Monitoring Ketinggian Air Berbasis IoT

  • Weno Syechu * Mail Politeknik Negeri Medan, Indonesia
  • Rian Syahputra Politeknik Negeri Medan, Indonesia
  • Efori Bu'ulolo Politeknik Negeri Medan, Indonesia
  • Amir Saleh Politeknik Negeri Medan, Indonesia
Keywords: Random Forest; Internet of Things; ESP32; ultrasonic sensor; water level; flood status

Abstract

Real-time water-level monitoring is essential to support timely decision-making in early flood warning systems. This study investigates the application of the Random Forest algorithm for four-level water-status classification in an Internet of Things (IoT)-based monitoring system utilizing an ESP32 microcontroller, an HC-SR04 ultrasonic sensor, Wi-Fi connectivity, a Blynk dashboard, and a buzzer. The hardware prototype performs water-surface distance acquisition, remote visualization, and threshold-based local alarm activation, whereas machine learning modeling and evaluation are conducted offline on a computer using Python. An experimental dataset of 600 records was constructed through structured simulation reflecting the prototype's reading characteristics across a 0–100 cm range, and therefore does not yet represent continuous actual field measurements. The dataset comprises water level, level change (delta level), rate of water-level change, and four target classes: Safe, Warning, Alert, and Flood. Using stratified sampling, the data were partitioned into 480 training records and 120 testing records. The Random Forest model with 150 decision trees achieved an accuracy of 95.83%, weighted precision of 95.93%, weighted recall of 95.83%, and weighted F1-score of 95.84% on the experimental dataset. The primary contribution of this work lies in establishing a structured pipeline linking IoT sensor acquisition with water-level dynamic feature engineering and multi-class classification, which requires further end-to-end validation using actual field sensor data.

References

M. Darwis, H. A. Al Banna, S. R. Aji, D. Khoirunnisa, and N. Natassa, “IoT Based Early Flood Detection System with Arduino and Ultrasonic Sensors in Flood-Prone Areas,” J. Tek. Inform., vol. 16, no. 2, pp. 133–140, 2023, doi: 10.15408/jti.v16i2.32161.

M. Krishnaveni, S. K. Praveen Kumar, E. Arul Muthusamy, J. Kowshick, and K. G. Arunya, “Real-time monitoring of water level and storage dynamics of irrigation tank using IoT,” H2Open J., vol. 3, no. 1, pp. 392–400, 2020, doi: 10.2166/h2oj.2020.123.

S. Said, L. D. Samsumar, Emi Suryadi, Ardiyallah Akbar, and Zaenudin, “Sistem Monitoring Pengukur Jarak Ketinggian Air pada Bendungan Berbasis Internet Of Things,” J. Rekayasa Sist. Inf. dan Teknol., vol. 2, no. 1, pp. 568–578, 2024, doi: 10.70248/jrsit.v2i1.1192.

M. T. A. Susila, I. N. Firdaus, M. F. Chuzairi, and D. Rahmawati, “Flood Early Warning System Prototype Based on Ultrasonic Sensor and Internet of Things,” J. Rekayasa Elektr., vol. 19, no. 3, pp. 100–106, 2023, doi: 10.17529/jre.v19i3.33147.

Diono, Muhammad Syafei Gozali, and H. Tri Guntoro, “IoT Implementation in Water Level Monitoring System Using ESP32 and Antares Platform,” J. Integr., vol. 18, no. 1, pp. 18–24, 2026, doi: 10.30871/ji.v18i1.12814.

A. P. Hasanah and H. Hafni, “Perancangan Sistem Monitoring Level Air Menggunakan Sensor Ultrasonik Berbasis Iot Dengan Aplikasi Blynk,” J. Inform. dan Tek. Elektro Terap., vol. 13, no. 2, pp. 1477–1483, 2025, doi: 10.23960/jitet.v13i2.6485.

M. Iqbal, A. Rosadi, and E. K. Andana, “PERANCANGAN SISTEM IoT UNTUK DETEKSI DINI BANJIR BERBASIS,” vol. 4, no. 1, pp. 18–28, 2022.

S. Potharaju, S. N. Tambe, R. K. Tirandasu, D. A. Kumar, B. Kiranmai, and M. V. V. P. Kantipudi, “Explainable deep unsupervised learning for flood monitoring and anomaly detection using multivariate DWLR sensors,” Sci. Rep., vol. 16, no. 1, pp. 1–16, 2026, doi: 10.1038/s41598-026-55978-9.

J. Kaur, A. Singh, and A. Huong, “IoT Flood Monitoring System,” vol. 4, no. 1, pp. 45–54, 2023.

Ardyka Bayu Reovan, Guruh Putro Dirgantoro, and Muhammad Jauhar Vikri, “Pendeteksian Dini pada Potensi Banjir dengan Berbasis Internet of Things Menggunakan Algoritma Random Forest,” JURIKOM (Jurnal Ris. Komputer), vol. 13, no. 2, pp. 712–722, 2026, doi: 10.30865/jurikom.v13i2.9644.

M. I. Prasetiyowati, N. U. Maulidevi, and K. Surendro, “Feature selection to increase the random forest method performance on high dimensional data,” Int. J. Adv. Intell. Informatics, vol. 6, no. 3, pp. 303–312, 2020, doi: 10.26555/ijain.v6i3.471.

W. Fang et al., “An evaluation of random forest based input variable selection methods for one month ahead streamflow forecasting,” Sci. Rep., vol. 14, no. 1, pp. 1–12, 2024, doi: 10.1038/s41598-024-81502-y.

R. D. Ismanto, H. L. Fitriana, J. Manalu, I. Prasasti, and A. A. Purboyo, “Development of a Flood Hazard Mapping Model using Random Forest in Sumedang Regency, West Java, Indonesia,” AIP Conf. Proc., vol. 2941, no. 1, 2023, doi: 10.1063/5.0181521.

M. Esfandiari, S. Jabari, H. McGrath, and D. Coleman, “Flood mapping using random forest and identifying the essential conditioning factors; A case study in fredericton, new brunswick, Canada,” ISPRS Ann. Photogramm. Remote Sens. Spat. Inf. Sci., vol. 5, no. 3, pp. 609–615, 2020, doi: 10.5194/isprs-Annals-V-3-2020-609-2020.

H. Il Kim, Y. S. Lee, and B. Kim, “Real-time flood prediction applying random forest regression model in urban areas,” J. Korea Water Resour. Assoc., vol. 54, no. S-1, pp. 1119–1130, 2021, doi: 10.3741/JKWRA.2021.54.S-1.1119.

A. S. Handayani, C. S. R. Aritonang, Suroso, N. L. Husni, W. Caesarendra, and L. Novianti, “A Dual-Model Spatiotemporal Flood Prediction System Using Sentinel-1 SAR Imagery and Meteorological Data: A Case Study in Palembang, Indonesia,” J. Robot. Control, vol. 6, no. 6, pp. 3198–3213, 2025, doi: 10.18196/jrc.v6i6.27546.

L. R. Fauzi and I. Suharjo, “Prototipe Alat Deteksi Banjir Berbasis ESP32, TinyML, dan Notifikasi Telegram,” J. Kridatama Sains dan Teknol., vol. 8, no. 01, pp. 115–137, 2026, doi: 10.53863/kst.v8i01.2115.

L. S. Qamarani and M. Riasetiawan, “Klasifikasi Level Banjir Menggunakan Random Forest dan Support Vector Machine,” IJEIS (Indonesian J. Electron. Instrum. Syst., vol. 14, no. 2, p. 199, 2024, doi: 10.22146/ijeis.97043.

R. Wahyudi, D. Kiswanto, W. Aulia, and S. Audy Priscilia, “Implementation of IoT and Machine Learning for Monitoring and Prediction of Tank Water Levels,” J. Artif. Intell. Eng. Appl., vol. 5, no. 2, pp. 2590–2599, 2026, doi: 10.59934/jaiea.v5i2.1936.

Y. Ratmini, V. Atina, and E. Purwanto, “Sistem Monitoring dan Peringatan Dini Banjir Berbasis Internet of Things (IoT),” J. Ilm. Teknol. Inf. Asia, vol. 19, no. 1, pp. 1–7, 2025, doi: 10.32815/jitika.v19i1.1103.

S. Z. Ardian, Maratanto, D. Pratama, and Faturrohman, “Pengembangan Sistem Berbasis Iot Dan Machine Learning,” vol. 3, no. 04, pp. 1–6, 2026.

Dimensions Badge
Published
2026-11-30
Section
Articles