IoT-Based Automatic Shed System To Prevent Unwanted

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 59

IoT Based Smart Water Quality Monitoring System

Abstract:
Abstract:
With the ongoing fourth revolution, technology has been growing rapidly day by day. One of the
Theefficient
most significant and Internetuses
of Things
of this (IoT) is theevident
has been network of physical
in the farming devices, vehicles,
sector. From home appliances
a basic
other toitems
water sprinkler system embedded with
the requirement electronics,
of Fertilizer sensors,crops,
for specific actuators, software
the likes and connectivity wh
of Artificial
enables
intelligence and the these
Internet of things
things to connect
have and in
brought exchange data. Water
great changes. Onequality
of the isissues
majorwhich
environmental prob
in India.
need to be addressed is theThe largest of
protection source
cropsoffrom
waterheavy
quality in India
rainfall is causes
which intreatedsignificant
sewage. Other sources
damage to the croppollution include
production agricultural
and soil runoff
yield, also andhuge
causing unregulated small scale
mental distress to a industry thatinresults in polluti
farmer. We
most
our proposed model haveofgiven
the rivers, lakes
a solution and problem
to this surface water. In automated
by giving conventional systems,
as well the monitoring proc
as manual
involvesbehind
control. The motivation the manual collection
our paper is to of sample
keep water protected
the crops from various regions,
from followed by testing
these heavy
analysis. the
precipitations and preserve Thesame
sensors connected
rainwater with Arduino-uno
for future in water
purposes when discrete way to We
is scarce. detect
usethe
a water parame
andatoNodeMCU
Moisture sensor with display in module
a desktop
to application. The quality
ensure the covering of estimated
of the water should beand
field monitored
LCD continuously
ensure
display to show status the safe supply of water from any water bodies and water resources for drinkable
of Field
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


1
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
CHAPTER-1
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
INTRODUCTION
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
1.1 EMBEDDED SYSTEM
and to display in a desktop application. The quality of water should be monitored continuously
An embedded system is a system which is going to do a predefined specified task is the
ensure the safe supply of water from any water bodies and water resources for drinkable
embedded system and is even defined as combination of both software and hardware. A general-
using it and that continuous measurement of water condition based on the parameters IoT help
purpose definition of embedded systems is that they are devices used to control, monitor or assist
in improving the health and living standards of all living things.
the operation of equipment, machinery or plant. "Embedded" reflects the fact that they are an
integral part of the system. At the other extreme a general-purpose computer may be used to
control the operation of a large complex processing plant, and its presence will be obvious.

All embedded systems are including computers or microprocessors. Some of these computers are
however very simple systems as compared with a personal computer. The very simplest
embedded systems are capable of performing only a single function or set of functions to meet a
single predetermined purpose. In more complex systems an application program that enables the
embedded system to be used for a particular purpose in a specific application determines the
functioning of the embedded system. The ability to have programs means that the same
embedded system can be used for a variety of different purposes. In some cases a microprocessor
may be designed in such a way that application software for a particular purpose can be added to
the basic software in a second process, after which it is not possible to make further changes. The
applications software on such processors is sometimes referred to as firmware.

