Flood Monitoring and Avoidance System
Flood Monitoring and Avoidance System
“IoT Early Flood Detection & Avoidance System” is an intelligent system which keeps close watch
over various natural factors to predict a flood, so we can embrace ourselves for caution, to minimize the
damage caused by the flood. Natural disasters like floods can be devastating leading to property damage and
loss of lives. To eliminate or lessen the impacts of the flood, the system uses various natural factors to detect
floods. The system has a Wi-Fi connectivity; thus, it’s collected data can be accessed from anywhere quite
To detect a flood the system observes various natural factors, which includes humidity, temperature, water
level and flow level. To collect data of mentioned natural factors the system consists of different sensors
which collect data for individual parameters. For detecting changes in humidity and temperature the system
has a DHT11 Digital Temperature Humidity Sensor. It is an advanced sensor module with consists of
resistive humidity and temperature detection components. The water level is always under observation by a
float sensor, which works by opening and closing circuits (dry contacts) as water levels rise and fall. It
normally rests in the closed position, meaning the circuit is incomplete and no electricity is passing through
the wires yet. Once the water level drops below a predetermined point, the circuit completes itself and sends
electricity through the completed circuit to trigger an alarm. The flow sensor on the system keeps eye on the
flow of water.
The water flow sensor consists of a plastic valve body, a water rotor, and a hall-effect sensor. When water
flows through the rotor, the rotor rolls. Its speed changes with different rate of flow. All the sensors are
connected to Microcontroller, which processes and saves data. The system has a Wi-Fi feature, which is
CHAPTER 8: REFERENCES 36
CHAPTER 9 APPENDIX 37
LIST OF FIGURES
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
In recent years, flooding has become one of the major natural disasters in India. India is ranked among
the top 10 countries most threatened by floods in the world. Floods have various impacts, with material,
human, economic, and social losses being some of the most significant consequences. Heavy rainfall is one
of the key factors contributing to flash floods. To reduce human and economic losses, certain preventive
measures need to be followed. One of the most important and preliminary steps is to alert the public before a
disaster occurs.
Although some areas have early flood alert systems, many of these systems are not highly efficient, as
they typically only send information to a limited number of organizations within restricted areas. As a result,
during a flood, it takes longer to pass on the message to people living in nearby areas, and they are often
unable to save their belongings as the water rises quickly.
While flooding cannot always be prevented, early detection through continuous monitoring can help
reduce the losses faced by society. Several projects are focused on improving early flood monitoring
systems. One such project involves using a flood observatory system to indicate water levels and alert people
in remote areas. The observatory system communicates with the monitoring system via a GSM modem to
send information about the flow rate and receive commands.
Another approach uses flood detection systems that estimate real-time water levels using wireless sensor
networks. These systems provide data through a GSM modem and send notifications via social media
platforms such as Facebook and Twitter. Additionally, real-time flood monitoring systems using wireless
sensor networks have been introduced to monitor river conditions and provide continuous, up-to-date
information.
1. Coastal Flooding: Coastal flooding occurs when the sea level rises, leading to inundation of low-
lying seaside areas. These areas may have natural or man-made defenses, such as sand dunes or
barriers, to protect against the water.
2. River Flooding: River flooding is the most common type of flooding near coastal areas, often caused
by heavy rainfall. When rivers overflow their banks, they inundate surrounding areas.
IOT Flood Monitoring and Avoidance 2
3. Flash Flooding: Flash flooding happens when the ground is unable to absorb rainwater as quickly as
it falls, leading to rapid water accumulation and flooding.
4. Urban Flooding: Urban flooding occurs due to inadequate drainage systems in urban areas, which
can lead to water accumulation and flooding after heavy rainfall.
5. Ponding: Ponding refers to the accumulation of water in relatively flat areas, often occurring when
the ground is unable to drain excess water efficiently.
Although flooding cannot always be prevented, the damage it causes can be minimized by detecting
floods early. A system that continuously monitors water flow can help achieve this. The system uses a water
level indicator, to measure the water level. This data is displayed on an application. If the water level exceeds
the maximum threshold, the alert system is triggered.
To address this issue, we aim to develop a solution that will benefit the community, such as an early flood
warning system using IoT.
During floods, an intelligent IoT-based flood monitoring system plays a crucial role. A highly effective
system will help both the government and society manage flood situations and assist victims, thereby
minimizing the disaster's impact. It is essential to make this system accessible, easy to use, cost-effective,
and, most importantly, capable of providing timely warnings to the public. The proposed system will feature
IOT Flood Monitoring and Avoidance 3
a simple monitoring interface, along with sufficient data on current flood levels and forecasts of short-term
water levels.
Do et al. have proposed a flood cautioning structure that has been examined and created. The structure
contains an early flood forewarning station which is charged by solar power. The flood advised station is
equipped with the water level sensor. The data, which is gotten from sensors, are stored and transmitted to
the observing focus by means of GPRS convention. The observing focus' capacity is to gather, research data
from the stations and send results to the notification focus where alerts can be created to the considered
nearby areas and notification is also sent through SMS from the client server. A website page was made to
demonstrate the water level, and the foreseen information for persistent activity. The issue with this
framework is setting up the conditions for testing in the lab takes a while to have the test results as a general
rule [1].
Sakib et al. have proposed a neuro-fluffy controller-based flood observing framework utilizing remote
sensor organize. The framework utilizes IEEE 802.15.4 convention as a conveyed hub to gather the sensor
data, for example, water level information from the waterway, precipitation, and wind speed information
from a chosen site. In order to endorse the flood checking structure, Chadpur, a flood slanted area of
Bangladesh, has been considered as a picked site. The sensors' information is sent to the disseminated alarm
focus from the main control unit by using Zigbee module. Sensor data is researched by the neuro-fluffy
controller. The sensor data are processed using Raspberry Pi controller for warning condition. The remote
sensor is included for sending detected data to location instantaneously. It is incompetent to control moving
procedures with time delays and change in the MF can require a change in the rules. And it undergoes a
multi-parameter optimization problem [2].
Mousa et al. have planned a new detecting gadget that can consistently screen urban flash floods and
traffic blockage for flood watching. This recognizing gadget relies upon the mix of ultrasonic distance
measurement for detecting temperature, using a blend of L1-regularized recreation. Second, looking at
counts that have been executed on a remote sensor platform. And artificial neural systems to process
estimation data. The results demonstrate that water levels can be constantly assessed with reduced error, and
that the pre-preparing and AI plans can continue running logically on starting at now open remote sensor
stages. In the present case, ANNs show extraordinary mix properties anyway it enables us to use a low
number of neurons and parameters, making it suitable for low power installed frameworks applications [3].
IOT Flood Monitoring and Avoidance 4
Khalaf et al. have proposed a portrayal of an alarm making structure for flood identification with an
accentuation on choosing momentum water level using sensors. The framework then gives a cautioning
message about water level using Global Communication and Mobile System modem to explicit individuals.
Also, the Short Message Service is provided for the framework rapidly exchanges and conveys information
through the web-based open framework. AI calculations were directed to play out the classification process.
The tests were done to characterize flood information from typical and in-danger condition in which
arrangement accuracy was accomplished utilizing Random Forest algorithm. The calculation experiences
complexity and is tedious to develop compared to decision trees [4].
Dashpute et al. have proposed a flood detection system to screen rising water in local locations. Utilizing
ultrasonic sensors, they made a flood level detecting device which is connected to Node MCU controller to
process the sensor's analog signal into a usable advanced estimation of separation. The client can get real-
time data on observing overflowed streets over SMS-based administration. The level of the flood will be
partitioned into four. The flood sensor and microcontroller will be controlled by solar-based energy to assist
constant activity of water flood height identification and system information transmission. The Arduino
Flood Detector System is created to monitor flood that will support drivers or street users to stay away from
issues when a flood happens. The issue identified in this system is that it will not predict the values or it
takes previous for classification by using any machine learning algorithm [5].
IOT Flood Monitoring and Avoidance 5
CHAPTER 2
PROJECT MECHANISM
Ultrasonic
Sensor
Float Sensor
THINGSPEAK
Temperature Sensor:
IOT Flood Monitoring and Avoidance 7
A temperature sensor detects the hotness or coldness of the environment. The temperature is measured either
through direct contact with the surroundings or indirectly.
Humidity Sensor:
A humidity sensor (also known as a hygrometer) detects, measures, and reports both the moisture and air
temperature in the environment. The ratio of moisture in the air to the maximum moisture the air can hold at
a specific temperature is called relative humidity. This becomes an important factor when assessing comfort
levels. Humidity sensors work by detecting changes that affect electrical currents or temperature in the air.
Water Level sensors are used to measure the water level. These sensors can detect the level of various
substances such as liquids (water, oil), slurries, and even solids that are capable of flowing.
LCD Display:
An LCD (Liquid Crystal Display) screen is an electronic display module widely used in various devices and
circuits. The 16x2 LCD display is a basic module, displaying 16 characters per line across two lines. Each
character is formed in a 5x7 pixel matrix. The 16x2 intelligent alphanumeric dot matrix display can show up
to 224 different characters and symbols. The LCD has two registers: Command and Data. The display
contrast can be adjusted using a potentiometer connected to the VEE pin.
Microcontroller Section:
This section serves as the control unit of the entire project. It consists of a microcontroller along with
associated components. The microcontroller is the heart of the system, as it monitors the sensors and updates
the web through a WiFi module.
Thingspeak:
Thingspeak is an open-source IoT application and API that allows for reading and writing data from various
devices. It uses the HTTP protocol to communicate. In Thingspeak, graphs and numerical displays are used
to monitor the data that is updated from the sensors via the internet. Thingspeak offers several advantages,
including the ability to trigger certain actions if specific conditions are met.
The Flood Monitoring and Avoidance System operates using an ESP8266 microcontroller to
collect and process data from various environmental sensors, including a float sensor, temperature sensor,
and humidity sensor. These sensors continuously monitor the water level in the surrounding area, as well as
the temperature and humidity of the environment. The float sensor detects rising water, while the
temperature and humidity sensors provide data about weather conditions that may indicate potential
flooding.
The ESP8266 microcontroller reads the sensor values at regular intervals and compares them to predefined
thresholds. If any of the values exceed these thresholds for example, if the water level rises above a safe limit
or if the temperature and humidity reach levels that suggest heavy rainfall or flooding the system processes
this information to trigger an alert.
Once the system detects dangerous conditions, it activates a buzzer to provide alert to people, warning them
of the potential flood. Simultaneously, the ESP8266 transmits the collected data to the ThingSpeak cloud
platform via Wi-Fi. This allows users to remotely monitor the situation through the ThingSpeak app or
website, providing real-time data on the water level, temperature, and humidity.
The system enables continuous monitoring of flood-prone areas, and users can view trends and track changes
in environmental conditions over time. This combined system of local and remote alerts helps people stay
safe by providing early warnings and enabling proactive flood avoidance.
.
IOT Flood Monitoring and Avoidance 11
CHAPTER 3
HARDWARE REQUIREMENTS
Introduction
NodeMCU is an open source LUA based firmware developed for the ESP8266 wifi chip. By
exploring functionality with the ESP8266 chip, NodeMCU firmware comes with the ESP8266 Development
board/kit i.e. NodeMCU Development board.
NodeMCU Development kit provides access to these GPIOs of ESP8266. The only thing to take care
of is that NodeMCU Devkit pins are numbered differently than internal GPIO notations of ESP8266 as
shown in the below figure and table. For example, the D0 pin on the NodeMCU Devkit is mapped to the
internal GPIO pin 16 of ESP8266.
IOT Flood Monitoring and Avoidance 14
The below table gives NodeMCU Dev Kit IO pins and ESP8266 internal GPIO pins mapping
Pin Names on NodeMCU Development Kit ESP8266 Internal GPIO Pin number
D0 GPIO16
D1 GPIO5
D2 GPIO4
D3 GPIO0
D4 GPIO2
D5 GPIO14
D6 GPIO12
D7 GPIO13
IOT Flood Monitoring and Avoidance 15
Pin Names on NodeMCU Development Kit ESP8266 Internal GPIO Pin number
D8 GPIO15
D9/RX GPIO3
D10/TX GPIO1
D11/SD2 GPIO9
D12/SD3 GPIO10
The GPIO’s shown in the blue box (1, 3, 9, 10) are not commonly used for GPIO purpose on Dev Kit
ESP8266 is a system on a chip (SoC) design with components like the processor chip. The processor
has around 16 GPIO lines, some of which are used internally to interface with other components of the SoC,
like flash memory.
Since several lines are used internally within the ESP8266 SoC, we have about 11 GPIO pins
remaining for GPIO purposes.
2 pins out of 11 are generally reserved for RX and TX in order to communicate with a host PC from
which compiled object code is downloaded.
Hence finally, this leaves just 9 general-purpose I/O pins i.e. D0 to D8.
As shown in the above figure of NodeMCU Dev Kit. We can see RX, TX, SD2, SD3 pins are not
commonly used as GPIOs since they are used for other internal processes. But we can try with SD3 (D12)
pin which mostly likes to respond for GPIO/PWM/interrupt like functions.
Note that the D0/GPIO16 pin can be only used as GPIO read/write, no special functions are
supported on it.
Note
Some of the GPIO pins are used while booting, so pulling this pin HIGH or LOW can prevent NODEMCU
from booting
GPIO0: It oscillates and stabilizes HIGH after ~100ms. Boot Failure if pulled LOW
GPIO1: LOW for ~50ms, then HIGH, Boot Failure if Pulled LOW.
GPIO2: It oscillates and stabilize HIGH after ~100ms, Boot Failure if Pulled LOW.
GPIO3: LOW for ~50ms, then HIGH.
IOT Flood Monitoring and Avoidance 16
GPIO Cautions:
If the GPIO pin defines as an OUTPUT LOW then don’t connect this pin to VCC, it will get short
circuit, and large current flow will damage your controller or GPIO pin.
If the GPIO Pin defines as an OUTPUT HIGH then don’t connect this pin to Ground, it will draw
large current which will damage your controller or GPIO pin.
For switch connection always use a pull-up or pull-down (based on your coding logic). Always use
pull UP/pull down resistor inside the microcontroller or connect an external resistor.
Don’t connect the direct VCC pin to the GPIO pins, otherwise it will short the power supply when
you press the switch.
IOT Flood Monitoring and Avoidance 17
While interfacing the led always connect a series resistor to limit the current, otherwise LED will
burn.
IOT Flood Monitoring and Avoidance 18
Jumper wires are simply wires that have connector pins at each end, allowing them to be used to
connect two points to each other without soldering. Jumper wires are typically used with breadboards and
other prototyping tools to make it easy to change a circuit as needed. Fairly simple. In fact, it doesn’t get
much more basic than jumper wires.
Though jumper wires come in a variety of colors, the colors don’t actually mean anything. This
means that a red jumper wire is technically the same as a black one. But the colors can be used to your
advantage to differentiate between types of connections, such as ground or power.
Jumper wires typically come in three versions: male-to-male, male-to-female and female-to-female.
The difference between each is in the end point of the wire. Male ends have a pin protruding and can plug
into things, while female ends do not and are used to plug things into. Male-to-male jumper wires are the
most common and what you likely will use most often. When connecting two ports on a breadboard, a male-
to-male wire is what you will need.
IOT Flood Monitoring and Avoidance 19
A float switch definition is: It is a type of contact liquid level sensor which uses a float to operate a
switch within a tank. This switch is also known as a level sensor. These switches play a key role in
controlling other devices like pumps & alarms when a level of liquid increases or drops to a particular point.
The float switch symbol is shown below. These switches range from small sizes to large sizes. Float switches
come in two different styles: magnetic (Electromagnetic) and Mechanical float type.
Stem
The stem of the switch is a plastic part that connects the switch to the keycap directly. The stem can be
plastic or metal depending on the requirement.
IOT Flood Monitoring and Avoidance 20
Reed Switch
The reed switch is hermetically sealed within a stem of the float switch. These are most frequently
designed with stainless steel or plastic. The water float covers a sealed magnet to move up & down the stem
length when a level of fluid increases and decreases.
Permanent Magnet
A permanent magnet in a switch moves consistently with the level of fluid on a guide tube. A reed
contact is connected in the guide tube which is energized throughout the non-magnetic walls of the float by
the float magnet approach.
The working of a float switch is based on the principle of buoyancy i.e., when there is no liquid in
contact with the float, it floats on top of the liquid surface and triggers an alarm signal, when there is enough
liquid in contact with float, it submerges itself into liquid and stops alarming. The principle of operation is
the same for the style of float switches but works depending on their construction of it. Let’s see how both
works.
Humidity sensors are devices used to measure humidity levels in the air. Relative humidity sensors
also measure air temperature, but they are not effective for temperatures above 100 degrees Celsius.
Humidity sensors, often referred to as hygrometers, are low-cost, sensitive electronic devices designed to
measure air humidity. Humidity can be quantified as relative humidity, absolute humidity, or specific
humidity. Based on the type of humidity they measure; these sensors are classified as Relative Humidity
sensors or Absolute Humidity sensors.
Furthermore, humidity sensors can be categorized according to the method they use to measure
humidity. These include Capacitive Humidity Sensors, Resistive Humidity Sensors, and Thermal
Conductivity Humidity Sensors.
When selecting a humidity sensor, key factors to consider include accuracy, linearity, reliability,
repeatability, and response time.
IOT Flood Monitoring and Avoidance 21
The DTH11 is a 1-wire programmable temperature sensor from Maxim Integrated. It is commonly
used to measure temperature in harsh environments such as chemical solutions, mines, or soil. The sensor is
ruggedly constructed and can also be purchased with a waterproof option, which simplifies the mounting
process. The sensor has a wide temperature measurement range from -55°C to +125°C, with a reasonable
accuracy of ±0.5°C. Each DTH11 sensor has a unique address and only requires a single pin on the
microcontroller to transfer data, making it an excellent choice for measuring temperature at multiple points
without consuming many digital pins on the microcontroller.
Pin Configuration
3 Data Outputs the temperature value, which can be read using the 1-wire method
Operating Voltage: 3V to 5V
Accuracy: ±0.5°C
3.6 BUZZER
Specifications
Color is black
3.7 LED
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a pn-junction diode, which
emits light when activated. When a suitable voltage is applied to the leads, electrons can recombine with
electron holes within the device, releasing energy in the form of photons. This effect is called
electroluminescence, and the colour of the light (corresponding to the energy of the photon) is determined
by the energy band gap of the semiconductor.
An LED is often small in area (less than 1mm) and integrated optical components may beed to
shape its radiation pattern.
LCDs were a big leap in terms of the technology they replaced, which include light-emitting diode
(LED) and gas-plasma displays. LCDs allowed displays to be much thinner than cathode ray tube (CRT)
technology. LCDs consume much less power than LED and gas-display displays because they work on the
principle of blocking light rather than emitting it. Where an LED emits light, the liquid crystals in an LCD
IOT Flood Monitoring and Avoidance 25
produces an image using a backlight. As LCDs have replaced older display technologies, LCDs have begun
being replaced by new display technologies such as OLEDs.
A display is made up of millions of pixels. The quality of a display commonly refers to the number of
pixels; for example, a 4K display is made up of 3840 x2160 or 4096x2160 pixels. A pixel is made up of three
subpixels; a red, blue and green—commonly called RGB. When the subpixels in a pixel change color
combination, a different color can be produced. With all the pixels on a display working together, the display
can make millions of different colors. When the pixels are rapidly switched on and off, a picture is created.
The way a pixel is controlled is different in each type of display; CRT, LED, LCD and newer types of
displays all control pixels differently. In short, LCDs are lit by a backlight, and pixels are switched on and off
electronically while using liquid crystals to rotate polarized light. A polarizing glass filter is placed in front
and behind all the pixels, the front filter is placed at 90 degrees. In between both filters are the liquid crystals,
which can be electronically switched on and off
LCDs are made with either a passive matrix or an active-matrix display grid. The active-matrix LCD
is also known as a thin film transistor (TFT) display. The passive matrix LCD has a grid of conductors with
pixels located at each intersection in the grid. A current is sent across two conductors on the grid to control
the light for any pixel. An active matrix has a transistor located at each pixel intersection, requiring less
current to control the luminance of a pixel. For this reason, the current in an active-matrix display can be
switched on and off more frequently, improving the screen refresh time. Some passive matrix LCDs have
dual scanning, meaning that they scan the grid twice with current in the same time that it took for one scan in
the original technology. However, active matrix is still a superior technology out of the two.
IOT Flood Monitoring and Avoidance 26
An ultrasonic sensor is an electronic device that measures the distance of a target object by emitting
ultrasonic sound waves and converts the reflected sound into an electrical signal. Ultrasonic waves travel
faster than the speed of audible sound (i.e. the sound that humans can hear). Ultrasonic sensors have two
main components: the transmitter (which emits the sound using piezoelectric crystals) and the receiver
(which encounters the sound after it has travelled to and from the target).
In order to calculate the distance between the sensor and the object, the sensor measures the time it takes
between the emission of the sound by the transmitter to its contact with the receiver. The formula for this
calculation is D = ½ T x C (where D is the distance, T is the time, and C is the speed of sound ~ 343
meters/second). For example, if a scientist set up an ultrasonic sensor aimed at a box and it took 0.025
seconds for the sound to bounce back, the distance between the ultrasonic sensor and the box would be:
CHAPTER 4
SOWFWARE REQUIREMENTS
4.1 ARDUINO IDE
IDE stands for Integrated Development Environment‖: it is an official software introduced by
Arduino.cc, that is mainly used for editing, compiling and uploading the code in the Arduino Device. Almost
all Arduino modules are compatible with this software that is an open source and is readily available to
install and start compiling the code on the go.
Arduino Sketch
Arduino sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to,
and run on an Arduino board. A basic Arduino sketch consists of two functions:
setup() loop()
Writing Sketch
Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension.ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE), including complete error messages
and other information. The bottom righthand corner of the window displays the configured board and serial
port. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open
the serial monitor.
The two required parts or functions enclose blocks of statements are: void setup()
statements;
void loop()
Statements;
}
IOT Flood Monitoring and Avoidance 28
Where setup() is the preparation, while loop() is the execution. Both functions are required for the
program to work. The setup function should follow the declaration of any variable at the very beginning of
the program. It is the first function to run in the program, it runs only once and is used to set pin Mode or
initialize serial communication. The loop function follows next and includes the code to be executed
continuously - reading inputs, triggering outputs, etc. This function is the core of all Arduino program and
does the bulk of the work
The Arduino Integrated Development or Arduino software contains a text editor for writing code. A
message area, a text console, a tool bar with buttons for common functions and a series of menus. It connects
to Arduino hardware to upload programs and communicate with them.
4.2 THINGSPEAK
ThingSpeak is a platform that offers a variety of services specifically designed for creating IoT
applications. It enables real-time data collection, visualizes the data through charts, and provides the ability
to create plugins and apps for interaction with web services, social networks, and other APIs. Each of these
features will be explored in detail below.
IOT Flood Monitoring and Avoidance 29
At the heart of ThingSpeak is the ‘ThingSpeak Channel’. A channel stores the data sent to ThingSpeak and
consists of the following components:
8 fields for storing data of any type – These fields can store data from sensors or embedded devices.
3 location fields – These can store latitude, longitude, and elevation, which are particularly useful for
tracking a moving device.
1 status field – A brief message describing the data stored in the channel.
To use ThingSpeak, we need to sign up and create a channel. Once a channel is created, we can send
data, let ThingSpeak process it, and retrieve it as needed. Let's begin by signing up and setting up a channel
on ThingSpeak.
ThingSpeak Apps
ThingSpeak offers a range of apps that simplify integration with web services, social networks, and other
APIs. Below are some of the apps provided by ThingSpeak:
ThingTweet – This app allows you to post messages to Twitter through ThingSpeak. Essentially, it
acts as a Twitter proxy, redirecting your posts to Twitter.
ThingHTTP – This app enables you to connect to web services and supports HTTP methods such as
GET, PUT, POST, and DELETE.
IOT Flood Monitoring and Avoidance 30
TweetControl – With this app, you can monitor your Twitter feeds for a specific keyword and
process requests when that keyword is found. Once detected, you can use ThingHTTP to connect to a
web service or trigger a specific action.
React – This app lets you send a tweet or trigger a ThingHTTP request when a channel meets a
specified condition.
TalkBack – Use this app to queue up commands and allow a device to act on these queued
commands.
TimeControl – This app allows you to schedule a ThingTweet, ThingHTTP, or TalkBack action at a
specific time in the future or at a specified time on certain days of the week.
CHAPTER 5
RESULTS AND DISCUSSIONS
In fig 5.3 we can see that as the water level is safe it indicates green color in the app which means that there
will be no occurrence of floods.
CHAPTER 6
ADVANTAGES AND CHALLENGES
6.1 ADVANTAGES
1. Early Detection and Prevention:
The system provides real-time monitoring of water levels, temperature, and humidity, allowing for
early detection of potential flood risks. This can help in preventing or mitigating the impacts of floods
by alerting authorities or individuals ahead of time.
2. Cost-Effective:
Using affordable components such as NodeMCU, water level sensors, and other environmental
sensors, this system is relatively inexpensive to deploy compared to traditional flood monitoring
systems. It makes flood monitoring accessible to a wider range of communities and regions.
3. Real-Time Monitoring:
The system offers continuous real-time data collection and analysis, ensuring that any sudden
changes in environmental conditions (water level rise, temperature fluctuation, or humidity change)
are immediately detected and responded to, potentially saving lives and property.
By integrating ThinkSpeak, the data can be remotely accessed from anywhere via the internet. This
makes it easier for authorities or users to monitor flood-prone areas without having to be physically
present at the site, enhancing the efficiency of monitoring efforts.
5. Alert Mechanism:
The integration of a buzzer in the system provides a local audible alarm whenever the water level or
other environmental factors exceed a set threshold, alerting individuals in the area to evacuate or take
action immediately.
6. Scalability:
The system is scalable, meaning more sensors or additional units can be easily added to cover larger
areas or more locations. This flexibility allows for a broader coverage of flood-prone regions without
significant infrastructure changes.
IOT Flood Monitoring and Avoidance 35
With ThinkSpeak integration, the system can not only provide real-time monitoring but also store
historical data, which can be analyzed to identify trends, seasonal patterns, and correlations between
weather variables and flooding events. This historical data is valuable for making informed decisions
about flood prevention measures.
6.2 CHALLENGES
1. Accuracy of Sensors:
The reliability and accuracy of water level, temperature, and humidity sensors can vary depending on
environmental conditions and sensor calibration. Inaccurate readings could lead to false alarms or
missed warnings, reducing the effectiveness of the system.
2. Environmental Factors:
Harsh weather conditions such as high winds, heavy rain, or extreme temperatures could damage or
interfere with the sensors, affecting the overall functionality of the system. Protecting the hardware
from environmental damage is essential.
The water level sensors might only be effective for a specific range of water heights, which may limit
their ability to monitor extreme flooding conditions. Scaling the system to cover wider floodplains
may require additional sensors and infrastructure.
4. Internet Connectivity:
Since ThinkSpeak relies on an internet connection for data analysis and storage, any loss of internet
connectivity in remote or rural flood-prone areas could hinder the ability to monitor and respond to
flood events. Backup communication methods need to be considered
IOT Flood Monitoring and Avoidance 36
CHAPTER 7
7.1 CONCLUSION
The Flood Observatory System is designed as an intelligent device capable of transmitting real-time
water level data from remote locations to a monitoring station, regardless of time or distance. This system
operates as a standalone unit, requiring no additional devices or systems to function. Its built-in self-
monitoring ensures efficient and reliable performance at the monitoring station. In the event of a failure, such
as issues with the sensor unit or power supply, the system will notify personnel at the monitoring station in
real time. The Flood Observatory System can also be connected to a visual and audio unit, providing
warnings and alerts to users through text displays or a traffic light system during flooding events. The
system's implementation cost is minimal compared to the significant efficiency and value it offers in
preventing damage and saving lives. Its practicality helps reduce the financial impact of floods and provides
critical support for flood-prone areas, ensuring safety and mitigating potential disasters. The system was
specifically developed for monitoring and alerting in remote, high-risk flood zones, safeguarding both people
and infrastructure.
Sensors play a crucial role in the Flood Observatory System, and further research into wireless sensor
technology would be beneficial for replacing the current sensors. Accurate and precise detection of water
levels will enhance the data collection process for the monitoring station. Flood alert information can be
displayed on LED boards for road users, strategically placed in key locations for safety purposes. This
information should be transmitted wirelessly in real-time from the measurement site. A potential power
source for the sensors and centralized control unit is solar energy. If powered by solar cells, the Flood
Observatory System would be easy to install and maintain. Solar power also offers a cost-effective energy
solution, particularly when the system is deployed in remote areas. To ensure sustainability, the design of the
circuits and control unit should focus on minimizing power consumption during operation.
IOT Flood Monitoring and Avoidance 37
CHAPTER 8
REFERENCES
1. H. N. Do, M. Vo, V. Tran, P. V. Tan, and C. V. Trinh, “An Early Flood Detection System Using
2. S. N. Sakib, T. Ane, N. Matin, and M. S. Kaiser, “An Intelligent Flood Monitoring System for
3. M. Mousa, X. Zhang, and C. Claudel, “Flash Flood Detection in Urban Cities Using Ultrasonic and
Infrared Sensors,” IEEE Sensors Journal, vol. 16, no. 19, pp. 7204–7216, 2016.
4. M. Khalaf, A. J. Hussain, D. Al-jumeily, P. Fergus, and I. O. Idowu, “Advance Flood Detection and
Notification System based on Sensor Technology and Machine Learning Algorithm,” pp. 105–108,
2015.
5. K. R. Dashpute, V. B. Gaikwad, and S. S. Sawkar, “Flood detection using iot,” no. 2, pp. 1289–1292,
2018.
6. B. K. Durga, A. Ece, S. Peter, and S. E. College, “Design of Early Warning Flood Detection
10. WWW.ATMEL.COM
11. WWW.NATIONAL.COM
12. WWW.MICROCONTROLLER.NET
13. WWW.8051PROJECTS.INF
IOT Flood Monitoring and Avoidance 38
CHAPTER 9
APPENDIX
SOURCE CODE
#include <DHT.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <WiFi.h>
// Pin configuration
const int flowSensorPin = 27; // GPIO pin for water flow sensor
const int floatSwitchPin = 26; // GPIO pin for float switch
const int trigPin = 18; // GPIO pin for ultrasonic sensor Trig
const int echoPin = 19; // GPIO pin for ultrasonic sensor Echo
const int dhtPin = 32; // GPIO pin for DHT sensor
const int ledPin = 2; // GPIO pin for Green LED
const int buzzerPin = 4; // GPIO pin for Buzzer
// ThingSpeak credentials
const char *ssid = "123456789"; // WiFi SSID
const char *pass = "123456789"; // WiFi password
const char *server = "api.thingspeak.com";
String apiKey = "1AZ1IZJEGE9B0Y5G";
void setup() {
IOT Flood Monitoring and Avoidance 40
// Setup pins
pinMode(flowSensorPin, INPUT_PULLUP); // Flow sensor
pinMode(floatSwitchPin, INPUT_PULLUP); // Float switch
pinMode(trigPin, OUTPUT); // Ultrasonic Trig pin
pinMode(echoPin, INPUT); // Ultrasonic Echo pin
pinMode(ledPin, OUTPUT); // Green LED
pinMode(buzzerPin, OUTPUT); // Buzzer
// Initialize LCD
lcd.init();
lcd.backlight();
lcd.clear();
// Connect to WiFi
Serial.print("Connecting to WiFi...");
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
IOT Flood Monitoring and Avoidance 41
delay(500);
Serial.print(".");
}
Serial.println("Connected to WiFi");
}
void loop() {
// Reverse the float switch logic
bool floatState = digitalRead(floatSwitchPin); // Direct logic (no negation)