You are on page 1of 47

WATER PURITY MONITORING

AND NOTIFICATION SYSTEM

2017

B TECH MINIPROJECT REPORT

Done by

AATHMAY PUTIYAN - ETAOEEC001

ABHISHA P. M. - ETAOEEC004

ARUN R. - ETAOEEC017

ARYA VISWANATH - ETAOEEC018

Department of Electronics and Communication

Engineering

Government Engineering College


Thrissur - 680 009
ACKNOWLEDGEMENT

First and foremost we thank the Almighty for His infinite blessings that He
has showered on us in every moment of developing this work.
Project WATER PURITY MONITORING AND NOTIFICATION SYS-
TEM is a success carved out of our hard work along with the encouragement
and co-operation of a number of people. We are greatly indebted to each and
everyone of them.
We would like to express our sincere gratitude to Assistant Professor Latha
K. N our guide who always motivated and advised us throughout the project.
We would like to acknowledge the project co-ordinator Assistant Profes-
sor Job Chunkath for his valuable advice and whole hearted co-operation.
We would also like to thank Professor Mrinalini C P, the Head of the De-
partment, Department of Electronics and Communication Engineering, Govt.
Engineering College, Thrissur for facilitating us with all the requirements of
the project wholeheartedly. The cooperation offered by the lab staff of Envi-
ronmental Laboratory, Civil Department, Govt. Engineering College, Thrissur
and other department personnel is also worth mentioning.
Our friends who helped us throughout the strenuous process of project
completion deserve a token of appreciation and our deepest gratitude. We
also thank all those friendly souls whom we unfortunately failed to mention.

AATHMAY PUTIYAN
ABHISHA P. M.
ARUN R.
ARYA VISWANATH

i
ABSTRACT

Quality of water is of paramount importance, whether it is for livestock wa-


tering, irrigation, spraying, or drinking water. Many people are aware of some
of their water quality problems. For example, some people may be plagued
with high concentrations of iron, which causes aesthetically unpleasing color-
ing and staining. Unfortunately, not all water quality problems can be easily
detected without proper testing. The water may look good but may actually
be unsuitable for its specific application.
Monitoring water quality by having it tested regularly is an important part
of maintaining a safe and reliable source. Hence why the need for a system to
detect water quality and to notify the user about the quality. This system can
be implemented in houses and factories and can easily be attached to tanks
and pumps. It will be able to measure the physiochemical parameters of wa-
ter quality like hardness, turbidity, pH etc. Sensors are used for this that are
connected to a microcontroller to analyze the data. When water quality pa-
rameters reach unsafe levels the user is notified. The system can be extended
to large supply pumps by notifying the water authorities, if impurities are de-
tected. This helps to ensure that the water source is being properly protected
from potential contamination.

ii
Contents

1 INTRODUCTION 1
1.1 OBJECTIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 PROJECT MOTIVATION . . . . . . . . . . . . . . . . . . . . . 2
1.3 IMPLEMENTATION . . . . . . . . . . . . . . . . . . . . . . . . 2

2 LITERATURE REVIEW 3
2.1 TESTING OF PARAMETERS . . . . . . . . . . . . . . . . . . 3
2.1.1 Turbidity (Suspended Solids) . . . . . . . . . . . . . . . 3
2.1.2 Estimation of Calcium and Magnesium Ions
(Total Hardness) . . . . . . . . . . . . . . . . . . . . . . 4
2.2 TEST KITS AVAILABLE IN INDIA . . . . . . . . . . . . . . . 4

3 GENERAL DESCRIPTION 8
3.1 BLOCK DIAGRAM . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 BLOCK DIAGRAM DESCRIPTION . . . . . . . . . . . . . . . 8

4 HARDWARE DESCRIPTION 9
4.1 ARDUINO UNO . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.1.1 Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.2 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1.3 Input and Output . . . . . . . . . . . . . . . . . . . . . . 11
4.1.4 Communication . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 GSM SIM900A MODULE . . . . . . . . . . . . . . . . . . . . . 12
4.2.1 GSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.2 GSM MODULE . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 TURBIDITY SENSOR . . . . . . . . . . . . . . . . . . . . . . . 15
4.3.1 LDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.2 LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.3 Working of Turbidity Sensor . . . . . . . . . . . . . . . . 17
4.4 CONDUCTIVITY SENSOR . . . . . . . . . . . . . . . . . . . . 17
4.4.1 Working of Conductivity Sensor . . . . . . . . . . . . . . 18

5 CALIBRATION 20

6 CIRCUIT DESCRIPTION 22
6.1 CIRCUIT DIAGRAM . . . . . . . . . . . . . . . . . . . . . . . 22
6.2 CIRCUIT OPERATION . . . . . . . . . . . . . . . . . . . . . . 23

iii
7 FLOWCHART AND PROGRAMMING 24
7.1 FLOWCHART . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.2 PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

8 RESULT AND INFERENCES 29


8.1 ADVANTAGES . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.2 DISADVANTAGES . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.3 FURTHER IMPROVEMENTS . . . . . . . . . . . . . . . . . . 30
8.4 COST ESTIMATION . . . . . . . . . . . . . . . . . . . . . . . 31

9 CONCLUSION 32

10 BIBLIOGRAPHY 33

11 APPENDIX A 34

12 APPENDIX B 36

13 APPENDIX C 39

iv
List of Figures

2.1 Nephelometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

3.1 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4.1 Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10


4.2 GSM SIM900A . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3 Turbidity Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 Turbidity Sensor - Circuit . . . . . . . . . . . . . . . . . . . . . 16
4.5 Conductivity Sensor . . . . . . . . . . . . . . . . . . . . . . . . 18
4.6 Conductivity Sensor - Circuit . . . . . . . . . . . . . . . . . . . 19

5.1 Hardness Calibration Graph . . . . . . . . . . . . . . . . . . . . 21


5.2 Turbidity Calibration Graph . . . . . . . . . . . . . . . . . . . . 21