The simplest devices consist of a single microprocessor (often called a "chip”), which may
itself be packaged with other chips in a hybrid system or Application Specific Integrated Circuit
(ASIC). Its input comes from a detector or sensor and its output goes to a switch or activator

ELECTRONICS AND COMMUNICATION ENGINEERING


2
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
which (for example) may start or stop the operation of a machine or, by operating a valve, may
control the flow ofAbstract:
fuel to an engine.

The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
1.2 LITERATURE SURVEY
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
The fundamental target of this task is to add portability and mechanization to the way toward
and to display in a desktop application. The quality of water should be monitored continuously
overseeing and checking heat and temperature . The framework overcomes this issue between the
ensure the safe supply of water from any water bodies and water resources for drinkable
worker wellbeing and the invention arranging directors by giving brought together checking to
using it and that continuous measurement of water condition based on the parameters IoT help
heater warmth and temperature over the whole framework. Various divisions use the framework
in improving the health and living standards of all living things.
for sequencing various procedures that are secluded separated. Extra for the force utilization.
Typically what happens is that the complete bill i.e. tower power utilization and building's
capacity utilization comes in a single bill and henceforth organizations can't get careful force
utilization. Taking into account the mind boggling propels in advancement, we have had the
alternative to track and screen them eagerly at the continuous, which helps with extending the
protection of system. This headway anticipates that us should be appreciative for this
development, which helps with empowering the checking and following of structure to shield
them from theft.Atmega328p microcontroller is a refined insignificant exertion device used for a
couple of purposes that may be sensible or particular reliant on its ability to perform enormous
tasks. This high proficiency depends on the limitless adaptability in the utilization of this gadget
for a few purposes, including Internet applications. Also, its broad use is because of the chance of
being modified a few times as a little PC that can be utilized as an embellishment in different
gadgets or in explicit undertakings and capacities that might be for reconnaissance.

Nikhil Kedia entitled “The Water Quality Monitoring for Rural Areas-A Sensor Cloud Based
Economical Project.” Published in 2015 1st International Conference on Next Generation
Computing Technologies (NGCT-2015) Dehradun, India. This paper highlights the entire water

ELECTRONICS AND COMMUNICATION ENGINEERING


3
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
quality and pollutants monitoring methods, sensors used the embedded design, and information

Abstract:
dissipation procedures, role of government, network operator and villagers in ensuring proper
information dissipation. It also explores the Sensor Cloud domain, while it automatically
improves the waterThe Internet
quality offeasible
is not Things at
(IoT)
this ispoint,
the network
efficientof
usephysical devices,and
of technology vehicles, home appliances
economic
other items
practices can help improve waterembedded with
quality and electronics,
awareness among sensors,
people. actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
Jayti Bhatt,Jigneshinvolves
Patoliyathe manual
entitled collection
“Real of sample
Time Water water
Quality from various
Monitoring regions,
System”. This followed
paper by testing
describes to ensureanalysis.
the safe The sensors
supply connected
of drinking with
water theArduino-uno in be
quality should discrete way to
monitored in detect the water parame
real time
andapproach
for that purpose new to displayIOT
in a(Internet
desktop of
application. The quality
Things) based of water
water quality should be has
monitoring monitored
been continuously
ensurethe
proposed. In this paper, thedesign
safe supply
of IOTofbased
waterwater
fromquality
any water bodies system
monitoring and water
thatresources
monitors for drinkable
using
the quality of water it and
in real thatThis
time. continuous measurement
system consists of water
of some condition
sensors based onthe
which measure thewater
parameters IoT help
quality parameter insuch
improving
as pH,theturbidity,
health andconductivity,
living standards of all living
dissolved things.
oxygen, temperature. The
measured values from the sensors are processed by the microcontroller and these processed
values are transmitted remotely to the core controller that is raspberry pi using Zigbee protocol.
Finally, sensors data can view on internet browser application using cloud computing.

Michal Lom, Ondrej Pribyl, Miroslav Svitek entitled “Industry 4.0 as a Part of Smart Cities”.
This paper describes the conjunction of the Smart City Initiative and the concept of Industry 4.0.
The term smart city has been a phenomenon of the last years, which is very inflected especially
since 2008 when the world was hit by the financial crisis. The main reasons for the emergence of
the Smart city initiative are to create a sustainable model for cities and to preserve the quality of
life of their citizens. The term smart city is not only seen as a technical discipline, but different
economic, humanitarian or legal aspects must be involved as well. In the Industry 4.0, the Internet
of Things (IoT) shall be used for the development of so–called smart products. Subcomponents of
the product are equipped with their own intelligence. The added intelligence is used both during
the manufacturing of a product as well as during subsequent handling, up to continuous
monitoring of the product lifecycle (smart processes). The other main aspects of the Industry 4.0
for enhancing the services are Internet of Services (IoS), that includes especially intelligent
transport and logistics (smart mobility, smart logistics), as well as Internet of Energy (IoE), which

ELECTRONICS AND COMMUNICATION ENGINEERING


4
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
determines how the natural resources are made used in proper way (electricity, water, oil, etc.).

Abstract:
IoT, IoS, IoP and IoE can be considered as an element that can create a connection of the Smart
city initiative and Industry 4.0 – Industry 4.0 can be seen as a part of smart cities.
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


5
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
CHAPTER-2
Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


6
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
EMBEDDED SYSTEM
Abstract:
An embedded system is a programmed controlling and operating system with a dedicated
function within aThe Internet
larger of Thingsor(IoT)
mechanical is the system,
electrical network often
of physical
with devices,
real-timevehicles,
computinghome appliances
othersystems
constraints. Embedded items embedded
control manywith electronics,
devices sensors,
in common actuators, software and connectivity wh
use today.
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig 2.1: Block diagram of embedded system

An embedded system is one kind of a computer system mainly designed to perform several tasks
like to access, process, and store and also control the data in various electronicsbased systems.
Embedded systems are a combination of hardware and software where software is usually known
as firmware that is embedded into the hardware. One of its most important characteristics of these
systems is, it gives the o/p within the time limits. Embedded systems support to make the work
more perfect and convenient. So, we frequently use embedded systems in simple and complex
devices too. The applications of embedded systems mainly involve in our real life for several
devices like microwave, calculators, TV remote control, home security and neighbourhood traffic
control systems, etc.

Modern embedded systems are often based on microcontrollers (i.e., CPUs with integrated
memory or peripheral interfaces), but ordinary microprocessors (using external chips for memory
and peripheral interface circuits) are also common, especially in more complex systems. In either

ELECTRONICS AND COMMUNICATION ENGINEERING


7
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
case, the processor(s) used may be types ranging from generalpurpose to those specialized in

Abstract:
certain class of computations or even custom designed for the application at hand.

Thesystem
Since the embedded Internet
is of Things (IoT)
dedicated is the tasks,
to specific network of physical
design devices,
engineers vehicles,it home
can optimize to appliances
reduce the size andother items
cost of embedded
the product with electronics,
and increase sensors,
the reliability actuators, software and connectivity wh
and performance.
enables these things to connect and exchange data. Water quality is major environmental prob
in range
Embedded systems India. from
The largest
portablesource
devicesof such
wateras quality
digital in India and
watches is intreated sewage.
MP3 players, to Other sources
pollution include
large stationary installations agricultural
like traffic runoff and
lights, factory unregulated
controllers, and small scale
largely industry
complex that results in polluti
systems
most of
like hybrid vehicles, the and
MRI, rivers,avionics.
lakes andComplexity
surface water. In conventional
varies systems,
from low, with the monitoring proc
a single
involves
microcontroller chip, to verythe manual
high collection
with multiple of sample
units, water
peripherals from
and various
networks regions,inside
mounted followed
a by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
large chassis or enclosure.
and to display in a desktop application. The quality of water should be monitored continuously
Embedded systemsensure the safe supply
are designed of water
to do some from tasks,
specific any water
ratherbodies anda water
than be resources for drinkable
generalpurpose
usingtasks.
computer for multiple it andSome
that continuous measurement
also have real-time of waterconstraints
performance condition based on the
that must be parameters
met, IoT help
for reasons such asinsafety
improving the healthothers
and usability; and living
maystandards
have lowoforall
noliving things. requirements,
performance
allowing the system hardware to be simplified to reduce costs.

Embedded systems are not always standalone devices. Many embedded systems consist of small
parts within a larger device that serves a more general purpose. An embedded system in an
automobile provides a specific function as a subsystem of the car itself.

The program instructions written for embedded systems are referred to as firmware, and are
stored in read-only memory or flash memory chips. They run with limited computer hardware
resources: little memory, small or non-existent keyboard or screen.

2.1 EMBEDDED SYSTEM HARDWARE

An embedded system uses a hardware platform to perform the operation. Hardware of the
embedded system is assembled with a microprocessor/microcontroller. It has the elements such as
input/output interfaces, memory, user interface and the display unit. Generally, an embedded
system comprises of the following

ELECTRONICS AND COMMUNICATION ENGINEERING


8
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Power Supply
The power supply Abstract:
is an essential part of any embedded systems circuits. An embedded system
may need a supply of 5 volts or if it is low power then maybe 3.3 or 1.8v. The supply may be
The of
provided with the help Internet
batteryoforThings
we can(IoT) is the
use any wallnetwork
adapter.ofIt physical devices,
will depend on thevehicles, home appliances
application
need. The power other items
supply embedded
circuit can be with electronics,
designed sensors,
with the actuators,
help some littlesoftware and ofconnectivity wh
knowledge
enables
electronics. For that, these
we need things rectifier
a bridge to connect and exchange
circuit, capacitor data. Water
as a filter quality
and is major
a voltage environmental prob
regulator
in India.
that provides constant outputThe largest source of water quality in India is intreated sewage. Other sources
supply.
pollution include agricultural runoff and unregulated small scale industry that results in polluti
Processor most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves
A processor is the main theinside
brain manual
any collection
embedded of sampleThis
systems. water
is afrom
majorvarious
factor regions, followed
that affects the by testing
performance of theanalysis.
system. The sensors
There connected
are different with Arduino-uno
processors available ininthe
discrete way
market. Antoembedded
detect the water parame
and to displayor
system may use microprocessor in microcontroller.
a desktop application. The quality
The processor of water
comes should architecture
in different be monitored continuously
ensure
like 8-bit, 16-bit and theThe
32-bit. safe8-bit
supply of water
processor from anyused
is generally water
in abodies and water resources
small application where we for drinkable
using it andlike
need some basic computation thatinput
continuous measurement
and output no heavy of water condition based on the parameters IoT help
processing.
in improving the health and living standards of all living things.
Memory
If we are using a microcontroller like AT89s51, AT89s52 or ATmega, the memory is available
on-chip. We generally talk about two types of memory in the embedded systems
 Read-Only memory (RAM)
 Random Access Memory (ROM)
 Electrically Erasable Programmable Read-Only Memory (EEPROM)

RAM memory is volatile memory and used for temporary storage of the data. And the selection
of it depends on the user need and the application. The ROM memory or Code Memory, this is
used for the storage of the program. Once system powered, the system fetches the code from the
ROM memory. The EEPROM is a unique memory. The content can be erased and reprogrammed
by a high voltage pulse input. This is used to store the data by the program itself. Suppose we
have a temperature data logger. And it needs to store the data every one hour. It means we need
the data at runtime after the system is started.

Timers-Counters

ELECTRONICS AND COMMUNICATION ENGINEERING


9
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
If you are working in embedded systems, you must have heard about

Abstract:
 What are timer and counter
 Why we use timer and counter
The
 What is difference Internet
between of Things
timers (IoT) is the network of physical devices, vehicles, home appliances
and counter
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables
In some application, we these
need things to connect
to generate someand exchange
delay. data.
Like for Water quality
blinking an LED, is major environmental
we need a prob

delay. For makinginsquare


India.pulse
The we
largest
need source
a delay.ofBut
water
therequality
is somein issue
Indiawhen
is intreated sewage.
we generate the Other sources
pollution
delay from the normal include
coding agricultural
style by making anyrunoff
loopand unregulated
running small scale
for a particular industry
time. that results in polluti
Definitely,
most delay
this will give you some of thebutrivers, lakes
the code andthis
after surface water. in
loop remains In waiting
conventional systems,
for state the monitoring proc
and delayed.
involves the manual collection of sample water from various regions, followed by testing
Communication Ports
Embedded systemsanalysis.
hardwareThehas
sensors connected
different with
types of Arduino-uno ports
communication in discrete way to detect
to communicate the water parame
with
the other embeddedand to displayexample,
devicesFor in a desktop application.
popular ArduinoThe quality
UNO boardofhas
water should beIC
ATmega328 monitored
and it continuously
ensure the safe
has following communication port: supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
 UART
in improving the health and living standards of all living things.
 I2C
 SPI

For sending data from one board to other we can use these serial protocols. But for that, we need
to program it.

Input and Output


To interact with the embedded systems, we need input. The input may be provided by the user or
by some sensor. Sometimes some systems need more input or output. So, the processor selection
will be based on I/O. These input and output are generally divided into ports like P0, P1, P2 and
P3 in Arduino UNO R3 And PA, PB, PC and PD in ATmega series of the microcon The I/O need
to be configured for input or output based on the provided register. And for that, we need to refer
the datasheet of the manufacturer.

Application SpecificCircuits
Some hardware components are common while designing the embedded systems. But some are
different and depends on the application need. Like a temperature sensor need a temperature

ELECTRONICS AND COMMUNICATION ENGINEERING


10
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
sensor for sensing the temperature. While others hand an alcohol detector has a sensor to detect
the alcohol level Abstract:
The Internet
But the remaining hardware of Thingsmight
components (IoT)beis the
thesame
network
like of physical devices, vehicles, home appliances
 Power Supply other items embedded with electronics, sensors, actuators, software and connectivity wh

 Processor enables these things to connect and exchange data. Water quality is major environmental prob

 Display Device in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
 Buzzer for Alert
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
2.2 EMBEDDED SYSTEM SOFTWARE
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
The software of an embedded system is written to execute a particular function. It is normally
ensure the safe supply of water from any water bodies and water resources for drinkable
written in a high-level setup and then compiled down to offer code that can be stuck within a non-
using it and that continuous measurement of water condition based on the parameters IoT help
volatile memory in the hardware. Embedded system software is intended to keep in view of the
in improving the health and living standards of all living things.
following three limits.
 Convenience of system memory
 Convenience of processor’s speed
 When the embedded system runs constantly, there is a necessity to limit power dissipation for
actions like run, stop and wake up.

2.3 RTOS (REAL TIME OPERATING SYSTEM)


A system which is essential to finish its task and send its service on time, then only it said to be a
real time operating system. RTOS controls the application software and affords a device to allow
the processor run. It is responsible for managing the different hardware resources of a personal
computer and also host applications which run on the PC

This operating system is specially designed to run various applications with an exact timing and a
huge amount of consistency. Particularly, this can be significant in measurement & industrial
automation systems where a delay of a program could cause a safety hazard.

2.4 HOW IS SOFTWARE EMBEDDED INTO A SYSTEM?

ELECTRONICS AND COMMUNICATION ENGINEERING


11
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
We need a program written in assembly or in embedded c language. And then we compile it. This

Abstract:
compiled code converted into HEX code. This hex code is programmed or burned into the ROM
of the system using some programmer.
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
These are the toolsother items
that are embedded
generally used inwith electronics,
embedded systemsensors, actuators, software and connectivity wh
development
 Assembler enables these things to connect and exchange data. Water quality is major environmental prob

 Emulator in India. The largest source of water quality in India is intreated sewage. Other sources

 Debugger pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
 Compiler
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
Assembler
and to display in a desktop application. The quality of water should be monitored continuously
Your program is in assembly language. This assembly language program is converted into the
ensure the safe supply of water from any water bodies and water resources for drinkable
HEX code using this utility. Then using some hardware called as a programmer we write the
using it and that continuous measurement of water condition based on the parameters IoT help
chip.
in improving the health and living standards of all living things.
Emulator
An emulator is hardware or software tool that has a similar functionality to the target system or
guest system. It enables the host system to execute the functionality and other components. It is a
replica of the target system. And used for debugging the code and issues. Once program or code
is fixed at the host system, it is transferred to the target system
Debugger
Sometimes we are not getting expected results or output due to errors or bug. There are certain
tools that are specifically used for the debugging process. Where we can see the controls flow and
register value to identify the issue. Compiler A compiler is a software tool that converts one
programming language into target code that a machine can understand. The compiler basically
used for translating the high-level language into the low-level language like machine code,
assembly language or object code.

2.5 EMBEDDED SYSTEM CHARACTERISTICS


 Generally, an embedded system executes a particular operation and does the similar
continually. For instance: A pager is constantly functioning as a pager.

ELECTRONICS AND COMMUNICATION ENGINEERING


12
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
 All the computing systems have limitations on design metrics, but those can be especially tight.
Design metric is a Abstract:
measure of an execution features like size, power, cost and also performance.
 It must perform fast enough and consume less power to increase battery life.
 Several embedded The Internet
systems of Things
should (IoT) react
constantly is thetonetwork
changesofinphysical devices,
the system vehicles,
and also home appliances
calculate
particular results other
in realitems
timeembedded withdelay.
without any electronics, sensors, aactuators,
For instance, car cruisesoftware and itconnectivity wh
controller;
enables
continuously displays and these things
responds to to connect
speed and exchange
& brake sensors. Itdata.
mustWater quality
calculate is major environmental prob
acceleration/de-
in India.
accelerations frequently in a The largest
limited time;source of computation
a delayed water qualitycans
in consequence
India is intreated sewage.
in let-down to Other sources
control the car. pollution include agricultural runoff and unregulated small scale industry that results in polluti
 It must be based most of the rivers, lakes
on a microcontroller and surface based.
or microprocessor water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
 It must require a memory, as its software generally inserts in ROM. It does not require any
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
secondary memories in the PC.
and to display in a desktop application. The quality of water should be monitored continuously
 It must need connected peripherals to attach input & output devices.
ensure the safe supply of water from any water bodies and water resources for drinkable
 An Embedded system is inbuilt with hardware and software where the hardware is used for
using it and that continuous measurement of water condition based on the parameters IoT help
security and performance and Software is used for more flexibility and features.
in improving the health and living standards of all living things.
2.6 EMBEDDED SYSTEM APPLICATIONS
The applications of embedded system basics include smart cards, computer networking, satellites,
telecommunications, digital consumer electronics, missiles, etc.

Fig 2.2: Embedded System Applications

ELECTRONICS AND COMMUNICATION ENGINEERING


13
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
 Embedded systems in automobiles include motor control, cruise control, body safety, engine
safety, robotics in Abstract:
an assembly line, car multimedia, car entertainment, E-com access, mobiles
etc.
TheinInternet
 Embedded systems of Things (IoT)
telecommunications is the
include network ofmobile
networking, physical devices, and
computing, vehicles, home appliances
wireless
other items embedded with electronics, sensors, actuators, software and connectivity wh
communications, etc.
enables
 Embedded systems these
in smart things
cards to connect
include andtelephone
banking, exchangeanddata. Water systems.
security quality is major environmental prob
in India.
 Embedded Systems The largest
in satellites source
and missiles of water
include quality
defence, in India is intreated
communication, sewage. Other sources
and aerospace
pollution include agricultural runoff and unregulated small scale industry that results in polluti
 Embedded systems in computer networking & peripherals include image processing,
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
networking systems, printers, network cards, monitors and displays
involves the manual collection of sample water from various regions, followed by testing
 Embedded Systems in digital consumer electronics include set-top boxes, DVDs, highdefinition
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
TVs and digital cameras
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


14
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


15
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
CHAPTER-3
Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
Existing system: This paper aims to propose an Arduino based automatic shed system
in India. The largest source of water quality in India is intreated sewage. Other sources
“SmartShed”, which depends upon three environmental factors: water, temperature and intensity
pollution include agricultural runoff and unregulated small scale industry that results in polluti
of light. If any factor is sensed above a specific threshold the shed will automatically be applied
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
otherwise it will be removed without human intervention. Three sensors: water sensor for rain
involves the manual collection of sample water from various regions, followed by testing
detection, light dependent resistor (LDR) for measuring intensity of light and LM35 for
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
measuring temperature a
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


16
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
PROPOSED SYSTEM
Abstract:
The most important advantage of this system is that it is fully automated such as:
When it rains, the shed system opens automatically, and when it stops raining,
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
the shed systemother
closes automatically
items embedded with byelectronics,
sensing the rain with
sensors, the help
actuators, of aand
software rainconnectivity wh
sensor and the enables
user will
these be notified
things through
to connect IoT. For
and exchange data. IoT
Waterpurposes, a Wi-Fi
quality is major environmental prob

module is usedinand
India.
forThe largest
this, it issource of water
possible quality
to get in India is on
notifications intreated
phone.sewage.
This Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
project also describes the project model, testing, and hardware. This system
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
consists of the innovative design of an umbrella system for the shed system,
involves the manual collection of sample water from various regions, followed by testing
which opens and closes
analysis. The with
sensorsthe help of
connected withaArduino-uno
high-torque motor way
in discrete andto is fully
detect the water parame
automated and and
controlled
to displaybyin Arduino. This umbrella
a desktop application. shedofsystem
The quality is thebeheart
water should of continuously
monitored
ensure
the project which willtheprotect
safe supply of waterfrom
the crops fromunwanted
any water bodies anda water
rain as resultresources
people for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
will be benefitted and the economy in the agriculture sector will rise beyond
in improving the health and living standards of all living things.
expectations.

3.1 BLOCK DIAGRAM


In this arduino Uno will control the entire system. Temperature sensor, humidity sensor and fire
sensors are utilized in this project. Whenever there is change in temperature then temperature
sensor activates and switches on the exhaust fan and as well as sends SMS and location to the
corresponding phone number. Whenever there is change in humidity then humidity sensor
activates and sends SMS and location to the corresponding phone number. Whenever there fire is
exploded then fire sensor activates and sprinkles the water using water sprinkler and as well as
sends SMS and location to the corresponding phone number.

ELECTRONICS AND COMMUNICATION ENGINEERING


17
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
POWER
RAIN SENSOR The Internet of Things (IoT) is the network of SUPPLY
physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
LCD in
in India. The largest source of water quality DISPLAY
India is intreated sewage. Other sources
L298N
pollution include agricultural runoff and unregulated small scale industry that results in polluti
ARDUINO
most of the rivers, lakes
UNO and surface water.
SERVOIn MOTOR1
conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
DC MOTOR
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
SERVO of
and to display in a desktop application. The quality MOTOR2
water should be monitored continuously

SERVO MOTOR ensure the safe supply of water from any water bodies and water resources for drinkable
SERVO MOTOR4
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig. 3.1: Block diagram of proposed system

ELECTRONICS AND COMMUNICATION ENGINEERING


18
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
3.2 HARDWARE COMPONENTS USED

Abstract:
3.2.1 ARDUINO
3.2.1.1 Overview The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital
enables these things to connect and exchange data. Water quality is major environmental prob
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
in India. The largest source of water quality in India is intreated sewage. Other sources
resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains
pollution include agricultural runoff and unregulated small scale industry that results in polluti
everything needed to support the microcontroller; simply connect it to a computer with a USB
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
cable or power it with a AC-to-DC adapter or battery to get started.
involves the manual collection of sample water from various regions, followed by testing
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
and to display in a desktop application. The quality of water should be monitored continuously
USB-to-serial converter.
ensure the safe supply of water from any water bodies and water resources for drinkable
Revision3 Of The Board Has The Following New Features
using it and that continuous measurement of water condition based on the parameters IoT help
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new
in improving the health and living standards of all living things.
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible both with the board that use the
AVR, which operate with 5V and with the Arduino Due that operate with 3.3V. The second one
is a not connected pin that is reserved for future purposes. Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is
the latest in a series of USB Arduino boards, and the reference model for the Arduino platform;
for a comparison with previous version

Fig. 3.2: Arduino board

ELECTRONICS AND COMMUNICATION ENGINEERING


19
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

3.2.1.2 Schematic Abstract:


& Reference Design

The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig. 3.3: Schematic & Reference Design

The Arduino reference design can use an Atmega8, 168, or 328, Current models use an
ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is

ELECTRONICS AND COMMUNICATION ENGINEERING


20
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
identical on all three processors.

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
3.2.1.3 SPECIFICATIONS
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
Microcontroller ATmega328
in India. The largest source of water quality in India is intreated sewage. Other sources
Operating Voltage 5V
pollution include agricultural runoff and unregulated small scale industry that results in polluti
Input Voltage 7-12V (recommended)
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
Input Voltage (limits) 6-20V
involves the manual collection of sample water from various regions, followed by testing
Digital I/O Pins 14 (of which 6 provide PWM output)
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
Analog Input Pins 6
and to display in a desktop application. The quality of water should be monitored continuously
DC Current per I/O Pin 40 mA
ensure the safe supply of water from any water bodies and water resources for drinkable
DC Current for 3.3V Pin 50 mA
using it and that continuous measurement of water condition based on the parameters IoT help
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot loader
in improving the health and living standards of all living things.
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz

3.2.1.4 POWER

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The recommended
range is 7 to 12 volts.
The power pins are as follows
VIN. The input voltage to the Arduino board when it's using an external power source

ELECTRONICS AND COMMUNICATION ENGINEERING


21
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
(asopposed to 5 volts from the USB connection or other regulated power source). You can

Abstract:
supply voltage through this pin, or, if supplying voltage via the power jack, access it through this
pin.
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other
5V.This pin outputs items embedded
a regulated withregulator
5V from the electronics, sensors,
on the board. actuators,
The board software and connectivity wh
can besupplied
enables
with power either from thethese things jack
DC power to connect and the
(7 - 12V), exchange data. Water
USB connector quality
(5V), is major
or the environmental
VIN pin of prob
the board (7-12V).inSupplying
India. The largestviasource
voltage of orwater
the 5V 3.3Vquality in Indiathe
pins bypasses is regulator,
intreated sewage.
and can Other sources
damage your board.pollution
We don'tinclude
adviseagricultural
it. runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves
3V3. A 3.3 volt supply the manual
generated by the collection of sampleMaximum
on-board regulator. water from various
current drawregions, followed by testing
is 50mA.
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
GND. Ground pins.and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
IOREF This pinusing
on itthe
and that continuous
Arduino boardmeasurement of water
provides the condition
voltage basedwith
reference on thewhich
parameters IoT help
themicrocontroller inoperates.
improving the healthconfigured
A properly and living shield
standards
canofread
all living things.pin voltage and
the IOREF
select the appropriate power source or enable voltage translators on the outputs for working with
the 5V or 3.3V.

3.2.1.5 Memory

The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

3.2.1.6 Input And Output

Each of the 14 digital pins on the Uno can be used as an input or output, using pin Mode
(), digital Write (), and digital Read () functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-
50 ohms. In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Thesepins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

ELECTRONICS AND COMMUNICATION ENGINEERING


22
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on alow

Abstract:
value, a rising or falling edge, or a change in value. See the attach Interrupt() function for details.

Theand
PWM: 3, 5, 6, 9, 10, Internet of Things
11. Provide 8-bit(IoT)
PWMisoutput
the network of physical
with theanalog devices, vehicles, home appliances
Write()function.
other items
SPI: 10 (SS), 11 (MOSI), embedded13with
12 (MISO), electronics,
(SCK). sensors,
These pins supportactuators, software and connectivity wh
SPI communicationusing
the SPI library. enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
LED: 13. There ispollution
a built-ininclude agriculturaltorunoff
LED connected digitaland
pinunregulated small
13. When the pinscale industry
is HIGH that results in polluti
value,the
most
LED is on, when the pin of the rivers,
is LOW, lakes and surface water. In conventional systems, the monitoring proc
it's off.
involves the manual collection of sample water from various regions, followed by testing
analysis.
The Uno has 6 analog The
inputs, sensors
labeled A0connected with
through A5, Arduino-uno
each in discrete
of which provide wayoftoresolution
10 bits detect the water parame
(i.e. 1024 differentand to display
values). in a desktop
By default application.
they measure from The quality
ground to 5ofvolts,
waterthough
shouldisbe
it monitored
possible continuously
to change the upperensure
end ofthe saferange
their supply of the
using water frompinany
AREF andwater bodiesReference
the analog and water()resources
function. for drinkable
Additionally, someusing it andspecialized
pins have that continuous measurement of water condition based on the parameters IoT help
functionality:
in improving the health and living standards of all living things.
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using theWirelibrary.

There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used withanalog Reference().

Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset buttonto
shields which block the one on the board.

3.2.1.7 Communication

The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on
the board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required.

ELECTRONICS AND COMMUNICATION ENGINEERING


23
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
The Arduino software includes a serial monitor which allows simple textual data to be

Abstract:
sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is
being transmitted via the USB-to-serial chip and USB connection to the computer (but not for
Theon
serial communication Internet of Things
pins 0 and 1). (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
A Softwareenables
Serial these things
library to connect
allows andcommunication
for serial exchange data.on
Water
any quality
of the is majordigital
Uno's environmental prob
in India.
pins. The ATmega328 The largest
also supports I2C source
(TWI) of
andwater quality in IndiaThe
SPI communication. is intreated sewage. Other sources
Arduino software
pollution
includes a Wire library includeuse
to simplify agricultural
of the I2Crunoff
bus; and unregulated
see the small scale
documentation industry
for details. Forthat
SPIresults in polluti
most
communication, use of the
the SPI rivers, lakes and surface water. In conventional systems, the monitoring proc
library.
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
3.2.1.8 Programming
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
The Arduino Uno can be programmed with the Arduino software. The ATmega328 on the
using it and that continuous measurement of water condition based on the parameters IoT help
Arduino Uno comes pre burned with a boot loader that allows you to upload new code to it
in improving the health and living standards of all living things.
without the use of an external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).You can also bypass the boot loader and program the
microcontroller through the ICSP (In-Circuit Serial Programming) header; see these instructions
for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy)
and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU boot loader). See this user-contributed tutorial for more information.

