You are on page 1of 77

FLOOD MONITORING AND ALERTING SYSTEM

A Major Project Report


submitted in fulfillment for the award of the degree of

Bachelor of Technology
in

Electronics and Communication Engineering


Under the Esteemed Guidance of

Mr. KOUSTUBH KULKARNI


Assistant Professor

by

ARUKONDA RAHUL 187Z1A0406

Department of Electronics and Communication Engineering


Nalla Narasimha Reddy Education Society’s Group of Institutions
(Approved by AICTE, Affiliated to JNTUH & Accredited by NBA and NAAC)
An Autonomous Institution

Chowdariguda, Medchal-Malkajgiri (Dist.), Hyderabad –500088, Telangana

2021-2022
SCHOOL OF ENGINEERING

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

INSTITUTE’s VISION AND MISSION

VISION :
• To be a premier institution ensuring globally competent and ethically
strongprofessionals.
MISSION :
• To provide higher education by refining the traditional methods of teaching to
makeglobally competent professionals.

• To impart quality education by providing the state of the art infrastructure and
innovative research facilities.

• To practice and promote high standards of professional ethics, transparency and


accountability.

DEPARTMENT’s VISION AND MISSION


VISION :

• To produce creative Electronics and Communication engineering graduates with


cuttingedge technology and Research to meet Industry and societal needs.
MISSION :

• To provide innovative learning environment to enable the students to face the


challenges.

• To provide value based education by promoting activities addressing societal needs.

• To enable graduates to develop the skills to solve complex problems


inmultidisciplinary activities.
Nalla Narasimha Reddy Education Society’s
Group of Institutions
(Approved by AICTE, Affiliated to JNTUH & Accredited by NBA and NAAC)

An Autonomous Institution

Chowdariguda, Medchal-Malkajgiri (Dist.), Hyderabad –500088,

School of Engineering

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the project work entitled “FLOOD MONITORING AND
ALERTING SYSTEM” submitted by ARUKONDA RAHUL bearing roll number
187Z1A0406 is in fulfillment for the award of the degree of Bachelor of Technology in
Electronics and Communication Engineering from Jawaharlal Nehru Technological
University, Hyderabad during the academic year 2021-22.

This project is a record of bonafide work carried out by him under the supervised
guidance and has not been submitted to any other university or institution for the award
of any degree.

Internal Guide Head of the Department

Mr. KOUSTUBH KULKARNI Mr. P.S. SREENIVASA REDDY


Assistant professor Associate Professor

External Examiner
ACKNOWLEDGEMENT

I would like to thank, Mr. KOUSTUBH KULKARNI, Assistant Professor,


internal guide for his wonderful support and unforgettable help towards the project.
Without his encouragement and constant guidance, we could not have finished this
project and dissertation.
I would like to thank Dr. P. MICHAEL PREETAM RAJ, Associate Professor
& Project Coordinator for the constant support and guidance throughout the
durationof project.
I would like to thank Dr. T. RAJASEKHAR, Associate Professor & Project
Coordinator for the constant support and guidance throughout the duration of project.
I would like to thank Mr. P.S. SREENIVASA REDDY, Associate Professor &
Head of the Department of Electronics and Communication Engineering for inspiring
us to take up a project on this subject and successfully guiding us towards its
completion.
I would like to thank Dr. G. JANARDHANA RAJU, Dean, School of
Engineering for providing us by means of attaining our cherished goals.
I would like to thank Director Dr. C.V. KRISHNA REDDY whose sayings and
teachings have been pivotal for us in all aspects of my academics. He has stood beside
us in all the difficult times, and his love has helped us to overcome all the failures and
success.
I express my gratitude to the institution NALLA NARASIMHA REDDY
EDUCATION SOCIETY’S GROUP OF INSTITUTIONS.
Last but not the least, I would like to thank all the faculty members & lab
instructors for the timely inputs and help for the successful completion of the project.

ARUKONDA RAHUL 187Z1A0406


DECLARATION

I hereby declare that the project dissertation entitled “FLOOD

MONITORING AND ALERTING SYSTEM” submitted by us in the partial

fulfillment for the award of the degree of Bachelor of Technology in Electronics &

Communication Engineering under Jawaharlal Nehru Technological University

(JNTU), Hyderabad is our original work carried out during the academic year

2021- 22 and has not been submitted earlier to any other university/institution for

the fulfillment of the requirement for any degree or course of study.

I also declare that no chapter of this manuscript is whole or in part

incorporated in this report has been copied or fetched from any earlier work done by

others. However, the extract of literature which has been used for the study &

reporting has been duly acknowledged and indexed by providing the details in the

context of references.

Date: ARUKONDA RAHUL


Place: 187Z1A0406
CONTENTS
ABSTRACT i
LIST OF FIGURES ii

CH.NO. CHAPTER NAME PAGE NO


1. INTRODUCTION 1
1.1 what is this system 1
1.2 Motivation 1
1.3 Objectives 2
1.4 Scope 2
1.5 Main Contribution 3
1.6 Existing Model 3
1.7 Proposed Model 4
1.8 Internet of Things(IOT) 5
1.9 Embedded IOT 7
1.10 Embedded system hardware 8
1.11 Sensor and its specifications 10
2. DESCRIPTION ABOUT CIRCUIT COMPONENTS 12
2.1 Arduino UNO 12
2.2 SIM 900A GSM module 19
2.3 16*2 LCD Display 27
2.4 Water flow sensor 30
2.5 Heat sink 32
2.6 Relay Module 34
2.7 Buzzer 37
2.8 DC motor 42
2.9 ThingSpeak cloud 46
2.10 Software used 47
3. CONSTRUCTION OF THE CIRCUIT 50
3.1 System theory of operation 50
3.2 Block diagram 50
3.3 Circuit diagram 51
3.4 Flow chart 52
3.5 Experimental setup 53
3.6 Working 54
4. RESULTS 55
5. CONCLUSION 57
REFERENCES
APPENDIX iv
ABSTRACT

Flood is one of the natural disasters which cannot be avoided totally.Every year,death rate
due to flood increases because of absence of early warning.In developed country like
U.S,Japan etc. the flooding problem is minimized significantly and do not affect much due
to availability of emergency systems.But the developing Countries like India,Brazil etc. is
suffering a lot during flood.Every year number of deaths due to flooding keeps increasing
in different part of our country.Whenever, flooding happens living area near the riverbank
and river downstream area are affected severly than others.
They need to be alerted much earlier to have extra time to evacuate immediately.To avoid
this situation we need to be authorized warning systemsystem provides such information
by alerting through buzzer and sending a text message to registered mobile number.To
solve this problem,this project demonstrates the idea and implementation of a Flood
Monitoring and Alerting system using Internet Of Things(IOT) with GSM technology
which is used to alert people through text alert message.

i
LIST OF FIGURES
Figure No Description PageNo
1.6 Existing model block diagram 3
1.7 Proposed model block diagram 4
1.9 Embedded IOT 8
1.10 Embedded Hardware 9
2.1(a) Arduino UNO 12
2.1(b) Pin description of Arduino 13
2.1(c) Memory of Arduino 14
2.1(d) Selecting Arduino 16
2.1(e) Upload button 16
2.1(f) Arduino in detail 17
2.1(g) ICSP Header 18
2.2(a) GSM module 19
2.2(b) GSM technology Architecture 20
2.2(c) GSM circuit 25
2.3 16*2 LCD display 27
2.4 Water flow sensor 30
2.5 Heat sink 32
2.6 Relay module 34
2.7(a) Buzzer 37
2.7(b) Internal circuit of buzzer 41
2.8(a) 12V DC motor 42
2.8(b) DC motor construction parts 43
2.8(c) Production of torque in a DC motor 44
2.10 Basic Arduino coding window 48
3.2 Block diagram 50
3.3 Circuit diagram 51
3.4 Flow chart 52
3.5 Experimental setup 53

ii
4(a) Alert SMS notification 55
4(b) ThingSpeak Uploaded data 56

iii
CHAPTER 1
INTRODUCTION
FLOOD MONITORING AND ALERTING SYSTEM

INTRODUCTION
Flood occurs when water overflows from the river, lake or from heavy rainfall and it
can happen at any time of the year. Flooding can be very dangerous, when floods happen
in an area that people live, the water carries along objects like houses, cars, furniture and
even people. It can wipe away property, trees and many more heavy items. For years,
flooded roads have beena problem in Metro Mumbai. It causes heavy flow of traffic.
Both motorists and commuters are getting stuck in a flooded areas and getting lost in
finding possible routes just to go to their destinations. When traffic happened, people’s
money, time and effort are wasted. Through the local government unit flood control has
been extending their efforts to inform the commuters regarding the situation in flooded
areas during rainy season, still the dissemination of information to the locals are not
enough.
For this reason, the “Arduino Flood Detector System” is been develop, to help the
road user to avoid this problem happened. It was invented based on problem faced by
motorists and commuters when flood occurred. This will avoid the traffic jam because
the users have a time to find a possible routes before they are going to be stuck at the
flood area.

1.1 What is this system


The system will function when the admin activate the system and when water along the
road detected by distance over ultrasonic sensor. When the flood occur, the ultrasonic
sensor will sent signal to the microprocessor circuit and the sense water level will be
display in the user interface and it will automatically send a Short Message Service
(SMS) to those recognized residents and it will continue update until the water level
detected returns to normal.
The process repeats as the water level continuous to rise. The idea of an SMS based
warningsystem was proposed because mobile phones have become a popular
communication deviceamong people all over the world. All mobile phone are able to
communicate because it comprises of a GSM. This system used to detect the current
water level of flood around the road and will give real-time information to the
motorists or commuters that has still not passing through the flooded areas to avoid
problem.

1.2 MOTIVATION
This flood monitoring system is designed and developed to warn and alert both
authority and the owners of the vehicles about the flood almost immediately. A water
level sensor will be set at two points of water level which is at 0.05 m and 0.09 m. When
the water reaches this point, it will light on the Light Emitting Diode (LED) and trigger
the buzzer that acts as an alarm to alert both authority and owner. All the readings of
water level are shown in an application called Blynk that will connect through the
connection of a Wireless Fidelity (Wi-Fi) for reference. This project applied both,
hardware and software programming.
The hardware components of this system is divided into three (3) main parts which

1
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

are: i) the water level sensor as the input system, ii) an Arduino Mega 2560 as the main
microcontroller which controlall inputs and output of the system and an ESP 8266 Wi-Fi
module as an interfacewith the output and connection to application respectively and, iii)
an LED and a buzzer as the output system. Meanwhile, for software programming,
Arduino software IDE is used for hardware coding. Hence, a system and mechanism
for real-time surveillance of the potentialflooding at the car park should be established.
Other researchers also implement this type of project to overcome the flood crisis.
The project as reported in [7-8] is quite similar with this project, but was more
focused more on the detection of water level. Unfortunately, the system cannot send any
notification directly to the users. Besides that, researchers in [8-9] also developed
roughly the same system, where the system can warn and alert users through a
technology called Global System Messaging (GSM) technology.
System which is used in this research possesses advantages compared to these two
systems where it can send notifications prompt, direct and fast, in fact the fastest to the
users. Users can receive this notification through an application called the Blnyk
Application that has been installed in each user’s smartphone. This system has been
implemented with the latest technology called the Internet of Things (IoT), that have this
amazing capability of sending anyinformation wirelessly. The objective of this project is
to design, develop and build a flood warning system especially for parking spaces that
will alert and warn the vehicle owner apart from developing an application that can be
monitored effortlessly via a newest technology of wireless connection.

1.3 OBJECTIVES
The main objective of this project is to develop and design a flood detection system that
will detect flood automatically and send data to the Local Government Unit and to
residents usingan Arduino. Specific Objectives
-To design a circuit and create a programming code using the microcontroller.
-To apply the Serial Communication in transmitting the data from one place to another
place.
-To detect the current level of the flood where the system sensor will be divided into
four levels.