6.1 Monitoring System . . . . . . . . . . . . . . . . . . . . . . . . . 22


6.2 Notification System . . . . . . . . . . . . . . . . . . . . . . . . . 23

8.1 Received Message A . . . . . . . . . . . . . . . . . . . . . . . . 29


8.2 Received Message B . . . . . . . . . . . . . . . . . . . . . . . . 30

11.1 ATmega328 Microprocessor . . . . . . . . . . . . . . . . . . . . 34

12.1 SIM900A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

13.1 Hardness Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . 39

v
List of abbreviations

DIP Dual In line Package


GSM Global System for Mobile Communication
SMS Short Message Service
LDR Light Dependent Resistor
LED Light Emitting Diode
IC Integrated Circuit
TTL Transistor transistor logic
A/D Analog to Digital
I/O Input-Output
AVR Advanced Virtual RISC
RISC Reduced Instruction Set Computer
ICSP In-Circuit Serial Programming
NTU Nephelometric turbidity units
UART (Universal Asynchronous Receiver/Transmitter)
SPI Serial Peripheral Interface
KVA Kilovolt ampere
PWM Pulse Width Modulation
USB Universal Serial Bus
DFU Device Firmware Upgrade
GND Ground
A Ampere
mg/L milligrams per litre
V Volts
SIM subscriber identity module
GPRS general packet radio service
RTC Real Time Clock
FDMA Frequency-division multiple access
Kbps kilobits per second

vi
LCD Liquid crystal display
SMT Surface-mount technology
Rx Receiver
GPIO General-purpose input/output
MMS Multimedia Messaging Service
PPP Point-to-Point Protocol
USSD Unstructured Supplementary Service Data
CSD Circuit Switched Data
PBCCH Packet Broadcast Control Channel
TCP Transmission Control Protocol
FTP File Transfer Protocol

vii
Chapter 1

INTRODUCTION

When we turn on the tap and fill up a glass, go for a dip in the ocean or fry
up a freshly caught fish from the local lake, most of us take it for granted that
these are all safe actions. The reality is that behind the scenes, scientists work
tirelessly to ensure that the quality of the worlds most valuable resource is
as high as possible. Water purification is the process of removing undesirable
chemicals, biological contaminants, suspended solids and gases from water.
The goal is to produce water fit for a specific purpose. Most water is disin-
fected for human consumption (drinking water), but water purification may
also be designed for a variety of other purposes, including fulfilling the require-
ments of medical, pharmacological, chemical and industrial applications. The
methods used include physical processes such as filtration, sedimentation, and
distillation; biological processes such as slow sand filters or biologically active
carbon; chemical processes such as flocculation and chlorination and the use of
electromagnetic radiation such as ultraviolet light. For water from lakes and
streams to coastal waters and estuaries, water quality monitoring is a critical
practice carried out in countries across the globe.
The purpose of the system is to ensure that the water surface is being pro-
tected from potential contamination. On an overview, water sample is analysed
using two sensors -
1.Conductivity Sensor
2.Turbidity Sensor
and the status of water is analysed and notification is sent to the user. Ba-
sically, the system measures the physicochemical parameters of water quality
like turbidity and hardness. The main constraints on the project was keeping
the budget low and making it user friendly.

1
B.TECH MINI PROJECT 2017

1.1 OBJECTIVE
Through this project we aimed at using technology for the most relevant
social issue prevailing today. By understanding the quality of water whether
it is turbid, hard or pure we can distinguish between the processing techniques
of water. By notifying the user about the purity level of water, the user can
be aware about the precautions to be taken. Thus we can reduce the health
issues related to it. Moreover this knowledge can be used to test the suitability
of water quality for its intended purpose.That is the more pure water can be
used for drinking, less pure can be used for agriculture etc. Thus the health
issues can be reduced as well as water conservation can also be done. In this
era of water scarcity and other water related health issues this low cost and
simple system will definitely be a boon.

1.2 PROJECT MOTIVATION


The issues related to water including scarcity and water borne diseases were
spreading in colleges and hostels. It was because of the social issue that we
came up with the idea to monitor and notify the user about the water qual-
ity which will certainly help to reduce such issues to an extend. Moreover the
challenge was to develop a system with low cost and with a simple hardware de-
sign. Water quality monitoring data is incredibly useful however its not always
easy to gather. Specialists use a range of different techniques to put together
results, including taking samples of chemical conditions, analysing sediments
and using fish tissue extracts to find traces of metals, oils, pesticides, dissolved
oxygen and nutrients. The above processes that these specialists use are really
complicated and thus to simplify this for layman and for day to day use a
system had to be developed.
At the end of the day, water quality monitoring is an essential part of
keeping the planet healthy and sustainable. As we continue to build cities,
clear land for farming and make other man-made changes to the natural envi-
ronment, water quality monitoring becomes increasingly important.

1.3 IMPLEMENTATION
The system we proposed is a low cost, easy to implement one which con-
sists of two sensors, a microcontroller and a GSM (Global System for Mobile
Communication) module. The sensors are -
1.Turbidity sensor
2.Conductivity sensor
The sensor output is given to microcontroller where necessary analyzes is
done and is fed to the GSM. The GSM sends messages to the user notifying
whether the system is turbid or hard.

Department of ECE, GEC, Thrissur 2


Chapter 2

LITERATURE REVIEW

2.1 TESTING OF PARAMETERS


2.1.1 Turbidity (Suspended Solids)
Water from various sources may contain suspended solids such as fine dust
particles. With suitable filters and appropriate mechanisms, the water should
be without suspensions. However in case the fine particles are of colloidal
dimensions they will still persist and the water could thus appear turbid. Tur-
bidity can be measured by a Nephelometer. A nephelometer is an instrument
for measuring concentration of suspended particulates in a liquid or gas col-
loid. A nephelometer measures suspended particulates by employing a light
beam (source beam) and a light detector set to one side (often 90) of the source
beam. Particle density is then a function of the light reflected into the detector
from the particles. To some extent, how much light reflects for a given density
of particles is dependent upon properties of the particles such as their shape,
color, and reflectivity. Nephelometers are calibrated to a known particulate,
then use environmental factors (k-factors) to compensate lighter or darker col-
ored dusts accordingly. K-factor is determined by the user by running the
nephelometer next to an air sampling pump and comparing results. There is
a wide variety of research-grade nephelometers on the market as well as open
source varieties. The units of turbidity from a calibrated nephelometer are
called Nephelometric Turbidity Units (NTU).

