IoT-Based Flood Early Detection System Study Using ESP32, HC-SR04 Sensor, ThingSpeak, and Telegram

Moh. Ali Algifari Usman, Iskandar Zulkarnain Nasibu, Bambang Panji Asmara, Ikhsan Hidayat

Abstract


Floods are one of the most frequent natural disasters in Indonesia and cause significant human and material losses. Effective flood disaster management requires an early warning system capable of providing real-time information to the public and relevant agencies. This study designs and implements a prototype of an Internet of Things (IoT)-based flood early detection system using an ESP32 microcontroller as the main processing unit. An HC-SR04 ultrasonic sensor is used to continuously measure water level. Water level data is sent to the ThingSpeak cloud platform for monitoring and data visualization purposes, as well as forwarded as warning notifications via Telegram Bot to registered users. In addition, a buzzer is installed as a local alarm to provide immediate warnings at the monitoring location. Tests conducted show that the system is able to detect changes in water level with an average measurement error of 1.05% and an average notification latency of 2.7 seconds. This system successfully distinguishes four status levels: safe, alert I, alert II, and emergency, which can be utilized as an affordable and easy-to-implement IoT-based flood monitoring solution.

Keywords


Early Detection; ESP32; Flood; IoT; Thingspeak

Full Text:

PDF

References


L. Wang et al., “A review of the flood management: from flood control to flood resilience,” Nov. 01, 2022, Elsevier Ltd. doi: 10.1016/j.heliyon.2022.e11763.

N. Rindsfüser, A. P. Zischg, and M. Keiler, “Monitoring flood risk evolution: A systematic review,” Sep. 20, 2024, Elsevier Inc. doi: 10.1016/j.isci.2024.110653.

M. Esposito, L. Palma, A. Belli, L. Sabbatini, and P. Pierleoni, “Recent Advances in Internet of Things Solutions for Early Warning Systems: A Review,” Mar. 01, 2022, MDPI. doi: 10.3390/s22062124.

T. S. R. Pereira, T. P. de Carvalho, T. A. Mendes, and K. T. M. Formiga, “Evaluation of Water Level in Flowing Channels Using Ultrasonic Sensors,” Sustainability (Switzerland), vol. 14, no. 9, May 2022, doi: 10.3390/su14095512.

A. Mulyani, D. Kurniadi, and R. E. Saputra, “IoT-Based Real-Time River Monitoring and Early Flood Warning Using ESP32 and HC-SR04,” 2026, doi: 10.56741/jnest.v5i01.1252.

V. N. Sulistyawan, N. A. Salim, F. G. Abas, and N. Aulia, “Parking Tracking System Using Ultrasonic Sensor HC-SR04 and NODEMCU ESP8266 Based IoT,” in IOP Conference Series: Earth and Environmental Science, Institute of Physics, 2023. doi: 10.1088/1755-1315/1203/1/012028.

Y. Basir, M. Rizki, A. Pratama, and M. W. Aminullah, “Perancangan Sistem Pendeteksi Dan Penanggulangan Banjir Menggunakan ESP32 Berbasis IoT,” Jurnal Ilmiah GIGA, vol. 26, no. 1, doi: 10.47313/jig.v%vi%i.2127.

P. T. Wikantama and R. Puspitasari, “Perancangan Perangkat Pengukur Ketinggian Banjir dengan ESP32 dan Telegram Berbasis IoT,” Elektriese: Jurnal Sains dan Teknologi Elektro, vol. 13, no. 02, pp. 107–114, Nov. 2023, doi: 10.47709/elektriese.v13i02.3108.

D. N. Bestari and A. Wibowo, “An IoT-Based Real-Time Weather Monitoring System Using Telegram Bot and Thingsboard Platform,” International Journal of Interactive Mobile Technologies, vol. 17, no. 6, pp. 4–19, 2023, doi: 10.3991/ijim.v17i06.34129.

N. A. Pramono, B. A. Purwandani, O. Ghaisyani, F. P. P. Mallisa, and F. I. Sofyan, “Development a prototype of river water level monitoring system using ESP32 based on internet of things for flood mitigation,” in Journal of Physics: Conference Series, Institute of Physics, 2023. doi: 10.1088/1742-6596/2498/1/012039.

S. Rosadi and P. Studi Sistem Komputer, “PROTOTYPE SISTEM PENDETEKSI BANJIR MENGGUNAKAN NODEMCU DAN PROTOKOL MQTT BERBASIS INTERNET OF THINGS,” Jurnal Sistem Informasi dan Informatika (Simika) P-ISSN, vol. 5, pp. 2622–6901, 2022.

W. Musa, I. Hidayat, S. Alam, B. Asmara, and A. Tolago, “PENGONTROLAN ENERGI PANAS DAN KELEMBABAN MENGGUNAKAN SENSOR DHT22 DAN ESP32 PADA PROSES FERMENTASI TEMPE GEMBUS,” Journal Of Renewable Energy Engineering, vol. 2, pp. 50–55, Apr. 2024, doi: 10.56190/jree.v2i1.33.

A. H. Miry and G. A. Aramice, “Water monitoring and analytic based ThingSpeak,” International Journal of Electrical and Computer Engineering, vol. 10, no. 4, pp. 3588–3595, 2020, doi: 10.11591/ijece.v10i4.pp3588-3595.

A. D. Rakhman, I. Komang Somawirata, M. Ardita, and I. K. Somawirata, “Flood Early Warning System with Notification Using Telegram Bot Based on IoT System,” Journal homepage: Journal of Electrical Engineering and Computer (JEECOM), vol. 7, no. 1, 2025, doi: 10.33650/jeecom.

M. Siddique, T. Ahmed, and M. S. Husain, “Flood Monitoring and Early Warning Systems – An IoT Based Perspective,” Jul. 31, 2023, European Alliance for Innovation. doi: 10.4108/eetiot.v9i2.2968.

Tolago, A. I., Nadifa, U., Asri, A. A. O., & Hidayat, I. (2026). Flood Susceptibility Mapping of Gorontalo Province Based on Climate and Spatial Data Using Machine Learning. Journal of Electrical Engineering and Computer (JEECOM), 8(3), 204-212.


Refbacks

  • There are currently no refbacks.


Copyright (c) 2026 International Journal of Embedded Computer Engineering

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.