Rainfall refers to the amount of precipitation that falls in a specific area over a certain period, typically measured in millimeters (mm). High rainfall can increase the risk of flooding. This study aims to develop an IoT-based system to detect water levels, measure rainfall, and automatically control the opening and closing of floodgates. The collected data is permanently stored in a database and can be monitored remotely. The researchers utilized an Arduino Mega 2560 microcontroller and an ESP32 to process data, an ultrasonic sensor to measure water level (in cm), and a rainfall sensor (in mm). The data is transmitted to a Firebase database and connected to a Telegram bot, allowing administrators to monitor it in real time. The system classifies water levels into four categories: safe (0–30 cm), alert (31–40 cm), warning (41–50 cm), and danger (51–60 cm). Rainfall intensity is also categorized into four levels: light (0.5–20 mm/h), moderate (20–50 mm/h), heavy (50–100 mm/h), and extreme (more than 100 mm/h). The system automatically adjusts the floodgates based on water conditions but also allows for manual control. The sensors demonstrated an average accuracy of 97%, with an average notification delay of 675 ms during extreme rainfall conditions.
                        
                        
                        
                        
                            
                                Copyrights © 2025