Figure 2.1: Nephelometer

3
B.TECH MINI PROJECT 2017

2.1.2 Estimation of Calcium and Magnesium Ions


(Total Hardness)
Hard water contains calcium and magnesium ions and estimation of these
are important for determining the hardness of water. Titration with EDTA
(Ethylenediamine Tetra Acetate) is a common method for estimation of these
ions. Reagents are
A. Sodium hydroxide (0.1 N)
B. Standard calcium solution : Weighed 1.0 gm of anhydrous calcium carbon-
ate into a 500 ml erlenmeyer flask. A funnel was placed in the flask neck and
1+1 HCl is added until all CaCO3 gets dissolved. The volume is made upto 1
liter.
C. Erichrome black T indicator 0.5 g of Erichrome black T in 100 g tri-
ethanolamine. Two drops of indicator is added to per 50 ml solution to be
titrated.
D. EDTA (Versenate) solution (0.01 M) 3.723 g of disodium dihydrogen
ethylenediamine-tetra-acetate is dissolved in water and diluted to 1 liter. The
solution is standardized (CaCl2), using titration procedure given below using
indicator (Erichrome black).
E. Buffer solution: 16.9 g ammonium chloride (NH4Cl) is added in 143 ml
conc. ammonium hydroxide. 1.25 g of magnesium salt of EDTA is then added
and the volume is made to 250 ml with distilled water.

Procedure:
I. Titration of sample:
25 ml sample is diluted to 50 ml with distilled water. 1-2 drops of buffer
solution are added (to give a pH of 10.0). 1-2 drops of indicator solution
are added and the solution is titrated with standard EDTA solution, with
continuous stirring till the end point is reached (blue color).
II. Calculation:
Hardness as mg CaCO3/L = [A x B x 100]/ ml sample
Where, A = ml titration for sample and B = mg CaCO3 equivalent to 1.00 ml
EDTA titrant
Calcium as mg Ca/L = A x B x 400.8/ml sample
A = ml titrant for sample
B = mg CaCO3 equivalent to 1 ml EDTA titrant at the calcium indicator end
point.

2.2 TEST KITS AVAILABLE IN INDIA


For rapid testing kits have been developed by a number of Indian institu-
tions and are being marketed. Recently the Central Pollution Control Board
(CPCB), Delhi and the Sriram Institute for Industrial Research, Delhi have
conducted a comparative evaluation of various water testing kit packages avail-
able in India. Some manufacturers names and address are listed below.

Department of ECE, GEC, Thrissur 4


B.TECH MINI PROJECT 2017

Details of selected Water Quality Kits: Availability in India


1. Developed by : Defence Laboratory, Jodhpur
Method of Analysis : Qualitative, visual colour
comparison
Parameters that can be analysed : Fluoride, nitrate, iron, nitrite,
residual chlorine, chlorides,
total dissolved solids, fecal
coliform
Power Supply : 220V AC mains or 12 V/DC
battery
Weight : 10 kg
Size : 42 cm x 28 cm x 25 cm
Components : Single unit with built in
incubator

2. Developed by : Industrial Toxicology


Research Centre, Lucknow
Method of Analysis : Quantitative, colorimetric
and titrimetric
Parameters that can be analysed : pH, fluoride, nitrate, iron,
nitrate residual chlorine,
chlorides, alkalinity, hardness
and fecal coliform
Power Supply : AC mains, 20/110 volts
for 1 KVA generator
Weight : 16 kg
Size : 50 cm x 35 cm x 28 cm
Components : Incubator and calorimetric
unit with suitcase
holding chemicals (2 units)

3. Developed by : National Environmental


Engineering Research Institute,
Nagpur

Department of ECE, GEC, Thrissur 5


B.TECH MINI PROJECT 2017

a) Name of the kit : Rapid Aqua Tester


Method of Analysis : Colour comparison
Parameters that can be analysed : pH, fluoride, iron, residual
chlorine
Power Supply : No power required
Weight : 300 g
Size : 9.7 cm x 9.7 cm x 3.1 cm
Components : Single unit
b) Name of the kit : Rapid Bacteriological Tester
Method of Analysis : Bacteriological
Parameters that can be analysed : Fecal coliform (12 hours)
Power Supply : 230 volts
Weight : 10 kg
Size : 39 cm x 34 cm x 30 cm
Components : Single unit
c) Name of the kit : Aquazer
Method of Analysis : Visual colour comparison,
titrimetric tablet count method,
bacteriological examination
Parameters that can be analysed : pH, fluoride, iron, residual
chlorine, chlorides, hardness,
nitrite, nitrate and fecal
coliform (12 hours)
Power Supply : 230 volts
Weight : 10 kg
Size : 39 cm x 34 cm x 30 cm
Components : Single unit
d) Name of the kit : Titrimetric Water Analyser
Method of Analysis : Titrimetric tablet count method
Parameters that can be analysed : Acidity, alkalinity, hardness and
chlorides
Power Supply : No power required
Components : Single unit
e) Name of the kit : Mini Digital Colorimeter
Method of Analysis : Quantitative

Department of ECE, GEC, Thrissur 6


B.TECH MINI PROJECT 2017

Parameters that can be analysed : Fluoride, iron, residual chlorine,


nitrate and chromate
Power Supply : Single 9 volt battery and 2 1.5
volt cells
Weight : 400 g
Components : Single unit

