0% found this document useful (0 votes)
83 views

Project Report

This document describes a project to develop a real-time flood water level monitoring and alerting system using IoT. The system will use ultrasonic sensors connected to a microcontroller and WiFi module to detect flood water levels, which will then send alerts to relevant authorities and the public. The goal is to provide early detection of flooding to allow people time to evacuate and protect property.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Project Report

This document describes a project to develop a real-time flood water level monitoring and alerting system using IoT. The system will use ultrasonic sensors connected to a microcontroller and WiFi module to detect flood water levels, which will then send alerts to relevant authorities and the public. The goal is to provide early detection of flooding to allow people time to evacuate and protect property.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

REAL TIME FLOOD WATER LEVEL MONITORING & ALERTING

SYSTEM USING IOT


A project work Submitted in partial fulfillment of the requirements for the award of the
degree of BACHELOR OF SCIENCE IN COMPUTER TECHNOLOGY
HINDUSTHAN COLLEGE OF ARTS AND SCIENCE

Project work done By

PRIYADHARSHNI.S
(Reg.No:17BST247)

Under the Supervision and Guidance of

Ms. PRIYANKA.G B.E., M.E.,


(Assistant Professor, Department of Computer Technology)

DEPARTMENT OF COMPUTER TECHNOLOGY


HINDUSTHAN COLLEGE OF ARTS & SCIENCE
Approved by AICTE and Govt. of Tamil Nadu
An Autonomous College -Affiliated to Bharathiar University
Accredited by NAAC – An ISO Certified Institution
City Campus, Nava India
Avinashi Road, Coimbatore – 641 028,
Tamil Nadu, India

MARCH 2021
CERTIFICATE
CERTIFICATE

This is to certify that the Project work titled “REAL TIME FLOOD WATER

LEVEL MONITORING & ALERTING SYSTEM USING IOT, submitted in


partial fulfillment of the requirements for the award of the Degree of Bachelor of Science in
Computer Technology is record of the original work done by PRIYADHARSHNI.S
(Reg.No:17BST247) under my supervision and guidance.

Faculty Guide Head of the Department

Submitted for project viva – voce Examination held on

Internal Examiner External Examiner


DECLARATION
DECLARATION

I hereby declare that this Project work entitled “REAL TIME FLOOD WATER

LEVEL MONITORING & ALERTING SYSTEM USING IOT”, is a record of


original work done by me under the supervision and guidance of Ms. PRIYANKA.G B.E., M.E., and
that this project work has not formed the basis for the awarded of any Degree / Diploma / Associateship /
Fellowship or similar title to any candidate of any University.

PLACE: Coimbatore SIGNATURE OF THE CANDIDATE


DATE: (PRIYADHARSHNI.S)
(Reg.No:17BST247)
ACKNOWLEDGEMENT
ACKNOWLEDGEMENT

Words cannot be express to show my gratitude to our Managing Trustee


Smt.T.SARASUWATHI KHANNAIYANN, Who had been an example in my life for achieving
goals.

I take this golden opportunity to extend my sincere gratitude to our honorable principal
Dr.A.PONNUSAMY MSW.,MBA.,DLL.,MPhil.,Ph.D. Hindusthan College Of Arts And
Science,Coimbatore,for giving me an opportunity to undertake the project work.

I extend my profound gratitude and thanks to our respected Head of the Department
Mrs.K.MYTHILI M.Sc.,MPhil.,(Ph.D)., Head of the Department,Computer Technology
Hindusthan College of Arts and Science, Coimbatore, for her cheerful encouragement and
supporting me a lot,with her valuable guidance and suggestion.

My sincere thanks to Ms.PRIYANKA.G B.E.,M.E., Assistant Professor, Department of


Computer Technology, Project Coordinator for the successful completion of this project.

I am extremely grateful to my guide Ms.PRIYANKA.G B.E.,M.E., Assistant professor in


Department of Computer Technology,Who took keen interest in my work and put me in right
path,through her valuable suggestion and timely help in each stage of my project

My sincere thanks to all faculty members of Department of Computer Technology for their
supportive encouragement.

I thank my family members and friends, for their support and encouragement to do this
project.
ABSTRACT
ABSTRACT

The objective of this project is to monitor the flood situation & alert in case of danger
through IOT Network. Floods lead to a vast loss of life and property in many countries. But in
developing countries the lack of proper technology leads to more loss of life and property due to
flood. This is due to lack of flood detection systems. IoT based real-time flood water level
monitoring and alerting system solves problem by implementing an early flood detection
mechanism. In this project we will connect sonar sensors which are interfaced with µC through
Digital I/O Pins in order to measure flood levels. Flooding situations are detected by sonar sensors
which are placed distinctly in the water ways. When flood occurs system detects flood levels such
as safe, medium and risk alerting people early in order to evacuate bank in emergency using IOT.
Warning communities of the incoming flood provides an effective solution to this by giving people
sufficient time to evacuate and protect their property.
TABLE OF CONTENTS
TABLE OF CONTENTS

S.NO CONTENTS PAGE.NO

1. INTRODUCTION 1
Organization Profile 1
2. SYSTEM STUDY 5
Existing System 5
Proposed System 6
3. SYSTEM SPECIFICATION 8
Hardware Specification 8
Arduino Uno 9
WiFi Module 10
Liquid Crystal Display 12
Ultrasonic module 13
Power Supply 18
Software Specification 23
Language Tools 23
Internet of Things 23
4. SYSTEM DESIGN 27
Database Design 27
Table Design 27
4.4 Output Design 28
5. SYSTEM IMPLEMENTATION 31
6. SYSTEM TESTING 37
Test Approach 37
Future to be Tested 37
7. CONCLUSION 40
8. SCOPE FOR FUTURE ENHANCEMENT 42
BIBLIOGRAPHY 44
APPENDIX 46
1. INTRODUCTION