1.4 SCOPE
This study is conducted to solve the problems brought about by floods. The device shall
contain with the following features: It has ultrasonic sensor to sense the distance of water
level of flood on the road. The system provided a camera that will display the real-time
image of the flood that can view via livestream.
It includes Serial Communication to send warning text message with the content of
date, time, water level and road accessibility. The system has three (3) modules which
are Users, Logs, and Contact Numbers. It can be modify by the admin.
The unit containing the sensor is suggested to be place in front of Our system. The
position of the sensor must be placed perpendicular to the flood water; otherwise, there

2
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

will be an imperfect reflection of ultrasonic waves and cause measurement errors.

The sensor is suggested to be placed on a pole with a height of about 3 to 3.5 meters. The
flood sensors and microcontrollers will be powered by a Solar Power Bank with 80,
000 Ampere Ampere-Hour (mAh) for the benefit of continuous operation of water
flood height detection and network data transmission.

1.5 MAIN CONTRIBUTION


I have followed the exixsting model and studied it well and developed this model by
making necessary changes which are replaced by some other components for a better
response.So here in this model i have developed this project by concentrating on the
existing model and also assured that this model is light and easy to develop manner.

1.6 EXISTING MODEL

Fig 1.6 Existing model block diagram


In this existing model, the system consists of a Water flow sensor and a Arduino UNO
and buzzer.In the working process ,when the floods are eventually to occour,this system
as it connected to Water flow sensor and there is a threshold voltage which is set and
when the waterflow is more than that threshold level.
Then this signal is processed in the Arduino as the Water flow sensor is connected to
the Arduino and as per the connections given to the different pins of the Arduino then
the Arduino is connected to the Buzzer and hence the alert is given through sound and
hence the people nearby will hear that sound and they will be alerted and try to evacuate
the place.
The main objective of this system is whenever the water flow increases there is a
chance of getting floods and hence the buzzer gets activated and thereby alerting the
near by residers.

3
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

1.7 PROPOSED MODEL

Fig 1.7 Proposed model block diagram


As in the existing model there is an alerting system which alerts through the buzzer but
that system is not that much applicable as the sound is not heard from long and hence
the alert is not done properly.
So in this system We proposed the alerting system through SMS by using a GSM
module.Thissystem has added components when compared to the existing system.
This system consists of a water flow sensor,Arduino Uno,GSM module and a things
speak cloud.water flow sensor is connected to thr Arduino and when the water flows
through the water flow sensor,there is a threshold value which is set previously by the
user.
When the speed of the water is more and if it exceeds the threshold voltage then as the
Arduino is connected to the Things speak cloud and hence this information of flood
detection is updatedin the cloud .
Also as the Arduino is connected to the buzzer and GSM module and hence alert is
given through the sound and also SMS is sent to the registered mobile number and
hence the people gets alerted before the flooding happens and hence they can evacuate
the place and prevent themselves from the floods.

4
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

1.8 INTERNET OF THINGS(IOT)


The Internet of Things(IOT) is the network of physical objects-devices, vehicles,
buildings and other items-embedded with electronics, software, sensors and network
connectivity that enables these objects to collect and exchange data.
The IOT allows objects to be sensed and controlled remotely across existing network
infrastructure, creating opportunities for more direct integration of the physical world
into computer based systems, and resulting in improved efficiency, accuracy and
economic benefit.
When IOT is augmented with sensors and actuators, the technology becomes an
instance of the more general class of cyber-physical systems, which also encompasses
technologies such as smart grids, smart homes and smart cities. Each thing is uniquely
identifiable through its embedded computing system but is able to interoperate between
the existing internet infrastructure
When something is connected to the internet, that means that it can send information
or receive information, or both. This ability to send and/or receive information makes
things “smart."Let’s use smart phones again as an example. Right now you can listen to
just about any song in the world, but it’s not because your phone actually has every song
in the world stored on it.
It’s because every song in the world is stored somewhere else, but your phone can
send information (asking for that song) and then receive information (streaming that
song on your phone).
All a thing has to do is connect to super storage or to a super computer. In the
Internet of Things, all the things that are being connected to the internet can be put into
three categories:
1. Things that collect information and then send it.
2.Things that receive information and then act on.
3.Things that do both.
4.And all three of these have enormous benefits that compound on each other.

1. Collecting and Sending Information


Sensors could be temperature sensors, motion sensors, moisture sensors, air quality
sensors, light sensors, you name it. These sensors, along with a connection, allow us to
automatically collect information from the environment which, in turn, allows us to
make more intelligent decisions.
On a farm, automatically getting information about the soil moisture can tell farmers
exactlywhen their crops need to be watered. Instead of watering too much (which can
be an expensive over-use of irrigation systems) or watering too little (which can be an
expensive loss of crops), the farmer can ensure that crops get exactly the right amount
of water.
This enables farmers to increase their crop yield while decreasing their associated
expenses. Just as our sight, hearing, smell, touch, and taste allow us, humans, to make
sense of the world, sensors allow machines (and the humans monitoring the
machines) to make sense ofthe world.

5
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

2. Receiving and Acting on Information


We’re all very familiar with machines getting information and then acting. Your printer
receives a document and it prints it. Your car receives a signal from your car keys and the
doorsopen. The examples are endless.
Whether it’s a simple as sending the command “turn on” or as complex as sending a
3D modelto a 3D printer, we know that we can tell machines what to do from far away.
The real power of the Internet of Things arises when things can do both of the above.
Things that collect information and send it, but also receive information and act on it.

3. Doing Both: The Goal of an IoT System


Let’s quickly go back to the farming example. The sensors can collect information
about the soil moisture to tell the farmer how much to water the crops, but you don’t
actually need the farmer. Instead, the irrigation system can automatically turn on as
needed, based on how muchmoisture is in the soil.
You can take it a step further too. If the irrigation system receives information about
the weather from its internet connection, it can also know when it’s going to rain and
decide not towater the crops today because they’ll be watered by the rain anyways.
And it doesn’t stop there! All this information about the soil moisture, how much the
irrigation system is watering the crops, and how well the crops actually grow can be
collected and sent to supercomputers that run amazing algorithms that can make sense of
all this information.
And that’s just one kind of sensor. Add in other sensors like light, air quality, and
temperature, and these algorithms can learn much, much more. With dozens, hundreds,
thousands of farms all collecting this information, these algorithms can create incredible
insights into how to makecrops grow the best, helping to feed the world.
Internet of Things Devices is non-standard devices that connect wirelessly to a network
with each other and able to transfer the data. IoT devices are enlarging the internet
connectivity beyond standard devices such as smartphones, laptops, tablets, and
desktops. Embedding these devices with technology enable us to communicate and
interact over the networks and they canbe remotely monitored and controlled.

PROPERTIES OF IOT DEVICES:

 Sense: The devices that sense its surrounding environment in the form of
temperature, movement, and appearance of things, etc.
 Send and receive data: IoT devices are able to send and receive the data over the
networkconnection.
 Analyzation: The devices are used for analyzation of the data that received from
the otherdevice over the internet networks.
 Controlled: IoT devices may control from some endpoint also. Otherwise, the IoT
devicesare themselves communicate with each other endlessly leads to the system
failure.






6
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

APPLICATIONS:-

1. IoT Applications – Wearables:-


Wearable technology is a hallmark of IoT applications and probably is one of the
earliest industries to have deployed the IoT at its service. We happen to see Fit Bits, heart
rate monitors and smartwatches everywhere these days.One of the lesser-known
wearables includes the Guardian glucose monitoring device. The device is developed to
aid people suffering from diabetes. It detects glucose levels in the body, using a tiny
electrode called glucose sensor placed under the skin and relays the information via
Radio Frequency to a monitoring device.

2. Smart Home Applications:-


When we talk about IoT Applications, Smart Homes are probably the first thing that we
thinkof. The best example I can think of here is Jarvis, the AI home automation
employed by Mark Zuckerberg. There is also Allen Pan’s Home Automation System
where functions in the house are actuated by use of a string of musical notes. The
following video could give you a better idea.

3. Health Care:-
IoT applications can turn reactive medical-based systems into proactive wellness-based
systems.The resources that current medical research uses, lack critical real-world
information.
It mostly uses leftover data, controlled environments, and volunteers for medical
examination. IoT opens ways to a sea of valuable data through analysis, real-time field
data, and testing. The Internet of Things also improves the current devices in power,
precision, and availability. IoT focuses on creating systems rather than just equipment.

1.9 EMBEDDED IOT

It is essential to know about the embedded devices while learning the IoT or building
the projects on IoT. The embedded devices are the objects that build the unique
computing system. These systems may or may not connect to the Internet.
An embedded device system generally runs as a single application. However, these
devices can connect through the internet connection, and able communicate through
othernetwork devices.
The embedded system software can be as simple as lighting controls running using
an 8- bit microcontroller. It can also be complicated software for missiles, process
control systems, airplanes etc.








7
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM


Fig 1.9 Embedded IoT

1.10 Embedded System Hardware

The embedded system can be of type microcontroller or type microprocessor. Both of


thesetypes contain an integrated circuit (IC).

The essential component of the embedded system is a RISC family microcontroller


like Motorola 68HC11, PIC 16F84, Atmel 8051 and many more. The most important
factor that differentiates these microcontrollers with the microprocessor like 8085 is their
internal read and writable memory. The essential embedded device components and
system architectureare specified below.

An embedded system is a microprocessor-based computer hardware system with


software that is designed to perform a dedicated function, either as an independent
system or as a part of a large system. At the core is an integrated circuit designed to carry
out computationfor real-time operations.

8
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 1.10 Embedded Hardware

Embedded System Software


The embedded system that uses the devices for the operating system is based on the
language platform, mainly where the real-time operation would be performed.
Manufacturers build embedded software in electronics, e.g., cars, telephones, modems,
appliances, etc.

The embedded system software can be as simple as lighting controls running using
an 8-bit microcontroller. It can also be complicated software for missiles, process
control systems, airplanes etc.

Difference Between IoT and Embedded Systems


The term “embedded systems” is usually used to describe the devices or machines that
operate with minimum or no human supervision. Probably any device that runs software
can be called an embedded system to some extent. Think of your dishwasher, microwave,
washing machine, or oven: these devices arrive with a computer board that is pre-
programmed and requires no updating.

Embedded systems are a subset of the Internet of Things (IoT), an integration of


devices connected to the internet. Small software programs that implement a few
functions tend to be embedded systems. The IoT is a process in which objects are
equipped with sensors, processors for the hardware development, software systems,
protocols and web APIs, which together create a connected environment of embedded
systems.
9
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

The term “embedded systems” is usually used to describe the devices or machines
that operate with minimum or no human supervision. Probably any device that runs
software can be called an embedded system to some extent. Think of your dishwasher,
microwave, washing machine, or oven: these devices arrive with a computer board that
is pre-programmed and requires no updating.
Embedded systems are a subset of the Internet of Things (IoT), an integration of
devices connected to the internet. Small software programs that implement a few
functions tend to be embedded systems. The IoT is a process in which objects are
equipped with sensors, processors for the hardware development, software systems,
protocols and web APIs, which together create a connected environment of embedded
systems.

With the advancement of wireless communication, the devices will be able to


connect to each other seamlessly. The future of IoT and embedded systems depends on
the improvement of the technologies for faster communication with high intertwined
connections between devices.

IoT is getting more and more popular in our daily lives, so this technology’s
advancement is inevitable and can be definitely expected to continue. This can pose
some problems with privacy and security, which will require new solutions and
improvements of the system securityof internet-connected embedded systems.

The growth potential for the embedded industry is enormous. And the path forward
is becoming clearer every day. It’s time that we start building IoT systems, and provide
value to our customers.The Internet of Things (IoT) is no longer a fanciful vision. It is
very much withus, in everything from factory automation to on-demand entertainment.

IoT software solutions have largely had to be built from scratch with a high degree
of customization to specific requirements, which has driven up the cost and complexity
of development and deterred many prospective entrants to the market.
What have been missing are developer tools that alleviate the costs associated with
building the foundational infrastructure—the “plumbing” of their solutions—so they can
focus on optimizing the core functionality and bring solutions to market more quickly
with less cost. Benison Technologies is addressing these challenges with new solutions
that have the potentialto expand the market for IoT by reducing the cost and complexity
of development.

