Design of flood warning prototype using ESP32 module-based ultrasonic sensors
Design of flood warning prototype using ESP32 module-based ultrasonic sensors
Arnawan Hasibuan1, Muhtadi Zahiri1, Misbahul Jannah1, Fahrian Roid1, Rizky Almunadiansyah1,
Armen Abta1, I Made Ari Nrartha2
1
Department of Electrical Engineering, Faculty of Engineering, Universitas Malikussaleh, Lhokseumawe, Indonesia
2
Department of Electrical Engineering, Faculty of Engineering, Universitas Mataram, Mataram, Indonesia
Corresponding Author:
Arnawan Hasibuan
Department of Electrical Engineering, Faculty of Engineering, Universitas Malikussaleh
Lhokseumawe, Indonesia
Email: [email protected]
1. INTRODUCTION
Erratic weather will greatly affect environmental conditions, one example is the high rainfall that
occurs throughout the rainy season. High, uneven, and unpredictable rainfall can pose a threat of natural
disasters in the form of floods where areas that have a lower elevation than the surrounding area will usually
be inundated by water [1], [2]. In 2021 there were 5,402 natural disasters, of which 33.21% were floods,
which occurred 1,794 times, followed by other natural disasters such as extreme weather with a percentage of
29.19%, which occurred 1,577 times, landslides with a percentage of 24.45%, which occurred 1,321 times,
and 710 other natural disasters. The impact of these events resulted in 728 people died, 87 people missing,
14,915 people injured, 7,630,692 people suffered and displaced, 158,658 housing units damaged, 5,614 units
of public facilities and services damaged [3].
Floods can occur at any time for different reasons, where floods can cause losses on a large enough
scale, both in terms of material and infrastructure to casualties. In Indonesia itself, floods occur almost every
year with handling is still not optimal [4], the type of flood that often occurs in Indonesia itself is flooding
caused by overflowing rivers that affect people living around the river [5] floods cause many people to lose
property, shelter and even result in loss of life [6] and also this natural disaster can traumatize the victims.
Until now, the absence of a system that can help people detect floods early makes the risk and impact of
flooding itself still a serious threat to society [7].
Mulyana and Kharisma [8], a student of Informatics Engineering STMIK Tasikmalaya, has made a
project "design of flood early warning tool with Arduino UNO R3 microcontroller" as well as paper [9], [10]
which discusses the flood early warning system. However, this tool has a weakness because it uses a
capacitive sensor that is inserted into the water, so that over time it will corrode the capacitor plate, and only
uses a buzzer alarm to notify of flooding so that the information generated is still less efficient when received
by the community. Umari et al. [11], a student of the College of Meteorology Climatology and Geophysics,
made a final project entitled "design of a flood early warning system based on ultrasonic sensors and
microcontrollers as a flood mitigation effort". In this research there are also weaknesses in the tools that have
been made, namely only using buzzer alarms and liquid crystal display (LCD) as information notifications
[12]. So this article will explain a new breakthrough by utilizing the ESP32 microcontroller module to make
a more efficient and accurate flood detection system by using ultrasonic sensors as water surface level
detectors, flow sensors as water discharge meters in rivers, and tipping bucket rain as rain intensity meters.
The sensors used in this design are also better than capacitive sensors that are prone to corrosion due to direct
contact with water [13], [14]. The development of existing technology is very supportive for the development
of systems that can be a solution in dealing with the problems of human life including this flood disaster. The
ESP32 microcontroller is one of the technologies that can be utilized to create a flood disaster mitigation
system as discussed in this article to be able to help the community to be more alert in dealing with flood
disasters, so that preventive action can be taken to reduce potential material losses to potential casualties such
as damage to electronic equipment and vehicles [15].
RTC
WATER FLOW
ESP32
SENSOR
SMART PHONE
RAIN SENSOR
Design of flood warning prototype using ESP32 module-based ultrasonic sensors (Arnawan Hasibuan)
128 ISSN: 2089-4864
The implemented module is a potential flood warning tool that uses an ultrasonic sensor placed 31
cm above the surface of the water base which functions as a water level detector [27], [28]. When the
ultrasonic sensor detects a change in water level, the system will send information to the smartphone in the
form of water level status that has the potential to cause flooding [29], [30]. The process will repeat every
day so that users do not need to check and monitor directly what indications on certain elements can cause
accidents if the river water level rises suddenly [31], [32].
Int J Reconfigurable & Embedded Syst, Vol. 14, No. 1, March 2025: 126-135
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 129
rain sensor detects rainfall, and if there is, the rainfall level will be recorded. After the data from all sensors is
collected, the system reads the event time using the real time clock (RTC) and displays the information. The
data obtained is then sent by the ESP32 to the user. The system continues to monitor whether the process has
been completed; if so, the device enters standby mode, if not, the sensor will be reread. This algorithm ends
after the entire process is complete. Below are each step of the Algorithm 1.
Design of flood warning prototype using ESP32 module-based ultrasonic sensors (Arnawan Hasibuan)
130 ISSN: 2089-4864
Int J Reconfigurable & Embedded Syst, Vol. 14, No. 1, March 2025: 126-135
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 131
each level. These results are important for assessing the reliability and sensitivity of the flow sensor in water
flow monitoring and control applications.
We tested the flow sensor using a ruler and stopwatch. We filled it with water and measured how
long it took for the water level to drop by 1 cm. The sensor readings for flow rate were around 6.7 m/s in
most tests. There was some variation in flow rate readings and the time it took for the water to drain.
5 ÷ (19.25 × 3) = 0.0865 𝑚𝑚
where 𝐶𝐻 is rainfall (mm), 𝑉 is volume of water (ml), 𝐿𝑘 is collector area (m2), and 𝑇𝑡 is tipping amount.
The result was a rainfall of 0.0865 mm, in the second test, the water dripped with spet was 10 ml but
the sensor got a reading of 7 tipping, where there was a difference of 1 tipping:
10 ÷ (19.25 × 7) = 0.0742 𝑚𝑚
Obtained results of rainfall 0.0742 mm. In the third test, 15 ml of water was dripped, the sensor read
9 tips and obtained a result of 0.0865. The highest difference was obtained in the 2 cm test which showed a
difference in rainfall of 0.0123 mm. There are several factors that cause this error, namely the mechanics on
the seesaw sensor not working properly, errors in the electronics that occur between the magnets and the hall
effect sensor, and the slope of the terrain.
Design of flood warning prototype using ESP32 module-based ultrasonic sensors (Arnawan Hasibuan)
132 ISSN: 2089-4864
Table 7. Test results at low water level Table 8. Test results on rainfall
Water surface level Information Lots of tips Information
1 cm Safe water level 1 Drizzle
2 cm Safe water level 8 Drizzle
3 cm Safe water level 11 Drizzle
4 cm Safe water level 17 Drizzle
5 cm Safe water level 20 Moderate rain
6 cm Standby water level 25 Moderate rain
7 cm Standby water level 32 Moderate rain
8 cm Standby water level 39 Moderate rain
9 cm Standby water level 46 Moderate rain
10 cm Standby water level 53 Heavy rain
11 cm Danger water level 61 Heavy rain
12 cm Danger water level 77 Heavy rain
13 cm Danger water level 86 Heavy rain
14 cm Danger water level 93 Heavy rain
15 cm Danger water level 106 Very heavy rain
The analysis we did helps us understand flood risks and how to warn people. We can use this
information to build an innovative flood early warning system for smartphones in flood-prone areas. This
system will alert people about potential floods, helping to reduce the impact of flooding on communities.
4. CONCLUSION
Early flood warnings are crucial! New technologies can help us prevent disasters. One way is to
develop a flood warning system that alerts communities about potential flooding. Designing and building the
hardware involves modeling, planning algorithms, assembling components, wiring, and mechanics.
Integrating software with the hardware includes planning a flood warning control algorithm using sensors
Int J Reconfigurable & Embedded Syst, Vol. 14, No. 1, March 2025: 126-135
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 133
like ultrasonic, flow, and rain tipping. The system triggers a message when the ultrasonic sensor detects
water level changes and sends alerts about rain intensity when rain tipping sensors detect rainfall. This tool,
which will be built and installed around the main location that causes flooding, will later be able to provide
information in the form of an early warning to the smartphone community that there is a possibility of a flood
natural disaster, this effort is expected to be a solution to reduce the impact that will be felt by the community
from the occurrence of a flood natural disaster.
REFERENCES
[1] A. A. Ghapar, S. Yussof, and A. A. Bakar, “Internet of things (IoT) architecture for flood data management,” International Journal
of Future Generation Communication and Networking, vol. 11, no. 1, pp. 55–62, 2018, doi: 10.14257/ijfgcn.2018.11.1.06.
[2] A. Hasibuan, R. Rosdiana, and D. S. Tambunan, “Design and development of an automatic door gate based on internet of things
using Arduino Uno,” Bulletin of Computer Science and Electrical Engineering, vol. 2, no. 1, pp. 17–27, 2021.
[3] A. C. Utomo, “BNPB verifies 5,402 disaster incidents throughout 2021 (in Indonesian: BNPB Verifikasi 5.402 Kejadian Bencana
Sepanjang Tahun 2021),” Badan Nasional Penanggulangan Bencana, 2021. [Online]. Avalable: https://bnpb.go.id/berita/bnpb-
verifikasi-5-402-kejadian-bencana-sepanjang-tahun-2021.
[4] A. H. Rismayana, C. A. Sugianto, and I. B. Budiyanto, “Prototyping of flooding early warning system using internet of things
technology and social media,” in MATEC Web of Conferences, 2018, vol. 197, p. 16003.
[5] H. P. Uranus, N. R. Adhinugroho, D. H. Yulian, and R. Mangunsong, “Design and realization of solar-powered IoT-based flood
early warning system with telegram messaging, auto-restart watchdog, and power management,” GCISTEM Proceeding, vol. 1,
pp. 96–108, 2022, doi: 10.56573/gcistem.v1i.4.
[6] A. A. Salim, E. Hesti, and others, “The water monitoring system in flood alert level design based on internet of things (IoT),”
Jurnal E-Komtek, vol. 6, no. 2, pp. 184–195, 2022, doi: 10.37339/e-komtek.v6i2.959.
[7] Y. I. Chandra, D. R. Irawati, M. Riastuti, and K. Rokoyah, “Prototype river water level detection tool using ultrasonic sensor with
sound output based on Arduino Uno microcontroller,” International Journal of Information System and Technology (IJISTECH),
vol. 7, no. 1, pp. 7–16, 2023.
[8] Mulyana E and Kharisman R, “Design of flood early warning device with Arduino Uno R3 microcontroller (in Indonesian:
Perancangan alat peringatan dini bahaya banjir dengan mikrokontroler Arduino Uno R3),” Creative Information Technology
Journal (CITEC Journal), vol. 1, no. 3, pp. 171–182, 2014.
[9] I. Arianti, M. Rafani, E. Ryanti, A. Arena, and others, “Prototype of flood early warning system as a disaster preparedness and
response effort,” Seybold Report, vol. 18, no. 2, pp. 272–277, 2023, doi: 10.17605/OSF.IO/AP8H3.
[10] A. Wannachai, S. Aramkul, B. Suntaranont, Y. Somchit, and P. Champrasert, “HERO: hybrid effortless resilient operation
stations for flash flood early warning systems,” Sensors, vol. 22, no. 11, p. 4108, 2022, doi: 10.3390/s22114108.
[11] C. Umari, E. Anggraini, and R. Z. Muttaqin, “Design and construction of an early warning system for floods based on ultrasonic
sensors and microcontrollers as an effort to overcome flooding (in Indonesian: Rancang bangun sistem peringatan dini banjir
berbasis sensor ultrasonik dan mikrokontroler sebagai upaya penanggulangan banjir,” Jurnal Meteorologi Klimatologi dan
Geofisika, vol. 4, no. 2, pp. 35–42, 2017.
[12] I. H. Abd Halim, A. I. Mahamad, and M. F. M. Fuzi, “Automated alert system for river water level and water quality assessment
using telegram bot API,” Journal of Computing Research and Innovation, vol. 6, no. 3, pp. 65–74, 2021, doi:
10.24191/jcrinn.v6i3.234.
[13] A. Hasibuan, A. Asran, R. R. Sembiring, M. Isa, M. I. Yusoff, and S. R. A. Rahim, “Design of investment detection in fish
cultivation Uno Arduino based,” Andalasian International Journal of Applied Science, Engineering and Technology, vol. 1, no. 1,
pp. 10–20, 2021, doi: 10.25077/aijaset.v1i1.1.
[14] M. Daud, M. Y. Zulfikar, A. Hasibuan, and M. Isa, “Prototype of automatic watering and fertilizing system for oil palm seeds
based on internet of things,” Andalas Journal of Electrical and Electronic Engineering Technology, vol. 3, no. 1, pp. 1–9, 2023,
doi: 10.25077/ajeeet.v3i1.37.
[15] A. Hasibuan, Kartika, A. Qodri, and M. Isa, “Temperature monitoring system using Arduino Uno and smartphone application,”
Bulletin of Computer Science and Electrical Engineering, vol. 2, no. 2, pp. 46–55, 2021, doi: 10.25008/bcsee.v2i2.1139.
[16] R. Vinayakumar, M. Alazab, K. P. Soman, P. Poornachandran, A. Al-Nemrat, and S. Venkatraman, “Deep learning approach for
intelligent intrusion detection system,” IEEE Access, vol. 7, pp. 41525–41550, 2019, doi: 10.1109/ACCESS.2019.2895334.
[17] K. Sivaraman, R. M. V. Krishnan, B. Sundarraj, and S. Sri Gowthem, “Network failure detection and diagnosis by analyzing
syslog and SNS data: Applying big data analysis to network operations,” International Journal of Innovative Technology and
Exploring Engineering, vol. 8, no. 9, pp. 883–887, 2019, doi: 10.35940/ijitee.I3187.0789S319.
[18] A. D. Dwivedi, G. Srivastava, S. Dhar, and R. Singh, “A decentralized privacy-preserving healthcare blockchain for IoT,”
Sensors, vol. 19, no. 2, pp. 1–17, 2019, doi: 10.3390/s19020326.
[19] S. Leonelli and N. Tempini, Data Journeys in the Sciences, Springer. doi: 10.1007/978-3-030-37177-7_8.
[20] G. Nguyen et al., “Machine learning and deep learning frameworks and libraries for large-scale data mining: a survey,” Artificial
Intelligence Review, vol. 52, no. 1, pp. 77–124, 2019, doi: 10.1007/s10462-018-09679-z.
[21] F. Al-Turjman, H. Zahmatkesh, and L. Mostarda, “Quantifying uncertainty in internet of medical things and big-data services
using intelligence and deep learning,” IEEE Access, vol. 7, pp. 115749–115759, 2019, doi: 10.1109/ACCESS.2019.2931637.
[22] S. Kumar and M. Singh, “Big data analytics for healthcare industry: Impact, applications, and tools,” Big Data Mining and
Analytics, vol. 2, no. 1, pp. 48–57, 2019, doi: 10.26599/BDMA.2018.9020031.
[23] L. M. Ang, K. P. Seng, G. K. Ijemaru, and A. M. Zungeru, “Deployment of IoV for smart cities: applications, architecture, and
challenges,” IEEE Access, vol. 7, pp. 6473–6492, 2019, doi: 10.1109/ACCESS.2018.2887076.
[24] B. P. L. L. et al., “A survey of data fusion in smart city applications,” Information Fusion, vol. 52, pp. 357–374, 2019, doi:
10.1016/j.inffus.2019.05.004.
[25] Y. Wu et al., “Large scale incremental learning,” Proceedings of the IEEE Computer Society Conference on Computer Vision and
Pattern Recognition, vol. 2019-June, pp. 374–382, 2019, doi: 10.1109/CVPR.2019.00046.
[26] A. Mosavi, S. Shamshirband, E. Salwana, K. Chau, and J. H. M. Tah, “Prediction of multi-inputs bubble column reactor using a
novel hybrid model of computational fluid dynamics and machine learning,” Engineering Applications of Computational Fluid
Mechanics, vol. 13, no. 1, pp. 482–492, 2019, doi: 10.1080/19942060.2019.1613448.
Design of flood warning prototype using ESP32 module-based ultrasonic sensors (Arnawan Hasibuan)
134 ISSN: 2089-4864
[27] M. H. Khuzaidin, “Development of centralized real-time flood detection and warning system,” Progress in Engineering
Application and Technology, vol. 4, no. 1, pp. 263–270, 2023.
[28] A. Hasibuan, W. V. Siregar, M. Isa, E. Warman, R. Finata, and M. Mursalin, “The use of regression method on simple e for
estimating electrical energy consumption,” HighTech and Innovation Journal, vol. 3, no. 3, pp. 306–318, 2022, doi:
10.28991/HIJ-SP2022-03-06.
[29] 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, 2023,
vol. 2498, no. 1, p. 12039, doi: 10.1088/1742-6596/2498/1/012039.
[30] R. Khan, M. Shabaz, S. Hussain, F. Ahmad, and P. Mishra, “Early flood detection and rescue using bioinformatic devices,
internet of things (IoT) and Android application,” World Journal of Engineering, vol. 19, no. 2, pp. 204–215, 2022,
10.1108/WJE-05-2021-0269.
[31] B. A. Purwandani, D. E. Lianny, M. F. Anggraeni, P. Fauziah, N. A. Pramono, and R. Hartawan, “Learning Arduino as a simple
river water level detection system based on ultrasonic sensors,” Journal of Disruptive Learning Innovation (JODLI), vol. 3, no. 1,
pp. 26–33, 2021, doi: 10.17977/um072v3i12021p26-33.
[32] M. Anbarasan et al., “Detection of flood disaster system based on IoT, big data and convolutional deep neural network,”
Computer Communications, vol. 150, pp. 150–157, 2020, doi: 10.1016/j.comcom.2019.11.022.
[33] A. Diriyana, U. Darusalam, and N. D. Natasha, “Water level monitoring and flood early warning using microcontroller with IoT
based ultrasonic sensor,” Jurnal Teknik Informatika C.I.T, vol. 11, no. 1, pp. 22–28, 2019.
[34] S. A. Ali, F. Ashfaq, E. Nisar, U. Azmat, and J. Zeb, “A prototype for flood warning and management system using mobile
networks,” in 2020 17th International Bhurban Conference on Applied Sciences and Technology (IBCAST), 2020, pp. 326–331,
doi: 10.1109/IBCAST47879.2020.9044531.
[35] S. A. Hamzah et al., “Flood level detection system using ultrasonic sensor and ESP32 camera: preliminary results,” Journal of
Advanced Research in Applied Mechanics, vol. 119, no. 1, pp. 162–173, 2024, doi: 10.37934/aram.119.1.162173.
[36] N. H. Mamat, H. A. Shazali, and W. Z. Othman, “Development of a weather station with water level and waterflow detection
using Arduino,” in Journal of Physics: Conference Series, vol. 2319, no. 1, 2022, doi: 10.1088/1742-6596/2319/1/012020.
[37] H. Yulia, S. Pramono, S. Sutrisno, and B. D. Jati, “IoT based early warning system of landslide and flood disasters,” in AIP
Conference Proceedings, 2023, vol. 2674, no. 1, doi: 10.1063/5.0114101.
BIOGRAPHIES OF AUTHORS
Int J Reconfigurable & Embedded Syst, Vol. 14, No. 1, March 2025: 126-135
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 135
Design of flood warning prototype using ESP32 module-based ultrasonic sensors (Arnawan Hasibuan)