Natural disasters happen everywhere in the world, and they can be completely disturbing
the human life and the economy of the country. Economy and growth of any country depend upon
the flooding. The system is much advantaged for protecting the lives of people and animals. The
proposed model is very much utilized for monitoring of the water level, flow variations in rivers
and the same can be used for measuring of the water level at Dam/ Reservoirs. The measured
values are regularly updated on the web server which is very much useful to send flood alerts to
consistent authority and people for faster action. The project mainly constitute a wireless sensor
nodes which called as a mote and the motes are placed along the river beds to monitor water
condition.

ORGANIZATIONAL PROFILE

Vertex Software Solution is one of the developing companies in the field of Information
Technology. Vertex Software Solution provides Software development, Web site Development
and services to the reputed clients.

The Company provides software products, IT services, website solutions, for a variety of
industry verticals including Insurance, Banking, Capital Markets, Mutual Funds & Asset
Management, Wealth Management, Government, Manufacturing and Retail. These solutions and
services include Managed IT Services, Application Software Development & Maintenance,
Payment solutions, Business Intelligence, Document Imaging & Digitization, IT consulting and
various Transactions.

Our Services

Our Mission and Vision

Mission: Our Roadmap starts with our mission, which is enduring. It declares our purpose as a
company and serves as the standard against which we weigh our actions and decisions. To create
a value for our customers and make a difference through our quality of service and open vision

1
Vision: Our vision serves as the framework for our Roadmap and guides every aspect of our
business by describing what we need to accomplish in order to continue achieving sustainable,
quality growth.

Designing Tools

Web 2.0 Development: CSS, MYSQL, ASP, Ms Access, FrontPage, JavaScript, Php – Mysql
Dreamweaver , Ruby on rail , Ms Front Page, Visual Basic, MS SQL