4. Developed by : Elico
Name of the kit : Water Quality Analyser
Method of Analysis : Through probes
Parameters that can be analysed : pH, temperature, dissolved
oxygen, conductivity
Power Supply : Two 9 volt battery
Weight : 6 kg
Size : Medium size VIP suitcase
Components : Single unit

5. Developed by : CSIO, Chandigarh (Central


Scientific Instruments
Organisation)
Parameters that can be analysed : Turbidity, conductivity,
salinity and pH
Operated by : Main supply and battery

6. Developed by : AIIH PH (All Indian


Institute of Hygiene and Public
Health), Kolkata
Parameters that can be analysed : Turbidity, pH, hardness,
chloride, iron, nitrate, fluoride,
residual chlorine and arsenic.
Bacteriological test kit with
incubator is provided

Department of ECE, GEC, Thrissur 7


Chapter 3

GENERAL DESCRIPTION

3.1 BLOCK DIAGRAM


The generic block diagram of the proposed system is shown below.

Figure 3.1: Block diagram

3.2 BLOCK DIAGRAM DESCRIPTION


The system consists of two sensors- a conductivity sensor and a turbidity
sensor, a microcontroller and a GSM module. The outputs of the sensors
are fed into the ATmega328P microcontroller via the analog inputs of the
Arduino Uno board. The microcontroller, then depending on, whether the
sensor outputs are above or below threshold limits, transmits data serially to
the GSM module. The GSM module then sends the message regarding the
waters quality to the users phone.

8
Chapter 4

HARDWARE DESCRIPTION

4.1 ARDUINO UNO


Arduino is an open-source platform used for building electronics projects.
Arduino consists of both a physical programmable circuit board (often referred
to as a microcontroller) and a piece of software, or IDE (Integrated Develop-
ment Environment) that runs on your computer, used to write and upload
computer code to the physical board. The Arduino platform has become quite
popular with people just starting out with electronics, and for good reason.
Unlike most previous programmable circuit boards, the Arduino does not need
a separate piece of hardware (called a programmer) in order to load new code
onto the board, a USB cable is enough. Additionally, the Arduino IDE uses
a simplified version of C++, making it easier to learn to program. Finally,
Arduino provides a standard form factor that breaks out the functions of the
micro-controller into a more accessible package.

The Arduino Uno is a microcontroller board based on the ATmega328.


It has 14 digital input/output pins (of which 6 can be used as PWM outputs,
6 analog inputs, a 16MHz ceramic resonator, a USB connection , a power jack,
an ICSP Header, and a Reset button. It contains everything needed to sup-
port the microcontroller, simply connect it to a computer with a USB cable or
power it with an AC-to-DC adapter or battery to get started. The Uno dif-
fers 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).

9
B.TECH MINI PROJECT 2017

Figure 4.1: Arduino Uno

4.1.1 Power
The Arduino Uno can be powered via the USB connection or with external
power source is selected automatically. External power can come either from
an AC-to-DC adapter or battery. The adapter can be connected by plugging a
2.1 mm center positive plug into the boards 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-20 volts. If supplied with less
than 7V, however, the 5V pin may supply less than 5V 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 is using an external
power source. You can supply voltage through this pin or if supplying
voltage via the power jack, access it through this pin.
• 5V: This pin outputs a regulated 5V from the regulator on the board.
The board can be supplied with power either from the DC power jack (7-
12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator,
and can damage your board.
• 3.3V: A 3.3V supply generated by the on-board regulator. Maximum
current drawn is 50mA.
• GND: Ground pins
• IOREF: This pin on the Arduino 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 working with 5V or 3.3V.

Department of ECE, GEC, Thrissur 10


B.TECH MINI PROJECT 2017

4.1.2 Memory
The ATmega has 32 kB (with 0.5 kB used for the bootloader). It also has
2KB of SRAM and 1 kB of EEPROM library).

4.1.3 Input and Output


Each of the 14 digital pins on the Uno board can be used as an input
or output, using pinMode(), digitalWrite() and digitalRead() functions. They
operate at 5V. each pin can provide or receive a maximum of 40mA and has an
internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition,
some pins have specialized functions:
• Serial: 0(RX) and 1(TX). Used to receive and transmit TTL serial data,
These pins are connected to the corresponding pins of the ATmega8U2
USBto-TTL Serial chip.
• External interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
• PWM: 3,5,6,9,10 and 11. Provide 8-bit PWM output with the analog-
Write() function.
• SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK). These pins support SPI
communication using the SPI library.
• LED: 13. There is a built-in LED connected to digital pin 13. When the
pin is HIGH value, the LED is on, when the pin is low, it is off. The
Uno has 6 analog inputs , labelled A0 to A5, each of which provide 10
bits of resolution( i.e. 1024 different values). By default, they measure
from ground to 5 volts, though it is possible to change the upper end
of their range using the AREF pin and the analogReference() function.
Additionally, some pins have specialized functionality.
• TWI:A4 or SDA pin and A5 or SCL pin. Support TWI communication
using the Wire library. There are a couple of other pins on the board.
• AREF: Reference voltage for the analog inputs. Used with analogRefer-
ence().
• Reset. Bring this LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.

4.1.4 Communication
The Arduino Uno has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega328 pro-
vides UART TTL (5V) serial communication, which is available on digital pins
0(RX) and 1(TX). An ATmega 16U2 on the board channels this serial com-
munication over USB and appears on a virtual common 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. The
Arduino software includes a serial monitor which allows simple textual data

Department of ECE, GEC, Thrissur 11


B.TECH MINI PROJECT 2017

to be 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 serial communication on pins
0 and 1). A Software Serial library allows for serial communication on any
of the Unos digital pins.The ATmega328 also supports I2C (TWI) and SPI
communication. The Arduino software includes a Wire library to simplify use
of the 12C bus; For SPI communication, use the SPI library.

4.2 GSM SIM900A MODULE

Figure 4.2: GSM SIM900A

Department of ECE, GEC, Thrissur 12


B.TECH MINI PROJECT 2017

