Instructions For 4-2 B.Tech Project Thesis Preparation
Instructions For 4-2 B.Tech Project Thesis Preparation
Instructions For 4-2 B.Tech Project Thesis Preparation
USING IOT”
A Dissertation
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS & COMMUNICATION ENGINEERING
Submitted By
I.HARSHITHA (20JR1A0469)
J.LAHARI (20JR1A0470)
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
(NBA Accredited Department)
KKR & KSR INSTITUTE OF TECHNOLOGY AND SCIENCES
(Autonomous)
Vinjanampadu (V), Vatticherukuru (M), Guntur (Dt),
Andhra Pradesh -522017.
APRIL – 2024.
ELECTRONICS AND COMMUNICATION ENGINEERING
CERTIFICATE
This is to certify that this project report entitled “FLOOD DETECTION &
AVOIDANCE SYSTEM USING IOT” submitted by M.BHAVYA SRI (21JR5A0409),
I.HARSHITHA (20JR1A0469), J.LAHARI (20JR1A0470) to Jawaharlal Nehru University
Kakinada, through KKR & KSR Institute of Technology and Sciences for the award of the
Degree of Bachelor of Technology in Electronics and Communication Engineering is a
bonafide record of project work carried out by them under my supervision during the
academic year 2023 – 2024.
We here by declare that the project “Flood Detection & Avoidance system using
IOT” has been carried out by me and this work has been submitted to KKR & KSR Institute
of Technology and Sciences (A), Vinjanampadu, affiliated to Jawaharlal Nehru
Technological University, Kakinada in partial fulfillment of the requirements for the award
of degree of Bachelor of Technology in Electronics and Communication Engineering.
We further declare that this project work has not been submitted in full or part
for the award of any other degree in any other educational institutions.
I.HARSHITHA (20JR1A0469)
J.LAHARI (20JR1A0470)
ACKNOWLEDGEMENT
I.HARSHITHA (20JR1A0469)
J. LAHARI (20JR1A0470)
INSTITUTE VISION AND MISSION
INSTITUTION VISION
INSTITUTION MISSION
PEO2: Have the ability to demonstrate technical competence in the fields of electronics
and communication engineering and develop solutions to the problems.
PEO5: Take individual responsibility and to work as a part of a team towards the
fulfillment of both individual and organizational goals.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge
to assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.
12. Life-long learning: Recognize the need for, and have the preparation and ability
engage in independent and life-long learning in the broadest context of technological
change.
Course Outcomes (COS):
CO425.6: Prepare the project Documentation and present the report using
appropriate method.
CO221.6 1 2 3 2 2 2 3
1. CO425.1 is mapped with PO1, PO2 and PO4, PO6, PO7 as basic knowledge of
Engineering and problem Analysis activities are highly essential to conduct
examinations on existing systems which have been using in industries as a part of and to
define the problem of proposed system.
2. CO425.2 is mapped with POI, PO2, PO4 and PO6, PO9, PO10, PO11 as for
identification, gathering analysis and classification of requirements for the proposed
system, basic knowledge of engineering and Analysis steps along with complex problem
analysis through the efforts of team work in order to meet the specific needs of the
customer.
3. CO425.3 is mapped with PO2, POS and PO12 as to conduct the literature review and
to examine the relevant systems to understand and identify the merits and demerits of
each to enhance and develop the proposed as per the need.
4. CO425.4 is mapped with POI, PO2, PO3, PO4, POS and PO7, POS, PO9, PO10
because modularization and design of the project is needed after requirements
elicitation. For modularization and design of the project, Basic knowledge of
Engineering. Analysis capabilities, Design skills and communication is needed between
team members as different modules are designed individually before integration.
5. CO425.5 is mapped with PO3, POS, PO7, PO9, PO11 and PO12 as to construct the
project latest technologies are needed. The development of project is done individually
and in groups with well-defined communication by using the engineering and
management principles.
6. CO425.6 is mapped with PO6, PO10 and PO12 because during and after completion
of the project, documentation is needed along with proper methods of presentation
through understanding and application of engineering and management principles,
which in turn needs well defined communication between the team members with all the
ethical values. Even the project development team defines the future enhancements as a
part of the project development after identifying the scope of the project.
CO-PSOs Mapping with Reasons:
2. CO425.2 is mapped with PSO1, PSO2 and PSO3as identifying and classifying the
requirements is a part of Application development and evolutionary computing changes
and also follows ethical principles.
4. CO425.4 is mapped with PSOI, PSO3 because modularization and logical design is
also a part of Application development and follows computing changes using Deep
learning technology.
6. CO425.6 is mapped with PSO2 as for project documentation and presentation; the
project team members apply the professional and leadership qualities
ABSTRACT
The flood detection and alerting system utilizes Arduino and Node MCU as controllers,
with the latter serving as the Wi-Fi module for remote communication. The system
incorporates a raindrop sensor to monitor precipitation levels and categorize them into
three distinct stages: the anticipation of rain, light rain, and heavy rain. Additionally, a
DHT11 sensor measures temperature to provide supplementary environmental data.
Information gathered by these sensors is displayed in real-time on an LCD screen,
offering users immediate insights into weather conditions.
To mitigate the risks associated with flooding, the system features an innovative
mechanism for controlling barrage gates remotely. A motor connected to the Node
MCU serves as a proxy for these gates, enabling automated responses to varying flood
levels. Leveraging a server-based infrastructure, users can initiate gate operations from a
distance, thereby facilitating timely interventions to manage water flow and mitigate
flood-related damages. This integration of remote control capabilities enhances the
system's effectiveness in flood management and response, offering a proactive approach
to safeguarding communities against the adverse effects of inundation.
Keywords: Arduino, LCD, Rain drop sensor, DHT11 sensor, Ultrasonic sensor,
Node MCU
Chapter Title Page No.
No.
1 Introduction i
1.5 Applications
2 Literature Survey
2.1 Introduction
2.4 Conclusion
3 Designing of System
3.1 Existing System
3.2 Proposed System
3.3 Proposed System Block diagram
4 Hardware Requirements
4.6 Rectifier
4.7 Capacitors
5 Software Requirements
5.3 Embedded C
6.1 Code
7.1 Conclusion
Bibliography
List of Figures
Figure.No. Label PageNo.
4.7.1 Capacitor
4.9.1 Buzzer
At the core of this system are Arduino and Node MCU microcontrollers, which serve as
the brains of the operation. The Arduino board is responsible for interfacing with
various sensors, including the raindrop sensor and DHT11 temperature sensor, to collect
crucial environmental data. Meanwhile, the Node MCU module enables wireless
connectivity via Wi-Fi, allowing the system to transmit information to remote servers
and receive commands for automated responses. This combination of hardware
components forms the foundation for building an intelligent flood detection and alerting
system capable of monitoring weather conditions and taking proactive measures to
mitigate flood risks.
1.2.1 Introduction:
User interface
Embedded system
Software Hardware
Inputs
Output
1. Hardware
2. Software
Timers Memory
Power
Application
supply and Processor Serial specific
oscillator communication circuits
circuits ports
Interrupt Parallel
controller ports
Power Supply
Processor
Memory
Timers
Serial communication ports
Output/Output circuits
System application specific circuits
Embedded systems use different processors for its desired operation. Some of the
processors used are
1. Microprocessor
2. Microcontroller
Microprocessor
• CPU on a chip.
• We can attach required amount of ROM, RAM and I/O ports.
• Expensive due to external peripherals.
• Large in size
• general-purpose
Microcontroller
• Computer on a chip
• fixed amount of on-chip ROM, RAM, I/O ports
• Low cost.
• Compact in size.
• Specific –purpose
Generally we write source codes for embedded systems in assembly language, but the
processors run only executable files. The process of converting the source code
representation of your embedded software into an executable binary image involves
three distinct steps:
Each of the source files must be compiled or assembled into an object file.
1. All of the object files that result from the first step must be linked together to
produce a single object file, called the re-locatable program.
2. Physical memory addresses must be assigned to the relative offsets within the re-
locatable program in a process called relocation.
The result of the final step is a file containing an executable binary image that is ready
to run on the embedded system.
Source code
Assembler
Linker
Locator
Executable file
Processor
Mobile computing
Networking
Wireless Communications
Banking
Telephone
Security Systems
Stage 1: Considering the problems of existing methods and giving solution to that
problem by considering the basic requirements for our proposed system
Stage 2:
1. Microcontroller
2. Inputs for the proposed system (ex: sensors, drivers etc..,)
Stage 3:
After considering hardware requirements, now we need to check out the software requirements.
Based on the microcontroller we select there exists different software for coding, compiling,
debugging. we need to write source code for that proposed system based on our requirements
and compile, debug the code in that software .
After completing all the requirements of software and hardware we need to bring both
together to work our system. For this we need to burn our source code into microcontroller, after
burning our source code to microcontroller then connect all input and output modules as per our
requirement.
CHAPTER-2
LITERATURE SURVEY
2.1 Introduction:
Flood detection and avoidance systems play a crucial role in mitigating the adverse
effects of floods, which can cause significant damage to life and property. Over the
years, various techniques and technologies have been developed and explored in the
realm of flood detection and avoidance. Remote sensing techniques, including satellite
imagery and aerial surveys, have been widely used for early flood detection by
monitoring changes in water levels and identifying flood-prone areas. Additionally,
sensor networks deployed in rivers, streams, and urban areas provide real-time data on
water levels, rainfall intensity, and weather conditions, aiding in timely flood warnings
and evacuation strategies. Machine learning and data analytics techniques are
increasingly being integrated into flood detection systems to improve accuracy and
predictive capabilities based on historical data patterns.
Furthermore, the adoption of Internet of Things (IoT) devices and smart infrastructure
enables automated responses such as activating flood barriers, redirecting traffic, and
managing water flow to minimize flood impacts. Research in this field continues to
focus on enhancing the precision, scalability, and resilience of flood detection and
avoidance systems through interdisciplinary collaborations between engineers,
environmental scientists, and policymakers.
In recent literature, there has been a growing emphasis on integrating advanced
technologies such as artificial intelligence (AI) and unmanned aerial vehicles (UAVs)
into flood detection and avoidance systems.
Overall, the literature reflects a multifaceted approach to flood detection and avoidance,
integrating cutting-edge technologies, data-driven insights, community participation,
and policy interventions to build more robust and adaptive flood resilience frameworks
at local, regional, and global scales. Ongoing research and collaborations across
disciplines continue to drive innovation and enhance the effectiveness of flood risk
management strategies in the face of climate change and urbanization challenges.
2.4 Conclusion :
In conclusion, the literature survey on flood detection and avoidance systems highlights
a diverse range of approaches and technologies aimed at mitigating the impact of floods.
From traditional sensor-based systems to advanced machine learning algorithms and
remote sensing techniques, researchers and engineers have made significant strides in
improving early detection, accurate prediction, and effective mitigation strategies.
However, challenges such as data accuracy, real-time response, and integration with
existing infrastructure remain areas for further research and development. As technology
continues to evolve, interdisciplinary collaboration and innovation will be key in
developing robust and scalable flood detection and avoidance systems that can
effectively protect lives and property in flood-prone areas.
1. Integration of IoT and Big Data: The integration of Internet of Things (IoT) devices
and Big Data analytics has shown promise in enhancing the capabilities of flood
detection systems. Real-time data collection, analysis, and decision-making can lead to
more proactive and effective responses to flood events.
5. Future Directions and Emerging Technologies: The literature survey highlights the
need for ongoing research into emerging technologies such as artificial intelligence,
blockchain, and autonomous systems for more advanced flood detection and avoidance
capabilities. Future efforts should also focus on interdisciplinary collaborations, policy
interventions, and risk communication strategies to address the complex challenges
posed by floods.
Fig 2.1 Effects of Floods
CHAPTER – 3
DESIGING OF SYSTEM
3.1 EXISTING SYSTEM
The existing method of flood detection and alerting typically relies on manual
monitoring and observation by local authorities or weather stations. This approach
involves periodic checks of rainfall levels using traditional rain gauges and visual
inspections of water levels in rivers and streams. However, these methods are often
labor-intensive, time-consuming, and prone to delays in data collection and analysis.
Moreover, they may not provide comprehensive coverage of all flood-prone areas,
leading to gaps in early warning systems. Additionally, traditional flood detection
methods may lack the ability to integrate real-time data from multiple sources or
communicate alerts rapidly to affected communities. As a result, there is a need for more
advanced and automated flood monitoring systems capable of leveraging IoT
technology to improve accuracy, efficiency, and timeliness in detecting and responding
to flood events.
Drawbacks:
1. Manual Monitoring:
2. Limited Coverage:
3. Time-Consuming:
4. Delayed Response:
5. Lack of Integration:
3.2 PROPOSED SYSTEM
The proposed method of the flood detection and alerting system aims to address the
limitations of the existing manual monitoring approach. In this method, Arduino and
NodeMCU are utilized as the primary controllers, offering enhanced automation and
real-time data processing capabilities. Raindrop sensors are strategically deployed to
detect varying levels of rainfall intensity, categorized into three levels: light rain,
moderate rain, and heavy rain. Additionally, a DHT11 sensor is employed to measure
temperature fluctuations, providing supplementary environmental data.
To enhance the system's functionality, a Wi-Fi module is integrated with Node MCU,
enabling seamless communication and data transmission to remote servers or cloud
platforms. This connectivity facilitates real-time monitoring of rainfall and temperature
conditions, enabling timely responses to potential flood situations. Moreover, an LCD
display is incorporated to provide visual feedback on the detected rain intensity and
temperature levels, ensuring transparency and accessibility of information to users.
Furthermore, an innovative aspect of the proposed method involves the integration of a
motor with Node MCU, representing gate control mechanisms during flood scenarios.
This enables remote operation of flood barriers or gates based on the detected rainfall
levels, enhancing the system's responsiveness and effectiveness in flood management.
3.3 Block Diagram:
3.4.2 APPLICATIONS
1. Early Warning Systems: The flood detection and alerting system can be
deployed in areas prone to floods, providing early warnings to residents and
authorities, allowing them to take preventive measures such as evacuations and
deploying emergency response teams.
2. Agricultural Monitoring: Farmers can utilize the system to monitor rainfall levels
and soil moisture, helping them make informed decisions about irrigation
scheduling and crop management practices, thereby optimizing agricultural
productivity.
3. Urban Infrastructure Management: Municipalities can integrate the system into
their urban infrastructure management to monitor water levels in drainage
systems, sewage networks, and reservoirs, enabling proactive measures to
prevent urban flooding and infrastructure damage.
4. Environmental Monitoring: Environmental agencies can deploy the system to
monitor river water levels, rainfall patterns, and soil moisture content in
environmentally sensitive areas, facilitating ecosystem conservation and
protection.
5. Disaster Risk Reduction: The system can contribute to disaster risk reduction
efforts by providing real-time data on flood conditions, helping disaster
management agencies coordinate response efforts, allocate resources efficiently,
and mitigate the impact of flooding on communities.
6. Industrial Safety: Industries located in flood-prone areas can utilize the system to
monitor water levels around their facilities, triggering automated shutdown
procedures or evacuation protocols to ensure employee safety and prevent
damage to equipment and infrastructure.
7. Transportation Management: Transportation authorities can deploy the system
along roadways, bridges, and tunnels to monitor water levels during heavy
rainfall events, enabling them to close affected routes promptly and reroute
traffic to prevent accidents and delays.
8. Infrastructure Planning: Urban planners and engineers can use historical flood
data collected by the system to inform infrastructure planning and design,
ensuring that new developments are resilient to flood risks and incorporate
sustainable drainage systems.
9. Emergency Response Coordination: Emergency response agencies can integrate
the system into their operations centers to receive real-time alerts and updates on
flood conditions, facilitating rapid deployment of resources and coordination of
rescue efforts during emergencies.
10. Research and Education: Academic institutions and research organizations can
use the data collected by the system for scientific studies on flood dynamics,
hydrology, and climate change impacts, advancing knowledge in these fields and
educating future generations about flood risk management strategies.
CHAPTER-4
HARDWARE DESCRIPTION
HARDWARE REQUIREMENTS
4.1 Arduino:
Arduino Uno is a very valuable addition in the electronics that consists of USB
interface, 14 digital I/O pins, 6 analog pins, and Atmega328 microcontroller. It also
supports serial communication using Tx and Rx pins.
There are many versions of Arduino boards introduced in the market like Arduino Uno,
Arduino Due, Arduino Leonardo, Arduino Mega, however, most common versions are
Arduino Uno and Arduino Mega. If you are planning to create a project relating to
digital electronics, embedded system, robotics, or IoT, then using Arduino Uno would
be the best, easy and most economical option.
It is an open-source platform, means the boards and software are readily available and
anyone can modify and optimize the boards for better functionality.
The software used for Arduino devices is called IDE (Integrated Development
Environment) which is free to use and required some basic skills to learn it. It can be
programmed using C and C++ language.
Some people get confused between Microcontroller and Arduino. While former is just
an on system 40 pin chip that comes with a built-in microprocessor and later is a board
that comes with the microcontroller in the base of the board, bootloader and allows easy
access to input-output pins and makes uploading or burning of the program very easy.
Nevertheless, we can say every Arduino is basically a microcontroller but not every
microcontroller is an Arduino.
First Arduino project was started in Interaction Design Institute Ivrea in 2003 by
David Cuartielles and Massimo Banzi with the intention of providing a cheap and
flexible way to students and professional for controlling a number of devices in the
real world.
The current version of Arduino Uno comes with USB interface, 6 analog input pins,
14 I/O digital ports that are used to connect with external electronic circuits. Out of
14 I/O ports, 6 pins can be used for PWM output.
It allows the designers to control and sense the external electronic devices in the real
world
Fig 4.1.2 Pin out Configuration
This board comes with all the features required to run the controller and can be
directly connected to the computer through USB cable that is used to transfer the
code to the controller using IDE (Integrated Development Environment) software,
mainly developed to program Arduino. IDE is equally compatible with Windows,
MAC or Linux systems, however, Windows is preferable to use. Programming
languages like C and C++ are used in IDE.
Apart from USB, battery or AC to DC adopter can also be used to power the board.
Arduino Uno boards are quite similar to other boards in Arduino family in terms of
use and functionality, however, Uno boards don’t come with FTDI USB to Serial
driver chip.
There are many versions of Uno boards available, however, Arduino Nano V3 and
Arduino Uno are the most official versions that come with Atmega328 8-bit AVR
Atmel microcontroller where RAM memory is 32KB.
When nature and functionality of the task go complex, Mirco SD card can be added
in the boards to make them store more information.
Arduino Uno comes with USB interface i.e. USB port is added on the board to
develop serial communication with the computer.
Atmega328 microcontroller is placed on the board that comes with a number of
features like timers, counters, interrupts, PWM, CPU, I/O pins and based on a
16MHz clock that helps in producing more frequency and number of instructions
per cycle.
Fig 4.1.3
It is an open source platform where anyone can modify and optimize the board based
on the number of instructions and task they want to achieve.
This board comes with a built-in regulation feature which keeps the voltage under
control when the device is connected to the external device.
Reset pin is added in the board that reset the whole board and takes the running
program in the initial stage. This pin is useful when board hangs up in the middle of
the running program; pushing this pin will clear everything up in the program and
starts the program right from the beginning.
There are 14 I/O digital and 6 analog pins incorporated in the board that allows the
external connection with any circuit with the board. These pins provide the flexibility
and ease of use to the external devices that can be connected through these pins.
There is no hard and fast interface required to connect the devices to the board.
Simply plug the external device into the pins of the board that are laid out on the
board in the form of the header.
The 6 analog pins are marked as A0 to A5 and come with a resolution of 10bits. These
pins measure from 0 to 5V, however, they can be configured to the high range
using analogReference() function and AREF pin.
13KB of flash memory is used to store the number of instructions in the form of code.
Only 5 V is required to turn the board on, which can be achieved directly using USB
port or external adopter, however, it can support external power source up to 12 V
which can be regulated and limit to 5 V or 3.3 V based on the requirement of the
project.
Pin Description:
There are several I/O digital and analog pins placed on the board which operates at 5V.
These pins come with standard operating ratings ranging between 20mA to 40mA.
Internal pull-up resistors are used in the board that limits the current exceeding from the
given operating conditions. However, too much increase in current makes these resisters
useless and damages the device.
LED. Arduino Uno comes with built-in LED which is connected through pin 13.
Providing HIGH value to the pin will turn it ON and LOW will turn it OFF.
Vin. It is the input voltage provided to the Arduino Board. It is different than 5 V
supplied through a USB port. This pin is used to supply voltage. If a voltage is provided
through power jack, it can be accessed through this pin.
5V. This board comes with the ability to provide voltage regulation. 5V pin is used to
provide output regulated voltage. The board is powered up using three ways i.e. USB,
Vin pin of the board or DC power jack.
USB supports voltage around 5V while Vin and Power Jack support a voltage ranges
between 7V to 20V. It is recommended to operate the board on 5V. It is important to
note that, if a voltage is supplied through 5V or 3.3V pins, they result in bypassing the
voltage regulation that can damage the board if voltage surpasses from its limit.
GND. These are ground pins. More than one ground pins are provided on the board
which can be used as per requirement.
Reset. This pin is incorporated on the board which resets the program running on the
board. Instead of physical reset on the board, IDE comes with a feature of resetting the
board through programming.
IOREF. This pin is very useful for providing voltage reference to the board. A shield is
used to read the voltage across this pin which then select the proper power source.
PWM. PWM is provided by 3, 5, 6,9,10, 11pins. These pins are configured to provide
8-bit output PWM.
SPI. It is known as Serial Peripheral Interface. Four pins 10(SS), 11(MOSI), 12(MISO),
13(SCK) provide SPI communication with the help of SPI library.
AREF. It is called Analog Reference. This pin is used for providing a reference voltage
to the analog inputs.
TWI. It is called Two-wire Interface. TWI communication is accessed through Wire
Library. A4 and A5 pins are used for this purpose.
Serial Communication. Serial communication is carried out through two pins called
Pin 0 (Rx) and Pin 1 (Tx).
Rx pin is used to receive data while Tx pin is used to transmit data.
External Interrupts. Pin 2 and 3 are used for providing external interrupts. An interrupt
is called by providing LOW or changing value.
4.1.4 Arduino Uno Technical Specifications
Operating Voltage 5V
SRAM 2 KB
EEPROM 1 KB
Arduino Uno comes with an ability of interfacing with other other Arduino boards,
microcontrollers and computer. The Atmega328 placed on the board provides serial
communication using pins like Rx and Tx.
4.1.5 Applications:
Arduino Uno comes with a wide range of applications. A larger number of people are
using Arduino boards for developing sensors and instruments that are used in scientific
research. Following are some main applications of the board.
Embedded System
Weighing Machines
Medical Instrument
Home Automation
Industrial Automation
There are a lot of other microcontrollers available in the market that are more powerful
and cheap as compared to Arduino board. So, why you prefer Arduino Uno?
Actually, Arduino comes with a big community that is developing and sharing the
knowledge with a wide range of audience. Quick support is available pertaining to
technical aspects of any electronic project. When you decide Arduino board over other
controllers, you don’t need to arrange extra peripherals and devices as most of
the functions are readily available on the board that makes your project economical in
nature and free from a lot of technical expertise.
4.2 LCD:
LCD (Liquid Crystal Display) is the innovation utilized in scratch pad shows and other
littler PCs. Like innovation for light-producing diode (LED) and gas-plasma, LCDs
permit presentations to be a lot more slender than innovation for cathode beam tube
(CRT). LCDs expend considerably less power than LED shows and gas shows since
they work as opposed to emanating it on the guideline of blocking light.
A LCD is either made with a uninvolved lattice or a showcase network for dynamic
framework show. Likewise alluded to as a meager film transistor (TFT) show is the
dynamic framework LCD. The uninvolved LCD lattice has a matrix of conductors at
every crossing point of the network with pixels. Two conductors on the lattice send a
current to control the light for any pixel. A functioning framework has a transistor
situated at every pixel crossing point, requiring less current to control the luminance of a
pixel.
Some aloof network LCD's have double filtering, which implies they examine the
matrix twice with current in the meantime as the first innovation took one sweep.
Dynamic lattice, be that as it may, is as yet a higher innovation.
A 16x2 LCD show is an essential module that is generally utilized in various gadgets
and circuits. These modules more than seven sections and other multi fragment LEDs
are liked. The reasons being: LCDs are affordable; effectively programmable; have no
restriction of showing exceptional and even custom characters (not at all like in seven
fragments), movements, etc.
A 16x2 LCD implies 16 characters can be shown per line and 2 such lines exist. Each
character is shown in a lattice of 5x7 pixels in this LCD. There are two registers in this
LCD, in particular Command and Data.
The directions given to the LCD are put away by the order register. An order is a
direction given to LCD to play out a predefined assignment, for example, introducing it,
clearing its screen, setting the situation of the cursor, controlling presentation, and so
forth. The information register will store the information that will be shown on the LCD.
The information is the character's ASCII incentive to show on the LCD.
Now that was all about the signals and the hardware. Let us come to data, signals and
execution.
Two types of signals are accepted by LCD, one is data and one is control. The LCD
module recognizes these signals from the RS pin status. By pulling the R / W pin high,
data can now also be read from the LCD display. Once the E pin has been pulsed, the
LCD display reads and executes data at the falling edge of the pulse, the same for the
transmission case.
It takes 39-43μS for the LCD display to place a character or execute a command. It takes
1.53ms to 1.64ms except for clearing display and searching for cursor to the home
position.
Any attempt to send data before this interval may result in failure in some devices to
read data or execute the current data. Some devices compensate for the speed by storing
some temporary registers with incoming data.
There are two RAMs for LCD displays, namely DDRAM and CGRAM. DDRAM
registers the position in which the character would be displayed in the ASCII chart.
Each DDRAM byte represents every single position on the display of the LCD.
The DDRAM information is read by the LCD controller and displayed on the LCD
screen. CGRAM enables users to define their personalized characters. Address space is
reserved for users for the first 16 ASCII characters.
Users can easily display their custom characters on the LCD screen after CGRAM has
been set up to display characters.
4.2.1 Images of LCD Display:-
Pin
Function Name
No
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
Selects command register when low; and data register when Register
4
high Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
RS (Register select)
A 16X2 LCD has two order and information registers. The determination of the register
is utilized to change starting with one register then onto the next. RS=0 for the register
of directions, while RS=1 for the register of information.
Command Register
The guidelines given to the LCD are put away by the direction register. An order is a
direction given to LCD to play out a predefined assignment, for example, instating it,
clearing its screen, setting the situation of the cursor, controlling showcase, and so on.
Order preparing happens in the direction register.
Data Register:
The information register will store the information that will be shown on the LCD. The
information is the character's ASCII incentive to show on the LCD. It goes to the
information register and is prepared there when we send information to the LCD. While
choosing RS=1, the information register.
As stated, the LCD itself comprises of an interface IC. This interface IC can be perused
or composed by the MCU. A large portion of the occasions we're simply going to keep
in touch with the IC since perusing will make it increasingly perplexing and situations
like that are exceptionally uncommon. Information such as cursor position, status
completion interrupts, etc. can be read if necessary.
There are some preset commands in the LCD that we need to send to the LCD via some
microcontroller. The following are some important command instructions:
2 02 Return home
The LCD can work in two striking modes, the 4-bit mode and the 8-bit mode. We send
the information snack through snack in 4 bit mode, first upper chomp, by then lower
snack. For those of you who don't have the foggiest idea what a goody is: a chomp is a
four-piece gathering, so a byte's lower four bits (D0-D3) are the lower snack, while a
byte's upper four bits (D4-D7) are the higher snack.This enables us to send 8 bit
data.This connects with us to send 8 bit data.Whereas in 8 bit mode we can send the 8-
bit information truly in one stroke since we utilize all the 8 information lines.You need
to get it now; yes 8-bit mode is quicker and immaculate than 4-bit mode.In any case, the
fundamental shortcoming is that it needs 8 microcontroller-related information lines.
This will result in our MCU coming up short on I/O pins, so 4-bit mode is extensively
utilized. To set these modes, no control pins are used.
ESP8266 has powerful on-board processing and storage capabilities that allow it to be
integrated with the sensors and other application-specific devices through its GPIOs
with minimal development up-front and minimal loading during runtime. Its high degree
of on-chip integration allows for minimal external circuitry, and the entire solution,
including the front-end module, is designed to occupy minimal PCB area.
This board is pre-flashed with NodeMCU – a Lua-based firmware for the ESP8266
which allows easy control via a neat scripting language – Lua – so you’re ready to go in
just a few minutes.
The ESP-12 Lua NodeMCU WIFI Dev Board Internet Of Things with ESP8266 is an
all-in-one microcontroller + WiFi platform that is very easy to use to create projects
with WiFi and IoT (Internet of Things) applications.
The board is based on the highly popular ESP8266 WiFi Module chip with the ESP-12
SMD footprint. This WiFi development board already embeds in its board all the
necessary components for the ESP8266 (ESP-12E) to program and upload code. It has a
built-in USB to serial chip upload codes, 3.3V regulator, and logic level converter
circuit so you can immediately upload codes and connect your circuits.
4.3.1 Features:
Arduino-like hardware IO
Onboard USB to serial chip to easily program and upload codes from the Arduino IDE
Has onboard 3.3V regulator to ensure enough power to function as your go-to WiFi
chip!
A direct current (DC) motor is a type of electric machine that converts electrical energy
into mechanical energy. DC motors take electrical power through direct current, and
convert this energy into mechanical rotation.
DC motors use magnetic fields that occur from the electrical currents generated, which
powers the movement of a rotor fixed within the output shaft. The output torque and
speed depends upon both the electrical input and the design of the motor.
The term ‘DC motor’ is used to refer to any rotary electrical machine that
converts direct current electrical energy into mechanical energy. DC motors
can vary in size and power from small motors in toys and appliances to large
mechanisms that power vehicles, pull elevators and hoists, and drive steel
rolling mills.
DC motors include two key components: a stator and an armature. The stator is the
stationary part of a motor, while the armature rotates. In a DC motor, the stator provides
a rotating magnetic field that drives the armature to rotate.
A simple DC motor uses a stationary set of magnets in the stator, and a coil of wire with
a current running through it to generate an electromagnetic field aligned with the centre
of the coil. One or more windings of insulated wire are wrapped around the core of the
motor to concentrate the magnetic field.
In the US, Thomas Davenport is widely celebrated as the inventor of the first electric
motor, and undoubtedly he was the first to patent a useable electric motor in 1837.
Davenport, however, was not the first person to build an electric motor, with various
inventors in Europe having already developed more powerful versions by the time
Davenport filed his patent.
In 1834, Moritz Jacobi had presented a motor that was three times as powerful as the
one Davenport would later patent, while Sibrandus Stratingh and Christopher Becker
were the first to demonstrate a practical application for an electric motor, by running a
small model car in 1835.
The first practical DC motor was invented some years later in 1886 by Frank Julian
Sprague, whose invention lead to the first motor powered trolley system in 1887, and the
first electric elevator in 1892. Sprague’s DC motor was a hugely significant
development, leading to a variety of applications which would reshape the face of
industry and manufacturing.
4.4.4 Types of DC Motors
So far, this guide has broadly explained how DC motors work, the history of these
mechanisms, and what they look like. While the principles are the same across variants,
there are actually several different types of DC motors, which offer specific advantages
and disadvantages over each other.
A power supply is a component that provides at least one electrical charge with power.
It typically converts one type of electrical power to another, but it can also convert a
different Energy form in electrical energy, such as solar, mechanical, or chemical.
A power supply provides electrical power to components. Usually, the term refers to
devices built into the powered component.Computer power supplies, for example,
convert AC current to DC current and are generally located along with at least one fan at
the back of the computer case.
4.6 Rectifier:
A rectifier is an electrical device that convertsalternating current (AC), which
periodically reverses direction, to direct current (DC), which flows in only one direction.
The process is known as rectification, since it "straightens" the direction of current.
Rectifiers have many uses, but are often found to serve as components of DC power
supplies and direct power transmission systems with high voltage. Rectification can be
used in roles other than direct current generation for use as a power source.
Fig 4.6.1 Circuit of rectifier
4.7 Capacitors:
Capacitors are used to attain from the connector the immaculate and smoothest DC
voltage in which the rectifier is used to obtain throbbing DC voltage which is used as
part of the light of the present identity. Capacitors are used to acquire square DC from
the current AC experience of the current channels so that they can be used as a touch of
parallel yield.
The voltage controllers are that their yield voltage as information requires no less than 2
volts. For example, 7805 as sources of information will require no less than 7V, and
7812, no less than 14 volts. This voltage is called Dropout Voltage, which should be
given to voltage controllers.
4.9 Buzzer:
Rated Voltage: 6V DC
Operating Voltage: 4-8V DC
Rated current: <30mA
Sound Type: Continuous Beep
Resonant Frequency: ~2300 Hz
Small and neat sealed package
Breadboard and Perf board friendly
4.9.3 How to use a Buzzer
A buzzer is a small yet efficient component to add sound features to our project/system.
It is very small and compact 2-pin structure hence can be easily used on breadboard,
Perf Board and even on PCBs which makes this a widely used component in most
electronic applications.
There are two types are buzzers that are commonly available. The one shown here is a
simple buzzer which when powered will make a Continuous Beeeeeeppp.... sound, the
other type is called a readymade buzzer which will look bulkier than this and will
produce a Beep. Beep. Beep. Sound due to the internal oscillating circuit present inside
it. But, the one shown here is most widely used because it can be customized with help
of other circuits to fit easily in our application.
This buzzer can be used by simply powering it using a DC power supply ranging from
4V to 9V. A simple 9V battery can also be used, but it is recommended to use a
regulated +5V or +6V DC supply. The buzzer is normally associated with a switching
circuit to turn ON or turn OFF the buzzer at required time and require interval.
4.9.4 Applications of Buzzer
It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object
or obstacle on its path It will bounce back to the module. Considering the travel time
and the speed of the sound you can calculate the distance.
In order to generate the ultrasound we need to set the Trig pin on a High State for 10 µs.
That will send out an 8 cycle ultrasonic burst which will travel at the speed of sound.
The Echo pins goes high right away after that 8 cycle ultrasonic burst is sent, and it
starts listening or waiting for that wave to be reflected from an object.
If there is no object or reflected pulse, the Echo pin will time-out after 38ms and get
back to low state.
If we receive a reflected pulse, the Echo pin will go down sooner than those 38ms.
According to the amount of time the Echo pin was HIGH, we can determine the distance
the sound wave traveled, thus the distance from the sensor to the object.
For that purpose we are using the following basic formula for calculating distance:
Raindrop Sensor is a tool used for sensing rain. It consists of two modules, a rain
board that detects the rain and a control module, which compares the analog value, and
converts it to a digital value. The raindrop sensors can be used in the automobile sector
to control the windshield wipers automatically, in the agriculture sector to sense rain and
it is also used in home automation systems.
Working voltage 5V
Output format: Digital switching output (0 and 1), and analog voltage output
AO
Potentiometer adjust the sensitivity
Uses a wide voltage LM393 comparator
Comparator output signal clean waveform is good, driving ability, over 15mA
Anti-oxidation, anti-conductivity, with long use time
With bolt holes for easy installation
Small board PCB size: 3.2cm x 1.4cm
Interfacing the raindrop sensor with a microcontroller like 8051, Arduino, or PIC is
simple. The rain board module is connected with the control module of the raindrop
sensor as shown in the below diagram.
Fig 4.11.1 Rain Drop Sensor
The control module of the raindrop sensor has 4 outputs. VCC is connected to a 5V
supply. The GND pin of the module is connected to the ground. The D0 pin is connected
to the digital pin of the microcontroller for digital output or the analog pin can be used.
To use the analog output, the A0 pin can be connected to the ADC pin of a
microcontroller. In the case of Arduino, it has 6 ADC pins, so we can use any of the 6
pins directly without using an ADC converter. The sensor module consists of a
potentiometer, LN393 comparator, LEDs, capacitors and resistors. The pinout image
above shows the components of the control module. The rainboard module consists of
copper tracks, which act as a variable resistor. Its resistance varies with respect to the
wetness on the rainboard. The below fig shows the rain board module.
The DHT11 is a basic, low-cost digital temperature and humidity sensor. It uses a
capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out
a digital signal on the data pin (no analog input pins needed). It’s fairly simple to use,
but requires careful timing to grab data. The only real downside of this sensor is you can
only get new data from it once every 2 seconds.
4.12.3 Power and PinDHT11’s power supply is 3-5.5V DC. When power is supplied to
the sensor, do not send any instruction to the sensor in within one second in order to
pass the unstable status. One Capacitor valued 100nF can be added between VDD and
GND for power filtering.
CHAPTER-5
SOFTWARE DESCRIPTION
SOFTWARE REQUIREMENTS
Arduino IDE where IDE stands for Integrated Development Environment – An official
software introduced by Arduino.cc, that is mainly used for writing, 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 IDE is an open source software that is mainly used for writing and
compiling the code into the Arduino Module.
It is an official Arduino software, making code compilation too easy that even a
common person with no prior technical knowledge can get their feet wet with the
learning process.
It is easily available for operating systems like MAC, Windows, and Linux and runs
on the Java Platform that comes with inbuilt functions and commands that play a
vital role for debugging, editing and compiling the code in the environment.
The main code, also known as a sketch, created on the IDE platform will ultimately
generate a Hex File which is then transferred and uploaded in the controller on the
board.
The IDE environment mainly contains two basic parts: Editor and Compiler where
former is used for writing the required code and later is used for compiling and
uploading the code into the given Arduino Module.
You can download the Software from Arduino main website. As I said earlier, the
software is available for common operating systems like Linux, Windows, and MAX, so
make sure you are downloading the correct software version that is easily compatible
with your operating system.
If you aim to download Windows app version, make sure you have Windows 8.1 or
Windows 10, as app version is not compatible with Windows 7 or older version of
this operating system.
1. Menu Bar
2. Text Editor
3. Output Pane
As you download and open the IDE software, it will appear like an image below.
The bar appearing on the top is called Menu Bar that comes with five different options
as follow
File – You can open a new window for writing the code or open an existing one.
Following table shows the number of further subdivisions the file option is
categorized into.
As you go to the preference section and check the compilation section, the Output Pane
will show the code compilation as you click the upload button.
And at the end of compilation, it will show you the hex file it has generated for the
recent sketch that will send to the Arduino Board for the specific task you aim to
achieve.
Edit – Used for copying and pasting the code with further modification for font
Sketch – For compiling and programming
Tools – Mainly used for testing projects. The Programmer section in this panel is
used for burning a bootloader to the new microcontroller.
Help – In case you are feeling skeptical about software, complete help is available
from getting started to troubleshooting.
The Six Buttons appearing under the Menu tab are connected with the running program
as follow.
The check mark appearing in the circular button is used to verify the code. Click this
once you have written your code.
The arrow key will upload and transfer the required code to the Arduino board.
The button appearing on the top right corner is a Serial Monitor – A separate pop-up
window that acts as an independent terminal and plays a vital role for sending and
receiving the Serial Data. You can also go to the Tools panel and select Serial
Monitor, or pressing Ctrl+Shift+M all at once will open it instantly. The Serial
Monitor will actually help to debug the written Sketches where you can get a hold of
how your program is operating. Your Arduino Module should be connected to your
computer by USB cable in order to activate the Serial Monitor.
You need to select the baud rate of the Arduino Board you are using right now. For
my Arduino Uno Baud Rate is 9600, as you write the following code and click the
Serial Monitor, the output will show as the image below.
Fig 5.1.2 Output screen
The main screen below the Menu bard is known as a simple text editor used for writing
the required code.
The bottom of the main screen is described as an Output Pane that mainly highlights the
compilation status of the running code: the memory used by the code, and errors
occurred in the program. You need to fix those errors before you intend to upload the
hex file into your Arduino Module.
More or less, Arduino C language works similar to the regular C language used for any
embedded system microcontroller, however, there are some dedicated libraries used for
calling and executing specific functions on the board.
5.1.3 Libraries:
Libraries are very useful for adding the extra functionality into the Arduino Module.
There is a list of libraries you can add by clicking the Sketch button in the menu bar and
going to Include Library.
As you click the Include Library and Add the respective library it will on the top of the
sketch with a #include sign. Suppose, I Include the EEPROM library, it will appear on
the text editor as
#include <EEPROM.h>.
Most of the libraries are preinstalled and come with the Arduino software. However,
you can also download them from the external sources.
Making pins Input and output:
The digitalRead and digitalWrite commands are used for addressing and making the
Arduino pins as an input and output respectively.
These commands are text sensitive i.e. you need to write them down the exact way they
are given like digitalWrite starting with small “d” and write with capital “W”. Writing it
down with Digitalwrite or digitalwrite won’t be calling or addressing any function.
In order to upload the sketch, you need to select the relevant board you are using and the
ports for that operating system. As you click the Tools on the Menu, it will open like the
figure below.
Following figure shows the COM4 that I have used for my project, indicating the
Arduino Uno with COM4 port at the right bottom corner of the screen.
After correct selection of both Board and Serial Port, click the verify and then upload
button appearing in the upper left corner of the six button section or you can go to the
Sketch section and press verify/compile and then upload.
The sketch is written in the text editor and is then saved with the file extension .ino.
It is important to note that the recent Arduino Modules will reset automatically as you
compile and press the upload button the IDE software, however, older version may
require the physical reset on the board.
Once you upload the code, TX and RX LEDs will blink on the board, indicating the
desired program is running successfully.
Note: The port selection criteria mentioned above is dedicated for Windows operating
system only, you can check this Guide if you are using MAC or Linux.
The amazing thing about this software is that no prior arrangement or bulk of mess is
required to install this software, you will be writing your first program within 2 minutes
after the installation of the IDE environment.
5.2 BootLoader:
As you go to the Tools section, you will find a bootloader at the end. It is very helpful to
burn the code directly into the controller, setting you free from buying the external
burner to burn the required code.
When you buy the new Arduino Module, the bootloader is already installed inside the
controller. However, if you intend to buy a controller and put in the Arduino module,
you need to burn the bootloader again inside the controller by going to the Tools section
and selecting the burn bootloader.
5.3 EMBEDDED C
During infancy years of microprocessor based systems, programs were developed using
assemblers and fused into the EPROMs. There used to be no mechanism to find what
the program was doing. LEDs, switches, etc. were used to check correct execution of the
program. Some 'very fortunate' developers had In circuit Simulators (ICEs), but they
were too costly and were not quite reliable as well.
Embedded devices have resource constraints (limited ROM, limited RAM, limited stack
space, less processing power)
Components used in embedded system and PCs are different; embedded systems
typically uses smaller, less power consuming components. Embedded systems are more
tied to the hardware.
Two salient features of Embedded Programming are code speed and code size. Code
speed is governed by the processing power, timing constraints, whereas code size is
governed by available program memory and use of programming language. Goal of
embedded system programming is to get maximum features in minimum space and
minimum time. Embedded systems are programmed using different type of languages:
Machine Code
Application level language like Visual Basic, scripts, Access, etc. Assembly language
maps mnemonic words with the binary machine codes that the processor uses to code
the instructions. Assembly language seems to be an obvious choice for programming
embedded devices. However, use of assembly language is restricted to developing
efficient codes in terms of size and speed. Also, assembly codes lead to higher software
development costs and code portability is not there. Developing small codes are not
much of a problem, but large programs/projects become increasingly difficult to manage
in assembly language. Finding good assembly programmers has also become difficult
nowadays. Hence high level languages are preferred for embedded systems
programming.
Though C and embedded C appear different and are used in different contexts, they have
more similarities than the differences. Most of the constructs are same; the difference
lies in their applications.
Embedded systems often have the real-time constraints, which is usually not there with
desktop computer applications.
Embedded systems often do not have a console, which is available in case of desktop
applications.
So, what basically is different while programming with embedded C is the mindset; for
embedded applications, we need to optimally use the resources, make the program code
efficient, and satisfy real time constraints, if any. All this is done using the basic
constructs, syntaxes, and function libraries of 'C'.
CHAPTER - 6
TESTING & RESULT ANALYSIS
6.1 Code
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
#include <SimpleDHT.h>
int pinDHT11 = 2;
const int trigPin = 3;
const int echoPin = 4;
int rain=A0;
int buz=5;
long duration;
int distance;
int rain_val;
String str;
SimpleDHT11 dht11(pinDHT11);
void setup() {
Serial.begin(9600);
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("FLOOD ");
lcd.setCursor(0,1);
lcd.print("MONITORING...");
delay(2000);
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(rain,INPUT);
pinMode(buz, OUTPUT);
digitalWrite(buz,LOW);
}
void loop()
{
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance = duration * 0.034 / 2;
delay(500);
// Serial.println(distance);
rain_val=analogRead(rain);
delay(500);
// Serial.println(rain_val);
byte temperature = 0;
byte humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
Serial.print("Read DHT11 failed, err="); Serial.print(SimpleDHTErrCode(err));
Serial.print(",");
Serial.println(SimpleDHTErrDuration(err)); delay(1000);
return;
}
// Serial.print((int)temperature); Serial.print(" *C, ");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("TEMP:");
lcd.setCursor(5,0);
lcd.print((int)temperature);
lcd.setCursor(7,0);
lcd.print("RAIN:");
lcd.setCursor(12,0);
lcd.print(rain_val);
lcd.setCursor(0,1);
lcd.print("LEVEL:");
lcd.setCursor(7,1);
lcd.print(distance);
delay(1000);
if(distance<10&&(int)temperature<30&&rain_val<300&&rain_val>0)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("LEVEL INCREASED");
lcd.setCursor(0,1);
lcd.print("CHANCES OF FLOOD");
digitalWrite(buz,HIGH);
delay(1000);
}
else if((int)temperature<30&&rain_val<500&&rain_val>400)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("IT MAY RAIN..");
digitalWrite(buz,HIGH);
delay(1000);
}
else if((int)temperature<30&&rain_val<400&&rain_val>300)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("IT IS RAINING...");
digitalWrite(buz,HIGH);
delay(1000);
}
else if((int)temperature<30&&rain_val<300&&rain_val>0)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("HEAVY RAIN...");
digitalWrite(buz,HIGH);
delay(1000);
}
else if((int)temperature<30)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("LESS TEMP.");
digitalWrite(buz,HIGH);
delay(1000);
}
else if(rain_val<500&&rain_val>400)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("IT MAY RAIN..");
lcd.setCursor(0,1);
lcd.print("AT NORMAL TEMP.");
digitalWrite(buz,HIGH);
delay(1000);
}
else if(rain_val<400&&rain_val>300)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("IT IS RAINING...");
lcd.setCursor(0,1);
lcd.print("AT NORMAL TEMP.");
digitalWrite(buz,HIGH);
delay(1000);
}
// else if((int)temperature<30&&rain_val<300&&rain_val>0)
// {
// lcd.clear();
// lcd.setCursor(0,0);
// lcd.print("HEAVY RAIN...");
//
// digitalWrite(buz,HIGH);
// delay(1000);
// }
else
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("NORMAL...");
digitalWrite(buz,LOW);
delay(1000);
}
str =String(distance)+String("!")+String((int)temperature)+String("@")
+String(rain_val);
Serial.println(str);
delay(1000);
}
#include <ESP8266WiFi.h>
#include "ThingSpeak.h"
WiFiClient client;
// Timer variables
unsigned long lastTime = 0;
unsigned long timerDelay = 30000;
String String_main;
String String_1;
String String_2;
String String_3;
void setup() {
Serial.begin(9600);
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop()
{
if ((millis() - lastTime) > timerDelay) {
ThingSpeak.setField(1,String_1);
ThingSpeak.setField(2,String_2);
ThingSpeak.setField(3,String_3);
int x = ThingSpeak.writeFields(myChannelNumber,myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
lastTime = millis();
}
}
}
6.2 Result Analysis
Heavy Rain
Condition:
- Temperature < 30
- Rain intensity < 300
Action:
- Display "HEAVY RAIN..." on the LCD screen.
- Activate the buzzer.
As heavy rain descends upon the area, the flood monitoring system springs into
action to address the escalating situation.
Detecting a temperature below 30 degrees Celsius and a significant rainfall
intensity below 300 units, the system identifies the onset of heavy rainfall.
Promptly reacting, it updates the LCD screen to reflect the prevailing heavy rain
conditions.
Concurrently, the system activates a buzzer, emitting a loud audible signal to
warn nearby individuals of the intensifying rain and the potential risks associated
with heavy downpours.
This proactive response aims to ensure the safety and preparedness of those
within the monitored area during adverse weather conditions.
6.2.2 Test case 2
Potential Flooding
Condition:
- Distance < 10 (indicating water level near the sensor)
- Temperature < 30
- Rain intensity < 300 and > 0
Action:
- Display "LEVEL INCREASED" and "CHANCES OF FLOOD" on the LCD screen.
- Activate the buzzer.
In this critical scenario, the flood monitoring system detects an imminent threat
of flooding as multiple conditions align.
The system registers a dangerously close water level, indicated by a proximity
sensor reading of less than 10 units. Coupled with a temperature below 30
degrees Celsius and moderate rainfall intensity not exceeding 300 units, the
situation warrants immediate attention.
Upon recognition of these factors, the system issues a stark warning on the LCD
screen, alerting viewers to the heightened risk of flooding. To amplify the
urgency, the system activates a buzzer, sounding an audible alarm to prompt
swift action and mitigate potential damages.
CHAPTER - 7
CONCLUSION & FUTURE SCOPE
7.1 CONCLUSION
In conclusion, the flood detection and alerting system present a significant advancement
in disaster management technology, offering proactive measures to mitigate the impact
of flooding on communities and infrastructure. By leveraging IoT sensors and real-time
data transmission capabilities, the system provides early warnings and critical
information to stakeholders, enabling timely responses and decision-making during
flood events. This technology represents a crucial step forward in enhancing resilience
to natural disasters and protecting lives and property in flood-prone areas.
Furthermore, the versatility of the system extends its utility beyond immediate disaster
response, offering valuable insights for various applications such as agricultural
management, urban planning, and environmental monitoring. The data collected by the
system can inform evidence-based policymaking, support sustainable development
initiatives, and contribute to scientific research on climate change and hydrology.
Moreover, its integration into existing infrastructure and emergency response
frameworks enhances overall preparedness and coordination efforts, strengthening
community resilience and adaptive capacity in the face of evolving environmental
challenges.
Overall, the flood detection and alerting system exemplify the transformative potential
of technology in addressing complex societal issues and advancing disaster risk
reduction strategies. As climate change continues to amplify the frequency and intensity
of extreme weather events, innovative solutions like this are essential for building more
resilient and sustainable communities. By harnessing the power of IoT, data analytics,
and collaborative partnerships, we can better anticipate, mitigate, and adapt to the
impacts of floods, ultimately safeguarding the well-being and prosperity of present and
future generations.
The future scope for flood detection and avoidance systems is promising, with several
avenues for development and improvement. Here are some key areas of future scope for
these systems:
Advanced Sensor Technologies: Continued advancements in sensor
technologies, including IoT sensors, LiDAR (Light Detection and Ranging), and
radar systems, will enhance the accuracy and coverage of flood detection
systems. These sensors can provide real-time data on water levels, precipitation,
soil moisture, and other critical parameters for early warning and decision-
making.
Integration of Artificial Intelligence (AI) and Machine Learning (ML): AI
and ML algorithms have the potential to revolutionize flood detection and
avoidance systems. By analyzing large volumes of data, identifying patterns, and
making predictions, AI/ML models can improve flood forecasting accuracy,
optimize evacuation routes, and enhance resilience strategies.
Flood Prediction and Early Warning Systems: Future systems should focus
on developing more robust flood prediction models that can accurately forecast
flood events well in advance. Early warning systems that combine
meteorological data, hydrological modeling, and risk assessment can provide
timely alerts to communities and authorities, reducing loss of life and property
damage.
Smart Infrastructure and Resilient Design: The integration of smart
infrastructure components such as smart sensors, automated flood barriers, and
adaptive building designs can enhance the resilience of urban areas and critical
infrastructure against flood hazards. Incorporating green infrastructure and
nature-based solutions can also help in natural flood mitigation and water
management.
Data Sharing and Collaboration: Collaboration among stakeholders, including
government agencies, researchers, private sector entities, and communities, is
crucial for the success of flood detection and avoidance systems. Open data
platforms, standardization of data formats, and information sharing protocols can
facilitate effective collaboration and improve response coordination during flood
events.
[1] Sebin Sabu1 and Nora Elizabeth, “Kerela floods- A model of rescue and
rehabilitation using information technology and social media based crowdsourcing”,
IEEE India info. Vol. 13 No. 3 Jul-Sep 2018.
[2] H. Hamidon, “Flood level indicator and risk warning system for remote location
monitoring flood observatory system”,WSEAS Trans. Syst. Control, vol. 5, no.3,pp.
153-163,2018
[3] Z.M. Taib,N.S. Jaharuddin,and Z.D. Mansor, “ A review of flood disaster and
disaster in Malaysia” International journal of Accounting and business management,
vol. 4,no.3,2016.
[4] A.M. Leman, K.A. Rahman, M.N.M.Salleh, I.Baba, D.Feriyanto, L.S.C. Johnson,
and S.N Hidayah M., “A review of flood catastrophic management in malaysia, “ ARPN
Journal of Engineering and applied sciences, vol.11,no. 14, Jul 2016.
[6] M. Mathematic and R. Grace, “Flood alert management system using iota and
microcontroller,” International journal of innovative research in computer and
communication engineering, vol. 5, no. 4, April 2017.
[7] S.J. Priya, S. Kashaya, E. Arena, J. A. M. Julie, and V. Ranjani, “ Flood monitoring
and alerting system,” International journal of computer engineering and technology
(IJCET), vol. 8, no. 2,p.15, Mar 2017.