Languages: Java (JDK4.0) Applets, ActiveX Data Objects (ADO4, VB.NET, C#, struts, Jsp )

Web Server: IIS, Apache


Reporting: Crystal Reports.
Designing: Adobe Photoshop, Flash, Macromedia Fireworks...

Our Solutions

The Company provides software products, IT services, website solutions. For a variety of
industry verticals including Insurance, Banking, Capital Markets, Mutual Funds & Asset
Management, Wealth Management, Government, Manufacturing and Retail. These solutions and
services include Managed IT Services, Application Software Development & Maintenance,
Payment solutions, Business Intelligence, Document Imaging & Digitization, IT consulting and
various Transactions

The Company's Global Delivery Model provides for the best resources to be drawn from
its vast talent pool across the globe to offer optimal solutions. The Company integrates its products
and services to create customized solutions to allow you to undertake technology-based business
transformation that allows reorganization in line with today's dynamic digital business
environment.

• ERP, CRM Solutions


• Application Development & Maintenance
• Mobile Application Development
• Web site Development
• Search Engine Optimization (SEO)

2
• Infrastructure Management Service (IMS)
• Hosting & Enterprise Services
• Software Training
• IT Staffing

3
SYSTEM STUDY

4
2. SYSTEM STUDY

EXISTING SYSTEM
BLOCK DIAGRAM:

LCD

LLER

FLOAT BUZZER
SENSOR

POWER
SUPPLY

5
PROPOSED SYSTEM
The proposed model is very much utilized for monitoring of the water level, flow variations
in rivers and the same can be used for measuring of the water level at Dam/ Reservoirs. The
measured values are regularly updated on the web server which is very much useful to send flood
alerts to consistent authority and people for faster action.

ADVANTAGES

• IoT based real-time flood water level monitoring and alerting system solves
problem by implementing an early flood detection mechanism.
• Flooding situations are detected by sonar sensors which are placed distinctly in
the water ways.
• When flood occurs system detects flood levels such as safe, medium and risk
alerting people early in order to evacuate bank in emergency using IOT.
• Warning communities of the incoming flood provides an effective solution to this
by giving people sufficient time to evacuate and protect their property.

6
SYSTEM SPECIFICATION
7
3. SYSTEM SPECIFICATION

HARDWARE SPECIFICATIONS

• ARDUINO UNO
• SENSORS
• ULTRASONIC SONAR SENSOR
• IOT KIT
• LCD
• POWER SUPPLY

SOFTWARE SPECIFICATIONS
• ARDUINO IDE
• HTML
• PHP
• MYSQL

HARDWARE SPECIFICATION
ARDUINO UNO GENERAL DESCRIPTION

The source code for the IDE is released under the GNU General Public License, version.
The Arduino IDE supports the languages C and C++ using special rules of code structuring. The
Arduino IDE supplies a software library from the Wiring project, which provides many common
input and output procedures. User-written code only requires two basic functions, for starting the
sketch and the main program loop, that are compiled and linked with a programs tub main() into
an executable cyclic executive program with the GNU toolchain, also included with the IDE
distribution. The Arduino IDE employs the program avrdude to convert the executable code into
a text file in hexadecimal encoding that is loaded into the Arduino board by a loader program in
the board's firmware.

8
ARDUINO UNO
Arduino is a prototype platform (open-source) based on an easy-to-use hardware and software. It
consists of a circuit board, which can be programmed (referred to as a microcontroller) and a ready-
made software called Arduino IDE (Integrated Development Environment), which is used to write
and upload the computer code to the physical board.
The key features are −
Arduino boards are able to read analog or digital input signals from different sensors and turn it
into an output such as activating a motor, turning LED on/off, connect to the cloud and many other
actions.
You can control your board functions by sending a set of instructions to the microcontroller on the
board via Arduino IDE (referred to as uploading software).
Unlike most previous programmable circuit boards, Arduino does not need an extra piece of
hardware (called a programmer) in order to load a new code onto the board. You can simply use a
USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to
program.
Finally, Arduino provides a standard form factor that breaks the functions of the micro-controller
into a more accessible package.

9
Board Types
Various kinds of Arduino boards are available depending on different microcontrollers
used. However, all Arduino boards have one thing in common: they are programed through the
Arduino IDE.
The differences are based on the number of inputs and outputs (the number of sensors,
LEDs, and buttons you can use on a single board), speed, operating voltage, form factor etc.
Some boards are designed to be embedded and have no programming interface (hardware),
which you would need to buy separately. Some can run directly from a 3.7V battery, others need
at least 5V.

WIFI MODULE
Introduction

ESP8266-01 Features

• Low cost, compact and powerful Wi-Fi Module


• Power Supply: +3.3V only
• Current Consumption: 100mA
• I/O Voltage: 3.6V (max)
• I/O source current: 12mA (max)
• Built-in low power 32-bit MCU @ 80MHz
• 512kB Flash Memory
• Can be used as Station or Access Point or both combined
• Supports Deep sleep (<10uA)
• Supports serial communication hence compatible with many development platform like
Arduino
• Can be programmed using Arduino IDE or AT-commands or Lua Script

WIFI ESP8266 Module

There are so many methods and IDEs available to with ESP modules, but the most
commonly used on is the Arduino IDE. So let us discuss only about that further below.

10
The ESP8266 module works with 3.3V only, anything more than 3.7V would kill the
module hence be cautions with your circuits. The best way to program an ESP-01 is by using the
FTDI board that supports 3.3V programming. If you don’t have one it is recommended to buy one
or for time being you can also use an Arduino board. One commonly problem that every one faces
with ESP-01 is the powering up problem. The module is a bit power hungry while programming
and hence you can power it with a 3.3V pin on Arduino or just use a potential divider. So it is
important to make a small voltage regulator for 3.31v that could supply a minimum of 500mA.
One recommended regulator is the LM317 which could handle the job easily.
The switch SW2 (Programming Switch) should be held pressed to hold the GPIO-0 pin to
ground. This way we can enter into the programming mode and upload the code. Once the code is
released the switch can be released. A simplified circuit diagram for using the ESP8266-01
module is given below

ESP8266 - WI-FI MODULE

11
The ESP8266 Wi-Fi Module is a self contained SOC with integrated TCP/IP protocol stack
that can give any microcontroller access to your Wi-Fi network. The ESP8266 is capable of either
hosting an application or offloading all Wi-Fi networking functions from another application
processor. Each ESP8266 module comes pre-programmed with an AT command set firmware,
meaning, you can simply hook this up to your Arduino device and get about as much Wi-Fi-ability
as a Wi-Fi Shield offers (and that's just out of the box)! The ESP8266 module is an extremely cost
effective board with a huge, and ever growing, community.
This module has a powerful enough on-board processing and storage capability that allows
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, including the front-end module, is designed to
occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications and Bluetooth co-
existence interfaces; it contains a self-calibrated RF allowing it to work under all operating
conditions, and requires no external RF parts.

LIQDUID CRYSTAL DISPLAY (LCD)

Liquid crystal displays (LCD’s) have materials, which combine the properties of both
liquids and crystals. Rather than having a melting point, they have a temperature range within
which the molecules are almost as mobile as they would be in a liquid, but are grouped together in
an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal material sand witched in
between them. The inner surface of the glass plates are coated with transparent electrodes which
define the character, symbols or patterns to be displayed polymeric layers are present in between
12
the electrodes and the liquid crystal, which makes the liquid crystal molecules to maintain a
defined orientation angle.
One each polarizes are pasted outside the two glass panels. These polarizes would rotate
the light rays passing through them to a definite angle, in a particular direction. When the LCD is
in the off state, light rays are rotated by the two polarizes and the liquid crystal, such that the light
rays come out of the LCD without any orientation, and hence the LCD appears transparent.

LCD PIN DIAGRAM

ULTRASONIC MODULE HC-SR04

The ultrasonic sensor works on the principle of SONAR and RADAR system which is used to
determine the distance to an object.

Ultrasound
Ultrasound is high-pitched sound waves with frequencies higher than the audible limit of human
hearing.

13
Human ears can hear sound waves that vibrate in the range from about 20 times a second
(a deep rumbling noise) to about 20,000 times a second (a high-pitched whistling). However,
ultrasound has a frequency of over 20,000 Hz and is therefore inaudible to humans.
At its core, the HC-SR04 Ultrasonic distance sensor consists of two ultrasonic transducers.
The one acts as a transmitter which converts electrical signal into 40 KHz ultrasonic sound pulses.
The receiver listens for the transmitted pulses. If it receives them it produces an output pulse whose
width can be used to determine the distance the pulse travelled. As simple as pie!
The sensor is small, easy to use in any robotics project and offers excellent non-contact
range detection between 2 cm to 400 cm (that’s about an inch to 13 feet) with an accuracy of 3mm.
Since it operates on 5 volts, it can be hooked directly to an Arduino or any other 5V logic
microcontrollers.
Here are complete specifications:
Operating Voltage DC 5V
Operating Current 15Ma
Operating Frequency 40KHz
Max Range 4m
Min Range 2cm
Ranging Accuracy 3mm
Measuring Angle 15 degree
Trigger Input Signal 10µS TTL pulse
Dimension 45 x 20 x 15mm

14
HC-SR04 Ultrasonic Sensor Pinout

VCC is the power supply for HC-SR04 Ultrasonic distance sensor which we connect the
5V pin on the Arduino.
Trig (Trigger) pin is used to trigger the ultrasonic sound pulses.
Echo pin produces a pulse when the reflected signal is received. The length of the pulse is
proportional to the time it took for the transmitted signal to be detected.
GND should be connected to the ground of Arduino.

WORKING

It all starts, when a pulse of at least 10 µS (10 microseconds) in duration is applied to the
Trigger pin. In response to that the sensor transmits a sonic burst of eight pulses at 40 KHz. This
8-pulse pattern makes the “ultrasonic signature” from the device unique, allowing the receiver to
differentiate the transmitted pattern from the ambient ultrasonic noise.
The eight ultrasonic pulses travel through the air away from the transmitter. Meanwhile
the Echo pin goes HIGH to start forming the beginning of the echo-back signal.

15
In case, If those pulses are not reflected back then the Echo signal will timeout after 38 mS
(38 milliseconds) and return low. Thus a 38 mS pulse indicates no obstruction within the range of
the sensor.

If those pulses are reflected back the Echo pin goes low as soon as the signal is received. This
produces a pulse whose width varies between 150 µS to 25 mS, depending upon the time it took
for the signal to be received.

16
The width of the received pulse is then used to calculate the distance to the reflected object.
This can be worked out using simple distance-speed-time equation, we learned in High school. In
case you forgot, an easy way to remember the distance, speed and time equations is to put the
letters into a triangle.

Let’s take an example to make it more clear. Suppose we have an object in front of the
sensor at an unknown distance and we received a pulse of width 500 µS on the Echo pin. Now
let’s calculate how far the object from the sensor is. We will use the below equation.

Distance = Speed x Time

17
Here, we have the value of Time i.e. 500 µs and we know the speed. What speed do we have? The
speed of sound, of course! Its 340 m/s. We have to convert the speed of sound into cm/µs in order
to calculate the distance. A quick Google search for “speed of sound in centimeters per
microsecond” will say that it is 0.034 cm/µs. You could do the math, but searching it is easier.
Anyway, with that information, we can calculate the distance!

Distance = 0.034 cm/µs x 500 µs

But this is not done! Remember that the pulse indicates the time it took for the signal to be sent
out and reflected back so to get the distance so, you’ll need to divide your result in half.

Distance = (0.034 cm/µs x 500 µs) / 2

Distance = 8.5 cm

POWER SUPPLY

Block diagram

The ac voltage, typically 220V rms, is connected to a transformer, which steps that ac
voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave
rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This
resulting dc voltage usually has some ripple or ac voltage variation.
A regulator circuit removes the ripples and also remains the same dc value even if the input
dc voltage varies, or the load connected to the output dc voltage changes. This voltage regulation
is usually obtained using one of the popular voltage regulator IC units.

Working principle

TRANSFORMER RECTIFIER FILTER IC REGULATOR LOAD

18
Transformer
The transformer will step down the power supply voltage (0-230V) to (0-6V) level. Then
the secondary of the potential transformer will be connected to the precision rectifier, which is
constructed with the help of op–amp. The advantages of using precision rectifier are it will give
peak voltage output as DC; rest of the circuits will give only RMS output.

Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called as bridge rectifier.
The input to the circuit is applied to the diagonally opposite corners of the network, and the output
is taken from the remaining two corners.
Let us assume that the transformer is working properly and there is a positive potential, at
point A and a negative potential at point B. the positive potential at point A will forward bias D3
and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At this time D3 and
D1 are forward biased and will allow current flow to pass through them; D4 and D2 are reverse
biased and will block current flow.
The path for current flow is from point B through D1, up through RL, through D3, through
the secondary of the transformer back to point B. this path is indicated by the solid arrows.
Waveforms (1) and (2) can be observed across D1 and D3.
One-half cycle later the polarity across the secondary of the transformer reverse, forward
biasing D2 and D4 and reverse biasing D1 and D3. Current flow will now be from point A through
D4, up through RL, through D2, through the secondary of T1, and back to point A. This path is
indicated by the broken arrows. Waveforms (3) and (4) can be observed across D2 and D4. The
current flow through RL is always in the same direction. In flowing through RL this current
develops a voltage corresponding to that shown waveform (5). Since current flows through the
load (RL) during both half cycles of the applied voltage, this bridge rectifier is a full- wave rectifier.
One advantage of a bridge rectifier over a conventional full-wave rectifier is that with a
given transformer the bridge rectifier produces a voltage output that is nearly twice that of the
conventional full-wave circuit.
This may be shown by assigning values to some of the components shown in views A and
B. assume that the same transformer is used in both circuits. The peak voltage developed

19
between points X and y is 1000 volts in both circuits. In the conventional full-wave circuit
shown—in view A, the peak voltage from the center tap to either X or Y is 500 volts. Since only
one diode can conduct at any instant, the maximum voltage that can be rectified at any instant is
500 volts.
The maximum voltage that appears across the load resistor is nearly-but never exceeds-
500 v0lts, as result of the small voltage drop across the diode. In the bridge rectifier shown in view
B, the maximum voltage that can be rectified is the full secondary voltage, which is 1000 volts.
Therefore, the peak output voltage across the load resistor is nearly 1000 volts. With both circuits
using the same transformer, the bridge rectifier circuit produces a higher output voltage than the
conventional full-wave rectifier circuit.

IC voltage regulators
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the
circuitry for reference source, comparator amplifier, control device, and overload protection all in
a single IC. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage,
or an adjustably set voltage. The regulators can be selected for operation with load currents from
hundreds of milli amperes to tens of amperes, corresponding to power ratings from milli watts to
tens of watts.

20
Circuit diagram (Power supply)

A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied
to one input terminal, a regulated dc output voltage, Vo, from a second terminal, with the third
terminal connected to ground.
The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts.
Similarly, the series 79 regulators provide fixed negative regulated voltages from 5 to 24 volts.
• For ICs, microcontroller, LCD --------- 5 volts
• For alarm circuit, op-amp, relay circuits ----------- 12 volts

21
BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles,


household appliances such as a microwave oven, or game shows. It most commonly consists of a
number of switches or sensors connected to a control unit that determines if and which button was
pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or
control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping
sound. Initially this device was based on an electromechanical system which was identical to an
electric bell without the metal gong (which makes the ringing noise).
Often these units were anchored to a wall or ceiling and used the ceiling or wall as a
sounding board. Another implementation with some AC-connected devices was to implement a
circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit
up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric
sounder like aalert which makes a high-pitched tone. Usually these were hooked up to "driver"
circuits which varied the pitch of the sound or pulsed the sound on and off.

Circuit description:
The circuit is designed to control the buzzer. The buzzer ON and OFF is controlled by
Microcontroller. High Pulse is used for Buzzer ON by microcontroller and Low Pulse is for Buzzer
OFF.

22
SOFTWARE SPECIFICATION

Language Tools

Numerous configuration options are supported, affecting both core PHP features and
extensions. Configuration file php.ini is searched for in different locations, depending on the
way PHP is used. The configuration file is split into various sections, while some of the
configuration options can be also set within the web server configuration.

Use
PHP is a general-purpose scripting language that is especially suited to server-side web
development, in which case PHP generally runs on a web server. Any PHP code in a requested file
is executed by the PHP runtime, usually to create dynamic web page content or dynamic images
used on websites or elsewhere. It can also be used for command-line scripting and client- side
graphical user interface (GUI) applications. PHP can be deployed on most web servers, many
operating systems and platforms, and can be used with many relational database management
systems (RDBMS). Most web hosting providers support PHP for use by their clients. It is available
free of charge, and the PHP Group provides the complete source code for users to build, customize
and extend.

INTERNET OF THINGS

Things
A “thing” is an object equipped with sensors that gather data which will be transferred
over a network and actuators that allow things to act (for example, to switch on or off the light,

23
to open or close a door, to increase or decrease engine rotation speed and more). This concept
includes fridges, street lamps, buildings, vehicles, production machinery, rehabilitation equipment
and everything else imaginable. Sensors are not in all cases physically attached to the things:
sensors may need to monitor, for example, what happens in the closest environment to a thing.

Gateways
Data goes from things to the cloud and vice versa through the gateways. A gateway
provides connectivity between things and the cloud part of the IoT solution, enables data
preprocessing and filtering before moving it to the cloud (to reduce the volume of data for

24
detailed processing and storing) and transmits control commands going from the cloud to things.
Things then execute commands using their actuators.

Cloud gateway
Cloud gateway facilitates data compression and secure data transmission between field
gateways and cloud IoT servers. It also ensures compatibility with various protocols and
communicates with field gateways using different protocols depending on what protocol is
supported by gateways.

Streaming data processor


Streaming data processor ensures effective transition of input data to a data lake and control
applications. No data can be occasionally lost or corrupted.

Data lake
A data lake is used for storing the data generated by connected devices in its natural format.
Big data comes in "batches" or in “streams”. When the data is needed for meaningful insights it’s
extracted from a data lake and loaded to a big data warehouse.

Big data warehouse


Filtered and preprocessed data needed for meaningful insights is extracted from a data lake
to a big data warehouse. A big data warehouse contains only cleaned, structured and matched data
(compared to a data lake which contains all sorts of data generated by sensors). Also, data
warehouse stores context information about things and sensors (for example, where sensors are
installed) and the commands control applications send to things.

Data analytics
Data analysts can use data from the big data warehouse to find trends and gain actionable
insights. When analyzed (and in many cases – visualized in schemes, diagrams, infographics) big
data show, for example, the performance of devices, help identify inefficiencies and work out the
ways to improve an IoT system (make it more reliable, more customer-oriented). Also, the
correlations and patterns found manually can further contribute to creating algorithms for control
applications.

25
SYSTEM DESIGN

26
4. SYSTEM DESIGN
DATABASE DESIGN

CREATE TABLE IF NOT EXISTS `FLOODALERT` (

`sno` int(11) NOT NULL AUTO_INCREMENT,

`sonar1` int(11) NOT NULL,

`sonar2` int(11) NOT NULL,

`dt` datetime NOT NULL,

PRIMARY KEY (`sno`)

TABLE DESIGN

27
28
OUTPUT DESIGN

29
SYSTEM IMPLEMENTATION

30
5. SYSTEM IMPLEMENTATION

EMBEDDED SYSTEMS

Embedded systems are the electronically controlled devices where software and hardware
are tightly coupled. Embedded systems may contain a variety of computing devices. These are PCs
incorporated in other devices to operate application-specific functions. The end user usually is not
even aware of their existence.

EMBEDDED TESTING

Embedded Testing is checking the functional and non-functional attributes of both software
and hardware in an embedded system. The purpose of Embedded test is to verify and validate the
Embedded software as well as hardware against client requirement.

Embedded Software testing checks and ensure the concerned software is of good quality
and complies with all the requirements it should meet. Embedded software testing is an excellent
approach to guarantee security in critical applications like medical equipment, railways, aviation,
vehicle industry, etc. Strict and careful testing is crucial to grant software certification.

EMBEDDED SOFTWARE TESTING

• To find bugs in software


• Helps to reduce risk to both users and the company
• Cut down development and maintenance costs
• To improve performance

In Embedded Testing, the following activities are performed:

1. The software is provided with some inputs.

2. A Piece of the software is executed.

31
3. The software state is observed, and the outputs are checked for expected properties like whether
the output matches the expected outcome, conformance to the requirements and absence of system
crashes.

Embedded Software Testing Types

Fundamentally, there are five levels of testing that can be applied to embedded software

Software Unit Testing

The unit module is either a function or class. Unit Testing is performed by the development
team, primarily the developer and is usually carried out in a peer-review model. Based on the
specification of the module test cases are developed.

Integration Testing

Integration testing can be classified into two segments:

1. Software integration testing


2. Software/hardware integration testing.

In the end, the interaction of the hardware domain and software components are tested. This
can incorporate examining the interaction between built-in peripheral devices and software.

Embedded software development has a unique characteristic which focuses on the actual
environment, in which the software is run, is generally created in parallel with the software. This
causes inconvenience for testing since comprehensive testing cannot be performed in a simulated
condition.

System Unit Testing

Now the module to be tested is a full framework that consists of complete software code
additionally all real-time operating system (RTOS) and platform-related pieces such as interrupts,
tasking mechanisms, communications and so on. The Point of Control protocol is not

32
anymore a call to a function or a method invocation, but rather a message sent/got utilizing the
RTOS message queues.

System resources are observed to evaluate the system's ability to support embedded system
execution. For this aspect, gray-box testing is the favored testing method. Depending on the
organization, system unit testing is either the duty of the developer or a dedicated system
integration team.

System Integration Testing

The module to be tested begins from a set of components within a single node. The Points
of Control and Observations (PCOs) are a mix of network related communication protocols and
RTOS, such as network messages and RTOS events. Additionally to a component, a Virtual Tester
can likewise play the role of a node.

System Validation Testing

The module to be tested is a subsystem with a complete implementation or the complete


embedded system. The objective of this final test is to meet external entity functional requirements.
Note that an external entity either be a person, or a device in a telecom network, or both.

33
Difference: Embedded testing and Software Testing

Software Testing Embedded Testing


Software testing is related to software only. Embedded testing is related to both software as
well as hardware.
On average 90% testing done in the world is Embedded testing is done on embedded
purely manual black box testing. systems or chips it can be a black box or white
box testing.
Primary areas of testing are GUI checks, Primary areas of testing are the behavior of the
functionality, validation and some level of hardware for the no. of inputs given to it.
database testing.
Software testing is majorly performed on Embedded testing generally performed on the
client-server, web and mobile based Hardware.
applications.
e.g., Google Mail, Yahoo Mail, Android e.g., Machines of healthcare domain,
applications. Microcontrollers used in computers.

Challenges: Embedded Software Testing

Some of the challenges that one can face during Embedded software testing:

Hardware Dependency

Hardware dependency is among the main difficulties faced during embedded software
testing because of limited access to hardware. However, Emulators and Simulators may not
precisely represent the behavior of the actual device and could give a wrong sense of system
performance and application's usability.

Open Source Software

The majority of the embedded software components are open source in nature, not created
in-house and absence of complete test available for it. There is a wide range of test combinations
and resulting scenarios.

34
Software vs. Hardware Defects

Another aspect is when software is being developed for a freshly created hardware, during
this process high ratio of hardware defects can be identified. The found defect is just not limited
to software. It may be related to hardware also.

Reproducible Defects

Defects are harder to reproduce/recreate in the case of the embedded system. That enforces
the embedded testing procedure to value every defect occurrence substantially higher than in a
standard case, other than to gather as much data as could sensibly be required to alter the system
to find the foundation of the defect.

Continuous Software Updates

Embedded systems require regular software updates like the kernel upgrade, security fixes,
different device drivers, etc. Constraints identified with the software updates influence makes bug
identification difficult. Additionally, it increases the significance of build and deployment
procedure.

35
SYSTEM TESTING
36
6. SYSTEM TESTING

TEST APPROACH

We will test the project in two stages: software and hardware. The software part is to be
tested via the Arduino IDE, whereas the hardware part has to be tested physically. It is necessary
to check whether the system is working properly or not. To check whether the readings are
accurate, we will check the distance pointed out by the sensor by a meter tape.

FEATURES TO BE TESTED

After building the whole circuit we test it, testing procedure is given in 5.1. This project
should satisfy some features. Features to be tested as follows

• The ultrasonic sensor should give proper output. To check whether the output is accurate or
not, the output of the sensor will be checked against a meter tape.

• The arduino board should show the distance in the serial monitor. So should the NodeMCU.

• The GSM module should send messages after the specified delay. If the text messages are
reaching the phone, that means the GSM module is working. It should make a small ringing sound,
when it sends messages.

• The DHT11 sensor should work properly and show its output in the serial monitor.

• The blynk app should be checked.

Testing tools and environment

For testing of the project we require some tools, like to test Arduino program we require a
software called Arduino IDE. Using this we can check the program that program is working
properly or not. For hardware checking we require power supply and proper range of
measurements and a meter tape. The garbage dump should have only solid waste. The NodeMCU
should connect to the Blynk app and the app should show the output. For this ,the NodeMCU must
connect first to the wifi hotspot.

37
Testing procedure

For testing first connect the circuit to the power supply is given to the Arduino using
computer and it can be done by using battery. In this way the whole testing circuit is built. Now
we give input to the HC-SR04 by changing the level of solid garbage. Change in garbage levels
should be messaged using GSM Module.

Summary of testing procedure

1 ) Connect the circuit according to the diagram

2) Give power to the system.

3) Vary garbage level for the ultrasonic sensor to give output.