4.2.1 GSM
GSM (Global System for Mobile communications) is an open, digital cel-
lular technology used for transmitting mobile voice and data services. GSM
differs from first generation wireless systems in that it uses digital technology
and Time Division Multiple Access (TDMA) transmission methods. GSM is
a circuit-switched system that divides each 200kHz channel into eight 25kHz
time-slots. GSM operates in the 900MHz and 1.8GHz bands in Europe and
the 1.9GHz and 850MHz bands in the US. The 850MHz band is also used for
GSM and 3GSM in Australia, Canada and many South American countries.
GSM supports data transfer speeds of up to 9.6 kbit/s, allowing the trans-
mission of basic data services such as SMS (Short Message Service). Another
major benefit is its international roaming capability, allowing users to access
the same services when travelling abroad as at home. This gives consumers
seamless and same number connectivity in more than 210 countries. GSM
satellite roaming has also extended service access to areas where terrestrial
coverage is not available.
GSM-900 uses 890 - 915 MHz to send information from the Mobile Sta-
tion to the Base Transceiver Station (uplink) and 935 - 960 MHz for the other
direction (downlink), providing 124 RF channels (channel numbers 1 to 124)
spaced at 200 kHz. Duplex spacing of 45 MHz is used. In some countries the
GSM-900 band has been extended to cover a larger frequency range. This ’ex-
tended GSM’, E-GSM, uses frequency range 880 - 915 MHz (uplink) and 925 -
960 MHz (downlink), adding 50 channels (channel numbers 975 to 1023 and 0)
to the original GSM-900 band. The GSM specifications also describe ’railways
GSM’, GSM-R, which uses frequency range 876 - 915 MHz (uplink) and 921
- 960 MHz (downlink). GSM-R provides additional channels and specialized
services for use by railway personnel. All these variants are included in the
GSM-900 specification.
The method chosen by GSM is a combination of Time- and Frequency-
Division Multiple Access (TDMA/FDMA). The FDMA part involves the di-
vision by frequency of the (maximum) 25 MHz bandwidth into 124 carrier
frequencies spaced 200 kHz apart. One or more carrier frequencies are as-
signed to each base station. Each of these carrier frequencies is then divided
in time, using a TDMA scheme. The fundamental unit of time in this TDMA
scheme is called a burst period and it lasts 15/26 ms (or approx. 0.577 ms).
Eight burst periods are grouped into a TDMA frame (120/26 ms, or approx.
4.615 ms), which forms the basic unit for the definition of logical channels.
One physical channel is one burst period per TDMA frame.

4.2.2 GSM MODULE


A GSM module or a GPRS module is a chip or circuit that will be used
to establish communication between a mobile device or a computing machine
and a GSM or GPRS system. The modem (modulator-demodulator) is a crit-
ical part here. A GSM module or GPRS modules are similar to modems,
but theres one difference: A GSM/GPRS Modem is an external equipment,

Department of ECE, GEC, Thrissur 13


B.TECH MINI PROJECT 2017

whereas the GSM/GPRS module is a module that can be integrated within


an equipment. It is an embedded piece of hardware. The modem needs AT
commands, for interacting with processor or controller, which are communi-
cated through serial communication. These commands are sent by the con-
troller/processor. The MODEM sends back a result after it receives a com-
mand. Different AT commands supported by the MODEM can be sent by the
processor/controller/computer to interact with the GSM and GPRS cellular
network. Its functions include:

• Read, write and delete SMS messages.


• Send SMS messages.
• Monitor the signal strength.
• Monitor the charging status and charge level of the battery.
• Read, write and search phone book entries.

These modules consists of a GSM module or GPRS modem powered by


a power supply circuit and communication interfaces (like RS-232, USB 2.0,
and others) for computer. A GSM modem can be a dedicated modem device
with a serial, USB or Bluetooth connection, or it can be a mobile phone that
provides GSM modem capabilities.
The GSM SIM900A an ultra compact and reliable wireless module. The
SIM900A is a complete Dual-band GSM/GPRS solution in an SMT mod-
ule which can be embedded in the customer applications allowing the user
to benefit from small dimensions and cost-effective solutions. Featuring an
industry-standard interface, the SIM900A delivers GSM/GPRS 900/1800MHz
performance for voice, SMS, Data, and Fax in a small form factor and with
low power consumption. With a tiny configuration of 24mm x 24mm x 3 mm,
SIM900A can fit almost all the space requirements in your applications, espe-
cially for slim and compact demand of design.
Internally, the module is managed by an AMR926EJ-S processor, which
controls phone communication, data communication (through an integrated
TCP/IP stack), and (through an UART and a TTL serial interface) the com-
munication with the circuit interfaced with the cell phone itself. The processor
is also in charge of a SIM card (3 or 1.8 V) which needs to be attached to the
outer wall of the module.In addition, the GSM900 device integrates an analog
interface, A/D converter, RTC, SPI bus, IC, and a PWM module. The radio
section is GSM phase 2/2+ compatible and is either class 4 (2 W) at 850/ 900
MHz or class 1 (1 W) at 1800/1900 MHz.
The TTL serial interface is in charge not only of communicating all the data
relative to the SMS already received and those that come in during TCP/IP
sessions in GPRS (the data-rate is determined by GPRS class 10: max. 85,6
kbps), but also of receiving the circuit commands (in our case, coming from
the PIC governing the remote control) that can be either AT standard or
AT-enhanced SIMCom type. The module is supplied with continuous energy
(between 3.4 and 4.5 V) and absorbs a maximum of 0.8A during transmission.

Department of ECE, GEC, Thrissur 14


B.TECH MINI PROJECT 2017

4.3 TURBIDITY SENSOR