1.11 SENSOR AND ITS SPECIFICATIONS


A sensor is a device which receives and responds to a signal. a sensor is a converter that
measures a physical quantity and converts it into a signal which can be read by an
observer or by an instrument (mostly electronic). In the broadest definition, a sensor is a
device, module, machine, or subsystem that detects events or changes in its environment
and sends the information to other electronics, frequently a computer processor.
Sensors are always used with other electronics.Sensors are used in everyday objects
such as touch-sensitive elevator buttons (tactile sensor) and lamps which dim or

10
Department of ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

brighten by touching the base, and in innumerable applications of which most people are
never aware. With advances in micro machinery and easy-To use micro controller
platforms, the uses of sensors have expanded beyond the traditional fields of
temperature, pressure and flow measurement.
A sensor's sensitivity indicates how much its output changes when the input quantity
it measures changes. For instance, if the mercury in a thermometer moves 1 cm when
the temperature changes by 1 °C, its sensitivity is 1 cm/°C (it is basically the slope
assuming alinear characteristic). Some sensors can also affect what they measure; for
instance, a room temperature thermometer inserted into a hot cup of liquid cools the
liquid while the liquid heats the thermometer. Sensors are usually designed to have a
small effect on what is measured; making the sensor smaller often improves this and
may introduce other advantages.
Specifications of sensor:

 ACCURACY: Error between the result of a measurement and true


value being measured.

 RESOLUTION: The smallest increment of value that a device can make.


 SENSITIVITY: The ratio between the change in output signal to a small
change ininput physical signal. 

PRECISION: The ability of sensor to output the same value for same input over a
number of trials

11
Department of ECE,NNRESGI
CHAPTER 2
DESCRIPTION ABOUT CIRCUIT
COMPONENTS
FLOOD MONITORING AND ALERTING SYSTEM


DESCRIPTION ABOUT CIRCUIT COMPONENTS

The various components used in the construction of the circuit are

2.1 ARDUINO UNO

Fig 2.1(a) Arduino UNO

The Arduino UNO is a standard board of Arduino. Here UNO means 'one' in Italian. It
was named as UNO to label the first release of Arduino Software. It was also the first
USB board released by Arduino. It is considered as the powerful board used in various
projects. Arduino.cc developed the Arduino UNO board.Arduino UNO is
based on an ATmega328P microcontroller.

It is easy to use compared to other boards, such as the Arduino Mega board, etc. The
board consists of digital and analog Input/Output pins (I/O), shields, and other
circuits.The Arduino UNO includes 6 analog pin inputs, 14 digital pins, a connector, a
power jack, and an ICSP (In- Circuit Serial Programming) header. It is programmed
based on IDE, which stands for Integrated Development Environment. It ca n run on
both online and offline platforms.

12
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 2.1(b) pin description of Arduino

ATmega328 Microcontroller- It is a single chip Microcontroller of the ATmel


family. The processor code inside it is of 8-bit. It combines Memory (SRAM,
EEPROM, and Flash), Analog to Digital Converter, SPI serial ports, I/O lines, registers,
timer, external and internal interrupts, and oscillator.
ICSP pin - The In-Circuit Serial Programming pin allows the user to program using
the firmware of the Arduino board.
Power LED Indicator- The ON status of LED shows the power is activated. When
the power is OFF, the LED will not light up.
Digital I/O pins- The digital pins have the value HIGH or LOW. The pins numbered
from D0 to D13 are digital pins.
TX and RX LED's- The successful flow of data is represented by the lighting of
these LED's.
AREF- The Analog Reference (AREF) pin is used to feed a reference voltage to the
Arduino UNO board from the external power supply.
Reset button- It is used to add a Reset button to the connection.

13
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

USB- It allows the board to connect to the computer. It is essential for the
programming of the Arduino UNO board.
Crystal Oscillator- The Crystal oscillator has a frequency of 16MHz, which makes
the Arduino UNO a powerful board.
Voltage Regulator- The voltage regulator converts the input voltage to 5V.
GND- Ground pins. The ground pin acts as a pin with zero voltage.
Vin- It is the input voltage.
Analog Pins- The pins numbered from A0 to A5 are analog pins. The function of
Analog pins is to read the analog sensor used in the connection. It can also act as GPIO
(General Purpose Input Output) pins.

Why is Arduino recommended over other boards for beginners?


The USB port in the Arduino board is used to connect the board to the computer using the
USBcable. The cable acts as a serial port and as the power supply to interface the board.
Such dualfunctioning makes it unique to recommend and easy to use for beginners.
What is the main difference between Arduino UNO and Arduino
Mega? The Arduino UNO is a standard board recommended to beginners, while
Arduino Mega is usedfor complex projects due to its greater memory space.
Memory:-
The memory structure is shown in the below image:

Fig 2.1© Memory of Arduino

The preinstalled flash has a bootloader, which takes the memory of 0.5 Kb.Here,
SRAM stands for Static Random Access Memory, and EEPROM stands for
Electrically ErasableProgrammable Read-Only Memory.

14
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Technical Specifications of Arduino UNO


The technical specifications of the Arduino UNO are listed below:

There are 20 Input/Output pins present on the Arduino UNO board. These 20 pis
include 6 PWM pins, 6 analog pins, and 8 digital I/O pins.
The PWM pins are Pulse Width Modulation capable pins.
The crystal oscillator present in Arduino UNO comes with a frequency of 16MHz.
It also has a Arduino integrated WiFi module. Such Arduino UNO board is based on
the Integrated WiFi ESP8266 Module and ATmega328P microcontroller.
The input voltage of the UNO board varies from 7V to 20V.
Arduino UNO automatically draws power from the external power supply. It can also
draw power from the USB.

How to get started with Arduino UNO?


We can program the Arduino UNO using the Arduino IDE. The Arduino IDE is the
Integral Development program, which is common to all the boards.
We can also use Arduino Web Editor, which allows us to upload sketches and write the
code from our web browser (Google Chrome recommended) to any Arduino Board. It is
an online platform.
The USB connection is essential to connect the computer with the board. After the
connection, the PWR pins will light in green. It is a green power LED.
The steps to get started with Arduino UNO are listed below:As soon we connect the
board to the computer, Windows from XP to 10 will automatically install the board
drivers. But, if you have expanded or downloaded the zip package, follow the below steps:

Click on Start -> Control Panel -> System and Security.


Click on System -> Device Manager -> Ports (COM &LPT) ->
ArduinoUNO (COMxx). If the COM &LPT is absent, look Other Devices -> Unknown
Device.
Right-click to Arduino UNO (COmxx) -> Update Driver Software -> Browse my
computer for driver software.
Select the file "inf" to navigate else, select "ArduinoUNO.inf" .
Installation Finished.
Open the code or sketch written in the Arduino software.
Select the type of board.
Click on 'Tools' and select Board, as shown below:

15
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 2.1(d)Selecting Ardunio

Select the port. Click on the Tools -> Port (select the port). The port likely will be
COM3 or higher. For example, COM6, etc. The COM1 and COM2 ports will not
appear, because these two ports are reserved for the hardware serial ports.
Now, upload and run the written code or sketch.

To upload and run, click on the button present on the top panel of the Arduino
display, asshown below:

Fig 2.1(e) Upload button

Within the few seconds after the compile and run of code or sketch, the RX and TX
light present on the Arduino board will flash.
The 'Done Uploading' message will appear after the code is successfully
uploaded. The message will be visible in the status bar.

Arduino UNO Pinout:-


The Arduino UNO is a standard board of Arduino, which is based onan
ATmega328P microcontroller. It is easier to use than other types of Arduino Boards.

The Arduino UNO Board, with the specification of pins, is shown below:

16
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 2.1(f) Arduino in detail

Let's discuss each pin in detail.

ATmega328 Microcontroller- It is a single chip Microcontroller of the ATmel


family. The processor core inside it is of 8-bit. It is a low-cost, low powered, and a
simple microcontroller.
The Arduino Uno and Nano models are based on the ATmega328 Microcontroller.
Voltage Regulator:-The voltage regulator converts the input voltage to 5V. The
primary function of voltage regulator is to regulate the voltage level in the Arduino
Board.
For any changes in the input voltage of the regulator, the output voltage is constant and
steady.
GND:- Ground pins. The ground pins are used to ground the circuit.
TXD and RXD:-TXD and RXD pins are used for serial communication. The TXD
is used for transmitting the data, and RXD is used for receiving the data. It also
represents the successful flow of data.

17
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

USB INTERFACE:-The USB Interface is used to plug-in the USB cable. It


allows the board to connect to the computer. It is essential for the programming of
the Arduino UNO board.
RESET:-It is used to add a Reset button to the connection.
SCK:-It stands for Serial Clock. These are the clock pulses, which are used to synchronize
thetransmission of data.
MISO:-It stands for Master Input/ Slave Output. The save line in the MISO pin is used
to send the data to the master.
VCC:-It is the modulated DC supply voltage, which is used to regulate the IC's used in
the connection. It is also called as the primary voltage for IC's present on the Arduino
board. TheVcc voltage value can be negative or positive with respect to the GND pin.
Crystal Oscillator- The Crystal oscillator has a frequency of 16MHz, which makes
theArduino UNO a powerful board.
ICSP:-It stands for In-Circuit Serial Programming. The users can program the Arduino
board's firmware using the ICSP pins.The program or firmware with the advanced
functionalities is received by microcontroller with the help of the ICSP header.

The ICSP header consists of 6 pins.The structure of the ICSP header is shown below

Fig 2.1(g) ICSP Header

It is the top view of the ICSP header.

SDA:-It stands for Serial Data. It is a line used by the slave and master to send and
receivedata. It is called as a data line, while SCL is called as a clock line.
SCL:-It stands for Serial Clock. It is defined as the line that carries the clock data. It
is used to synchronize the transfer of data between the two devices. The Serial Clock is
generated bythe device and it is called as master.
SPI:-It stands for Serial Peripheral Interface. It is popularly used by the
microcontrollers to communicate with one or more peripheral devices quickly. It uses
conductors for data receiving, data sending, synchronization, and device selection (for
communication).

18
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

MOSI:-It stands for Master Output/ Slave Input.The MOSI and SCK are driven by
theMaster.
SS:-It stands for Slave Select. It is the Slave Select line, which is used by the master.
It actsas the enable line.
I2C:-It is the two-wire serial communication protocol. It stands for Inter Integrated
Circuits. The I2C is a serial communication protocol that uses SCL(Serial Clock) and
SDA (Serial Data) to receive and send data between two devices.3.3V and 5V are the
operating voltages of the board.

2.2 SIM 900A GSM MODULE

Fig 2.2(a) GSM Module

19
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Digital cellular technology like GSM (Global System for Mobile Communication) is
used to transmit mobile data as well as voice services. This concept was implemented
at Bell Laboratories using a mobile radio system in 1970.
As the name suggests, it is the standardization group name that was established in
the year1982 to make a general European mobile telephone standard. This technology
owns above 70% of the market share of the digital cellular subscriber around the
world. This technology was developed by using digital technology.
At present, GSM technology supports above 1 billion mobile subscribers around the
world in the above 210 countries. This technology provides voice and data services
from fundamentalto complex. This article discusses an overview of GSM technology.

What is GSM Technology?


GSM is a mobile communication modem; it stands for global system for mobile
communication (GSM). The idea of GSM was developed at Bell Laboratories in 1970.
It is a widely used mobile communication system in the world. GSM is an open and
digital cellular technology used for transmitting mobile voice and data services operate
at the 850MHz, 900MHz, 1800MHz, and 1900MHz frequency bands.
GSM technology was developed as a digital system using the time division multiple
access (TDMA) technique for communication purposes. A GSM digitizes and reduces
the data, then sends it down through a channel with two different streams of client data,
each in its own particular time slot.
The digital system has the ability to carry 64 kbps to 120 Mbps of data rates.There
are various cell sizes in a GSM system such as macro, micro, pico, and umbrella cells.
Each cell varies asper the implementation domain. There are five different cell sizes in a
GSM network macro, micro, pico, and umbrella cells. The coverage area of each cell
varies according to the implementation environment.
The time division multiple access (TDMA) technique relies on assigning different
time slots to each user on the same frequency. It can easily adapt to data transmission
and voice communication and can carry 64kbps to 120Mbps of data rate.