4) Get the output from the DHT11 sensor.

5) Send message via the GSM module

38
CONCLUSION
39
7. CONCLUSION
This work enlighting the possibility to provide an alert system to overcome the flood risk.
It can also contribute to the authority or company such as firefighter or any government state
agency that can help the society about the flooding or any natural disaster. The proposed prototype
system has been tested and it works as proposed. It is able to send an alert message to the user with
the time of the water rise also with the speed of the water rises for prediction how quick is the
flood is happening. It also has been tested in a controlled environment to evaluate the performance.
For real implementation, several sensors might be integrated for accurate detection.

40
SCOPE FOR FUTURE ENHANCEMENT
41
8. SCOPE FOR FUTURE ENHANCEMENT
Floods lead to a vast loss of life and property in many countries. But in developing
countries the lack of proper technology leads to more loss of life and property due to flood. This
is due to lack of flood detection systems. IoT based real-time flood water level monitoring and
alerting system solves problem by implementing an early flood detection mechanism.When flood
occurs system detects flood levels such as safe, medium and risk alerting people early in order to
evacuate bank in emergency using IOT.

42
BIBLOGRAPHY

43
BIBLOGRAPHY

1. SebinSabu1 and Nora Elizabeth ,“Kerala Floods -A Model of Rescue and Rehabilitation
using Information Technology and Social Media based Crowdsourcing ,“ IEEE India Info.
Vol. 13 No. 3 Jul -Sep2018