ELECTRONICS AND COMMUNICATION ENGINEERING


24
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
3.2.1.9 Automatic (Software) Reset

Abstract:
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed inThe Internet
a way of Things
that allows (IoT)
it to be is by
reset thesoftware
networkrunning
of physical
on a devices,
connectedvehicles, home appliances
computer.
other
One of the hardware flowitems embedded
control withofelectronics,
lines (DTR) sensors, actuators,
theATmega8U2/16U2 software
is connected to theand
resetconnectivity wh
enables
line of the ATmega328 viathese
a 100things
nano to connect
farad and exchange
capacitor. When thisdata.
lineWater quality
is asserted is major
(taken low),environmental
the prob
in enough
reset line drops long India. The largest
to reset source
the chip. ofArduino
The water quality in uses
software Indiathis
is capability
intreated to
sewage.
allow Other sources
you to upload codepollution
by simplyinclude agricultural
pressing the uploadrunoff and
button in unregulated
the Arduino small scale industry
environment. that results in polluti
This means
that the boot loadermost
can of thea rivers,
have shorter lakes andassurface
timeout, water. ofInDTR
the lowering conventional systems, the monitoring proc
can be well-coordinated
with the start of theinvolves
upload. the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
This setup and
hastoother
display in a desktopWhen
implications. application.
the UnoTheisquality of water
connected should abecomputer
to either monitored continuously
running Mac OS Xensure the safe
or Linux, supply
it resets of time
each watera from any water
connection bodies
is made to itand water
from resources
software (via for drinkable
using it half-second
USB). For the following and that continuous measurement
or so, the boot loaderofiswater condition
running on thebased
Uno. on the parameters
While it is IoT help
in improving
programmed to ignore the health
malformed and anything
data (i.e. living standards
besidesofanallupload
living things.
of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make sure
that the software with which it communicates waits a second after opening the connection and
before sending this data. The Uno contains a trace that can be cut to disable the auto-reset. The
pads on either side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN".
You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the
reset line.

3.2.1.10 USB Over Current Protection

The Arduino Uno has a resettable poly fuse that protects your computer's USB ports from
shorts and over current. Although most computers provide their own internal protection, the fuse
provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse
will automatically break the connection until the short or overload is removed.

ELECTRONICS AND COMMUNICATION ENGINEERING


25
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
3.2.1.11 Physical Characteristics

Abstract:
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with
the USB connector and power jack extending beyond the former dimension. Four screw holes
allow the board to The Internet to
be attached of aThings
surface(IoT) is the
or case. network
Note ofdistance
that the physicalbetween
devices,digital
vehicles,
pinshome
7 appliances
other not
and 8 is 160 mil (0.16"), items
an embedded with
even multiple electronics,
of the sensors,ofactuators,
100 mil spacing software
the other pins . and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
3.3Power Supply in India. The largest source of water quality in India is intreated sewage. Other sources
pollution
Power supply is the include
circuit from agricultural
which we get arunoff and
desired dcunregulated small
voltage to run thescale
otherindustry
circuits.that
Theresults in polluti
most
voltage we get from of theline
the main rivers, lakes
is 230V ACand
butsurface water.
the other In conventional
components systems,
of our circuit the5Vmonitoring proc
require
involves
DC. Hence a step-down the manual
transformer collection
is used to get of sample
12V water isfrom
AC which latervarious regions,
converted to 12Vfollowed
DC by testing
analysis.
using a rectifier. The outputThe sensors connected
of rectifier with
still contains Arduino-uno
some in discrete
ripples even though itway
is atoDC
detect the water parame
signal
and to as
due to which it is called display in a desktop
Pulsating DC. To application. The quality
remove the ripples of water
and obtain should be
smoothed DCmonitored
power continuously
ensure
filter circuits are used. thea safe
Here supply
capacitor of water
is used. The from anyiswater
12V DC rated bodies
down toand
5V water
using resources
a positive for drinkable
using
voltage regulator chip it and
7805. thatacontinuous
Thus measurement
fixed DC voltage of 5V isofobtained.
water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig. 3.4: POWER SUPPLY CIRCUIT

ELECTRONICS AND COMMUNICATION ENGINEERING


26
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
3.3.1LM35
Here LM35 series Abstract:
is also one of the sensors in precision integrated-circuit temperature. Its result
volts are proportional to linearly the more range of temperature values in Celsius temperature.
Thethe
The Here to calculate Internet
LM35of Things
thus has an(IoT)
upperis hand
the network of physical
over linear devices,
temperature vehicles,
sensors home appliances
calibrated
in ° Kelvin, as theother
user items
is not embedded
required towith electronics,
subtract sensors, voltage
a large constant actuators, software
from and toconnectivity wh
its output
obtain convenient enables these
Centigrade things It
scaling. to doesn’t
connectused
and exchange data. Water
exterior adjust quality
to provide is major
25%°C environmental prob
of room
in India.
temperature and ±50%°C andThe
−55largest source
to +150°C is a of wateritsquality
overall in India
temperature is intreated sewage. Other sources
range.
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.
Fig 3.5: PIN LAYOUT OF LM35

Features of LM35
 Its linearly scale factor is + 10.0 mV/°C
 Its warranty correctness is +25°C)
 Here −55° to +150°C between ranges to rated this.
 It Support applications of remote side.
 Here using a wafer-level trimming because its cost is low.
 To perform operations on four to thirty voltage
 Its power is less than 60 μA.
 0.08°C in still air it’s self-heating is low.
 In ±50%°C its Non linearity is hard.
 For 0.1 W for 1 mA its impedance is low.
 ° Celsius (Centigrade) is Calibrated directly

ELECTRONICS AND COMMUNICATION ENGINEERING


27
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
3.3.2 LCD Display

Abstract:
This device is most commonly used in every embedded project; because of it’s a low cost and
also frees friendly available and programmer. Now a day’s most of us would have come across
The Internet
these displays in calculators. of get
Now Things
a bit(IoT) is the
technical thenetwork of physical
appearance using a devices, vehicles, get
16×2 LCD.Here home appliances
othertwo
sixteen Columns and items embedded
Rows with LCD.
have a 16×2 electronics, sensors,
In these have actuators, software
an 8×1, 8×2, 10×2, and
16×1connectivity wh
enables
different columns and these
rows. Herethings to connect
mainly and exchange
used in 16×2 data. Water
LCD. Because it havequality is major environmental
a 32 characters and prob
5×8 Pixel Dots andinalso
India.
eachThe largestitssource
character ofalso
pixels is water quality in India is intreated sewage. Other sources
shown.
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig. 3.6: LCD MODULE PIN OUT

Features of 16×2 LCD module


 Here to perform operation by using 4.7 to 5.3v.
 Its power is1mA consumption no use of backlight.
 By using a module is LCD of alphanumeric display, it means alphabetical and numeric are
represent
 It contains a 2 rows in each we have a 16 characters.
 By using a 5×8 pixel box to increase at each character.
 Here by using both eight-bit and four-bit modes.
 To exhibit at a row characters.
 Here only possible in Green and Blue Backlight.

ELECTRONICS AND COMMUNICATION ENGINEERING


28
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Table 3.1: Pin out description of 16X2 LCD

1 Abstract:
Vss (Ground) Here using a Ground pin, it is attached with down of the system.

2 Vdd(+5 Volt) Here by


The Internet of using
Thingsa (IoT)
+5V (4.7V
is the –network
5.3V) toofpower the LCD
physical devices, vehicles, home appliances
3 other items
VE(Contrast) Here embedded with
to decide the electronics,
level of contrast sensors, actuators, Grounded
to get a maximum software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
4 Select When connect to microcontroller to transfer info connecting
in India. The largest source of water quality in India is intreated sewage. Other sources
Register registers.
pollution include agricultural runoff and unregulated small scale industry that results in polluti
5 Reader Write
most of When receive
the rivers, infoand
lakes is grounded to LCD
surface water. In by using read systems,
conventional or write the monitoring proc
involvesdata.
the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
6 Enable For receive data attach the Microcontroller Pin connect between 1
and to display in a desktop application. The quality of water should be monitored continuously
and 0.
ensure the safe supply of water from any water bodies and water resources for drinkable
7 Data Pinusing
0-7 itWhen thecontinuous
and that pins are connected to zero
measurement to seven
of water it produce
condition anon
based 8-bit
the parameters IoT help
data line
in improving also toand
the health connect
living with microcontroller
standards of all livingtothings.
give the 8-bit
data. Here by using data pins 4, 5 ,6 and 7 to perform operation
on 4-bit mode.

15 LED Positive Here using a LED of Backlight pin Because it’s positive terminal.

16 LED It also use LED Backlight pin but it is a negative terminal.


Negative

The term LCD stands for liquid crystal display. It is one kind of electronic display module used in
an extensive range of applications like various circuits & devices like mobile phones, calculators,
computers, TV sets, etc. These displays are mainly preferred for multi-segment light-emitting
diodes and seven segments. The main benefits of using this module are inexpensive; simply
programmable, animations, and there are no limitations for displaying custom characters, special
and even animations, etc.

ELECTRONICS AND COMMUNICATION ENGINEERING


29
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
LCD 16×2 Pin Diagram

Abstract:
The 16×2 LCD pinout is shown below.
 Pin1 (Ground/Source Pin): This is a GND pin of display, used to connect the GND terminal of
Theunit
the microcontroller Internet of Things
or power source.(IoT) is the network of physical devices, vehicles, home appliances
 other
Pin2 (VCC/Source items
Pin): Thisembedded with supply
is the voltage electronics,
pin ofsensors, actuators,
the display, used software andtheconnectivity wh
to connect
supply pin of theenables these things to connect and exchange data. Water quality is major environmental prob
power source.
 in India.
Pin3 (V0/VEE/Control The
Pin): largest
This source of
pin regulates thewater quality
difference of in
theIndia is intreated
display, sewage.a Other sources
used to connect
changeable POT pollution include0 agricultural
that can supply to 5V. runoff and unregulated small scale industry that results in polluti
 most of the rivers,
Pin4 (Register Select/Control lakespinand
Pin): This surface
toggles water.
among In conventional
command systems,used
or data register, the tomonitoring proc
involves the
connect a microcontroller unitmanual
pin andcollection of sample
obtains either water
0 or 1(0 from
= data various
mode, and regions, followed by testing
1 = command
mode). analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
 and to display
Pin5 (Read/Write/Control Pin): in a desktop
This application.
pin toggles Theamong
the display qualitythe
of water
read orshould
writesbeoperation,
monitored continuously
ensure
and it is connected the safe supplyunit
to a microcontroller of water
pin to from any water
get either 0 or 1 bodies and Operation,
(0 = Write water resources
and 1 for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
= Read Operation).
 in improving
Pin 6 (Enable/Control the pin
Pin): This health and be
should living
heldstandards of all living
high to execute things. process, and it
Read/Write
is connected to the microcontroller unit & constantly held high.
 Pins 7-14 (Data Pins): These pins are used to send data to the display. These pins are connected
in two-wire modes like 4-wire mode and 8-wire mode. In 4-wire mode, only four pins are
connected to the microcontroller unit like 0 to 3, whereas in 8-wire mode, 8-pins are connected
to microcontroller unit like 0 to 7.
 Pin15 (+ve pin of the LED): This pin is connected to +5V
 Pin 16 (-ve pin of the LED): This pin is connected to GND.

Features of LCD16x2
The features of this LCD mainly include the following.
 The operating voltage of this LCD is 4.7V-5.3V
 It includes two rows where each row can produce 16-characters.
 The utilization of current is 1mA with no backlight
 Every character can be built with a 5×8 pixel box
 The alphanumeric LCDs alphabets & numbers
 Is display can work on two modes like 4-bit & 8-bit
 These are obtainable in Blue & Green Backlight

ELECTRONICS AND COMMUNICATION ENGINEERING


30
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
 It displays a few custom generated characters

Abstract:
3.3.3Temperature sensors
The Internet
By definition, “A device, ofmeasure
used to Things (IoT) is the
amount network
of heat of that
energy physical
allowsdevices, vehicles,
to detect home appliances
a physical
other from
change in temperature itemsa embedded with electronics,
particular source and convertssensors, actuators,
the data software
for a device and isconnectivity wh
or user,
enablesSensor.”
known as a Temperature these things to sensors
These connect have
and exchange data. Water
been deployed quality
for a long timeis in
major environmental prob
a variety
in India.
of devices. However, The
with the largest source
emergence of IoT,ofthey
water
havequality in India
found more roomis tointreated sewage.
be present in an Other sources
pollution
even greater number includeOnly
of devices. agricultural
a couplerunoff and unregulated
of years smallmostly
ago, their uses scale industry
includedthat
A/Cresults in polluti
mostand
control, refrigerators of similar
the rivers, lakesused
devices and for
surface water. In conventional
environmental systems,
control. However, withthethemonitoring proc
advent of the IoT involves thehave
world, they manual collection
found of insample
their role water from
manufacturing various agriculture
processes, regions, followed
and by testing
health industry. Inanalysis. The sensors connected
the manufacturing with Arduino-uno
process, many in discrete
machines require wayenvironment
specific to detect the water parame
andastodevice
temperature, as well displaytemperature.
in a desktop With
application. Theofquality
this kind of water should
measurement, be monitored continuously
the manufacturing
process can alwaysensure
remaintheoptimal.
safe supply ofother
On the waterhand,
frominany water bodies
agriculture, and water resources
the temperature of soil is for drinkable
using This
crucial for crop growth. it andhelps
that with
continuous measurement
the production of water
of plants, condition
maximizing thebased on the parameters IoT help
output.
in improving the health and living standards of all living things.

Fig. 3.7: TEMPERATURE SENSOR


LM35 is a temperature measuring device having an analog output voltage proportional to the
temperature. It provides output voltage in Centigrade (Celsius). It does not require any external
calibration circuitry. The sensitivity of LM35 is 10 mV/degree Celsius. As temperature increases,
output voltage also increases E.g. 250 mV means 25°C. It is a 3-terminal sensor used to measure
surrounding temperature ranging from -55 °C to 150 °C. LM35 gives temperature output which is
more precise than thermistor output.
3.3.4 DHT11
The DHT11 is a commonly used Temperature and humidity sensor that comes with a
dedicated NTC to measure temperature and an 8-bit microcontroller to output the values of
temperature and humidity as serial data.

ELECTRONICS AND COMMUNICATION ENGINEERING


31
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
DHT11 Pinout Configuration
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
No: Pin Name Description
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
For DHT11 Sensor
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
1 Vcc Power supply 3.5V to 5.5V
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
2 Data Outputs both Temperature and Humidity through serial Data
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
3 NC Nothat
using it and Connection
continuousand hence notofused
measurement water condition based on the parameters IoT help
in improving the health and living standards of all living things.

4 Ground Connected to the ground of the circuit

For DHT11 Sensor module

1 Vcc Power supply 3.5V to 5.5V

2 Data Outputs both Temperature and Humidity through serial Data

3 Ground Connected to the ground of the circuit

You can buy DHT11 sensor module from here.

DHT11 Specifications

 Operating Voltage: 3.5V to 5.5V


 Operating current: 0.3mA (measuring) 60uA (standby)

ELECTRONICS AND COMMUNICATION ENGINEERING


32
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
 Output: Serial data
 Temperature Range: 0°C to 50°C

Abstract:
Humidity Range: 20% to 90%
 Resolution: Temperature and Humidity both are 16-bit
 Accuracy: ±1°C and
The ±1%
Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
 Difference between DHT11 Sensor and Module
enables these things to connect and exchange data. Water quality is major environmental prob
 The DHT11 sensor can either be purchased as a sensor or as a module. Either
in India. The largest source of water quality in India is intreated sewage. Other sources
way, the performance of the sensor is same. The sensor will come as a 4-pin
pollution include agricultural runoff and unregulated small scale industry that results in polluti
package out of which only three pins will be used whereas the module will come
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
with three involves
pins as shown above.
the manual collection of sample water from various regions, followed by testing
 The only difference between
analysis. The sensorsthe sensor with
connected and module is that
Arduino-uno the module
in discrete willdetect
way to havethe
a water parame
filtering capacitor and pull-up
and to display resistor
in a desktop inbuilt, The
application. and quality
for theofsensor, you have
water should to use continuously
be monitored
them externally
ensureifthe
required.
safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

DC MOTOR

Introduction:

A DC motor is designed to run on DC electric power. Two examples of pure DC designs are
Michael Faraday's homopolar motor (which is uncommon), and the ball bearing motor, which is (so far) a
novelty. By far the most common DC motor types are the brushed and brushless types, which use
internal and external commutation respectively to create an oscillating AC current from the DC source --
so they are not purely DC machines in a strict sense.

A DC motor is any of a class of electrical machines that converts direct current electrical power
into mechanical power. The most common types rely on the forces produced by magnetic fields. Nearly
all types of DC motors have some internal mechanism, either electromechanical or electronic; to
periodically change the direction of current flow in part of the motor. Most types produce rotary motion;
a linear motor directly produces force and motion in a straight line.

ELECTRONICS AND COMMUNICATION ENGINEERING


33
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
DC motors were the first type widely used, since they could be powered from existing direct-

Abstract:
current lighting power distribution systems. A DC motor's speed can be controlled over a wide range,
using either a variable supply voltage or by changing the strength of current in its field windings. Small
DC motors are used The
in tools, toys, of
Internet andThings
appliances.
(IoT)The
is universal motor
the network of can operate
physical on direct
devices, current but
vehicles, home appliances
is a lightweight motor used
other for portable
items embedded power
withtools and appliances.
electronics, sensors,Larger DC motors
actuators, are used
software and inconnectivity wh
propulsion of electricenables
vehicles, elevator
these and
things tohoists,
connector in
anddrives for steel
exchange rolling
data. mills.
Water The advent
quality of power
is major environmental prob
electronics has madeinreplacement
India. Theoflargest
DC motors withof
source AC water
motorsquality
possibleinin many
India applications.
is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Types of dc motors:

1. Brushed DC Motors

2. Brushless DC motors

3. Coreless DC motors

ELECTRONICS AND COMMUNICATION ENGINEERING


34
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Brushed DC motors:
Abstract:
The classic DC motor design generates an oscillating current in a wound rotor with a split
ring commutator, and either a wound or permanent magnet stator. A rotor consists of a coil
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
wound around a rotor which is then powered by any type of battery.
other items embedded with electronics, sensors, actuators, software and connectivity wh
enablesofthese
Many of the limitations things commutator
the classic to connect andDCexchange data.
motor are dueWater
to thequality is major
need for environmental
brushes to prob
in India. TheThis
press against the commutator. largest source
creates of water
friction. quality
At higher in India
speeds, is intreated
brushes sewage. Other sources
have increasing
pollution
difficulty in maintaining includeBrushes
contact. agricultural
may runoff
bounceand
offunregulated small scale
the irregularities in theindustry that results in polluti
commutator
most of
surface, creating sparks. thelimits
This rivers,
thelakes and surface
maximum water.
speed of In conventional
the machine. systems,
The current thepermonitoring proc
density
involves
unit area of the brushes thethe
limits manual
outputcollection of sample
of the motor. water from
The imperfect various
electric regions,
contact followed by testing
also causes
analysis.
electrical noise. Brushes The sensors
eventually wearconnected with Arduino-uno
out and require replacement,inand
discrete way to detect
the commutator the water parame
itself
is subject to wear and
andtomaintenance.
display in a desktop application.
The commutator The quality
assembly on aoflarge
watermachine
should be
is monitored
a costly continuously
element, requiring ensure theassembly
precision safe supply of water
of many parts.from
thereany watertypes
are three bodiesof and water1.resources
dc motor dc series for drinkable
motor 2. dc shuntusing
motorit and thatcompound
3. dc continuousmotor
measurement
- these ofarewater
alsocondition
two typebased on the parameters IoT help
a. cummulative
in improving
compound b. deffercial compounndthe health and living standards of all living things.

Brushless DC motors:

Some of the problems of the brushed DC motor are eliminated in the brushless design. In this
motor, the mechanical "rotating switch" or commutator/brushgear assembly is replaced by an
external electronic switch synchronised to the rotor's position. Brushless motors are typically 85-
90% efficient, whereas DC motors with brushgear are typically 75-80% efficient.

Midway between ordinary DC motors and stepper motors lies the realm of the brushless DC
motor. Built in a fashion very similar to stepper motors, these often use a permanent magnet
external rotor, three phases of driving coils, one or more Hall effect sensors to sense the position
of the rotor, and the associated drive electronics. The coils are activated, one phase after the
other, by the drive electronics as cued by the signals from the Hall effect sensors. In effect, they
act as three-phase synchronous motors containing their own variable-frequency drive electronics.
A specialized class of brushless DC motor controllers utilize EMF feedback through the main
phase connections instead of Hall effect sensors to determine position and velocity. These motors
are used extensively in electric radio-controlled vehicles. When configured with the magnets on
the outside, these are referred to by modelists as outrunner motors.

ELECTRONICS AND COMMUNICATION ENGINEERING


35
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Brushless DC motors are commonly used where precise speed control is necessary, as in

Abstract:
computer disk drives or in video cassette recorders, the spindles within CD, CD-ROM (etc.)
drives, and mechanisms within office products such as fans, laser printers and photocopiers. They
The Internet
have several advantages of Things (IoT)
over conventional is the network of physical devices, vehicles, home appliances
motors:
other items embedded with electronics, sensors, actuators, software and connectivity wh
 Compared to AC fans
enables using
these shaded-pole
things motors,
to connect they are very
and exchange data.efficient, runningismuch
Water quality majorcooler
environmental prob
than the equivalent AC motors. This cool operation leads to much-improved life of the fan's
in India. The largest source of water quality in India is intreated sewage. Other sources
bearings.
pollution include agricultural runoff and unregulated small scale industry that results in polluti
 Without a commutator to wear out, the life of a DC brushless motor can be significantly longer
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
compared to a DC motor using brushes and a commutator. Commutation also tends to cause a
involves the manual collection of sample water from various regions, followed by testing
great deal of electrical and RF noise; without a commutator or brushes, a brushless motor may
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
be used in electrically sensitive devices like audio equipment or computers.
and to display in a desktop application. The quality of water should be monitored continuously
 The same Hall effect sensors that provide the commutation can also provide a convenient
ensure the safe supply of water from any water bodies and water resources for drinkable
tachometer signal for closed-loop control (servo-controlled) applications. In fans, the tachometer
using it and that continuous measurement of water condition based on the parameters IoT help
signal can be used to derive a "fan OK" signal.
in improving the health and living standards of all living things.
 The motor can be easily synchronized to an internal or external clock, leading to precise speed
control.
 Brushless motors have no chance of sparking, unlike brushed motors, making them better suited
to environments with volatile chemicals and fuels. Also, sparking generates ozone which can
accumulate in poorly ventilated buildings risking harm to occupants' health.
 Brushless motors are usually used in small equipment such as computers and are generally used
to get rid of unwanted heat.
 They are also very quiet motors which is an advantage if being used in equipment that is affected
by vibrations.

Modern DC brushless motors range in power from a fraction of a watt to many kilowatts. Larger
brushless motors up to about 100 kW rating are used in electric vehicles. They also find
significant use in high-performance electric model aircraft.

Coreless DC motors:

Nothing in the design of any of the motors described above requires that the iron (steel) portions
of the rotor actually rotate; torque is exerted only on the windings of the electromagnets. Taking
advantage of this fact is the coreless DC motor, a specialized form of a brush or brushless DC

ELECTRONICS AND COMMUNICATION ENGINEERING


36
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
motor. Optimized for rapid acceleration, these motors have a rotor that is constructed without any

Abstract:
iron core. The rotor can take the form of a winding-filled cylinder inside the stator magnets, a
basket surrounding the stator magnets, or a flat pancake (possibly formed on a printed wiring
The Internet
board) running between of Things
upper and (IoT)magnets.
lower stator is the network of physical
The windings devices, stabilized
are typically vehicles, home
by appliances
being impregnatedother
with items embedded
Electrical epoxy with electronics,
potting systems. sensors, actuators,
Filled epoxies that software and connectivity wh
have moderate
enables
mixed viscosity and a longthese
gel things to connect
time. These and exchange
systems data. Water
are highlighted by lowquality is major
shrinkage andenvironmental
low prob
in UL
exotherm. Typically India.
1446The largest source
recognized of water
as a potting qualityforinuse
compound India
up tois180C
intreated
(Classsewage.
H) UL Other sources
File No. E 210549.pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
Because the rotor is much lighter
involves in weight
the manual (mass) of
collection than a conventional
sample water fromrotor formed
various from copper
regions, followed by testing
windings on steel analysis.
laminations, the rotorconnected
The sensors can accelerate much more inrapidly,
with Arduino-uno discreteoften
way achieving a water parame
to detect the
mechanical time constant under 1inms.
and to display This is application.
a desktop especially true
Theifquality
the windings useshould
of water aluminum rather continuously
be monitored
than the heavier copper.
ensureBut
thebecause there of
safe supply is no metal
water mass
from in water
any the rotor to actand
bodies as awater
heat sink, even for drinkable
resources
small coreless motors must
using often
it and becontinuous
that cooled by forced air.
measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.
These motors were commonly used to drive the capstan(s) of magnetic tape drives and are still widely
used in high-performance servo-controlled systems, like radio-controlled vehicles/aircraft, humanoid
robotic systems, industrial automation, medical devices

CHAPTER-4

ELECTRONICS AND COMMUNICATION ENGINEERING


37
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
CONTROLLER
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
Arduino
other items embedded with electronics, sensors, actuators, software and connectivity wh
Arduino isenables
a computer
thesehardware
things toand software
connect company, data.
and exchange project, andquality
Water user community that
is major environmental prob
designs and manufactures
in India.microcontroller kits forofbuilding
The largest source digital devices
water quality in Indiaand
is interactive objects Other sources
intreated sewage.
that can sense andpollution
control objects
include in the physical
agricultural world.
runoff and The project'ssmall
unregulated products
scaleare distributed
industry that results in polluti
as open-source hardware
most ofand
thesoftware, whichand
rivers, lakes are surface
licensedwater.
under the GNU Lesser General
In conventional systems,Public
the monitoring proc
[1]
License (LGPL) orinvolves
the GNU the General Public License
manual collection (GPL),
of sample water permitting the manufacture
from various of
regions, followed by testing
Arduino boards and software
analysis. distribution
The by anyone.
sensors connected Arduino
with boards in
Arduino-uno arediscrete
available commercially
way to detect the water parame
in preassembled form,
and or as do-it-yourself
to display kits.application. The quality of water should be monitored continuously
in a desktop
ensure
Arduino board designs usethe safe supply
a variety of water fromand
of microprocessors anycontrollers.
water bodies
Theand water
boards are resources
equipped for drinkable
with sets of digitalusing it and input/output
and analog that continuous measurement
(I/O) of be
pins that may water condition
interfaced based onexpansion
to various the parameters IoT help
in improving
boards (shields) and the health
other circuits. Theandboards
living standards of all living
feature serial things.
communications interfaces,
including Universal Serial Bus (USB) on some models, which are also used for loading programs
from personal computers. The microcontrollers are typically programmed using a dialect of
features from the programming languages C and C++. In addition to using traditional compiler
toolchains, the Arduino project provides an integrated development environment (IDE) based on
the Processing language project.

The Arduino project started in 2005 as a program for students at the Interaction Design Institute
Ivrea in Ivrea, Italy,[2] aiming to provide a low-cost and easy way for novices and professionals to
create devices that interact with their environment using sensors and actuators. Common
examples of such devices intended for beginner hobbyists include simple robots, thermostats,
and motion detectors.

The name Arduino comes from a bar in Ivrea, Italy, where some of the founders of the project
used to meet. The bar was named after Arduino of Ivrea, who was the margrave of the March of
Ivrea and King of Italy from 1002 to 1014.

ELECTRONICS AND COMMUNICATION ENGINEERING


38
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

History

The origin of the Arduino project started at the Interaction Design Institute Ivrea (IDII) in Ivrea,
Italy.[2] At that time, the students used a BASIC Stamp microcontroller at a cost of $100, a
considerable expense for many students. In 2004, Colombian student Hernando Barragán created
the development platform Wiring as a Master's thesis project at IDII, under the supervision of
Massimo Banzi and Casey Reas, who are known for work on the Processing language. The
project goal was to create simple, low cost tools for creating digital projects by non-engineers.
The Wiring platform consisted of a printed circuit board (PCB) with an ATmega168
microcontroller, an IDE based on Processing and library functions to easily program the
microcontroller.[4]

In 2005, Massimo Banzi, with David Mellis, another IDII student, and David Cuartielles, added
support for the cheaper ATmega8 microcontroller to Wiring. But instead of continuing the work
on Wiring, they copied the Wiring source code and renamed it as a separate project, called
Arduino.[4]

ELECTRONICS AND COMMUNICATION ENGINEERING


39
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
The initial Arduino core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe,
Gianluca Martino, Abstract:
and David Mellis,[2] but Barragán was not invited to participate. [4] Following
the completion of the Wiring platform, lighter and less-expensive versions were distributed in the
The Internet
open-source community. [5] of Things
Adafruit (IoT)
Industries , ais New
the network of physical
York City supplierdevices, vehicles,
of Arduino home appliances
boards,
other estimated
parts, and assemblies, items embedded with electronics,
in mid-2011 sensors,official
that over 300,000 actuators, software
Arduinos hadand
beenconnectivity wh
enables
commercially produced, [6] these things to connect and exchange data. Water quality is major environmental prob
and in 2013 that 700,000 official boards were in users' hands.
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
Hardware most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Arduino is open-source hardware. The hardware reference designs are distributed under
a Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino

ELECTRONICS AND COMMUNICATION ENGINEERING


40
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
website. Layout and production files for some versions of the hardware are also available. The
source code for Abstract:
the IDE is released under the GNU General Public License, version 2.
[8]
Nevertheless, an official Bill of Materials of Arduino boards has never been released by
The Internet
Arduino staff. Although of Thingsand
the hardware (IoT) is the network
software designs of
arephysical devices, vehicles,
freely available home appliances
under copy
other itemshave
left licenses, the developers embedded with
requested thatelectronics, sensors, be
the name Arduino actuators,
exclusivesoftware and connectivity wh
to the official
product and not beenables these
used for things
derived to connect
works and
without exchange data.
permission. Water quality
The official policy is major environmental
document on prob
use of the Arduinoinname
India. The largest
emphasizes that source of water
the project quality
is open in India iswork
to incorporating intreated sewage.
by others into Other sources
pollution
the official product. [9] include
Several agricultural runoff
Arduino-compatible and unregulated
products small
commercially scale industry
released that results in polluti
have avoided
the project name bymost
usingofvarious
the rivers,
nameslakes andinsurface
ending water. In conventional systems, the monitoring proc
-duino.[10]
involves the manual collection of sample water from various regions, followed by testing
An Arduino board consists of an Atmel 8-, 16- or 32-bit AVR microcontroller (ATmega8,
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
ATmega168, ATmega328, ATmega1280, ATmega2560), but other makers' microcontrollers have
and to display in a desktop application. The quality of water should be monitored continuously
been used since 2015. The boards use single-row pins or female headers that facilitate
ensure the safe supply of water from any water bodies and water resources for drinkable
connections for programming and incorporation into other circuits. These may connect with add-
using it and that continuous measurement of water condition based on the parameters IoT help
on modules termed shields. Multiple, and possibly stacked shields may be individually
in improving the health and living standards of all living things.
addressable via an I²C serial bus. Most boards include a 5 V linear regulator and a
16 MHz crystal oscillator or ceramic resonator. Some designs, such as the LilyPad, run at 8 MHz
and dispense with the onboard voltage regulator due to specific form-factor restrictions.

Arduino microcontrollers are pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory. The default bootloader of the Aduino UNO is the optiboot
bootloader.[12] Boards are loaded with program code via a serial connection to another computer.
Some serial Arduino boards contain a level shifter circuit to convert between RS-232 logic levels
and transistor–transistor logic (TTL) level signals. Current Arduino boards are programmed
via Universal Serial Bus (USB), implemented using USB-to-serial adapter chips such as
the FTDI FT232. Some boards, such as later-model Uno boards, substitute the FTDI chip with a
separate AVR chip containing USB-to-serial firmware, which is reprogrammable via its own
ICSP header. Other variants, such as the Arduino Mini and the unofficial Boarduino, use a
detachable USB-to-serial adapter board or cable, Bluetooth or other methods, when used with
traditional microcontroller tools instead of the Arduino IDE, standard AVR in-system
programming (ISP) programming is used.

The Arduino board exposes most of the microcontroller's I/O pins for use by other
circuits. The Diecimila,[a] Duemilanove,[b] and current Uno[c] provide 14 digital I/O pins, six of

ELECTRONICS AND COMMUNICATION ENGINEERING


41
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
which can produce pulse-width modulated signals, and six analog inputs, which can also be used

Abstract:
as six digital I/O pins. These pins are on the top of the board, via female 0.1-inch (2.54 mm)
headers. Several plug-in application shields are also commercially available. The Arduino Nano,
The Internet
and Arduino-compatible of Things
Bare Bones Board(IoT)
[13] is Boarduino
and the network
[14] of physical devices, vehicles, home appliances
boards may provide male header
otherofitems
pins on the underside embedded
the board with
that can plugelectronics,
into soldersensors, actuators,
less bread boards. software and connectivity wh
Many Arduino-
enables these things
compatible and Arduino-derived to connect
boards and exchange
exist. Some data. Water
are functionally qualitytois an
equivalent major environmental prob
Arduino
in India. The largest
and can be used interchangeably. Manysource of the
enhance water quality
basic in India
Arduino is intreated
by adding output sewage.
drivers, Other sources
pollution include
often for use in school-level agricultural
education, runoff
to simplify and unregulated
making buggies andsmall
smallscale industry
robots. Othersthat
areresults in polluti
mostbut
electrically equivalent ofchange
the rivers, lakesfactor,
the form and surface water.
sometimes In conventional
retaining systems,
compatibility the monitoring proc
with shields,
involves
sometimes not. Some theuse
variants manual collection
different of sample
processors, water
of varying from various regions, followed by testing
compatibility.
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
Software development
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
A program for Arduino may be written in any programming language for a compiler that
in improving the health and living standards of all living things.
produces binary machine code for the target processor. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

The Arduino project provides the Arduino integrated development environment (IDE), which is
a cross-platform application written in the programming language Java. It originated from the
IDE for the languages Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace matching,
and syntax highlighting, and provides simple one-click mechanisms to compile and upload
programs to an Arduino board. It also contains a message area, a text console, a toolbar with
buttons for common functions and a hierarchy of operation menus.

A program written with the IDE for Arduino is called a sketch.[40] Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde. The Arduino IDE supports the languages C and C+
+ using special rules of code structuring. The Arduino IDE supplies a software library from
the Wiring project, which provides many common input and output procedures. User-written
code only requires two basic functions, for starting the sketch and the main program loop, that are

ELECTRONICS AND COMMUNICATION ENGINEERING


42
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
compiled and linked with a program stub main() into an executable cyclic executive program

Abstract:
with the GNU toolchain, also included with the IDE distribution. The Arduino IDE employs the
program avrdude to convert the executable code into a text file in hexadecimal encoding that is
The Internet
loaded into the Arduino board byofaThings (IoT) is the
loader program network
in the board'soffirmware.
physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
Applications in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
1. Xoscillo, an open-source oscilloscope[48]
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
2. Arduinome, a MIDI controller device that mimics the Monome
involves the manual collection of sample water from various regions, followed by testing
3. OBDuino, a trip computer that uses the on-board diagnostics interface found in most
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
modern cars
and to display in a desktop application. The quality of water should be monitored continuously
4. Ardupilot, drone software and hardware
ensure the safe supply of water from any water bodies and water resources for drinkable
5. Gameduino, an Arduino shield to create retro 2D video games[49]
using it and that continuous measurement of water condition based on the parameters IoT help
6. Arduino Phone, a do-it-yourself cellphone[50][51]
in improving the health and living standards of all living things.
7. Water quality testing platform[52]
8. Automatic titration system based on Arduino and stepper motor[53]
9. Low cost data glove for virtual reality applications[54]
10. Impedance sensor system to detect bovine milk adulteration[55]
11. Homemade CNC using Arduino and DC motors with close loop control by
Homofaciens[56]
12. DC motor control using Arduino and H-Bridge[

Technical specs

ELECTRONICS AND COMMUNICATION ENGINEERING


43
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Programming
The Arduino/Genuino Uno can be programmed with the (Arduino Software (IDE)). Select
"Arduino/Genuino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials. The ATmega328 on the Arduino/Genuino Uno
comes preprogrammed with a bootloader that allows you to upload new code to it without the use
of an external hardware programmer. It communicates using the original STK500 protocol
(reference, C header files).

You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header using Arduino ISP or similar; see these instructions for details. The
ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available in the

ELECTRONICS AND COMMUNICATION ENGINEERING


44
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Arduino repository. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be
activated by: Abstract:
 On Rev1 boards: connecting
The Internet the solder
of Things (IoT)jumper on the back
is the network of the board
of physical (nearvehicles,
devices, the maphome
of appliances
Italy) and then
otherrese ing the
items 8U2. with electronics, sensors, actuators, software and connectivity wh
embedded
 On Rev2 or later these
enables boards: thereto is
things a resistor
connect that pulling
and exchange data.theWater
8U2/16U2
quality HWB line
is major to
environmental prob
ground, making it easier
in India. Thetolargest
put intosource
DFU mode.
of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
involves the manual collection of sample water from various regions, followed by testing
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

ELECTRONICS AND COMMUNICATION ENGINEERING


45
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Warnings
The Arduino/Genuino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal protection, the
fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port, the
fuse will automatically break the connection until the short or overload is removed.

Differences with other boards


The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-
to-serial converter.

Power

ELECTRONICS AND COMMUNICATION ENGINEERING


46
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
The Arduino/Genuino Uno board can be powered via the USB connection or with an external
power supply. TheAbstract:
power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by
plugging a 2.1mm The Internet of plug
center-positive Things (IoT)
into is the network
the board's of physical
power jack. devices,
Leads from vehicles,
a battery can home
be appliances
other
inserted in the GND itemspinembedded
and Vin headers ofwith electronics,
the POWER sensors, actuators, software and connectivity wh
connector.
enables these things to connect and exchange data. Water quality is major environmental prob
The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V,
in may
however, the 5V pin India. The less
supply largest
thansource of water
five volts and thequality in India
board may is intreated
become unstable. sewage.
If using Other sources
more than 12V, thepollution
voltage regulator may overheat
include agricultural andand
runoff damage the board.
unregulated The
small power
scale pins are
industry thatasresults in polluti
follows:
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
 Vin. The input voltage to the Arduino/Genuino board when it's using an external
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
power source (as opposed to 5 volts from the USB connection or other regulated
and to display in a desktop application. The quality of water should be monitored continuously
power source). You can supply voltage through this pin, or, if supplying voltage via
ensure the safe supply of water from any water bodies and water resources for drinkable
the power jack, access it through this pin.
using it and that continuous measurement of water condition based on the parameters IoT help
 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
in improving the health and living standards of all living things.
supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
 GND. Ground pins.
 IOREF. This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source or enable voltage translators on
the outputs to work with the 5V or 3.3V.

Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output

ELECTRONICS AND COMMUNICATION ENGINEERING


47
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8,
168, and 328 is identical. Each of the 14 digital pins on the Uno can be used as an input or output,
Abstract: and digitalRead() functions. They operate at 5 volts. Each pin
using pinMode(), digitalWrite(),
can provide or receive 20 mA as recommended operating condition and has an internal pull-up
resistor (disconnected
Theby default)
Internet ofofThings
20-50k(IoT)
ohm.isAthe
maximum
networkofof40mA is the
physical value that
devices, must not
vehicles, home appliances
be exceeded on any I/O pin to avoid permanent damage to the microcontroller.
other items embedded with electronics, sensors, actuators, software and connectivity wh
In addition, some pins have
enables these things to connect and exchange data.specialized functions:
Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pollution include agricultural runoff and unregulated small scale industry that results in polluti
pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
involves the manual collection of sample water from various regions, followed by testing
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
details.
and to display in a desktop application. The quality of water should be monitored continuously
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
ensure the safe supply of water from any water bodies and water resources for drinkable
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using it and that continuous measurement of water condition based on the parameters IoT help
using the SPI library.
in improving the health and living standards of all living things.
 LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value,
the LED is on, when the pin is LOW, it's off.
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
 The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. There are a couple of other pins on the board:

o AREF. Reference voltage for the analog inputs. Used with analogReference().
o Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.

Communication
Arduino/Genuino Uno has a number of facilities for communicating with a computer, another
Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL (5V)

ELECTRONICS AND COMMUNICATION ENGINEERING


48
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on
the board channelsAbstract:
this serial communication over USB and appears as a virtual com port to
software on the computer. The 16U2 firmware uses the standard USB COM drivers, and no
The Internet
external driver is needed. of Things
However, (IoT) is the
on Windows, network
a .inf file is of physicalThe
required. devices, vehicles,
Arduino home appliances
Software
othermonitor
(IDE) includes a serial items which
embedded with
allows electronics,
simple sensors,
textual data actuators,
to be sent to and software and connectivity wh
from the board.
enables
The RX and TX LEDs onthese thingswill
the board to connect and exchange
flash when data.transmitted
data is being Water quality
viaisthe
major environmental prob
USB-to-
in connection
serial chip and USB India. The tolargest source of
the computer (butwater quality
not for serial in India is intreated
communication sewage.
on pins 0 and Other sources
pollution
1). A SoftwareSerial libraryinclude
allows agricultural runoff and on
serial communication unregulated small
any of the scale
Uno's industry
digital pins.that
Theresults in polluti
ATmega328 also most of the
supports I2Crivers,
(TWI)lakes and communication.
and SPI surface water. InThe
conventional systems, (IDE)
Arduino Software the monitoring proc
involves
includes a Wire library the manual
to simplify collection
use of of sample
the I2C bus; see thewater from various
documentation regions,For
for details. followed
SPI by testing
analysis.
communication, use the SPIThe sensors connected with Arduino-uno in discrete way to detect the water parame
library.
and to display in a desktop application. The quality of water should be monitored continuously
Automatic (Software) Reset
ensure the safe supply of water from any water bodies and water resources for drinkable
Rather than requiring a physical press of the reset button before an upload, the Arduino/Genuino
using it and that continuous measurement of water condition based on the parameters IoT help
Uno board is designed in a way that allows it to be reset by software running on a connected
in improving the health and living standards of all living things.
computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected
to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted
(taken low), the reset line drops long enough to reset the chip. The Arduino Software (IDE) uses
this capability to allow you to upload code by simply pressing the upload button in the interface
toolbar. This means that the bootloader can have a shorter timeout, as the lowering of DTR can be
well-coordinated with the start of the upload.

This setup has other implications. When the Uno is connected to either a computer running Mac
OS X or Linux, it resets each time a connection is made to it from software (via USB). For the
following half-second or so, the bootloader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before sending this data.

The Uno board contains a trace that can be cut to disable the auto-reset. The pads on either side of
the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able
to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this
forum thread for details.

ELECTRONICS AND COMMUNICATION ENGINEERING


49
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Revisions:

Abstract:
Revision 3 of the board has the following new features:1.0 pin out: added SDA and SCL pins that
are near to the AREF pin and two other new pins placed near to the RESET pin, the IOREF that
allow the shields The Internet
to adapt of Things
to the voltage(IoT) is thefrom
provided network of physical
the board. devices,
In future, vehicles,
shields will home
be appliances
other
compatible with both theitems
board embedded
that uses thewith
AVR,electronics, sensors,
which operates withactuators, software
5V and with and connectivity wh
the Arduino
Due that operates enables these
with 3.3V. things
The to connect
second one is aand
notexchange data.
connected pin,Water
that isquality is major
reserved environmental prob
for future
purposes. in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
1. Stronger
most RESET circuit.lakes and surface water. In conventional systems, the monitoring proc
of the rivers,
2. Atmega 16U2the
involves replace
manualthecollection
8U2. of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

CHAPTER-5

SOFTWARE

Software introduction:

ELECTRONICS AND COMMUNICATION ENGINEERING


50
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Arduino IDE Software. You can get different versions of Arduino IDE from the Download page

Abstract:
on the Arduino Official website. You must select your software, which is compatible with your
operating system (Windows, IOS, or Linux). After your file download is complete, unzip the file.
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig. 3.1 Opening arduino-nightly-windows.zip

Launch Arduino IDE. After your Arduino IDE software is downloaded, you need to unzip the
folder. Inside the folder, you can find the application icon with an infinity label (application.exe).
Doubleclick the icon to start the IDE.

ELECTRONICS AND COMMUNICATION ENGINEERING


51
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig:3.2 Launch Arduino IDE

Open your first project. Once the software starts, you have two options:

 Create a new project.

 Open an existing project example.

To create a new project, select File --> New

ELECTRONICS AND COMMUNICATION ENGINEERING


52
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improvingFig:3.2 Create
the health a new
and project
living standards of all living things.

Fig: 3.3Open an existing project example

ELECTRONICS AND COMMUNICATION ENGINEERING


53
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
Here, we are selecting just one of the examples with the name Blink. It turns the LED on and off

Abstract:
with some time delay. You can select any other example from the list Select your serial port.
Select the serial device of the Arduino board. Go to Tools -> Serial Port menu. This is likely to be
The Internet
COM3 or higher (COM1 of Things
and COM2 (IoT) isreserved
are usually the network of physical
for hardware devices,
serial ports). vehicles, home appliances
To find out,
you can disconnectother items embedded
your Arduino board andwith electronics,
re-open the menu,sensors,
the entryactuators, software
that disappears andbeconnectivity wh
should
enables
of the Arduino board. these things
Reconnect to connect
the board andthat
and select exchange data. Water quality is major environmental prob
serial port.
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig:3.4 Select your serial port

Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.

A- Used to check if there is any compilation error.


B- Used to upload a program to the Arduino board.
C- Shortcut used to create a new sketch.
D- Used to directly open one of the example sketch.
E- Used to save your sketch.
F- Serial monitor used to receive serial data from the board and send the serial data to the
board.
Now, simply click the "Upload" button in the environment.
Wait a few seconds; you will see the RX and TX LEDs on the board, flashing. If the upload is
successful, the message "Done uploading" will appear in the status bar.

ELECTRONICS AND COMMUNICATION ENGINEERING


54
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis.
Fig 3.5 function The symbol
of each sensorsappearing
connectedinwith
the Arduino-uno
Arduino IDE in discrete way to detect the water parame
toolbar
and to display in a desktop application. The quality of water should be monitored continuously
In this chapter, we will study in depth, the Arduino program structure and we will learn more new
ensure the safe supply of water from any water bodies and water resources for drinkable
terminologies used in the Arduino world. The Arduino software is open-source. The source code
using it and that continuous measurement of water condition based on the parameters IoT help
for the Java environment is released under the GPL and the C/C++ microcontroller libraries are
in improving the health and living standards of all living things.
under the LGPL. Sketch: The first new terminology is the Arduino program called “sketch”.
Structure Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software program, step
by step, and how we can write the program without any syntax or compilation error. Let us start
with the Structure. Software structure consist of two main functions:

Setup( ) function

Loop( ) function

ELECTRONICS AND COMMUNICATION ENGINEERING


55
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

Fig: 3.6 Bare minimum code

Data types in C refers to an extensive system used for declaring variables or functions of different
types. The type of a variable determines how much space it occupies in the storage and how the
bit pattern stored is interpreted. The following table provides all the data types that you will use
during Arduino programming.

ELECTRONICS AND COMMUNICATION ENGINEERING


56
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:
System Architecture: The IoT-based automatic shed system comprises the following
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
components:
other items embedded with electronics, sensors, actuators, software and connectivity wh
 Rainfall Sensors:enables
These these
sensors detect
things the onset
to connect of rain and
and exchange provide
data. Waterinput
qualitytoisthe control
major environmental prob
unit. in India. The largest source of water quality in India is intreated sewage. Other sources
 Control Unit: The central processing unit receives data from the sensors and triggers the
pollution include agricultural runoff and unregulated small scale industry that results in polluti
deployment of the shed when rainfall is detected.
 Actuators: Thesemost
mechanical devices
of the rivers, are and
lakes responsible for deploying
surface water. and retracting
In conventional systems,the
the monitoring proc
shed as per the control
involvesunit's instructions.
the manual collection of sample water from various regions, followed by testing
 Communication Module: Facilitates communication between sensors, actuators, and
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
the control unit.
and to display in a desktop application. The quality of water should be monitored continuously
3. Operational Workflow:
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
1. Rainfall sensors continuously monitor environmental conditions.
2. in improving
Upon detecting rainfall, the health
the sensors andsignals
send living standards of all living
to the control unit. things.
3. The control unit processes the incoming data and initiates the deployment of the shed.
4. Actuators engage to extend the shed over the crop area, providing protection from rain.
5. Once the rain subsides or predefined conditions are met, the control unit commands the
retraction of the shed.

4. System Benefits:

 Crop Protection: Ensures crops are shielded from excessive rainfall, reducing the risk of
damage and promoting healthy growth.
 Automation: Eliminates the need for manual intervention, allowing farmers to focus on
other essential tasks.
 Optimized Resource Usage: Prevents wastage of water and fertilizers due to runoff
caused by heavy rainfall.
 Data Insights: Collects environmental data, enabling farmers to make informed
decisions regarding crop management and irrigation scheduling.

5. Implementation Considerations:

 Weatherproof Design: Components should be adequately sealed to withstand outdoor


conditions.
 Power Supply: Ensure reliable power sources are available to sustain continuous
operation.

ELECTRONICS AND COMMUNICATION ENGINEERING


57
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System
 Remote Monitoring: Implement remote access capabilities for real-time monitoring and
control of the system.
Abstract:
 Scalability: Design the system to accommodate varying farm sizes and crop types.

. The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances
other items embedded with electronics, sensors, actuators, software and connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
in India. The largest source of water quality in India is intreated sewage. Other sources
pollution include agricultural runoff and unregulated small scale industry that results in polluti
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
CHAPTER-6
in improving the health and living standards of all living things.

CONCLUSION

ELECTRONICS AND COMMUNICATION ENGINEERING


58
ELECTRONICS AND COMMUNICATION ENGINEERING
IoT Based Smart Water Quality Monitoring System

Abstract:

6. Conclusion:The
TheInternet
IoT-based automatic
of Things (IoT) shed
is thesystem
networkoffers an innovative
of physical devices, solution
vehicles, to
home appliances

mitigate theother items


impact of embedded
unwanted with electronics,
rain on sensors, By
crop cultivation. actuators, software
leveraging sensorand connectivity wh
enables these things to connect and exchange data. Water quality is major environmental prob
technology and automation, farmers can enhance crop resilience and improve overall
in India. The largest source of water quality in India is intreated sewage. Other sources
agricultural productivity. Further research and development in this area can lead to
pollution include agricultural runoff and unregulated small scale industry that results in polluti
advancements in precision farming practices and sustainable food production
most of the rivers, lakes and surface water. In conventional systems, the monitoring proc
involves the manual collection of sample water from various regions, followed by testing
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parame
and to display in a desktop application. The quality of water should be monitored continuously
ensure the safe supply of water from any water bodies and water resources for drinkable
using it and that continuous measurement of water condition based on the parameters IoT help
in improving the health and living standards of all living things.

REFERENCES

ELECTRONICS AND COMMUNICATION ENGINEERING


59
ELECTRONICS AND COMMUNICATION ENGINEERING

You might also like