GSM Technology Architecture

The main elements in the GSM architecture include the following.

Fig 2.2(b) GSM technology Architecture

20
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Network and Switching Subsystem (NSS)


Base-Station Subsystem (BSS)
The mobile station (MS)
Operation and Support Subsystem (OSS)

Network Switching Subsystem (NSS)


In GSM system architecture, it includes different elements, which are frequently known
as the core system/network. Here, it is basically a data network including a variety of
units to provide the major control as well as interfacing of the entire mobile network
system. The core networkincludes the major elements which are discussed below.
Mobile Switching Centre (MSC)
The Mobile Switching Centre or MSC is the key element in the core network region of
the GSM network architecture. This mobile services switching center works like a
standard switching node in an ISDN otherwise PSTN, however, it also gives extra
functionality to allow the mobile user necessities to be supported like authentication,
registration, inter-MSC handovers call location & routing of the call to a cell phone
subscriber.
And, it also provides an edge toward the public switched telephone network so that
the phone calls can be connected from the network of the mobile to a phone to a
landline. Interfaces to other mobile switching center server are provided to allow mobile
calls to be made to mobilesover dissimilar networks.
Home Location Register (HLR)
This HLR database includes the information regarding the administrative like every
subscriber with their previous identified location. Like this, the GSM network is capable
to connect the calls to the related base station for the mobile switch.
Once an operator turns ON his/her phone, and then the phone registers through the
network so that it is probable to decide which base transceiver station is communicating
so that incoming calls can be connected properly.Even once the mobile is switched on,
but not active then it again registers to make sure that the HLR network is responsive to
its most recent location. There is one HLR for each network, even though it may be
dispersed across a variety of sub- centers for operational causes.
Visitor Location Register (VLR)
The VLR includes preferred information that is received from the HLR network to
allow the preferred services for the separate subscriber. The visitor location register can
be executed like a separate unit; however, it is usually realized like an essential element
of the MSC, before an individual unit. Thus, access is finished quicker & more
convenient.
Equipment Identity Register (EIR)
The EIR (Equipment Identity Register) is the unit that makes a decision whether
specified mobile gear may be permitted over the network. Every mobile gear
includes a number identified like the IMEI or International Mobile Equipment Identity.
So, this IMEI number is fixed within the mobile equipment & is verified through the
network while registration. It mainly depends on the information that is held within the
EIR, and the mobile device may be assigned one of 3 conditions which allowed over the
network, barred access, otherwise watched in case its problems.

21
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Authentication Centre (AuC)


The AuC (authentication center) is a protected file that includes the secret key in the
SIM card of the user. The AuC is mainly used for verification & for coding on the
radio channel. Gateway Mobile Switching Centre (GMSC)
Primarily connected without any information about the MS’s place. The GMSC obtains
the Mobile Station Roaming Number (MSRN) from the MSISDN based on HLR &
connecting the call toward the exact visited MSC. The “MSC” division of the name
GMSC is confusing as thegateway The GMSC/ Gateway Mobile Switching Centre is the
end to which a ME finishing call is process does not need any linking toward an MSC.
SMS Gateway (SMS-G)
The SMS gateway or SMS-G is used jointly to explain two SMS-Gateways in the GSM
standards.
These gateways control messages which are directed in dissimilar ways.The Short
Message Service Gateway Mobile Switching Centre (SMS-GMSC) is used for short
messages which arebeing transmitted to an ME.
The Short Message Service Inter-Working Mobile Switching Centre (SMS-IWMSC) is
used for short messages created through a mobile network. The main role of SMS-
GMSC is related to GMSC, but the SMS-IWMSC offers a permanent access end to the
SMS Centre.These units were the major ones that are used in the network of GSM
technology.
They were normally co-located, however frequently the overall middle network was
transmitted around the country wherever the network was situated. In case of
malfunction, it will give some flexibility.
Base Station Subsystem (BSS)
It acts as an interface between the mobile station and the network subsystem. It consists
of the Base Transceiver Station which contains the radio transceivers and handles the
protocols for communication with mobiles. It also consists of the Base Station Controller
which controls the Base Transceiver station and acts as an interface between the mobile
station and mobile switching center.
The network subsystem provides the basic network connection to the mobile stations.
The basic part of the Network Subsystem is the Mobile Service Switching Centre which
provides access to different networks like ISDN, PSTN, etc. It also consists of the Home
Location Register and the Visitor Location Register which provides the call routing and
roaming capabilities of GSM. It also contains the Equipment Identity Register which
maintains an account of all the mobile equipment wherein each mobile is identified by
its own IMEI number. IMEI stands for International Mobile Equipment Identity.
The BSS or Base Station Subsystem section of the second generation GSM network
architecture is basically connected with the mobiles over the network. This subsystem
includestwo elements which are discussed below.
Base Transceiver Station (BTS)
The BTS (Base Transceiver Station) which is utilized within a GSM network includes
the radio Tx, Rx & their related antennas to transmit, receive & directly converse
through the mobiles. This station is the important element for every cell and it
converses with the mobiles & the interface among the two is identified like the Um
interface with related protocols.
Base Station Controller (BSC)
The BSC (base station controller) is used to form the next phase reverse into the GSM
technology. This controller is used to control a collection of base transceiver stations &
it is frequently co-located through one of the transceiver stations within the group. This
controller manages the resources of radio to control different items like handover in the

22
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

collection of BTSs, assigns channels. It converses with the Base Transceiver Stations
over Abis interface.

The subsystem element in the base station of the GSM network uses the radio allowable
technology to allow a number of operators to right to use the system concurrently.
Every channel supports up to 8 operators by allowing a base station to include different
channels; a huge number of operators could be accommodated through every base
station.
These are located carefully through the provider of the network to allow whole area
coverage. This area can be enclosed with a base station that is often being called a cell.
Because it is not achievable to stop the signals from overlapping into the nearby cells
and channels which are used in single-cell are not utilized in the next.

Mobile Station
It is the mobile phone which consists of the transceiver, the display, and the processor
and is controlled by a SIM card operating over the network.
The MS (Mobile stations) or ME (mobile equipment) are most generally identified
through cell otherwise mobile phones which are the part of a GSM mobile
communications n/w that the operator observes & operates. At present, their dimension
has reduced radically whereas the functionality level has very much increased. And one
more benefit is that the time among charges has drastically enlarged. There are different
elements to the mobile phone, though the two essential elements are the hardware & the
SIM.
The hardware includes the major elements of the mobile phone like the case,
display, battery, & the electronics utilized to produce the signal & process the data
receiver to be broadcasted. The mobile station includes a number called the IMEI. This
can be set up on the mobile phonewhile manufacturing & it cannot be modified.
It is accessed by the network during registration to check whether the equipment has
been reported as stolen.
The SIM (Subscriber Identity Module) card includes the data which gives the user
identity toward the network. And also, it includes different information like a number
called the IMSI (International Mobile Subscriber Identity). When this IMSI is used in the
SIM card, the mobile user could simply change mobiles by moving the SIM from one
mobile to another.
So mobile changing is easy without changing the same mobile number means that
people would frequently improve, thus making a further income stream for the
providers of network & serving to enhance the total financial victory of GSM.
Operation and Support Subsystem (OSS)
The operation support subsystem (OSS) is a part of the complete GSM network
architecture. This is connected to the NSS & the BSC components. This OSS is mainly
used to control the GSM network & the BSS traffic load. It should be noted down that
when the number of BS enhances through the subscriber population scaling then some
of the preservation tasks are moved to the base transceiver stations so that the ownership
cost of the system can be reduced. The GSM network architecture of 2G mainly follows
a logical technique of operation. This is very simple as compared with present
architectures of mobile phone network which utilize software-defined units to allow
extremely supple operation. But the architecture of 2G GSM will demonstrate the voice
& operational fundamental functions that are required & how they arranged together.
When the GSM system is digital, then the network is a data network.

23
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Features of GSM Module


The features of the GSM module include the following.

Improved spectrum efficiency


International roaming
Compatibility with integrated services digital network (ISDN)
Support for new services.
SIM phonebook management
Fixed dialing number (FDN)
Real-time clock with alarm management
High-quality speech
Uses encryption to make phone calls more secure
Short message service (SMS)

The security strategies standardized for the GSM system make it the most secure
telecommunications standard currently accessible. Although the confidentiality of a call
and secrecy of the GSM subscriber is just ensured on the radio channel, this is a major
step in achieving end-to-end security.

GSM Modem
A GSM modem is a device that can be either a mobile phone or a modem device that
can be used to make a computer or any other processor communicate over a network. A
GSM modem requires a SIM card to be operated and operates over a network range
subscribed by the network operator. It can be connected to a computer through serial,
USB, or Bluetooth connection.
A GSM modem can also be a standard GSM mobile phone with the appropriate
cable and software driver to connect to a serial port or USB port on your computer.
GSM modem is usually preferable to a GSM mobile phone. The GSM modem has a
wide range of applications in transaction terminals, supply chain management, security
applications, weather stations, andGPRS mode remote data logging.

Working of GSM Module


From the below circuit, a GSM modem duly interfaced to the MC through the level
shifter IC Max232. The SIM card mounted GSM modem upon receiving digit command
by SMS from any cell phone sends that data to the MC through serial communication.
While the program is executed, the GSM modem receives the command ‘STOP’ to
develop an output at the MC, the contact point of which are used to disable the ignition
switch.
The command so sent by the user is based on an intimation received by him through
the GSM modem ‘ALERT’ a programmed message only if the input is driven low. The
complete operation is displayed over a 16×2 LCD display.
The operation support subsystem (OSS) is a part of the complete GSM network
architecture. This is connected to the NSS & the BSC components. This OSS is mainly
used to control the GSM network & the BSS traffic load.
It should be noted down that when the number of BS enhances through the
subscriber population scaling then some of the preservation tasks are moved to the base
transceiver stations so that the ownership cost of the system can be reduced.
The GSM network architecture of 2G mainly follows a logical technique of operation.
This is very simple as compared with present architectures of mobile phone network
which utilize software-defined units to allow extremely supple operation.
24
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

But the architecture of 2G GSM will demonstrate the voice & operational
fundamental functions that are required & how they arranged together. When the GSM
system is digital, then the network is a data network.

Fig 2.2© GSM Circuit

GSM Technology Applications


The applications of GSM technology include the following.

Intelligent GSM Technology for Automation and Security


These days, the GSM mobile terminal has become one of the items that are constantly
with us. Just like our wallet/purse, keys or watch, the GSM mobile terminal provides us
a communication channel that enables us to communicate with the world. The
requirement for aperson to be reachable or to call anyone at any time is very appealing.
This project, as the name says the project is based on GSM network technology for
transmission of SMS from sender to receiver. SMS sending and receiving is used for
ubiquitous access to appliances and allowing breach control at home. The system
proposes two sub- systems. The appliance control subsystem enables the user to control
home appliances remotely and the security alert subsystem gives automatic security
monitoring.
The system is capable enough to instruct users via SMS from a specific cell number
to change the condition of the home appliance according to the user’s needs and
requirements. The second aspect is that of security alert which is achieved in a way that
on the detection of intrusion, thesystem allows automatic generation of SMS.
25
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

GSM technology will allow communication anywhere, anytime, and with anyone. The
functional architecture of GSM employing intelligent networking principles, and its
ideology, which provides the development of GSM is the first step towards a true
personal communication system that enough standardization to ensure compatibility.

GSM Applications in Medical Services


Consider Two Situations like the following

1.A person is critically injured or has fallen ill and needs to be immediately taken care of.
All he or the person accompanying him has is a mobile phone.
2.A patient is discharged from the hospital and thinks of taking rest at his home, but still
has to go to the hospital for regular checkups. He may have a mobile phone and also
some medical sensor devices like health monitoring devices.