2. H. A. Rahman, “Global Climate Change and Its Effects on Human Habit at and
Environment in Malaysia, ”Malaysian J. Environ. Manag., vol. 10, no. 2, pp. 17–32,2009.

3. “Heavy mid-afternoon rain causes flash floods in city centre -Nation | The Star Online.”
[Online]. Available:http://www.thestar.com.my/news/nation/2017/03/28/heavy-mid-
afternoon-rain-causes-flash-floods-in-city-centre/. [Accessed:24-Nov-2016].

4. S. K. Subramaniam, V. R. Gannapathy, S. Subramonian, and A. H. Hamidon, “Flood level


indicator and risk warning system for remote location monitoring using flood observatory
system,” WSEAS Trans. Syst. Control, vol. 5, no. 3, pp. 153–163,2010.

5. H. Hamidon, “Flood level indicator and risk warning system for remote location
monitoring using flood observatory system,” WSEAS Trans. Syst. Control, vol. 5, no. 3,
pp. 153–163,2010.10.“Flood Detection using Sensor Network and Notification via SMS
and Public Network.”
[Online].Available:
https://www.researchgate.net/publication/263088726_Flood11._Detection_using_Sensor_Netwo
rk_and_Notification_via_S M S_and_Public_Network. [Accessed: 24-Nov-2016].