Turbidity is the quantitative measure of suspended particles in a fluid. It
can be soil in water or other such particles. Such particles are totally unde-
sired. Turbidity sensor uses light to convey information about turbidity in
water. The electronic turbidity sensor operates based on the scattered light
intensity with regards to light scattering in solids and liquids. The electronic
turbidity sensor used Light Emitting Diode (LED) as light transmitter, Light
Dependent Resistor (LDR) as receiver. Laboratory experiments have been
done by comparing the self-developed sensor with commercial turbidity meter
that gives an output in NTU. The advantages of the electronic turbidity sen-
sor are lightweight, user friendly, low-power consumption, easy to monitor and
low cost. Conclusively, the electronic turbidity sensor can be used as part of
a low-cost sensor to provide continuous turbidity information of water quality
directly to consumer. Laboratory tests are conducted and proven that the pro-
posed devices produced a comparable NTU reading as commercial turbidity
sensor.

Figure 4.3: Turbidity Sensor

Design
R1 is taken as 3.3kohms in order to obtain a Vout in the range of 0-3V so that
variations can be easily monitored
∴ R1 = 3.3kohms

V cc = 5V
I = 30mA
R2 = 166.67ohms
∴ R2 ≈ 150ohms

Department of ECE, GEC, Thrissur 15


B.TECH MINI PROJECT 2017

Figure 4.4: Turbidity Sensor - Circuit

4.3.1 LDR
Light Dependent Resistor (LDR) or a photo resistor is a device whose resistivity
is a function of the incident electromagnetic radiation. Hence, they are light
sensitive devices. They are also called as photo conductors, photo conductive
cells or simply photocells They are made up of semiconductor materials having
high resistance.

Working Principle of LDR


A light dependent resistor works on the principle of photo conductivity. Photo
conductivity is an optical phenomenon in which the materials conductivity
is increased when light is absorbed by the material. When light falls, i.e.
when the photons fall on the device, the electrons in the valence band of the
semiconductor material are excited to the conduction band. These photons
in the incident light should have energy greater than the band gap of the
semiconductor material to make the electrons jump from the valence band to
the conduction band. Hence when light having enough energy strikes on the
device, more and more electrons are excited to the conduction band which

Department of ECE, GEC, Thrissur 16


B.TECH MINI PROJECT 2017

results in large number of charge carriers. The result of this process is more
and more current starts flowing through the device when the circuit is closed
and hence it is said that the resistance of the device has been decreased. This
is the most common working principle of LDR.

4.3.2 LED
The lighting emitting diode is a p-n junction diode. It is a specially doped
diode and made up of a special type of semiconductors. When the light emits
in the forward biased, then it is called as a light emitting diode.

How does the Light Emitting Diode work


The light emitting diode simply, we know as a diode. When the diode is
forward biased, then the electrons holes are moving fast across the junction
and they are combining constantly, removing one another out. Soon after the
electrons are moving from the n-type to the p-type silicon, it combines with
the holes, then it disappears. Hence it makes the complete atom more stable
and it gives the little burst of energy in the form of a tiny packet or photon of
light.

4.3.3 Working of Turbidity Sensor


When the input voltage is given , LED gets illuminated. This light falls on
LDR. Depending on the intensity of light resistivity of LDR changes. If the
intensity of light falling is more resistivity decreases and hence the voltage drop
across the resistor connected in series with LDR increases.
Vout = Vcc - Vr
Vout = Output Voltage
Vcc = Input Voltage
Vr = Voltage drop across LDR

4.4 CONDUCTIVITY SENSOR


Electrical Conductivity (EC) senors measure the capacity of ions in an aque-
ous solution to carry electrical current. As the ranges in aqueous solutions are
usually small, the basic units of measurements are milliSiemens/cm (mS/cm)
and microSiemens/cm (S/cm). Conductivity is used widely to determine the
level of impurities in water supplies for domestic consumption as well as in-
dustrial use. Measurement of conductivity gives the hardness of water. Hard
water contains a high concentration of multivalent cations, commonly calcium
(Ca) and magnesium (Mg). The principle by which conductivity sensor mea-
sure conductivity is two plates are placed in the sample, a potential is applied
across the plates (normally a sine wave voltage), and the current is measured.
Conductivity (G), the inverse of Resistivity (R) is determined from the volt-
age dropped across the water. Since conductivity is an indicator of how easily

Department of ECE, GEC, Thrissur 17


B.TECH MINI PROJECT 2017

current passes through a solution, it is dependent on the quantity of ions and


their mobility in that solution.

4.4.1 Working of Conductivity Sensor


For an aqueous solution, applying a constant voltage (DC voltage) across two
electrodes causes electrolysis of the water. Voltage drop across aqueous solution
is measured through resistance, R, connected in series. That voltage across
resistance gives the indication about ions present in the water. Higher the
drop across resistance R more numbers of ions present in the water, higher the
hardness.
Vout= Vcc-Vc
Vout= Voltage drop across R
Vcc = Voltage applied
Vc = Voltage drop across aqueous solution
Vout is directly proportional to hardness.

Figure 4.5: Conductivity Sensor

Department of ECE, GEC, Thrissur 18


B.TECH MINI PROJECT 2017

Design
R3 is taken as 3.3kohms in order to obtain a Vout in the range of 0-3V so that
variations can be easily monitored.

Figure 4.6: Conductivity Sensor - Circuit

Department of ECE, GEC, Thrissur 19


Chapter 5

CALIBRATION

Experiments were performed out in the Environmental lab, Govt. Engi-


neering College, Thrissur to measure the hardness and turbidity of water.
The hardness of water was measured using titration method.The procedure is
described below.
1.Pipette 20 ml of water sample into a conical flask.
2. Add 1 ml of ammonia buffer solution followed by 3 drops of Eriochrome
Black T indicator solution.
3. Titrate with 0.01 M EDTA until the solution turns from wine red to sky
blue with no hint of red
4. Repeat the titration to obtain two concordant results.
This procedure was repeated for three samples of water.
The turbidity was measured using Nephelometer meter. The samples of water
was kept inside the meter and the turbidity was obtained in the LCD screen
in NTUs.
Based on the values obtained, graphs were plotted relating sensor outputs to
actual values of hardness and turbidity.