In both situations, the only way which can provide a solution is by using the mobile
communication system. In other words, using communication technologies any situation
like the above can be handled just by transmitting the patient details through the
communication network and receiving them and processing them at the receiver section-
either a the healthcarecenter or at the doctor’s home.

The doctor simply monitors the patient details and gives back the instructions to the
person(in the 1st case)so that he can at least take some precautions before finally
reaching the hospital and in the 2nd case monitors the test results of the patient and in case
of any abnormalities, takesthe next step for further treatment.
This whole situation is the telemedicine services. The telemedicine system can be used in
eitherof the three ways.

Using Video conferencing, where patients sitting at one place can have direct
interaction with the health care providers and accordingly carry on the curing process.
By using health monitoring sensors that keep updating about the health of the patient and
accordingly guide the health care providers to carry on the treatment.
By transmitting the acquired medical data and transmit the acquired data forconsultation
and processing.
For the above three ways, a wireless communication technique is used. Medical services
require many ways of getting access to stored resources. These can be medical
databases or online hosts with devices that can help recover and monitor patient health.
Different access options are broadband network, through medium-throughput media and
narrowband through GSM.

The advantages of GSM technology in the telemedicine system include the following.

It is more cost-effective.
GSM receivers are widely available- mobile phones and GSM modems
It has a high data transfer speed.

26
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Basic Telemedicine System


A basic telemedicine System consists of 4 modules:

The Patient Unit: It collects information from the patient, sends it as an analog
signal or converts it to the digital signal, controls the data flow, and transmits the data. It
basically consists of various medical sensors like heartbeat sensor, blood pressure
monitor, skin temperature monitor, spirometry sensor, etc which outputs an electrical
signal and sends these signals to the processor or a controller ( a Microcontroller or a
PC) for further processing of the signals and then transmits the results through a wireless
communication network.
Communication Network: It is used for data security and data transmission. The
GSM technology is used which uses mobile stations, base substations, and network
systems. The mobile station consists of the basic mobile access point or the mobile phone
and links the mobile phones with the GSM network forcommunication.
Receiver Unit/Server Side: It is basically a healthcare system where a GSM
modem is installed which receives and decodes the signals and sends them to the
presentation unit.
Presentation Unit: It is basically the processor that converts the data received into a
well-defined format and stores them so that the doctors can regularly monitor it and any
feedback to the client-side can be sent via SMS from the GSM modem.

A Simple Telemedicine System
A Basic Telemedicine system can be shown in a simplified way. It consists of two
units – The transmitter unit and the receiver unit. The transmitter unit transmits the
sensor input and the receiver unit receives this input to carry on further processing.

2.3. 16*2 LCD DISPLAY

Fig 2.3 16*2 LCD display

27
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

LCD (Liquid Crystal Display) is a type of flat panel display which uses liquid crystals
in its primary form of operation. LEDs have a large and varying set of use cases for
consumers and businesses, as they can be commonly found in smartphones, televisions,
computer monitors and instrument panels.
LCDs were a big leap in terms of the technology they replaced, which include light-
emitting diode (LED) and gas-plasma displays. LCDs allowed displays to be much
thinner than cathode ray tube (CRT) technology. LCDs consume much less power than
LED and gas-display displays because they work on the principle of blocking light
rather than emitting it. Where an LED emits light, the liquid crystals in an LCD produces
an image using a backlight.
As LCDs have replaced older display technologies, LCDs have begun being
replaced by new display technologies such as OLED’s.

How LCDs work


A display is made up of millions of pixels. The quality of a display commonly refers to
the number of pixels; for example, a 4K display is made up of 3840 x2160 or
4096x2160 pixels. A pixel is made up of three subpixels; a red, blue and green—
commonly called RGB. When the subpixels in a pixel change color combinations, a
different color can be produced. With all the pixels on a display working together, the
display can make millions of different colors. When the pixels are rapidly switched on
and off, a picture is created.
The way a pixel is controlled is different in each type of display; CRT, LED, LCD
and newer types of displays all control pixels differently. In short, LCDs are lit by a
backlight, and pixels are switched on and off electronically while using liquid crystals to
rotate polarized light. A polarizing glass filter is placed in front and behind all the
pixels, the front filter is placed at 90 degrees. In between both filters are the liquid
crystals, which can be electronically switched onand off.
LCDs are made with either a passive matrix or an active matrix display grid. The
active matrix LCD is also known as a thin film transistor(TFT) display. The passive
matrix LCD has a grid of conductors with pixels located at each intersection in the grid.
A current is sent across two conductors on the grid to control the light for any pixel.
An active matrix has a transistor located at each pixel intersection, requiring less
current to control the luminance of a pixel. For this reason, the current in an active
matrix display can be switched on and off more frequently, improving the screen refresh
time.
Some passive matrix LCD's have dual scanning, meaning that they scan the grid
twice with current in the same time that it took for one scan in the original technology.
However, active matrix is still a superior technology out of the two.

Types of LCDs
Types of LCDs include:
Twisted Nematic (TN)- which are inexpensive while having high response times.
However, TN displays have low contrast ratios, viewing angles and color contrasts.

In Panel Switching displays (IPS Panels)- which boast much better contrast ratios,
viewing angles and color contrast when compared to TN LCDs.

28
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Vertical Alignment Panels (VA Panels)- which are seen as a medium quality
between TN and IPS displays.

Advanced Fringe Field Switching (AFFS)- which is a top performer compared IPS
displays in color reproduction range.

LCD vs OLED vs QLED


LCDs are now being outpaced by other display technologies, but are not completely left
in the past. Steadily, LCDs have been being replaced by OLEDs, or organic light-
emitting diodes. OLEDs use a single glass or plastic panels, compared to LCDs which
use two. Because an OLED does not need a backlight like an LCD, OLED devices such
as televisions are typically much thinner, and have much deeper blacks, as each pixel in
an OLED display is individually lit.
If the display is mostly black in an LCD screen, but only a small portion needs to be
lit, the whole back panel is still lit, leading to light leakage on the front of the display.
An OLED screen avoids this, along with having better contrast and viewing angles and
less power consumption.
With a plastic panel, an OLED display can be bent and folded over itself and still
operate. This can be seen in smartphones, such as the controversial Galaxy Fold; or in
the iPhone X, which will bend the bottom of the display over itself so the display’s ribbon
cable can reach in towards the phone, eliminating the need for a bottom bezel.However,
OLED displays tend to be more expensive and can suffer from burn-in, as plasma-based
displays do.
QLED stands for quantum light-emitting diode and quantum dot LED. QLED
displays were developed by Samsung and can be found in newer televisions. QLEDs
work most similarly to LCDs, and can still be considered as a type of LCD. QLEDs add
a layer of quantum dot film to an LCD, which increases the color and brightness
dramatically compared to other LCDs. The quantum dot film is made up of small crystal
semi-conductor particles. The crystal semi- conductor particles can be controlled for
their color output.When deciding between a QLED and an OLED display, QLEDs have
much more brightness and aren’t affected by burn-in. However, OLED displays still
have a better contrast ratio and deeper blacks than QLEDs.

An LCD (Liquid Crystal Display) screen is an electronic display module and has a
wide range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. A 16x2 LCD means it can display 16
characters per line and there are 2 such lines. In this LCD each character is displayed in
5x7 pixel matrix. The 16 x 2 intelligent alphanumeric dot matrix display is capable of
displaying 224 different characters and symbols. This LCD has two registers, namely,
Command and Data.Command register stores various commands given to the display.

Data register stores data to be displayed. The process of controlling the display
involves putting the data that form the image of what you want to display into the data
registers, then putting instructions in the instruction register.

In your arduino project Liquid Crystal Display simplifies this for you so you don't
need to know the low-levellinstructions. Contrast of the display can be adjusted by
adjusting the potentiometer to be connected across VEE pin.

29
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

2.4 WATER FLOW SENSOR

Fig 2.4 Water flow sensor

Sensors play a very crucial role in today’s automatic systems. Being a small, low cost
and reliable device, sensors are easy to embed with larger electronics. Today we can
find various types of sensors in the market.
With the advance in technology, sensors are also evolved in their functioning and
size. From the early size of cm units, size of sensors has shrunk to the scale of nm.
Sensors have also solved many challenges of electronic and electrical engineering such
as finding the intensity of ambient light, determining the temperature in the furnace,
calculating humidity of surrounding, etc…. Water flow sensor gives an amazing solution
for measuring the flow rate of liquids.

30
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

What is Water Flow Sensor?


Huge industrial plants, commercial and residential buildings require a large amount of
water supply. The public water supply system is used to meet this requirement. To
monitor the amount of water being supplied and used, the rate of flow of water has to be
measured. Water flow sensors are used for this purpose.

Water flow sensors are installed at the water source or pipes to measure the rate
of flow ofwater and calculate the amount of water flowed through the pipe. Rate of
flow of water is measured as liters per hour or cubic meters.

Working Principle
Water flow sensor consists of a plastic valve from which water can pass. A water rotor
along with a hall effect sensor is present the sense and measure the water flow.
When water flows through the valve it rotates the rotor. By this, the change can be
observed in the speed of the motor. This change is calculated as output as a pulse signal
by the hall effect sensor. Thus, the rate of flow of water can be measured.
The main working principle behind the working of this sensor is the Hall effect.
According to this principle, in this sensor, a voltage difference is induced in the
conductor due to the rotationof the rotor. This induced voltage difference is transverse to
the electric current.
When the moving fan is rotated due to the flow of water, it rotates the rotor which
induces the voltage. This induced voltage is measured by the hall effect sensor and
displayed on the LCDdisplay.
The water flow sensor can be used with hot waters, cold waters, warm waters, clean
water, and dirty water also. These sensors are available in different diameters, with
different flow rate ranges.
These sensors can be easily interfaced with microcontrollers like Arduino. For this, an
Arduino microcontroller board for processing, a Hall effect water flow sensor, a 16×2
LCD display, and Breadboard connecting wires are required. The sensor is placed at the
water source inlet or at the opening of the pipe.
The sensor contains three wires. Red wire to connect with supply voltage. Black wire
to connect to ground and a yellow wire to collect output from Hall effect sensor. For
supply voltage 5V to 18V of DC is required.
Applications of Water Flow Sensor
Water flow sensors can measure the rate of flow of water either by measuring velocity
or displacement. These sensors can also measure the flow of water like fluids such as
measuring milk in a dairy industry etc…
There are various types of water flow sensors available based on their diameter and
method of measuring. A cost-effective and most commonly used water flow sensor is
Paddlewheel sensor.It can be used with water-like fluids.
For the type of applications where a straight pipe is not available for inlet, Positive
displacement flow meter is used. This type of water flow sensor can be used for viscous
liquidsalso.
For working with dirty water and wastewater which may be conductive, Magnetic
flow meter is used. For applications such as sewage water, slurries, and other dirty
liquids Ultrasonic flow meters are used.

31
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Example of Water Flow Sensor

YFS201 Hall effect sensor is an example of this sensor. These sensors also require a
display to display the measurements. This sensor outputs 4-5 pulses for every liter of
liquid flowing through it per minute. It has a working flow rate of 1-30liters per minute.

2.5 HEAT SINKS

Fig 2.5 Heat sink

Heat Sinks are one of the most common forms of thermal management in technology,
machinery, and even in natural systems. These components are so ubiquitous that
they're easy to overlook, even by those who are familiar with the technology. We'll
address the basic working principles involved in heat sinks, introduce active and
passive heat sinkconfigurations, and discuss how some users implement heat sinks in
their applications.

What is a Heat Sink?


A heat sink is a component that increases the heat flow away from a hot device. It
accomplishes this task by increasing the device's working surface area and the
amount of low-temperature fluid that moves across its enlarged surface area. Based
on each device's configuration, we find a multitude of heat sink aesthetics, design, and
ultimate capabilities. You can see a straight fin heat sink in the image at the top of
this article and a flared fin heat sink in the image below. Each heat sink is valuable
in applications that may have varying.
How Does a Heat Sink Work?
A heat sink works by moving heat away from a critical component. Nearly all heat
sinks accomplish this task in four basic steps:
1. The source generates heat
This source may be any system that creates heat and requires the removal of
said heat to function correctly, such as:

- Mechanical

- Electrical

32
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

- Chemical

- Nuclear

- Solar

- Friction

2. Heat transfers away from the source


Heat pipes can also aid in this process. In direct heat sink-contact applications,
heat moves into the heat sink and away from the source via natural conduction. The
heat sink material's thermal conductivity directly impacts this process. That's why
high thermal conductivity materials such as copper and aluminum are most common in
the construction of heat sinks.

3. Heat distributes throughout the heat sink


Heat will naturally travel through the heat sink via natural conduction
moving across the thermal gradient from a high temperature to a low-temperature
environment. This ultimately means that the heat sink's thermal profile will not be
consistent. As such, heat sinks will often be hotter towards the source and cooler
towards the sink's extremities.

4. Heat moves away from the heat sink

This process relies on the heat sink's temperature gradient and its working
fluid―most commonly air or a non-electrically- conductive liquid. The working fluid
passes across the surface of the warm heat sink and utilizes thermal diffusion and
convection to remove heat away from the surface and into the ambient environment.
This stage relies on, yet again, a temperature gradient to remove heat from the
heat sink. Therefore, if the ambient temperature is not cooler than the heat sink, no
convection and subsequent heat removal will occur. This step is also where the total
surface area of the heat sink becomes most advantageous. A large surface area
provides an increased area for thermal diffusion and convection to occur.

Active Heat Sinks vs. Passive Heat Sinks


Heat sinks are most commonly utilized in active, passive
or hybrid configurations.Passive heat sinks rely on natural convection, meaning the
buoyancy of hot air alone causes the airflow generated across the heat sink system.
These systems are advantageous as they do not require secondary power or control
systems to remove heat from the system. However, passive heat sinks are less
effective at transferring heat from a system than active heat sinks.

Active heat sinks

Utilize forced air to increase fluid flow across the hot area. Forced air is most
commonly generated by a fan,blower or even movement of the entire object―such as a
motorcycle's engine being cooled by the air passing along the heat sink fins designed
into the engine. One example of a fan producing forced air across a heat sink is the
33
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

fan in your personal computer turning on after your computer gets warm. The fan
forces air across the heat sink, which allows more unheated air to move across the
heat sink surface, thus increasing the total thermal gradient across the heat sink
system and allowing more heat to exit the overall system.

Hybrid heat sinks


Combine some aspects of passive and active heat sinks. These configurations are
less common, and they often rely on control systems to cool the system based on
temperature requirements. When the system operates at cooler levels, the forced air
source is inactive, only cooling the system passively. Once the source reaches higher
temperatures, the active cooling mechanism engages to increase the cooling
capacity of the heat sink system.

Popular Heat Sinks

As we mentioned, heat sinks are most commonly found in CPUs in computers.


For example, the Jeston nano has a large heat sink to assist in cooling the onboard
Quad-core ARM A57 CPU and 128-core NVIDIA Maxwell GPU, both of which
create ample amounts of heat and require exceptional cooling to avoid thermal
throttling. Similarly, Raspberry Pi microcontrollers have a built-in heat dissipator,
which they use in conjunction with a heat sink to increase the onboard Broadcom
chip's performance.

You can find stock heat sinks to cool most common chip sizes. Some heat sinks are
custom designed to handle a specific chip or device's thermal loads best.

2.6 RELAY MODULE

Fig 2.6 Relay module

We use relays for a wide range of applications such as home automation, cars and bikes
(automobiles), industrial applications, DIY Projects, test and measurement equipment,
and many more.
34
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

What is a Relay?

A Relay is a simple electromechanical switch. While we use normal switches to close or


open a circuit manually, a Relay is also a switch that connects or disconnects two
circuits. But instead of a manual operation, a relay uses an electrical signal to control an
electromagnet, which in turn connects or disconnects another circuit.’

Relays can be of different types like electromechanical, solid state.


Electromechanical relays are frequently used. Let us see the internal parts of this relay
before knowing about it working. Although many different types of relay were present,
their working is same.

Every electromechanical relay consists of an:


Mechanically movable contact switching points.

Electromagnet is constructed by wounding a copper coil on a metal core. The two


ends of the coil are connected to two pins of the relay as shown. These two are used as
DC supply pins.Generally two more contacts will be present, called as switching points
to connect high ampere load.
Another contact called common contact is present in order to connect the switching
points.These contacts are named as normally open (NO),normally closed(NC) and
common(COM) contacts.We can use a Relay either in a AC circuit or a DC Circuit.
In case of AC relays, for every current zero position, the relay coil gets demagnetized and
hence there would be a chance of continues breaking of the circuit.So, AC relays are
constructed withspecial mechanism such that continuous magnetism is provided in order
to avoid above problem. Such mechanisms include electronic circuit arrangement or
shaded coil mechanism.

How a Relay Works?

Relay works on the principle of electromagnetic induction.


When the electromagnet is applied with some current, it induces a magnetic field
around it. Above image shows working of the relay. A switch is used to apply DC
current to the load. In the relay, Copper coil and the iron core acts as electromagnet.
When the coil is applied with DC current, it starts attracting the contact as shown. This is
calledenergizing of relay.
When the supply is removed it retrieves back to the original position. This is
called Deenergizing of relay.
There are also such relays, whose contacts are initially closed and opened when there is
supplyi.e. exactly to opposite to the above shown relay.Solid state relays will have
sensing elementto sense the input voltage and switches the output using opto-coupling.

Relay Contact Types


As we have seen that relay is a switch. The terminology “Poles and throws” is also
applicable for relay. Depending on the number of contacts and number of circuits it
switches relays can be classified.Before we know about this classification of contacts
we have to know the poles and throws of a relay switch.
35
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Poles and Throws

Relays can switch one or more circuits. Each switch in relay is referred as pole.
Number of circuits a relay connects is indicated by throws.Depending on the poles and
throws, relays areclassified into
-Single Pole Single Throw
-Single Pole Double Throw
-Double Pole Single Throw
-Double Pole Double Throw

Single Pole Single Throw


A single pole single throw relay can control one circuit and can be connected to one
output. Itis used for the applications which require only ON or OFF state.
Single Pole Double Throw
A single pole double throw relay connects one input circuit to one of the two
outputs. This relay is also called as changeover relay.Though the SPDT has two output
positions, it may consist of more than two throws depends on the configuration and
requirement of the application.
Double pole single throw
A double pole single throw relay has two poles and single throw and it can be used
to connect two terminals of a single circuit at a time. For example, this relay is used for
connecting both phase and neutral terminals to the load at a time.
Double pole double throw
A DPDT (double pole double throw) relay has two poles and two throws for each
pole. In motor direction control, these are used for phase or polarity reversal.
The switching action between contacts for all these relays is performed when the coil
get energized.

Types of Relays
Relays can be classified into different types depending on their functionality,
structure, application etc. We listed out some of the common types of relays here.
-Electromagnetic
-Latching
-Electronic
-Non-Latching
-Reed
-High-Voltage
-Small Signal
-Time Delay
-Multi-Dimensional
-Thermal
-Differential
-Distance
-Automotive
-Frequency
-Polarized
-Rotary
36
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

-Sequence
-Moving Coil
-Buchholz
-Safety
-Supervision
-Ground Fault
We made a dedicated guide on different types of relays. To learn more about different
types ofrelays, read Classification of Relays.

Relay Applications
Relays are used to protect the electrical system and to minimize the damage to the
equipment connected in the system due to over currents/voltages. The relay is used for
the purpose of protection of the equipment connected with it.
These are used to control the high voltage circuit with low voltage signal in
applications audio amplifiers and some types of modems.
These are used to control a high current circuit by a low current signal in the
applications like starter solenoid in automobile. These can detect and isolate the faults
that occurred in power transmission and distribution system.

Typical application areas of the relays include


-Lighting control systems
-Telecommunication
-Industrial process controllers
-Traffic control
-Motor drives control
-Protection systems of electrical power system
-Computer interfaces
-Automotive
-Home appliances

How to Test a Relay?


Since they are electromechanical devices, relays can wear out eventually and
stop working over time. But there are few techniques to test if a relay is working or
not. These techniques include: Testing a Relay with a Multimeter.

2.7 BUZZER

Fig 2.7(a) Buzzer


37
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

There are many ways to communicate between the user and a product. One of the best
ways is audio communication using a buzzer IC. So during the design process,
understanding some technologies with configurations is very helpful. So, this article
discusses an overview of an audio signaling device like a beeper or a buzzer working
with applications.

What is a Buzzer?
An audio signaling device like a beeper or buzzer may be electromechanical or
piezoelectric or mechanical type. The main function of this is to convert the signal from
audio to sound. Generally, it is powered through DC voltage and used in timers, alarm
devices, printers, alarms, computers, etc. Based on the various designs, it can generate
different sounds like alarm, music, bell & siren.
The pin configuration of the buzzer is shown below. It includes two pins namely
positive and negative. The positive terminal of this is represented with the ‘+’ symbol or
a longer terminal. This terminal is powered through 6Volts whereas the negative
terminal is represented with the ‘-‘symbol or short terminal and it is connected to the
GND terminal.

History:-
The history of an electromechanical buzzer and piezoelectric is discussed below.

Electromechanical
This buzzer was launched in the year 1831 by an American Scientist namely Joseph
Henry but, this was used in doorbells until they were eliminated in 1930 in support of
musical bells, whichhad a smooth tone.

Piezoelectric
These buzzers were invented by manufacturers of Japanese & fixed into a broad
range of devices during the period of 1970s – 1980s. So, this development primarily
came due to cooperative efforts through the manufacturing companies of Japanese. In
the year 1951, they recognized the Application Research Committee of Barium Titanate
that allows the corporations to be cooperative competitively & bring about numerous
piezoelectric creations.

Specifications
The specifications of the buzzer include the following.
Colour is black
-The frequency range is 3,300Hz
-Operating Temperature ranges from – 20° C to +60°C
-Operating voltage ranges from 3V to 24V DC
-The sound pressure level is 85dBA or 10cm
-The supply current is below 15mA

38
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Types of Buzzer
A buzzer is available in different types which include the following.

-Piezoelectric
-Electromagnetic
-Mechanical
-Electromechanical
-Magnetic

Piezoelectric
As the name suggests, the piezoelectric type uses the piezoelectric ceramic’s
piezoelectric effect & pulse current to make the metal plate vibrate & generate sound.
This kind of buzzer is made with a resonance box, multi resonator, piezoelectric plate,
housing, impedance matcher, etc. Some of the buzzers are also designed with LED’s.
The multi resonator of this mainly includes ICs and transistors. Once the supply is given
to this resonator, it will oscillate and generates an audio signal with 1.5 to 2.kHz. The
impedance matcher will force the piezoelectric plate to produce sound

Electromagnetic
This type of buzzer is made with a magnet, solenoid coil, oscillator, housing,
vibration diaphragm, and magnet. Once the power supply is given, the oscillator which
produces the audio signal current will supply throughout the solenoid coil to generate a
magnetic field.
Sometimes, the vibration diaphragm will vibrate & generates sound under the
magnet & solenoid coil interaction. The frequency range of this ranges from 2 kHz to
4kHz.

Mechanical
These types of buzzers are subtypes of electromagnetic, so the components used in this
type are also similar. But the main difference is that the vibrating buzzer is placed on
the outside instead of the inside.

Electromechanical
The designing of these types of buzzers can be done with a bare metal disc & an
electromagnet. The working principle of this is similar to magnetic and electromagnetic.
It generates sound throughout the disc movement & magnetism.

Magnetic
Like a piezo type, magnetic is also used to generate a sound but they are different due to
core functionality. The magnetic type is more fixed as compared to the piezo type
because they work through a magnetic field.
Magnetic buzzers utilize an electric charge instead of depending on piezo materials to
generate a magnetic field, after that it permits another element of the buzzer to vibrate &
generate sound.
39
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

The applications of magnetic buzzers are similar to the piezo type in household devices,
alarmssuch as watches, clocks & keyboards.

Working Principle