44
APPENDIX

45
APPENDIX
CODINGS:

#include <LiquidCrystal.h>
#include <stdlib.h>
#include <stdio.h>

constint trigPin1 = 8;
constint echoPin1 = 9;
constint trigPin2 = 10;
constint echoPin2 = 11;
constint BUZ = A5;

long duration1,duration2;
int distanceCm1, distanceInch1,distanceCm2, distanceInch2;
int L1,L2;

// initialize the library with the numbers of the interface pins


LiquidCrystallcd(2,3,4, 5, 6, 7);
unsigned long int sec=0,min=0,last=0,MIN=0,MINN=0;

void setup() {

pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(BUZ, OUTPUT);
digitalWrite(BUZ, LOW);
lcd.begin(16,2);

Serial.begin(115200);

wifi_init();

lcd.setCursor(0,0);
lcd.print(" IOT BSD FLOOD. ");
lcd.setCursor(0,1);
lcd.print("MONITITORING SYS");
delay(2000); lcd.clear();
lcd.setCursor(0, 0);

46
lcd.print("R1: M: ");
lcd.setCursor(0, 1);
lcd.print("R2: ");

}
void loop() {

lcd.setCursor(15, 0);
lcd.print(min);

if(millis()>last+60000){last = millis();min++;

lcd.setCursor(0, 0);
lcd.print("R1: M: ");
lcd.setCursor(0, 1);
lcd.print("R2: ");

rl1 (); delay(200);


rl2 (); delay(200);
delay(2000);

if(L1<300)
{

digitalWrite(BUZ, LOW);

}
else if(L1>300 && L1<500)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-1 ");
lcd.setCursor(0, 1);
lcd.print(" ABOVE NORMAL ");digitalWrite(BUZ, HIGH);delay(1000);digitalWrite(BUZ,
LOW);

}
else if(L1>500 && L1<700)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-1 ");
lcd.setCursor(0, 1);

47
lcd.print(" SEVERE FLOOD ");digitalWrite(BUZ, HIGH);delay(3000);digitalWrite(BUZ,
LOW);

}
if(L1>700)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-1 ");
lcd.setCursor(0, 1);
lcd.print(" EXTREME FLOOD ");digitalWrite(BUZ, HIGH);delay(5000);digitalWrite(BUZ,
LOW);

