Professional Documents
Culture Documents
Real Time Water Quality Monitoring Through Iot
Real Time Water Quality Monitoring Through Iot
Real Time Water Quality Monitoring Through Iot
THROUGH IOT
A project Report
SUBMITTED BY
Y.LASYA (12951A0417)
D.DEEKSHA (12951A0407)
B.SRIKANTH (12951A0451)
K.MANOJ (12951A0420)
S LAKSHMANACHARI
ASSISTANT PROFESSOR
1|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
APRIL-2016
CERTIFICATE
This is to certify that the project work entitled “SMART CARD BASED PETRO CARD
MANAGING SYSTEM ”submitted as partial fulfilment for the award of Bachelor of
Technology degree in Electronic And Communication Engineering from Institute Of
Aeronautical Engineering, affiliated with Jawaharlal Nehru Technological University,
Hyderabad, is a record of bonafide work done during the academic year 2015 by
Y.LASYA (12951A0417)
D.DEEKSHA (12951A0407)
B.SRIKANTH (12951A0451)
K.MANOJ (12951A0420)
2|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
ACKNOWLEDGEMENT
This project brings with a sense of satisfaction, but it is never complete without
thanking those people who made it possible and whose constant support has crowned my
efforts with success.
We are thankful to the principal of college Prof. A.BARAI, head of the department
(ECE) V.R.SESHAGIRI RAO at INSTITUTE OF AERONAUTICAL ENGINEERING
College for supporting us.
We are also thankful to all the Lecturers and staff members of Electronics and
Communication Engineering Department for providing me with required facilities and
support towards the completion of the project.
3|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
DECLARATION
We hereby declare that this submission is own work and that, to the best of my knowledge
and belief, it contains no material previously published or written by another person nor
material which to a substantial extend has been accepted for the award of the award of any
other degree or diploma of the university or other institute of the higher leaning except where
due acknowledgement has been made in the text.
Y.LASYA (12951A0417)
D.DEEKSHA (12951A0407)
B.SRIKANTH (12951A0451)
K.MANOJ (12951A0420)
4|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
ABSTRACT
Nowadays drinking water is the most precious and valuable for all the human beings,
drinking water utilities faces new challenges in real-time operation. This challenge occurred
because of limited water resources growing population, ageing infrastructure etc. Hence
therefore there is a need of better methodologies for monitoring the water quality.
Traditional methods of water quality involve the manual collection of water sample at
different locations, followed by laboratory analytical techniques in order the character the
water quality. Such approaches take longer time and no longer to be considered efficient .
Although the current methodologies analysis the physical, chemical and biological agents, it
has several drawbacks: a) poor spatiotemporal coverage b) it is labor intensive and high
cost(labor, operation; and equipment) c)the lack of real time water quality information to
enable critical decisions for public health protection. Therefore, there is a need for continuous
online water quality monitoring.
The online water monitoring technologies have made a significant progress for source
water surveillance and water plant operation. The use of their technologies having high cost
associated with installation and calibration of a large distributed array of monitoring sensors.
The algorithm proposed on the new technology must be suitable for particular area and for
large system is not suitable.
By focusing on the above issues our paper design and develop a low cost system for
real time monitoring of the water quality in IOT environment. In our design ARM-7 is used
as a core controller. The design system applies a specialized IOT module for accessing sensor
data from core controller to the mobile. The sensor data can be viewed on the mobile using a
special IP address. Additionally the IOT module also provides a Wi-Fi for viewing the data
on mobile.
5|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CONTENTS PAGE NO
1. Introduction 10
1.1Embedded system 10
1.2 Microcontroller versus Microprocessor 11
1.3 Microprocessor 12
1.3.1 Features 13
2. Function description 14
2.1 LPC2148 Microcontroller 14
2.1.1 Features 14
2.1.2 Pin Configuration 16
2.1.3 Pin description 16
3. Circuit description 24
3.1 Block diagram 24
3.2 Circuit diagram 26
3.3 Components description 27
3.3.1 LPC2148 Microcontroller 27
3.3.2 Power supply circuit 24
3.3.3 Regulated power supply 27
3.3.4 Temperature sensor 32
3.3.5 pH sensor 33
3.3.6 Level sensor 34
3.3.7 MAX232 35
3.3.8 ESP8266 Wi-Fi module 36
3.3.9 LCD 38
3.3.10 Buzzer 41
4. Implementation 43
4.1 Introduction 43
4.2 Working 43
5. Software designing
5.1 Software tools required 45
5.2 Flow chart 43
6|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
APPENDICES 47
Source code
7|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
LIST OF FIGURES
3.16 Buzzer 42
4.1 Output of Water Quality Parameters 45
5.1 ARM device Programmer 49
5.2 Proload Programmer Device 50
6.1 Output using Keil-microvision3 51
CHAPTER-1
INTRODUCTION
1.1 EMBEDDED SYSTEMS:
8|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it, reducing the size and cost of the product, or increasing the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale.
Physically, embedded systems range from portable devices such as digital watches
and MP3 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants. Complexity varies from low, with a single
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
In general, "embedded system" is not an exactly defined term, as many systems have
some element of programmability. For example, Handheld computers share some elements
with embedded systems — such as the operating systems and microprocessors which power
them — but are not truly embedded systems, because they allow different applications to be
loaded and peripherals to be connected.
The past three decades have seen the introduction of a technology that has radically
changed the way in which we analyses the control the world around us. Born of parallel
developments in computer architecture and integrated circuit fabrication, the microprocessor
9|Page
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
or computer on a chip first became a commercial reality in 1971 with introduction of 4-bit
4004 by Intel corp.
Like the microprocessor, a microcontroller is a general purpose device, but one that is
meant to read data, perform limited calculation on that data and its environment based on
those calculations. The prime use of a microcontroller is to control the operation of a
machine using a fixed program that is stored in ROM & that does not change over the
lifetime of the system.
The design approach of the microcontroller mirrors that of the microprocessor make a
single design that can be used in as many applications as possible in order to sell, hopefully
as many as possible. The microprocessor accomplishes the goal by having a very flexible
and extensive repertoire of multi-byte instructions. These instructions work in Hardware
configurations that enable large amounts of memory and I/O to be connected to address and
data bus pins on the Integrated Circuit Package. Much of the activity in the Microprocessor
has to do with moving the code and data to and from external memory to the CPU. The
architecture features working registers that can be programmed to take Party in the memory
access process, and instruction set is aimed at expediting this activity in order to improve
throughput. The pins connected to the microprocessor to the external memory are unique, is
having a single function. Data is handled in byte or large sizes.
10 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
The microcontroller design uses a much more limited set of single and double byte
instructions that are used to move the code and data from internal memory to ALU Many
instructions are coupled with pins on integrated circuit package, the pins are “Programmable”
– that is capable of having several different functions depending on the wishes of the
programmer. The micro controller is concerned with getting data from and to its own pins.
The architecture and instructions are optimized to handle data in bit and byte size.
1.3 MICROPROCESSOR:
To make a complete computer one must add memory usually RAM & ROM, memory
decoders, an oscillator and number of I/O devices such as parallel and serial data ports in
addition special purpose devices such as interrupt handlers and counters
The key term in describing the design of the microprocessor is “general purpose”. The
hardware design of a microprocessor CPU is arranged so that a small or very large system
can be configured around the CPU as the application demands.
Prime use of microprocessor is to read data, perform extensive calculation on that data
and store those calculations in a mass storage device. The programs used by the
microprocessor are stored in the mass storage device and loaded in the RAM as the user
directs. A few microprocessor programs are stored in the ROM. The ROM based programs
are primarily are small fixed programs that operate on peripherals and other fixed device that
are connected to the system.
11 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
1.3.1 Features:
1. 8086 is a 40 pin IC
2. It is a 16-bit processor
3. Its operating voltage is 5 volts
4. Its operating frequency is 5 MHz
5. Total memory addressing capacity is 1MB (external).
6. It has 16-bit data bus and 20-bit address bus.
7. It has fourteen 16-bit registers.
8. Higher throughput (speed).
9. 8086 has 256 vectored interrupts.
10. 8086 uses two stage of pipelining. First is Fetch Stage and the second is Execute
Stage.
12 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CHAPTER-2
FUNCTIONAL DESCRIPTION
Due to their tiny size and low power consumption, LPC2141/42/44/46/48 are ideal for
applications where miniaturization is a key requirement, such as access control and point-of-
sale. Serial communications interfaces ranging from a USB 2.0 Full-speed device, multiple
UARTs, SPI, SSP to I2C-bus and on-chip SRAM of 8 kB up to 40 kB, make these devices
very well suited for communication gateways and protocol converters, soft modems, voice
recognition and low end imaging, providing both large buffer size and high processing
power. Various 32-bit timers, single or dual 10-bit ADCs, 10-bit DAC, PWM channels and
45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these
microcontrollers suitable for industrial control and medical systems.
Features of LPC2148:
16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory;
128-bit wide interface/accelerator enables high-speed 60 MHz operation.
13 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
14 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
15 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
16 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
ARM Architecture:
17 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
RISC:
RISC, or Reduced Instruction Set Computer. is a type of microprocessor architecture that
utilizes a small, highly-optimized set of instructions, rather than a more specialized set of
instructions often found in other types of architectures.
History:
The first RISC projects came from IBM, Stanford, and UC-Berkeley in the late 70s and early
80s. The IBM 801, Stanford MIPS, and Berkeley RISC 1 and 2 were all designed with a
similar philosophy which has become known as RISC. Certain design features have been
characteristic of most RISC processors:
One cycle execution time :RISC processors have a CPI (clock per instruction) of one
cycle. This is due to the optimization of each instruction on the CPU and a technique
called pipelining : a technique that allows for simultaneous execution of parts, or
stages, of instructions to more efficiently process instructions;
large number of registers : the RISC design philosophy generally incorporates a larger
number of registers to prevent in large amounts of interactions with memory.
4. 32 -bit processor
CISC RISC
18 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
Price/Performance Strategies
Price: move complexity from software to hardware. Price: move complexity from hardware to software.
Performance: make tradeoffs in favour of decreased code Performance: make tradeoffs in favor of a lower CPI,
size, at the expense of a higher CPI. at the expense of increased code size.
Design Decisions
Execution of instructions takes many cycles Simple, single-cycle instructions that perform
only basic functions. Assembler instructions
Design rules are simple thus core operates at
correspond to microcode instructions on a
higher clock frequencies
CISC machine.
Memory-to-memory addressing modes.
Design rules are more complex and operates
A microcode control unit. at lower clock frequencies
Spend fewer transistors on registers. Simple addressing modes that allow only
LOAD and STORE to access memory. All
operations are register-to-register.
Pin Configuration:
19 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
20 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
21 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
P0.8/TXD1/PWM4/AD1.1:
P0.8 — General purpose input/output digital pin (GPIO).
TXD1 — Transmitter output for UART1.
PWM4 — Pulse Width Modulator output 4.
AD1.1 — ADC 1, input 1, available in LPC2144/46/48 only.
P0.9/RXD1/ PWM6/EINT3:
P0.9 -General purpose input/output digital pin (GPIO).
RXD1 -Receiver input for UART1.
PWM6 -Pulse Width Modulator output 6.
EINT3 -External interrupt 3 input.
P0.10/RTS1/ CAP1.0/AD1.2:
P0.10 -General purpose input/output digital pin (GPIO).
RTS1 -Request to send output for UART1, LPC2144/46/48 only.
CAP1.0 -Capture input for Timer 1, channel 0.
AD1.2 -ADC 1, input 2, available in LPC2144/46/48 only.
P0.11/CTS1/ CAP1.1/SCL1:
P0.11 -General purpose input/output digital pin (GPIO).
CTS1 -Clear to send input for UART1, available in LPC2144/46/48 only.
CAP1.1 -Capture input for Timer 1, channel 1.
SCL1 -I2C1 clock input/output, open-drain output (for I2C-bus compliance).
P0.12/DSR1/MAT1.0/AD1.3:
P0.12 -General purpose input/output digital pin (GPIO).
DSR1 -Data Set Ready input for UART1, available in LPC2144/46/48 only.
MAT1.0 -Match output for Timer 1, channel 0.
AD1.3 -ADC input 3, available in LPC2144/46/48 only.
P0.13/DTR1/ MAT1.1/AD1.4:
P0.13 -General purpose input/output digital pin (GPIO).
DTR1 -Data Terminal Ready output for UART1, LPC2144/46/48 only.
MAT1.1 -Match output for Timer 1, channel 1.
AD1.4 -ADC input 4, available in LPC2144/46/48 only.
P0.14/DCD1/EINT1/SDA1:
P0.14 — General purpose input/output digital pin (GPIO)
DCD1 — Data Carrier Detect input for UART1, LPC2144/46/48 only
EINT1 — External interrupt 1 input
22 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
23 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
24 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CONNECT -Signal used to switch an external 1.5 k ohms resistor under the Software
control, used with the Soft Connect USB feature.
P1.0 to P1.31 I/O Port 1:
Port 1 is a 32-bit bidirectional I/O port with individual direction controls for each bit,
the operation of port 1 pins depends upon the pin function selected via the pin connect block,
pins 0 through 15 of port 1 are not Available.
P1.16/TRACEPKT0:
P1.16 -General purpose input/output digital pin (GPIO).
TRACEPKT0 -Trace Packet, bit 0, standard I/O port with internal pull-up.
P1.17/TRACEPKT1:
P1.17 -General purpose input/output digital pin (GPIO).
TRACEPKT1 -Trace Packet, bit 1, standard I/O port with internal pull-up.
P1.18/TRACEPKT2:
P1.18 — General purpose input/output digital pin (GPIO).
TRACEPKT2 — Trace Packet, bit 2, standard I/O port with internal pull-up.
P1.19/TRACEPKT3:
P1.19 — General purpose input/output digital pin (GPIO).
TRACEPKT3 — Trace Packet, bit 3, standard I/O port with internal pull-up.
P1.20/TRACESYNC:
P1.20 -General purpose input/output digital pin (GPIO).
TRACESYNC -Trace Synchronization, standard I/O port with internal pull-up.
P1.21/PIPESTAT0:
P1.21 -General purpose input/output digital pin (GPIO).
PIPESTAT0 -Pipeline Status, bit 0, standard I/O port with internal pull-up.
P1.22/PIPESTAT1:
P1.22 -General purpose input/output digital pin (GPIO).
PIPESTAT1 -Pipeline Status, bit 1, standard I/O port with internal pull-up.
P1.23/PIPESTAT2:
P1.23 -General purpose input/output digital pin (GPIO).
PIPESTAT2 -Pipeline Status, bit 2, standard I/O port with internal pull-up.
P1.24/TRACECLK:
P1.24 -General purpose input/output digital pin (GPIO).
TRACECLK — Trace Clock, standard I/O port with internal pull-up.
P1.25/EXTIN0:
25 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
26 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
27 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
Register r14 is called the link register ( lr ) and is where the core puts the return
address whenever it calls a subroutine.
Register r15 is the program counter ( pc ) and contains the address of the next
instruction to be fetched by the processor
The register file contains all the registers available to a programmer. Which registers are
visible to the programmer depend upon the current mode of the processor.
Current program status register :
The ARM core uses the cpsr to monitor and control internal operations. The
cpsr is a dedicated 32-bit register and resides in the register file. The following figure shows
the generic program status register.
The control bit field contains the processor mode, state , and interrupt mask bits (I,F).
Reserved bits are allocated for the future versions purpose.
The N, Z, C and V are condition code flags will be changed as a result of arithmetic and
logical operations in the processor
The M0, M1, M2, M3 and M4 bits are the mode bits
Processor Modes: Processor modes determine which register are active, and access rights to
CPSR register itself.
CHAPTER 3
28 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CIRCUIT DESCRIPTION
POWER
SUPPLY
M
I
C
R
TEMPERA O U MAX WIFI
TURE C A
MOBILE
SENSOR O R 232 MODULE
N T
T
A
R
PH O
D
SENSOR L
L
C
E
LCD R
LEVEL
SENSOR
ARM7
LPC2148 BUZZER
29 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
LCD DISPLAY:
LCD (Liquid Crystal Display) is an electronic display module. A 16x2 LCD display is a
very basic module and commonly used in various devices and circuits. These modules
are preferred over seven segments and other multi segment LEDs.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. LCD has two registers,
namely, Command and Data registers. The command register stores the command
instructions given to the LCD.
BUZZER:
A buzzer or beeper is a signalling device, usually electronic, typically used in
automobiles, household appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches connected to a control unit that
determines if and which button was pushed or a preset time has lapsed, and usually
illuminates a light on the appropriate button or control panel, and sounds a warning in
the form of a continuous or intermittent buzzing or beeping sound.
POWER SUPPLY:
The circuit basically consists of a step down transformer, a bridge rectifier, a low-pass
filter, and a regulator. It is centre tapped to have both -ve and +ve half cycle of AC
waveform to contribute to direct current and transforming energy using mutual
induction.TTL logic circuitry cannot work on voltage of 230v ac .So, we are stepping
down it to 9v.
A bridge rectifier is an arrangement of four or more diodes in a bridge circuit
configuration which provides the same output polarity for either input polarity.
It is used for converting an alternating current (AC) input into a direct current (DC)
output.
A low pass filter in the circuit is to filter out any unwanted high frequency noise from
nearby equipment. The cut-off frequency of the filter was chosen as 2Hz. The
frequency and phase responses of the amplifier together with the filter. The output
time response of the amplifier and filter circuit which consists of pulses.
30 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
TEMPERATURE
SENSOR ARM 7
MICRO
CONTROLLER
LEVEL WIFI Mobile
SENSOR MODULE
pH
SENSOR
ASM/C
PROGRAM
A 128-bit wide memory interface and unique accelerator architecture enable 32-bit
code execution at the maximum clock rate. For critical code size applications, the alternative
16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty.
32 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
BRIDGE RECTIFER:
Converting both polarities of input ac voltage to one of the constant polarity at its
output dc current. Yields a higher mean output voltage .Our circuitry can only work
on dc voltage. The negative peak inverse voltage is less compared to full wave
rectifier and is cost efficient.
33 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
FILTER CIRCUIT:
Low pass filter is a filter that passes with a frequency lower than a certain cut-off
frequency and attenuates signals with frequency higher than the cut-off frequency.
The amount of attenuation for each frequency depends on the filter design the
frequency at which the transition occurs is called the “cut-off frequency”.
VOLTAGE REGULATOR:
It has 5V Regulated output voltage. Input voltage range is 5V-18V. The voltage source
in circuit may have fluctuation and would not give fixed output voltage. It has three
pins Pin1-input, Pin2-ground, Pin3-output.Heat sink is used for dissipating heat into
surrounding air to protect device from damage. LM indicates as linear monolithic,78
indicates positive voltage and 05 indicates 5v.
34 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
This type of regulation is ideal for having a simple variable bench power supply. Actually
this is quite important because one of the first projects a hobbyist should undertake is the
construction of a variable regulated power supply. While a dedicated supply is quite handy
,it's much handier to have a variable supply on hand, especially for testing.
Mainly the ARM controller needs 3.3 volt power supply. To use these parts we need to build
a regulated 3.3 volt source. Usually you start with an unregulated power To make a 3.3 volt
power supply, we use a LM317 voltage regulator IC (Integrated Circuit). The IC is shown
below.
CIRCUIT FEATURES
35 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
LM317 is the standard part number for an integrated three-terminal adjustable linear voltage
regulator. LM317 is a positive voltage regulator supporting input voltage of 3V to 40V and
output voltage between 1.25V and 37V. A typical current rating is 1.5A although several
lower and higher current models are available. Variable output voltage is achieved by using a
potentiometer or a variable voltage from another source to apply a control voltage to the
control terminal. LM317 also has a built-in current limiter to prevent the output current from
exceeding the rated current, and LM317 will automatically reduce its output current if an
overheat condition occurs under load. LM317 is manufactured by many companies, including
National Semiconductor, Fairchild Semiconductor, and STMicroelectronics.
LM317 is available in a wide range of package forms for different applications including heat
sink mounting and surface-mount applications. Common form factors for high-current
applications include TO-220 and TO-3. LM317 is capable of dissipating a large amount of
heat at medium to high current loads and the use of a heat sink is recommended to maximize
the lifespan and power-handling capability.
36 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
LM337 is the negative voltage complement to LM317 and the specifications and function are
essentially identical, except that the regulator must receive a control voltage and act on an
input voltage that are below the ground reference point instead of above it.
In this project, in order to monitor the temperature continuously and compare this with the set
temperature preprogrammed in the microcontroller, initially this temperature value has to be
read and fed to the microcontroller. This temperature value has to be sensed. Thus a sensor
has to be used and the sensor used in this project is LM35. It converts temperature value into
electrical signals.
LM35 series sensors are precision integrated-circuit temperature sensors whose output
voltage is linearly proportional to the Celsius temperature. The LM35 requires no external
calibration since it is internally calibrated. . The LM35 does not require any external
calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and
±3⁄4°C over a full −55 to +150°C temperature range.
The LM35’s low output impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It can be used with single power
supplies, or with plus and minus supplies. As it draws only 60 μA from its supply, it has very
low self-heating, less than 0.1°C in still air.
Features
1. Calibrated directly in ° Celsius (Centigrade)
2. Linear + 10.0 mV/°C scale factor
3. 0.5°C accuracy guaranteed (at +25°C)
4. Rated for full −55° to +150°C range
5. Suitable for remote applications
6. Low cost due to wafer-level trimming
7. Operates from 4 to 30 volts
8. Less than 60 μA current drain
9. Low self-heating, 0.08°C in still air
37 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
ROLE OF LM35:
In this project, the temperature is to be monitored continuously and if the temperature
exceeds the set value preprogrammed in the microcontroller, a buzzer indication is provided
in the circuit to alert the people in the industry to stop the process immediately. Thus the
temperature sensor LM35 has to read the temperature continuously and the microcontroller
has to compare this temperature value with the set temperature preprogrammed in it. When
this temperature exceeds the set value, the microcontroller sends an indication to the buzzer
which gives a loud noise.
3.5 pH SENSOR:
The pH sensor components are usually combined into one device called a combination pH
electrode. The measuring electrode is usually glass and quite fragile. Recent
developments have replaced the glass with more durable solid-state sensors. The
preamplifier is a signal-conditioning device. It takes the high-impedance pH electrode
signal and changes it into allow impedance signal which the analiser or transmitter can
accept. The preamplifier also
strengthens and stabilizes the signal, making it less susceptible to electrical noise.
The sensor's electrical signal is then displayed. This is commonly done in a 120/240 V ac-
powered analiser or in a 24 V dc loop-powered transmitter.
Additionally, the analiser or transmitter has a man machine interface for calibrating the
sensor and configuring outputs and alarms, if pH control is being done.
38 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
Level sensors detect the level of liquids and other fluids and fluidized solids, including
slurries, granular materials, and powders that exhibit an upper free surface. The substance to
be measured can be inside a container or can be in its natural form (e.g., a river or a lake).
The level measurement can be either continuous or point values. Continuous level sensors
measure level within a specified range and determine the exact amount of substance in a
certain place, while point-level sensors only indicate whether the substance is above or below
the sensing point. Generally the latter detect levels that are excessively high or low.
There are many physical and application variables that affect the selection of the optimal
level monitoring method for industrial and commercial processes. The selection criteria
include the physical: phase (liquid, solid or slurry), temperature, pressure or vacuum,
chemistry, dielectric constant of medium, density (specific gravity) of medium, agitation
(action), acoustical or electrical noise, vibration, mechanical shock, tank or bin size and
shape. Also important are the application constraints: price, accuracy, appearance, response
rate, ease of calibration or programming, physical size and mounting of the instrument,
monitoring or control of continuous or discrete (point) levels. In short, level sensors are one
of the very important sensors and play very important role in variety of consumer/ industrial
applications. As with other type of sensors, level sensors are available or can be designed
using variety of sensing principles. Selection of an appropriate type of sensor suiting to the
application requirement is very important.
39 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
3.8 MAX232:
40 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
The ESP8266 Wi-Fi Module is a self contained SOC with integrated TCP/IP protocol
stack that can give any microcontroller access to your Wi-Fi network. The ESP8266 is
capable of either hosting an application or offloading all Wi-Fi networking functions from
another application processor. Each ESP8266 module comes pre-programmed with an AT
command set firmware, meaning, you can simply hook this up to your Arduino device and
get about as much Wi-Fi-ability as a Wi-Fi Shield offers (and that’s just out of the box)! The
ESP8266 module is an extremely cost effective board with a huge, and ever growing,
community.
This module has a powerful enough on-board processing and storage capability that
allows it to be integrated with the sensors and other application specific devices through its
GPIOs with minimal development up-front and minimal loading during runtime. Its high
degree of on-chip integration allows for minimal external circuitry, including the front-end
module, is designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP
applications and Bluetooth co-existence interfaces, it contains a self-calibrated RF allowing it
to work under all operating conditions, and requires no external RF parts.
41 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
There is an almost limitless fountain of information available for the ESP8266, all of which
has been provided by amazing community support. In the Documents section below you will
find many resources to aid you in using the ESP8266, even instructions on how to
transforming this module into an IOT (Internet of Things) solution. The ESP8266 Module is
not capable of 5-3V logic shifting and will require an external Logic Level Converter. Please
do not power it directly from your 5V dev board. This new version of the ESP8266 Wi-Fi
Module has increased the flash disk size from 512k to 1MB.
Features:
802.11 b/g/n
Wi-Fi Direct (P2P), soft-AP
Integrated TCP/IP protocol stack
Integrated TR switch, balun, LNA, power amplifier and matching network
Integrated PLLs, regulators, DCXO and power management units
+19.5dBm output power in 802.11b mode
Power down leakage current of <10uA
1MB Flash Memory
Integrated low power 32-bit CPU could be used as application processor
SDIO 1.1 / 2.0, SPI, UART
STBC, 1×1 MIMO, 2×1 MIMO
A-MPDU & A-MSDU aggregation & 0.4ms guard interval
Wake up and transmit packets in < 2ms
Standby power consumption of < 1.0mW (DTIM3)
42 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
A liquid crystal display (LCD) is a thin, flat display device made up of any number of
colour or monochrome pixels arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspended between two transparent
electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each
other. Without the liquid crystals between them, light passing through one would be blocked
by the other. The liquid crystal twists the polarization of light entering one filter to allow it to
pass through the other.
A program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to a
controller is an LCD display. Some of the most common LCDs connected to the controllers
are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively.
Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it
is even possible to produce a readout using the 5X7 dots plus cursor of the display. They
have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For
a 4-bit data bus it only requires the supply lines plus 6 extra lines (RS RW D7 D6 D5 D4).
When the LCD display is not enabled, data lines are tri state and they do not interfere with
the operation of the microcontroller.
Features:
(1) Interface with either 4-bit or 8-bit microprocessor.
(2) Display data RAM
(3) 80x8 bits (80 characters).
(4) Character generator ROM
(5) 160 different 5x7 dot-matrix character patterns.
(6) Character generator RAM
(7) 8 different user programmed 5x7 dot-matrix patterns.
(8) Display data RAM and character generator RAM may be accessed by the microprocessor.
43 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
(9) Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF, Blink Character, Cursor
Shift, Display Shift.
(10) Built-in reset circuit is triggered at power ON and Built-in oscillator.
Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:
Pin Description:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).
44 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
RS – register select:
There are two very important registers inside the LCD. The RS pin is used for their
selection as follows. If RS = 0, the instruction command code register is selected, allowing
the user to send a command such as clear display, cursor at home, etc. If RS = 1 the data
register is selected, allowing the user to send data to be displayed on the LCD.
R/W – read/write:
R/W input allows the user to write information to the LCD or read information
from it. R/W = 1 when reading; R/W =0 when writing.
E – Enable:
The enable pin is used by the LCD to latch information presented to its data pins.
When data is supplied to data pins, a high to low pulse must be applied to this pin in order for
the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns
wide.
D0 – D7:
45 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
The 8bit data pins, D0 – D7, are used to send information to the LCD or read the contents of
the LCD’s internal registers. To display letters and numbers, we send ASCII codes for the
letters A – Z, a – z, and numbers 0 – 9 to these pins while making RS = 1.There are also
instructions command codes that can be sent to the LCD to clear the display or force the
cursor to the home position or blink the cursor. Table below lists the instruction command
codes.
3.11 BUZZER:
Digital systems and microcontroller pins lack sufficient current to drive the
circuits like relays, buzzer circuits etc. While these circuits require around 10milli amps to be
operated, the microcontroller’s pin can provide a maximum of 1-2milli amps current. For this
reason, a driver such as a power transistor is placed in between the microcontroller and the
buzzer circuit.
46 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
Vcc
CONTROLLER BUZZER
PIN
GROUND
47 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CHAPTER- 4
IMPLEMENTATION
4.1. INTRODUCTION:
Nowadays drinking water is the most precious and valuable for all the human beings,
drinking water utilities faces new challenges in real-time operation. This challenge occurred
because of limited water resources growing population, ageing infrastructure etc. Hence
therefore there is a need of better methodologies for monitoring the water quality.
Traditional methods of water quality involve the manual collection of water sample at
different locations, followed by laboratory analytical techniques in order the character the
water quality. Such approaches take longer time and no longer to be considered efficient .
Although the current methodologies analysis the physical, chemical and biological agents, it
has several drawbacks: a) poor spatiotemporal coverage b) it is labor intensive and high
cost(labor, operation; and equipment) c)the lack of real time water quality information to
enable critical decisions for public health protection. Therefore, there is a need for continuous
online water quality monitoring.
The online water monitoring technologies have made a significant progress for source
water surveillance and water plant operation. The use of their technologies having high cost
associated with installation and calibration of a large distributed array of monitoring sensors.
The algorithm proposed on the new technology must be suitable for particular area and for
large system is not suitable.
By focusing on the above issues our paper design and develop a low cost system for
real time monitoring of the water quality in IOT environment. In our design ARM-7 is used
as a core controller. The design system applies a specialized IOT module for accessing sensor
data from core controller to the mobile. The sensor data can be viewed on the mobile using a
special IP address. Additionally the IOT module also provides a Wi-Fi for viewing the data
on mobile.
48 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
4.2 WORKING:
In this project, we are using three sensors namely temperature sensor, level sensor and
pH sensor which are used to collect the information from the required water. These sensors
are connected to the LCP2148 ARM-7 32bit microcontroller . The data which is collected in
ARM-7 , is sent to the receiver and through UART The MAX232 is an IC, that converts
signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic
circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and
RTS signals, as it plays a role for transmitting data from controller to the Wi-Fi module. The
output is viewed on LCD or Mobile phone through the Telnet software , through which
information about water parameters is displayed.
49 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CHAPTER-5
SOFTWARE DESIGNING
KEIL is a cross compiler. So first we have to understand the concept of compilers and
cross compilers. After then we shall learn how to work with keil.
CONCEPT OF COMPILER:
Compilers are programs used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying microprocessor, but not for
other microprocessors. I.E the programs written in one of the HLL like ‘C’ will compile
the code to run on the system for a particular processor like x86 (underlying
microprocessor in the computer). For example compilers for Dos platform is different
from the Compilers for Unix platform So if one wants to define a compiler then compiler
is a program that translates source code into object code.
A cross compiler is similar to the compilers but we write a program for the target
processor on the host processors. It means being in one environment you are writing a
code for another environment is called cross development. And the compiler used for
cross development is called cross compiler. So, the definition of cross compiler is a
compiler that runs on one computer but produces object code for a different type of
computer.
Cross compilers are used to generate software that can run on computers with a new
architecture or on special-purpose devices that cannot host their own compilers. Cross
compilers are very popular for embedded development, where the target probably couldn't
run a compiler. Typically an embedded platform has restricted RAM, no hard disk, and
limited I/O capability. Code can be edited and compiled on a fast host machine (such as a
PC or Unix workstation) and the resulting executable code can then be downloaded to the
50 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
target to be tested. Cross compilers are beneficial whenever the host machine has more
resources (memory, disk, I/O etc) than the target.
Keil C Compiler is one such compiler that supports a huge number of host and target
combinations. It supports as a target to 8 bit microcontrollers like Atmel and Motorola etc.
There are several advantages of using cross compiler. Some of them are described as
follows
• By using this compilers not only can development of complex embedded systems be
completed in a fraction of the time, but reliability is improved, and maintenance is easy.
• A rudimentary knowledge of the ARM memory architecture is desirable but not necessary.
• Register allocation and addressing mode details are managed by the compiler.
• The ability to combine variable selection with specific operations improves program
readability.
• Keywords and operational functions that more nearly resemble the human thought process
can be used.
• Program development and debugging times are dramatically reduced when compared to
assembly language programming.
• The library files that are supplied provide many standard routines (such as formatted output,
data conversions, and floating-point arithmetic) that may be incorporated into your
application.
• Existing routine can be reused in new programs by utilizing the modular programming
techniques available with C.
• The C language is very portable and very popular. C compilers are available for almost all
target systems. Existing software investments can be quickly and easily converted from or
51 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
• Project Manager.
• Simulator.
• Debugger.
Keil Software provides you with software development tools for the ARM family of
microcontrollers. With these tools, you can generate embedded applications for the multitude
of ARM derivatives. Keil provides following tools for ARM development .
Source-Level Debugger/Simulator,
The keil ARM tool kit includes three main tools, assembler, compiler and linker. An
assembler is used to assemble your ARM assembly program. A compiler is used to
compile your C source code into an object file.
52 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
PROLOAD:
Proload is software which accepts only hex files. Once the machine code is
converted into hex code, that hex code has to be dumped into the microcontroller
and this is done by the Proload. Proload is a programmer which itself contains a
microcontroller in it other than the one which is to be programmed.
This microcontroller has a program in it written in such a way that it accepts the
hex file from the Keil compiler and dumps this hex file into the microcontroller
which is to be programmed.
As the Proload programmer kit requires power supply to be operated, this power
supply is given from the power supply circuit designed above. It should be noted
that this programmer kit contains a power supply section in the board itself but in
order to switch on that power supply, a source is required. Thus this is
accomplished from the power supply board with an output of 12volts.
FEATURES:
Auto Identify connected hardware and devices.
Error checking and verification in-built.
53 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
54 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
DESCRIPTION:
It is simple to use and low cost, yet powerful flash microcontroller programmer for
the ARM series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase
and Blank Check. All fuse and lock bits are programmable.
This programmer has intelligent onboard firmware and connects to the serial port. It
can be used with any type of computer and requires no special hardware. All that is
needed is a serial communication ports which all computers have.
All devices have signature bytes that the programmer reads to automatically identify
the chip. No need to select the devic0e. type, just plug it in and go! All devices also
have a number of lock bits to provide various levels of software and programming
protection. These lock bits are fully programmable using this programmer. Lock bits
are useful to protect the program to be read back from microcontroller only allowing
erase to reprogram the microcontroller. The programmer connects to a host computer
using a standard RS232 serial port. All the programming 'intelligence' is built into
the programmer so you do not need any special hardware to run it. Programmer
comes with window based software for easy programming of the devices.
55 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
CHAPTER-6
RESULT ANALYSIS CONCLUSION AND FUTURE SCOPE
6.2 APPLICATIONS:
56 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
6.3 CONCULSION:
REFERENCES
www.national.com
www.nxp.com
www.8052.com
www.microsoftsearch.com
www.geocities.com
www.keil.com
57 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
APPENDICES
58 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
}
unsigned long int as3()
{
AD0CR&=0XFFFFFF00;
AD0CR|=0X01000008;
//delay(500);
while(!(AD0DR3&0X80000000));
return((AD0DR3 >> 6) & 0x03FF);
}
void pin()
{
PINSEL0=0X00050005;//SELECTING PIN OPERATION
PINSEL1=0X15000000;
PINSEL2=0X00000000;
IODIR0=0xffffffff;
//IODIR0=0X00000000|sensor1|sensor2;// as output and 2 pins as input
IODIR0 &= ~(lvl1|lvl2);
IODIR1=0XFFFFFFFF;//PORT1 AS OUTPUT
IOCLR1=0XFFFFFFFF;
AD0CR=0X00210600;// ADC CONTROL REGISTER
//IOPIN0|=0X0000001C;
//IOSET0=sensor1|sensor2;
}
/*char inp0(char _bit)
{
unsigned long c;
c = 1<<_bit; // Calculate digit to configuration for input port
IODIR0 &= ~c; // Set input port from parameter _bit
return((IOPIN0 & c)>>_bit); // Read and return data bit
}*/
59 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
60 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
void lcdbasic()
{
clcd(1);
stringlcd(0x80,"T:");//0x82,3,4
stringlcd(0x86,"L:"); //0x88,9,a
stringlcd(0xc0,"H:");//0xc2,3,4
}
void okc()
{
unsigned char rr;
do{
rr = receive_0();
}while(rr != 'K');
}
void wifiinit()
{
stringlcd(0x80,"IOT Initilizing");
string_0("AT\r\n"); delay(1500);
//okc();
string_0("ATE0\r\n");
okc();
string_0("AT+CWMODE=3\r\n");
delay(1500);
// string_0("AT+CWSAP=\"org_6547\",\"connectnow\",5,0\r\n");
delay(1500);
string_0("AT+CIPMUX=1\r\n");
delay(1500);
string_0("AT+CIPSERVER=1,23\r\n");
delay(1500);
stringlcd(0x80,"WAITING FOR CONNCT");
}
void sendwifi(unsigned char *chr,unsigned int length)
{
61 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
62 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
for(p=0;p<14;p++){rfid_t[p]=0;}
pin();
IOCLR0=buzzer;
ser_init_0(0x61,0x00);
ser_init_1(0x61,0x00); //serial initilization
initlcd(); //Energy Efficient Ethernet for Real-Time Industrial Networks
stringlcd(0x80,"IOT BASED WATER QUALITY");
delay(1000); //gprs();
clcd(1);
wifiinit();
while(receive_0()!='L');
delay(400);
stringlcd(0x80,"CONNECTED");
delay(2500);
clcd(1);
stringlcd(0x80,"T:");//0x83,4,5
stringlcd(0x88,"L:");//0xc3,4,5
stringlcd(0xc0,"PH:");
// InitSerial0Int((unsigned int)serial0_RxISR);
while(1)
{
tempv = as1();
tempv = (tempv/3);
clcd(0x82);conv(tempv);delay(500);
string_0("AT+CIPSEND=0,9\r\n"); delay(900);
63 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
string_0("Temp:");conv_serial_0(tempv);
delay(800);
if(tempv > 40)
{
IOSET0=buzzer;
}
if(tempv < 40)
{
IOCLR0=buzzer;
}
phv = as2();
//phv = (phv/3);
clcd(0xC4);conv(phv);
delay(500);
if(phv > 0 && phv < 200)
{
stringlcd(0xc4,"000 ");
string_0("AT+CIPSEND=0,8\r\n"); delay(900);
string_0("Ph-000\r\n");//6
delay(800);
}
64 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
string_0("Ph-0.7\r\n");//6
delay(800);
}
65 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
IOSET0=buzzer;
}
if(inp0(lvl1) == 0 && inp0(lvl2) == 1)
66 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
{
stringlcd(0x8A,"Lvl-1");
IOCLR0=buzzer;
string_0("AT+CIPSEND=0,9\r\n"); delay(900);
string_0("LEVEL-1\r\n");//6
delay(800);
}
delay(500);
}//end of whil1e
}
void serial0_RxISR(void) __irq
{
unsigned char ch,cht1;
cht1 = receive_0();
if(cht1 == '+'){
for(ch=0;ch<8;ch++){receive_0();}
67 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
gchr = receive_0(); }
/* for(ch=0;ch<12;ch++){rfid_t[ch]=receive_0();}
IOCLR0=relay;
if(strcmp(rfid_t,rfid_0)==0){card = 1;set3=1;}
if(strcmp(rfid_t,rfid_1)==0){card = 2;set3=1;}
if(strcmp(rfid_t,rfid_2)==0){card = 3;set3=1;}*/
68 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
69 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
70 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING
REAL TIME WATER QUALITY MONITORING THROUGH IOT
71 | P a g e
INSTITUTE OF AERONAUTICAL ENGINEERING