The working principle of a buzzer depends on the theory that, once the voltage is given
acrossa piezoelectric material, then a pressure difference is produced.

A piezo type includes piezo crystals among two conductors.Once a potential


disparity is given across these crystals, then they thrust one conductor & drag the
additional conductor through their internal property. So this continuous action will
produce a sharp sound signal.

Mounting Configurations
The mounting configurations of buzzers include the following.
-Panel Mount
-Wire Leads
-Screw Terminals
-Through Hole
-Spring Contact
-Surface Mount
-Plane surface
How to use a Buzzer?
A buzzer is an efficient component to include the features of sound in our system or
project. It is an extremely small & solid two-pin device thus it can be simply utilized on
breadboard or PCB. So in most applications, this component is widely used.

There are two kinds of buzzers commonly available like simple and readymade. Once
a simple type is power-driven then it will generate a beep sound continuously. A
readymade type looks heavier & generates a Beep. Beep. Beep. This sound is because of
the internal oscillating circuit within it.

This buzzer uses a DC power supply that ranges from 4V – 9V. To operate this, a 9V
battery is used but it is suggested to utilize a regulated +5V/+6V DC supply. Generally,
it is connected through a switching circuit to switch ON/OFF the buzzer at the necessary
time interval.

Buzzer Circuit Diagram


The circuit diagram of the water level indicator using the buzzer is shown below.
This circuit is used to sense or detect the water level within the tank or washing machine
or pool, etc. This circuit is very simple to design using few components such as a
transistor, buzzer, 300K variable resistor, and power supply or 9V battery.

40
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 2.7(b) internal circuit of buzzer

Once the two probes of the circuit are placed in the tank, it detects the level of water.
Once the water level exceeds the fixed level, then it generates a beep sound through a
buzzer connected to the circuit. This circuit uses a BC547B NPN Trasistor however we
can also use any general-purpose transistor instead of using 2N3904/2N2222.
This water level sensor circuit working is very simple and the transistor used within the
circuit works as a switch. Once the two probes notice the water level within the tank, then
the transistor turns ON & the voltage begins flowing throughout the transistor to trigger
the buzzer.

How to Choose a Buzzer?


While choosing a buzzer or speaker, many principles need to consider like the following.

-Size of the product


-Consumption of Current
-Type of terminal
-Frequency Voltage
-Volume
-Type
-AC/DC Voltage
-The tone is Continuous/Pulsed
-Fixing – Pins, Leads/Surface Mount
-Output of Sound
-Feedback Option
-Piezo Elements

Advantages
The advantages of a buzzer include the following.
-Simply Compatible
-Frequency Response is Good
-Size is small
-Energy Consumption is less
-The Range of Voltage usage is Large
-Sound Pressure is high.

41
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Disadvantages
The disadvantages of the buzzer include the following.
-Controlling is a little hard
-Generates Annoying Sound
-Training is necessary to know how to repair the condition without just turning off.

Applications
The applications of the buzzer include the following.
-Communication Devices
-Electronics used in Automobiles
-Alarm Circuits
-Portable Devices
-Security Systems
-Timers
-Household Appliances
-Electronic Metronomes
-Sporting Events
-Annunciator Panels
-Game Shows

2.8 DC MOTOR

Fig 2.8(a) 12V DC motor


42
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

A DC motor is an electrical machine that converts electrical energy into mechanical


energy. In a DC motor, the input electrical energy is the direct current which is
transformed into the mechanical rotation. In this session, let us know what is a DC
motor, types of DC motor and their applications.

What is a DC Motor?
A DC motor is defined as a class of electrical motors that convert direct current
electrical energy into mechanical energy.
From the above definition, we can conclude that any electric motor that is operated
using direct current or DC is called a DC motor. We will understand the DC motor
construction and how a DC motor converts the supplied DC electrical energy into
mechanical energy in the next few sections.

DC Motor Diagram

Fig 2.8(b) DC motor construction parts

Different Parts of a DC Motor


A DC motor is composed of the following main parts:

Armature or Rotor
The armature of a DC motor is a cylinder of magnetic laminations that are insulated
from one another. The armature is perpendicular to the axis of the cylinder. The
armature is a rotating part that rotates on its axis and is separated from the field coil by
an air gap.

Field Coil or Stator


A DC motor field coil is a non-moving part on which winding is wound to produce a
43
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

magnetic field. This electro-magnet has a cylindrical cavity between its poles.
Commutator
The commutator of a DC motor is a cylindrical structure that is made of copper
segments stacked together but insulated from each other using mica. The primary
function of a commutator is to supply electrical current to the armature winding.
Brushes
The brushes of a DC motor are made with graphite and carbon structure. These
brushes conduct electric current from the external circuit to the rotating commutator.
Hence, we come to understand that the commutator and the brush unit are concerned
with transmitting the power from the static electrical circuit to the mechanically rotating
region or the rotor.

DC Motor Working
In the previous section, we discussed the various components of a DC motor. Now,
using thisknowledge let us understand the working of DC motors.
A magnetic field arises in the air gap when the field coil of the DC motor is energised.
The created magnetic field is in the direction of the radii of the armature. The magnetic
field entersthe armature from the North pole side of the field coil and “exits” the armature
from the field coil’s South pole side.

Fig 2.8© Production of torque in a DC motor

44
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

When kept in a magnetic field, a current-carrying conductor gains torque and


develops a tendency to move. In short, when electric fields and magnetic fields interact, a
mechanical forcearises. This is the principle on which the DC motors work.

Types of DC motor
DC motors have a wide range of applications ranging from electric shavers to
automobiles. To cater to this wide range of applications, they are classified into different
types based on the field winding connections to the armature as:

-Self Excited DC Motor


-Separately Excited DC Motor
Now, let us discuss the various types of DC Motors in detail.

Self Excited DC Motor


In self-excited DC motors, the field winding is connected either in series or parallel
to the armature winding. Based on this, the self-excited DC motor can further be
classified as:

-Shunt wound DC motor


-Series wound DC motor
-Compound wound DC motor

Applications of DC Motor
The applications of different types of DC motors are listed below:
Shunt DC Motors
Owing to the fairly constant speed and medium starting torque of shunt DC motors,
they are used in the following applications:

Centrifugal and reciprocating pumps


-Lathe machines
-Blowers and Fans
-Drilling machines
-Milling machines
-Machine tools

Series DC Motors
Owing to the high starting torque and variable speed of series DC motors, they are used
in the following applications:

-Conveyors
-Hoists, Elevators
-Cranes
-Electric Locomotives

45
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Cumulative Compound DC motors


Owing to the high starting torque of cumulative compound DC motors, they are used
in the following applications:

-Shears
-Heavy Planers
-Rolling mills
-Elevators

2.9 THINGS SPEAK CLOUD


Thing Speak is a platform providing various services exclusively targeted for
building IoT applications. It offers the capabilities of real-time data collection,
visualizing the collected data in the form of charts, ability to create plugins and apps for
collaborating with web services, social network and other APIs.

We will consider each of these features in detail below. The core element of Thing
Speak is a‘Thing Speak Channel’.A channel stores the data that we send to Thing Speak
and comprises of the below elements:

8 fields for storing data of any type -These can be used to store the data from a sensor
or from an embedded device.

3 location fields - Can be used to store the latitude, longitude and the elevation. These
are very useful for tracking a moving device.

1 status field - A short message to describe the data stored in the channel. To use Thing
Speak, we need to sign up and create a channel. Once we have a channel, we can send
the data, allow Thing Speak to process it and also retrieve the same. Let us start
exploring Thing Speak by signing up and setting up a channel.

Thing Speak is IoT Cloud platform where you can send sensor data to the cloud.
You can also analyze and visualize your data with MATLAB or other software,
including making your ownapplications.
The Thing Speak service is operated by MathWorks. In order to sign up for
ThingSpeak, you must create a new MathWorks Account or log in to your existing
MathWorks Account.
Thing Speak is free for small non-commercial projects.
Things Speak includes a Web Service (REST API) that lets you collect and store
sensor data in the cloud and develop Internet of Things applications. It works with
Arduino, Raspberry Pi and MATLAB (premade libraries and APIs exists) But it should
work with all kind of Programming Languages, since it uses a REST API and HTTP.

46
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

2.10 SOFTWARE USED

The software used to program the heart of the project is Arduino IDE which can be
programmed in C/C++ language.

Arduino Coding Basics


We have already discussed the popular Arduino Boards, Arduino IDEs, and
Installation process of the Arduino software. We learned that Arduino IDE (Integrated
Development Environment) allows us to draw the sketch and upload it to the various
Arduino boards using code. The code is written in a simple programming language
similar to c and c++.The initial step to start with Arduino is the IDE download and
installation.

Brackets
There are two types of brackets used in the Arduino coding, which are listed below:

Parentheses ( )
Curly Brackets { }

Parentheses ( )
The parentheses brackets are the group of the arguments, such as method, function,
or a codestatement. These are also used to group the math equations.

Curly Brackets { }

The statements in the code are enclosed in the curly brackets. We always require
closed curlybrackets to match the open curly bracket in the code or sketch.

Open curly bracket-

' { ' Closed curly

bracket - ' } '

Line Comment

There are two types of line comments, which are listed below:

Single line comment


Multi-line comment

// Single line comment


The text that is written after the two forward slashes are considered as a single line
comment. The compiler ignores the code written after the two forward slashes. The
47
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

comment will not be displayed in the output. Such text is specified for a better
understanding of the code or for the explanation of any code statement.

The // (two forward slashes) are also used to ignore some extra lines of code without
deleting it.

/ * Multi - line comment */

The Multi-line comment is written to group the information for clear understanding.
It starts with the single forward slash and an asterisk symbol (/ *). It also ends with the /
*. It is commonly used to write the larger text. It is a comment, which is also ignored by
the compiler.

Coding Screen
The coding screen is divided into two blocks. The setup is considered as the
preparation block, while the loop is considered as the execution block. It is shown
below:

Fig 2.10 Basic Arduino code window

The set of statements in the setup and loop blocks are enclosed with the curly
brackets. We can write multiple statements depending on the coding
requirements for aparticular project.

What type of code is written in the setup block?


It contains an initial part of the code to be executed. The pin modes, libraries,
variables, etc., are initialized in the setup section. It is executed only once during the
uploading of the program and after reset or power up of the Arduino board.

Zero setup () resides at the top of each sketch. As soon as the program starts running,
the codeinside the curly bracket is executed in the setup and it executes only once.
48
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

What is Loop? What type of code is written in the Loop block?

The loop contains statements that are executed repeatedly. The section of code inside
the curlybrackets is repeated depending on the value of variables.

Time in Arduino
The time in Arduino programming is measured in a millisecond.

Where, 1 sec = 1000 milliseconds

We can adjust the timing according to the milliseconds.

For example, for a 5-second delay, the time displayed will be 5000

milliseconds. Let's consider a simple LED blink example.

The steps to open such example are:

-Click on the File button, which is present on the menu bar.


-Click on the Examples.
-Click on the Basics option and click on the Blink The

Example will reopen in a new window, as shown:

The digitalWrite () will disable the LOW during the INPUT mode. The output pin
will be considered as HIGH.

We can use the INPUT mode to use the external pull-down resistor. We are required
to set the pinMode as INPUT_PULLUP. It is used to reverse the nature of the INPUT
mode.

The sufficient amount of current is provided by the pull-up mode to dimly light an
LED, which is connected to the pin in the INPUT mode. If the LED is working dimly, it
means this conditionis working out.

Due to this, it is recommended to set the pin in OUTPUT mode.


The void loop () would include digitalWrite( ) and delay ( ) as the main function.

digitalWrite( )

The digitalWrite ( ) function is used to set the value of a pin as HIGH or LOW.Where,

HIGH: It sets the value of the voltage. For the 5V board, it will set the value of 5V, while
for 3.3V, it will set the value of 3.3V.
LOW: It sets the value = 0 (GND).

49
DEPARTMENT OF ECE,NNRESGI
CHAPTER 3
CONSTRUCTION OF THE CIRCUIT
FLOOD MONITORING AND ALERTING SYSTEM