if(L2<300)
{

digitalWrite(BUZ, LOW);
}
else if(L2>300 && L2<500)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-2 ");
lcd.setCursor(0, 1);
lcd.print(" ABOVE NORMAL ");digitalWrite(BUZ, HIGH);delay(1000);digitalWrite(BUZ,
LOW);

}
else if(L2>500 && L2<700)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-2 ");
lcd.setCursor(0, 1);
lcd.print(" SEVERE FLOOD ");digitalWrite(BUZ, HIGH);delay(3000);digitalWrite(BUZ,
LOW);

}
if(L2>700)
{
lcd.setCursor(0, 0);
lcd.print(" RIVER-2 ");
lcd.setCursor(0, 1);
lcd.print(" EXTREME FLOOD ");digitalWrite(BUZ, HIGH);delay(5000);digitalWrite(BUZ,
LOW);

}
48
if(min>1){
send_dt();min=0;

void rl1 ()
{

digitalWrite(trigPin1, LOW);
delayMicroseconds(2000);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(20);
digitalWrite(trigPin1, LOW);
delayMicroseconds(10);
duration1 = pulseIn(echoPin1, HIGH);
distanceCm1= duration1*0.034/2;

if(distanceCm1 >3 && distanceCm1 <400)


{

L1=distanceCm1*4;

lcd.setCursor(3,0);
if(L1>=100 && L1<800)
{
lcd.print(L1);
lcd.print(" m3/s ");}

}
else
{

49
void rl2 ()
{

digitalWrite(trigPin2, LOW);
delayMicroseconds(2000);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(20);
digitalWrite(trigPin2, LOW);
delayMicroseconds(10);
duration2 = pulseIn(echoPin2, HIGH);
distanceCm2= duration2*0.034/2;

if(distanceCm2 >3 && distanceCm2 <400)


{

L2=distanceCm2*4;

lcd.setCursor(3,1);
if(L2>=100 && L2<800)
{
lcd.print(L2);
lcd.print(" m3/s ");}
}
else
{

voidsend_dt()
{
intct=112;

lcd.clear();
lcd.setCursor(1, 0);
lcd.print("SENDING DATA..");

boolean at_flag11=1;
while(at_flag11)
{
Serial.print("AT+CIPSTART=\"TCP\",\"www.dreampixelz.in\",80");
Serial.write(0x0D);
Serial.write(0x0A);
while(Serial.available()>0)
50
{
if(Serial.find("OK"))
at_flag11=0;
}

delay(3000);
}

boolean at_flag12=1;

{
Serial.print("AT+CIPSEND=");Serial.print(ct);
Serial.write(0x0D);
Serial.write(0x0A);
while(Serial.available()>0)
{
if(Serial.find(">"))
at_flag12=0;
}

delay(3000);
}

boolean at_flag13=1;

Serial.print("GET /iot_19/write.php?sonar1=");
Serial.print(L1);

Serial.print("&sonar2=");
Serial.print(L2);//42

Serial.println("&headers=false HTTP/1.1");
Serial.println("Host: dreampixelz.in");
Serial.println("Connection: close"); //108+

Serial.write(0x0D);
Serial.write(0x0A);
Serial.write(0x0D);
Serial.write(0x0A); //112+

/
delay(3000);

lcd.clear();
lcd.setCursor(1, 0);
51
lcd.print("DATA SENT");
delay(3000);
lcd.clear();

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("R1: M: ");
lcd.setCursor(0, 1);
lcd.print("R2: ");

}
}

voidwifi_init()
{
lcd.clear();
lcd.print("Finding Module..");
booleanat_flag=1;
while(at_flag)
{
Serial.println("AT");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag=0;
}

delay(1000);
}

boolean at_flag1=1;
while(at_flag1)
{
Serial.println("ATE0");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag1=0;
}

delay(1000);
}

boolean at_flag2=1;
while(at_flag2)
{
52
Serial.println("AT+CWMODE=3");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag2=0;
}

delay(1000);
}

boolean at_flag3=1;
while(at_flag3)
{
Serial.println("AT+CIPMUX=0");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag3=0;
}

delay(1000);
}

boolean at_flag4=1;
while(at_flag4)
{
Serial.println("AT+CWQAP");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag4=0;
}

delay(3000);
}

boolean at_flag5=1;
while(at_flag5)
{
Serial.print("AT+CWJAP=\"iot\",\"qwertyuiop!\"");
Serial.write(0x0D);
Serial.write(0x0A);
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag5=0;
53
}

delay(3000);
}
lcd.setCursor(0,1); // Sets the location at which subsequent text written to the LCD will be
displayed
lcd.print(" WIFI INIT.. ");delay(1000);

54

You might also like