Let Hout and Tout be conductivity sensor and turbidity sensor outputs
in volts.
Hardness in mg/L = 350 x (Hout - 1.35)
Turbidity in NTU = (-1030) x (Tout - 3)

20
B.TECH MINI PROJECT 2017

Figure 5.1: Hardness Calibration Graph

Figure 5.2: Turbidity Calibration Graph

Department of ECE, GEC, Thrissur 21


Chapter 6

CIRCUIT DESCRIPTION

6.1 CIRCUIT DIAGRAM

Figure 6.1: Monitoring System

The Arduino Uno and the GSM SIM900A module are powered from
the AC mains using a 12V/1A DC adapter. The Turbidity sensor and the
Conductivity sensor are powered from the 5V pin of Arduino Uno. Pin num-
ber 10 of Arduino Uno is connected to the Rx of GSM.The output probes of
Conductivity and Turbidity sensor is connected to the analog pins A0 and A1
of Arduino Uno. Pin 10 of the Arduino Uno is connected to the Rx of the
GSM module and the two. They are both connected to a common ground.

22
B.TECH MINI PROJECT 2017

Figure 6.2: Notification System

6.2 CIRCUIT OPERATION


The circuit consists of a Conductivity Sensor, a Turbidity Sensor, an Ar-
duino Uno and a GSM SIM900A module. The connections are made as per the
circuit diagram. The output voltages from sensors are fed to the analog pins
A0 and A1 of Arduino Uno. The input data is processed by the ATmega328
microcontroller and the output is given to Rx of the GSM through pin 10 of
the Arduino Uno. Pin 10 is programmed to act as the Tx of Arduino Uno. The
GSM module based on the AT commands it receives,sends the corresponding
notification as SMS to the user. The sensor outputs are stored. When new sen-
sor values are read the microprocessor checks whether these values are same as
before. The above given process is then only repeated when the values change.
The corresponding voltage values of sensors are converted to the standard
units of hardness (mg/L) and turbidity (NTU). Hence the user gets notified
about the value of hardness in mg/L and turbidity in NTU. Water is consid-
ered hard when it has a hardness value greater than 60 mg/L. If hardness is
greater than 60mg/L, message is send as WATER IS HARD and if hardness
is less than 60mg/L, message is send as WATER IS NOT HARD along with
the corresponding hardness value. The World Health Organization, establishes
that the turbidity of drinking water should not be more than 5 NTU though
a 10 NTU value is also considered as applicable for daily use. Similarly if tur-
bidity is greater than 10 NTU, message is send as WATER IS TURBID and if
turbidity is less than 10 NTU, message is send as WATER IS NOT TURBID
along with the turbidity value. If the sensors are not in water, the conductivity
sensor outputs 0V. When this condition occurs the user receives the message
THE SENSOR IS OUT OF WATER.

Department of ECE, GEC, Thrissur 23


Chapter 7

FLOWCHART AND
PROGRAMMING

7.1 FLOWCHART

24
B.TECH MINI PROJECT 2017

Department of ECE, GEC, Thrissur 25


B.TECH MINI PROJECT 2017

7.2 PROGRAM
The program is given below:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
int H SensorValue, H temp, oldH Voltage=0;
float H Voltage, hardvalue;
int T SensorValue, T temp, oldT Voltage=0;
float T Voltage, turbidvalue;

void setup()
{
mySerial.begin(9600);
Serial.begin(9600);
delay(100);
}

void loop()
{
H SensorValue = analogRead(A0);
T SensorValue = analogRead(A1);
H Voltage = H SensorValue * (5.0 / 1023.0);
H temp = H Voltage;
T Voltage = T SensorValue * (5.0 / 1023.0);
T temp = T Voltage;
hardvalue = 350 * (H Voltage - 1.35);
turbidvalue = (-1030) * (T Voltage - 3);
if(hardvalue <0)

{if(H temp != oldH Voltage)


{
NoWaterAlert();
}
}
else
{
if(H temp != oldH Voltage)
{
HardAlert();
}
if(T temp != oldT Voltage)
{
TurbidAlert();
}
}
oldH Voltage = H temp;

Department of ECE, GEC, Thrissur 26


B.TECH MINI PROJECT 2017

oldT Voltage = T temp;


}

void NoWateraAlert()
{
mySerial.println(”AT+CMGF=1”);
delay(2000);
mySerial.println(”AT+CMGS=\”919645421093\”\r”);
delay(2000);
mySerial.println(”The sensor is out of water”);
delay(200);
mySerial.println((char)26);
delay(2000);
}

void HardAlert()
{
if(hardvalue >60)
{
SendText1();
}
else
{
SendText2();
}
}

void TurbidAlert()
{
if(turbidvalue >0 && turbidvalue <10)
{
SendText3();
}
else
{
SendText4();
}
}

void SendText1()
{
mySerial.println(”AT+CMGF=1”);
delay(2000);
mySerial.println(”AT+CMGS=\”919645421093\”\r”);
delay(2000);
mySerial.println(”The water is hard. The value of hardness in mg/L is ”);
mySerial.print(hardvalue);

Department of ECE, GEC, Thrissur 27


B.TECH MINI PROJECT 2017

delay(200);
mySerial.println((char)26);
delay(2000);
}

void SendText2()
{
mySerial.println(”AT+CMGF=1”);
delay(2000);
mySerial.println(”AT+CMGS=\”919645421093\”\r”);
delay(2000);
mySerial.println(”The water is not hard. The value of hardness in mg/L is ”);
mySerial.print(hardvalue);
delay(200);
mySerial.println((char)26);
delay(2000);
}

void SendText3()
{
mySerial.println(”AT+CMGF=1”);
delay(2000);
mySerial.println(”AT+CMGS=\”919645421093\”\r”);
delay(2000);
mySerial.println(”The water is not turbid. The value of turbidity in NTU is
”);
mySerial.print(turbidvalue);
delay(200);
mySerial.println((char)26);
delay(2000);
}

