A prototype for flood warning and management system using mobile networks
Summary/Abstract: We propose a novel prototype for an early flood warning and monitoring system for flood affected areas of Pakistan. The architectural design consists of three main blocks , the telemetry data collection block; responsible for collecting the data
2025-06-28 16:30:06 - Adil Khan
A prototype for flood warning and management system using mobile networks
Project Area of Specialization Internet of ThingsProject SummarySummary/Abstract:
We propose a novel prototype for an early flood warning and monitoring system for flood affected areas of Pakistan. The architectural design consists of three main blocks , the telemetry data collection block; responsible for collecting the data from the sensor nodes deployed on the river beds, the data analysis and processing block; that writes algorithms to process data received from sensors and creates necessary alerts/warning messages for the public and control messages for the spillways, and lastly the information dissemination block; that devices methods to notify community of the flood risk levels and warning messages using mobile network on their phones and also provides easy access to the same using android application on their mobile nodes. The prototype demonstrates the use of ESP32 development board to collect rainfall data, water flow and level measurements out of the sensors. The raw data is sent to the cloud using 4G WiFi device attached to the ESP board where it is processed according to the algorithm developed in MATLAB using an online IOT platform. after which a notification is sent out to the public using the SMS service which can also be accessed through android application developed on Android Studio. The proposed solution contributes in reducing the damage caused by floods, such as loss of life and infrastructure destruction
Project ObjectivesProject Objectives:
- Developing a prototype for an early flood warning and monitoring system
- Development of an Android application for an easy and fast access to the real time flood data and forecasts based on the sensors data from the river beds.
- Effective dissemination of critical warning and flood forecast messages to the community settled along the river beds
Project Implementation:
Our project can be divided into five Blocks The telemetry data collection block, the data analysis and processing block and lastly the information dissemination block.
1-The Telemetry Data Collection Block
This block consists of Sensors,ESP32 and an LTE device placed at riverbanks for Data collection. One of the Sensors placed is a Sonar Sensor, HC-SR04, an Ultrasonic ranging module which measures the depth of water. The Second Sensor used is a Rain Detector, which determines whether it is raining or not. Lastly the water flow sensor is used which will measure the flow of water. ESP along with their sensors makes one node. Our system will comprise of multiple nodes. This will add robustness to our system. Sensors are collecting data of water level, rain detection and water flow. This raw data is collected by ESP32 and this data is uploaded to cloud using LTE.

2-The Data Analysis and Processing Block
ESP-32 sends the raw telemetry data to be processed on the MATLAB based IOT platform. This IOT platform is using MQTT protocol to get raw data from ESP32. On the platform, the data is processed by averaging to reduce error, then the processed data is labelled on the basis of thresholds defined. Pseudo code of processing on IOT platform is as following.
Code:
**fth= Water flow threshold
**lth= Water level threshold
Totalflow= flow1+flow2;
Waterlevel=sonar1+sonar2;
Rain=rain1+rain2;
If(totalflow>fth1 && waterlevel>lth1 && rain==yes)
Danger=High;
elseif(totalflow>fth2 && waterlevel>lth2 && rain==yes)
Danger=moderate;
If(totalflow>fth3 && waterlevel>lth3 && rain==no)
Danger=low;
3-Android Application
There are methods of disseminating the flood risk notification to the user. One is an android application which gives real-time update and a Map Based View of the Flood risk level in various rivers. The application also has an option to contact local emergencies services

4-Command Center
Data from the cloud is fetched on a server PC every 5 minutes. A GSM module(SIM800L) is attached with this PC. This data is sent to the registered users through SMS using GSM module. We are using this block as a backup system to secure our data in PC server and to send flood risk level to users even if they are not connected to the internet.

5-Actuator Block
We have an ESP32 which is continuously fetching data from server PC using LTE. The ESP is the brain of our actuator block. It will control the spillway of the Dam on the basis of processed data fetched form the command center using relay circuits.

The full architecture diagram of the system is as follows