CONSTRUCTION OF THE CIRCUIT


3.1 SYSTEM THEORY OF OPERATION

“The main goal of the circuit is if the water flow increases then that signal is sent to the
Arduino and from the Arduino it is sent into the GSM which is used to send alert
message and then to the buzzer which makes alert through sound and then this
information is uploaded into the Thingspeak Cloud.

3.2 BLOCK DIAGRAM

Fig 3.2 Block diagram

50
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

3.3 CIRCUIT DIAGRAM

3.3 Circuit diagram

51
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

3.4 FLOW CHART

Fig 3.4 Flow chart


52
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

3.5. EXPERIMENTAL SETUP

Fig 3.5 Experimental setup

53
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

The above figure shows the experimental setup of the Flood monitoring and alerting
system.
The Circuit consists of GSM module and Arduino UNO and a relay module and a
buzzer anda water flow sensor and a DC motor and a 16*4 LCD display unit .

LCD is connected to the Arduino and all other components like water flow
sensor ,GSMmodule is also connected to Arduino.Realy module is connected to the DC
motor.

3.6 WORKING
Basically, Flood monitoring and alerting system detects a flooding condition upstream
and warns inhabitants downstream of the approaching flood. The longer the time
between the warning and the actual arrival of the flood, the better the residents can
prepare by bringing their belongings and themselves to safe places.Early warning
systems have been recognized as an effective tool to reduce vulnerabilities and improve
preparedness and response to natural hazards. The importance of early warning has been
underlined in various UN General Assembly resolutions as a critical element of disaster
reduction.

This circuit consists of an Arduino which is the heart of the project as the various
componentsare connected to it and the whole circuit functioning is done through this
Arduino only.

There is an 16*2 LCD display which is connected to the Arduino used to display the
various functions such as the System ready message and the title and the status of the
system and also to display the Data which is initially uploaded to the cloud and also to
display the commands of GSM module which is used to send text message to the
registered mobile number.Also when the water flow is increased the flow rate is also
displayed on the display.

Then the GSM is also connected to the Arduino only.There is a water flow sensor
which is used to measure the flow rate of the water and update to the Arduino and then
the Arduino as per the code compare this value with the threshold and if it is violated
then it sends signal to the GSM and the GSM sends message to the registered mobile
number.There is also a sound buzzer which is connected to the Arduino along with GSM
it is used to alert the people through sound.Then there is a DC motor which is connected
to the Arduino through a relay which is used to decrease the flow of water by rotating in
the opposite direction.

At first as we turn on the circuit and then the LCD displays as the flood alerting
system and the data is initially uploaded to the thingspeak cloud and also sends sms to
the registered mobile number with a message that “Flood alerting system” and then the
lcd displays as system ready and then the water starts flowing through the water flow
sensor as it contains the turbine inside which rotates corresponding to the speed of the
water and generates analong pulses as the voltage increases and the those values are sent
to the Arduino and compared with the Thresholdvalues given in the code and if that value
exceeds the threshold then it gives signal to the sound buzzer and GSM to send a message
stating that “Alert!water flow increased” and the the signal is sent to the DC motor
through the relay module and then the motor also activates by rotating which is used to
remove the excess amount of water and also used to recude the water flow byrotating in
the opposite direction.
54
DEPARTMENT OF ECE,NNRESGI
CHAPTER 4
RESULTS
FLOOD MONITORING AND ALERTING SYSTEM

RESULTS

Fig 4(a) Alert SMS NOtification


55
DEPARTMENT OF ECE,NNRESGI
FLOOD MONITORING AND ALERTING SYSTEM

Fig 4(b) Thingspeak uploaded data


56
DEPARTMENT OF ECE,NNRESGI
CHAPTER 5
CONCLUSION
FLOOD MONITORING AND ALERTING SYSTEM

CONCLUSION

Disasters, as the name suggests, brings about great havoc on lives and property
indiscriminately across the globe. Developing countries, however, experience much
worse destruction than the developed ones and are as well as less equipped to deal with
the aftereffects of these calamities.

Foreknowledge of the disaster could thus help all, especially the developing
countries by providing time to secure property and evacuate. Developing early warning
systems may be complicated, with many facets to the system requirements and many
additional intricacies, when within a developing country.

This project has tried to implement a potential Floods cannot be predicted easily,
but we are tryingto develop a system which tries to detect flood and give early
intimation to nearby people. TheIoT based flood detection and alert system may prove
to save the lives of people by reducing the human quick out during emergency
situations.

With further improvement to the system we will be able to predict even more
accurately andreduce the amount of false alerts. Adding to that with further
modification wewill be able topredict how much area around the river bank will be
affected due to the water level which will be crucial so that the resident of that area
could be evacuated to a safe place before floodactually causes any damage.

And also with few more further improvements like adding an APR33A3 to this system
mayfurther be helpful to the people who don’t know how to read a text message as it
sends therecorded voice messages to the registered mobile numbers.

57
DEPARTMENT OF ECE,NNRESGI
REFERENCES
1) N. Weng Chan, "Increasing flood risk in Malaysia: causes and solutions", Disaster
Prev. Manag. An Int. J., vol. 6, no. 2, pp. 72-86, May 1997.

2) H. A. Rahman, "Global Climate Change and Its Effects on Human Habitat 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 Onlins

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) 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.

6) Flood Detection using Sensor Network and Notification via SMS and Public
Network.

7). K. Khedo, Real-Time Flood Monitoring Using Wireless Sensor Networks, pp. 59-69,
2013.

8)E. N. Udo and E. B. Isong, Asian journal of computer and information systems, vol.1,
no.
APPENDX
CODE FOR SIMULATION

#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int buzzer=A1;
int motor=6;
int X;
int Y;
int temp=0;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
const int input = A0;
String data="";
int message=0;
int times=0;
int flowo=0;
int flowc=0;
void beep()
{
digitalWrite(buzzer,LOW);delay(1000);digitalWrite(buzzer,HIGH);delay(1000);
digitalWrite(buzzer,LOW);delay(1000);digitalWrite(buzzer,HIGH);delay(1000);
digitalWrite(buzzer,LOW);delay(1000);digitalWrite(buzzer,HIGH);delay(1000);
}
void setup()
{
pinMode(input,INPUT);
pinMode(buzzer,OUTPUT);digitalWrite(buzzer,HIGH);
pinMode(motor, OUTPUT); digitalWrite(motor,HIGH);
Serial.begin(9600);delay(1000);
lcd.clear();
lcd.clear();lcd.print("AT");Serial.print("AT\r\n");delay(1000);
lcd.clear();lcd.print("ATE0");Serial.print("ATE0\r\n");delay(1000);
lcd.clear();lcd.print("AT+CMGF=1");Serial.print("AT+CMGF=1\r\n");delay(1000);
lcd.clear();lcd.print("AT+CNMI=1,2,0,0");Serial.print("AT+CNMI=1,2,0,0\r\n");delay(10
00);
lcd.clear();lcd.print("DATA UPLOADING");
Serial.print("AT+SAPBR=3,1,");Serial.print('"');Serial.print("Contype");Serial.print('"');Se
rial.print(',');Serial.print('"');Serial.print("GPRS");Serial.print('"');Serial.print("\r\n");delay(
1000);
Serial.print("AT+SAPBR=3,1,");Serial.print('"');Serial.print("APN");Serial.print('"');Serial
.print(',');Serial.print('"');Serial.print("WWW");Serial.print('"');Serial.print("\r\n");delay(10
00);
Serial.print("AT+SAPBR=1,1\r\n");delay(10000);Serial.print("AT+SAPBR=1,1\r\n");dela
y(1000);Serial.print("AT+SAPBR=1,1\r\n");delay(1000);Serial.print("AT+SAPBR=1,1\r\
iv
n");delay(1000);Serial.print("AT+SAPBR=1,1\r\n");delay(1000);
Serial.print("AT+SAPBR=2,1\r\n");delay(1000);
Serial.print("AT+HTTPINIT\r\n");delay(1000);
Serial.print("AT+HTTPPARA=");Serial.print('"');Serial.print("URL");Serial.print('"');Seri
al.print(',');Serial.print('"');Serial.print("http://api.thingspeak.com/update?key=Y5WMK5L
0Q3F76Z5X &field1=Flood Alerting
System....");Serial.print('"');Serial.print("\r\n");delay(3000);
Serial.print("AT+HTTPACTION=0\r\n"); delay(1000);
Serial.print("AT+HTTPACTION=0\r\n"); delay(1000);
lcd.clear();lcd.print("DATA UPLOADED");delay(1000);
Serial.print("AT+CMGS=");
Serial.print('"');
Serial.print("9110728528");
Serial.print('"');
Serial.print("\r\n");delay(1000);
Serial.print("Flood Alerting System......");delay(100);
Serial.write(0x1A);delay(10000);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Chance of flood");
lcd.setCursor(0,1);lcd.print("ALERTING GSM&IoT");delay(2000);
lcd.clear();
lcd.print("system ready....");
delay(1000);
}
void loop()
{
temp=temp+1;
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
digitalWrite(motor,HIGH);
delay(500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("VOL. :0.00");
}
}
else
{
TOTAL = TOTAL + LS;
lcd.clear();
lcd.setCursor(0,0);
v
lcd.print("VOL.: ");
lcd.print(WATER*(-1));
lcd.print(" L/M");
if((WATER*(-1))>2)
{
lcd.clear();
lcd.print("Chances of Flood");
lcd.setCursor(0,1);
lcd.print("VOL.: ");
lcd.print(WATER*(-1));
lcd.print(" L/M");
digitalWrite(motor,LOW);
delay(1000);
beep();
lcd.clear();
lcd.clear();lcd.print("AT");Serial.print("AT\r\n");delay(1000);
lcd.clear();lcd.print("ATE0");Serial.print("ATE0\r\n");delay(1000);
lcd.clear();lcd.print("AT+CMGF=1");Serial.print("AT+CMGF=1\r\n");delay(1000);
lcd.clear();lcd.print("AT+CNMI=1,2,0,0");Serial.print("AT+CNMI=1,2,0,0\r\n");delay(10
00);
lcd.clear();lcd.print("DATA UPLOADING");
Serial.print("AT+SAPBR=3,1,");Serial.print('"');Serial.print("Contype");Serial.print('"');Se
rial.print(',');Serial.print('"');Serial.print("GPRS");Serial.print('"');Serial.print("\r\n");delay(
1000);
Serial.print("AT+SAPBR=3,1,");Serial.print('"');Serial.print("APN");Serial.print('"');Serial
.print(',');Serial.print('"');Serial.print("WWW");Serial.print('"');Serial.print("\r\n");delay(10
00);
Serial.print("AT+SAPBR=1,1\r\n");delay(10000);Serial.print("AT+SAPBR=1,1\r\n");dela
y(1000);Serial.print("AT+SAPBR=1,1\r\n");delay(1000);Serial.print("AT+SAPBR=1,1\r\
n");delay(1000);Serial.print("AT+SAPBR=1,1\r\n");delay(1000);
Serial.print("AT+SAPBR=2,1\r\n");delay(1000);
Serial.print("AT+HTTPINIT\r\n");delay(1000);
Serial.print("AT+HTTPPARA=");Serial.print('"');Serial.print("URL");Serial.print('"');Seri
al.print(',');Serial.print('"');Serial.print("http://api.thingspeak.com/update?key=91SHW5G
UCCRO6Y5M&field1=Alert!Chances_of_Flood");Serial.print('"');Serial.print("\r\n");dela
y(3000);
Serial.print("AT+HTTPACTION=0\r\n"); delay(1000);
Serial.print("AT+HTTPACTION=0\r\n"); delay(1000);
lcd.clear();lcd.print("DATA UPLOADED");delay(1000);
Serial.print("AT+CMGS=");
Serial.print('"');
Serial.print("9110728528");
Serial.print('"');
Serial.print("\r\n");delay(1000);
Serial.print("Alert!Water flow increased");delay(100);
Serial.write(0x1A);delay(10000);
}
else
{

digitalWrite(motor,HIGH);
vi
delay(500);
}
}
}

vii

You might also like