void SendText4()
{
mySerial.println(”AT+CMGF=1”);
delay(2000);
mySerial.println(”AT+CMGS=\”919645421093\”\r”);
delay(2000);
mySerial.println(”The water is turbid. The value of turbidity in NTU is ”);
mySerial.print(turbidvalue);
delay(200);
mySerial.println((char)26);
delay(2000);
}

Department of ECE, GEC, Thrissur 28


Chapter 8

RESULT AND INFERENCES

Developed a Water Purity Monitoring and Notification System .The system


checks whether the water is hard and turbid and notifies the user about the
status as SMS.

Figure 8.1: Received Message A

29
B.TECH MINI PROJECT 2017

Figure 8.2: Received Message B

8.1 ADVANTAGES
1.Easy to Implement.
2.Cost Effective.
3.Low power consumption.
4.High Speed
5.User Friendly

8.2 DISADVANTAGES
1.Prone to fluctuations in water quality
2.Difficulties for implementing in flowing water. When implemented in flowing
water there is a continuous change in values.

8.3 FURTHER IMPROVEMENTS


1.The notification system can be extended using Internet of Things.
2.More physiochemical parameters of water can be measured for better moni-
toring.

Department of ECE, GEC, Thrissur 30


B.TECH MINI PROJECT 2017

8.4 COST ESTIMATION


SL Item Price Quantity Total
NO.
1 Arduino-Uno with adapter 450 1 450
2 GSM module SIM900A 950 1 950
3 DC Adapter (12V,1A) 180 1 180
4 PVC Pipe(10cm,3cm dia) 30 1 30
5 Resistors .5 3 1.5
6 LED(Red) 2 1 2
7 LDR 4 1 4
8 Jumper wires 5 10 50
9 Dot Board 30 1 30
10 Miscellaneous 100 - 100
Total 1800

Department of ECE, GEC, Thrissur 31


Chapter 9

CONCLUSION

The water purity monitoring and notification system was developed with
the objective to monitor the water quality and to notify the user about the
status of water. By developing this system the objective of the project was
fulfilled. By measuring the turbidity, the transparency of the water is pre-
dicted. That certainly gave the measure of solid and muddy particles in the
water. The conductivity sensor gave the measure of dissolved ions in the water
and thus the hardness of water was also calculated. The device is easy to use
with little or no training and can be used in most situations. Apart from the
engineering point of view, this project also has a wide range of socio-economic
applications. However there is still a great deal of work and several significant
problems that must be overcome before such a system can be brought into
every household in order to ensure that everyone has access to clean and safe
drinking water. Yet we strongly believe that we have made a relevant step in
order to achieve this future.

32
Chapter 10

BIBLIOGRAPHY

1) Design of Smart Sensors for Real-Time Water Quality Monitoring NIEL


ANDRE CLOETE, REZA MALEKIAN, (Member, IEEE), AND LAKSHMI
NAIR, (Member, IEEE) Department of Electrical, Electronic and Computer
Engineering, University of Pretoria, Pretoria 0002, South Africa

2)Guidelines for Drinking-Water Quality, accessed on May 31, 2016. [Online].


Available: http://www.who.int/water sanitation health/publications/dwq-guidelines-
4/en/

3)The ARDUINO website[Online] .http://www.arduino.cc/

4)ARDUINO forum webpage[Online].http://www.arduino.cc/forum/

5)M. Goldblatt, “Realizing the right to sufficient water in South Africa’s


cities,” Urban Forum, vol. 8, no. 2, pp. 255276, 1997.

6)https://www.open-electronics.org/gsm-remote-control-part-4-sim900/

33
Chapter 11

APPENDIX A

ATMEGA328

Figure 11.1: ATmega328 Microprocessor

34
B.TECH MINI PROJECT 2017

Department of ECE, GEC, Thrissur 35


Chapter 12

APPENDIX B

SIM900A

Figure 12.1: SIM900A

36
B.TECH MINI PROJECT 2017

Features-
General features:
• Dual-Band 900/ 1800 MHz
• GPRS multi-slot class 10/8
• GPRS mobile station class B
• Compliant to GSM phase 2/2+
Class 4 (2 W @ 900 MHz)
Class 1 (1 W @ 1800MHz)
• Dimensions: 24*24*3 mm
• Weight: 3.4g
• Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced
AT Commands)
• SIM application toolkit
• Supply voltage range : 3.1 - 4.8V
• Low power consumption: 1.5mA(sleep mode)
• Operation temperature: -40C to +85 C
Specifications for Fax:
Group 3, class 1

Specifications for Data:


• GPRS class 10: max. 85.6 kbps (downlink)
• PBCCH support
• Coding schemes CS 1, 2, 3, 4
• CSD up to 14.4 kbps
• USSD
• Non transparent mode
• PPP-stack
Specifications for SMS via GSM/GPRS:
• Point to point MO and MT
• SMS cell broadcast
• Text and PDU mode
Software features:
• 0710 MUX protocol
• embedded TCP/UDP protocol
• FTP/HTTP( available at July ,2010)

Department of ECE, GEC, Thrissur 37


B.TECH MINI PROJECT 2017

Enhanced version add following features:

• FOTA ( available at July ,2010)


• MMS (available at July ,2010)
• Embedded AT (available at Q3,2010)

Specifications for Voice:

• Tricodec
i) Half rate (HR)
ii) Full rate (FR)
iii) Enhanced Full rate (EFR)
• Hands-free operation (Echo suppression)
• AMR
i) Half rate (HR)
ii) Full rate (FR)

Interfaces:

• Interface to external SIM 3V/ 1.8V


• analog audio interface
• RTC backup
• SPI interface
• Two Serial interfaces
• Antenna pad
• I2C
• GPIO
• PWM
• ADC

Compatibility:
AT cellular command interface

Department of ECE, GEC, Thrissur 38


Chapter 13

APPENDIX C

Figure 13.1: Hardness Datasheet

39

You might also like