Benefits of the project
Pakistan has long history of deadly floods, which in the past have caused loss of life, destruction of property, damage to agriculture, loss of livestock, and deterioration of health conditions owing to waterborne diseases. Due to the average global temperature increase caused by climate change and in conjunction with heavy monsoonal rains have supplemented the risk of deadly floods in Pakistan in recent years. Pakistan is one of the countries that is and would be most affected by climate change , so unfortunately the frequency of floods are very much likely to increase.
Pakistan is in need of a system that could help local communities in the Flood Danger Zones, to help notify them and the emergency services, with help of the data trend of the flood Risk Rivers. Due to lack of concern and safety measures, there isn’t an adequate system in place that could help prevent or at the very least curtail the damage caused by floods. Inhabitants of these Flood Risk area fail to receive any information on time or the notification system is so poor that any alerts fails to reach the population.
Our Project attempts to tackle these problems. Our design includes real-time system which updates the user on the flood risk level in their local area .
Technical Details of Final DeliverableTechnical details of final deliverables
There are two deliverables of this project:
- Management System
Management system comprises of 3 blocks telemetry data collection, command center and actuator block. We will be controlling the spillway of the river to reduce the risk of flood. We are using 3 types of sensors to monitor the behavior of water around the rivers. A Sonar sensor, rain detector and water flow sensor. The technical details of sensors are as follows:
SONAR
Sonar sensor will be used to measure the water level.
Working Voltage= 5V DC
Current rating= 15mA
It consists of a receiver and a transmitter. Transmitter sends a sound wave and receiver waits for that sound wave to come back and note that time. The distance is measured through the following equation.
Distance= speed of sound * time/2

Rain Detector
It will be used to check whether it is raining in the vicinity of a sensor node or not.
Working voltage= 3.3V~5V
Current rating= <20mA

Water Flow Sensor
Flow of water can be measured through it. In our case we are using YF-S201.
Working Voltage= 3.5V~24V
Flow range= 1-30L/min

We are using ESP32 as our microcontroller to extract data of sensors and send it to the cloud. It details is as follows
ESP32
ESP32 is a low cost, system on chip microcontroller with integrated Wifi and Bluetooth.
Working Voltage: 3.3V DC
Memory: 520Kib SRAM
CPU: Xtensa dual-core operating at 160 or 240 MHz.

Using this telemetry data which is being uploaded on the cloud by ESP32 we can continuously control the water level of river by opening and closing spillways of the dam of the corresponding river.
- Notification System
Notification system consists of telemetry data collection block, data analysis and collection block and command center. The notification system consists of an android application and SMS service. In the android application we are extracting the data from JSON file format. This file is downloaded every time the user wants to know the flood risk level of the river. Technical aspects of the android application are as follows
Android Application
Software used: Android Studio (3.4)
Language: JAVA
We are sending SMS by pairing a SIM 800L with PC server. Details of GSM module are as follows.
SIM 800L
A SIM card is inserted into SIM 800L and text messages can be generated by pairing it with a microcontroller.
Working Voltage: 3.4V~4.4V
Current rating: Typically it consumes <0.7mA of current
Frequency bands: Quad band supported

| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 31050 | |||
| ESP32 | Equipment | 6 | 1150 | 6900 |
| Flow sensor | Equipment | 2 | 700 | 1400 |
| Rain detector | Equipment | 2 | 150 | 300 |
| SONAR | Equipment | 2 | 200 | 400 |
| Glass model(prototype) | Equipment | 1 | 4200 | 4200 |
| Solenoid valve | Equipment | 2 | 1850 | 3700 |
| PCB | Equipment | 1 | 700 | 700 |
| Relay module | Equipment | 2 | 350 | 700 |
| Voltage regulator | Equipment | 25 | 15 | 375 |
| Cooling fan | Equipment | 1 | 75 | 75 |
| Wires | Equipment | 30 | 10 | 300 |
| USB wires | Equipment | 2 | 100 | 200 |
| Acrylic box for PCB | Equipment | 1 | 2000 | 2000 |
| Battery | Equipment | 1 | 2000 | 2000 |
| Battery charger | Equipment | 1 | 800 | 800 |
| Paper printings | Miscellaneous | 50 | 20 | 1000 |
| Stationery | Miscellaneous | 1 | 500 | 500 |
| Fare | Miscellaneous | 1 | 3000 | 3000 |
| Solar power bank | Equipment | 1 | 2500 | 2500 |