IoT Based Smart Water Quality Monitoring System
IoT Based Smart Water Quality Monitoring System
IoT Based Smart Water Quality Monitoring System
Abstract:
The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances and
other items embedded with electronics, sensors, actuators, software and connectivity which
enables these things to connect and exchange data. Water quality is major environmental problem
in India. The largest source of water quality in India is intreated sewage. Other sources of
pollution include agricultural runoff and unregulated small scale industry that results in polluting,
most of the rivers, lakes and surface water. In conventional systems, the monitoring process
involves the manual collection of sample water from various regions, followed by testing and
analysis. The sensors connected with Arduino-uno in discrete way to detect the water parameters
and to display in a desktop application. The quality of water should be monitored continuously, to
ensure the safe supply of water from any water bodies and water resources for drinkable and
using it and that continuous measurement of water condition based on the parameters IoT helps it
in improving the health and living standards of all living things.
CHAPTER-1
INTRODUCTION
All embedded systems are including computers or microprocessors. Some of these computers are
however very simple systems as compared with a personal computer. The very simplest
embedded systems are capable of performing only a single function or set of functions to meet a
single predetermined purpose. In more complex systems an application program that enables the
embedded system to be used for a particular purpose in a specific application determines the
functioning of the embedded system. The ability to have programs means that the same
embedded system can be used for a variety of different purposes. In some cases a microprocessor
may be designed in such a way that application software for a particular purpose can be added to
the basic software in a second process, after which it is not possible to make further changes. The
applications software on such processors is sometimes referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip”), which may
itself be packaged with other chips in a hybrid system or Application Specific Integrated Circuit
(ASIC). Its input comes from a detector or sensor and its output goes to a switch or activator
Nikhil Kedia entitled “The Water Quality Monitoring for Rural Areas-A Sensor Cloud Based
Economical Project.” Published in 2015 1st International Conference on Next Generation
Computing Technologies (NGCT-2015) Dehradun, India. This paper highlights the entire water
Jayti Bhatt,Jignesh Patoliya entitled “Real Time Water Quality Monitoring System”. This paper
describes to ensure the safe supply of drinking water the quality should be monitored in real time
for that purpose new approach IOT (Internet of Things) based water quality monitoring has been
proposed. In this paper, the design of IOT based water quality monitoring system that monitors
the quality of water in real time. This system consists of some sensors which measure the water
quality parameter such as pH, turbidity, conductivity, dissolved oxygen, temperature. The
measured values from the sensors are processed by the microcontroller and these processed
values are transmitted remotely to the core controller that is raspberry pi using Zigbee protocol.
Finally, sensors data can view on internet browser application using cloud computing.
Michal Lom, Ondrej Pribyl, Miroslav Svitek entitled “Industry 4.0 as a Part of Smart Cities”.
This paper describes the conjunction of the Smart City Initiative and the concept of Industry 4.0.
The term smart city has been a phenomenon of the last years, which is very inflected especially
since 2008 when the world was hit by the financial crisis. The main reasons for the emergence of
the Smart city initiative are to create a sustainable model for cities and to preserve the quality of
life of their citizens. The term smart city is not only seen as a technical discipline, but different
economic, humanitarian or legal aspects must be involved as well. In the Industry 4.0, the Internet
of Things (IoT) shall be used for the development of so–called smart products. Subcomponents of
the product are equipped with their own intelligence. The added intelligence is used both during
the manufacturing of a product as well as during subsequent handling, up to continuous
monitoring of the product lifecycle (smart processes). The other main aspects of the Industry 4.0
for enhancing the services are Internet of Services (IoS), that includes especially intelligent
transport and logistics (smart mobility, smart logistics), as well as Internet of Energy (IoE), which
SYSTEM OVERVIEW :
The proposed IoT based Smart Water Quality Monitoring System is able to read data from water
samples by sensors through the microcontroller and NodeMCU these values will be displayed on
the web browser. The proposed block diagram of based Smart Water Quality Monitoring System
consists of different sensors connected with controller and NodeMCU to measure important
physical parameters (pH, temperature, soil moisture) of water samples. The pH sensor is used to
measure the presence of acidity or alkalinity of any solution in logarithmic scale. The temperature
sensor provides accurate reading between –55 to 125ºC. To measure the water is presented or not.
The recommended detection range of this sensor is 1 to 15 ms/cm within a temperature between
0- 40ºC. The extracted data from these sensors are accessed by the controller arduino-uno and
transfer to NodeMCU and then to the developed web browser. The test water sample is
“Drinkable” or “Not Drinkable”,
CHAPTER-2
EMBEDDED SYSTEM
An embedded system is one kind of a computer system mainly designed to perform several tasks
like to access, process, and store and also control the data in various electronicsbased systems.
Embedded systems are a combination of hardware and software where software is usually known
as firmware that is embedded into the hardware. One of its most important characteristics of these
systems is, it gives the o/p within the time limits. Embedded systems support to make the work
more perfect and convenient. So, we frequently use embedded systems in simple and complex
devices too. The applications of embedded systems mainly involve in our real life for several
devices like microwave, calculators, TV remote control, home security and neighbourhood traffic
control systems, etc.
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance.
Embedded systems range from portable devices such as digital watches and MP3 players, to
large stationary installations like traffic lights, factory controllers, and largely complex systems
like hybrid vehicles, MRI, and avionics. 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.
Embedded systems are designed to do some specific tasks, rather than be a generalpurpose
computer for multiple tasks. Some also have real-time performance constraints that must be met,
for reasons such as safety and usability; others may have low or no performance requirements,
allowing the system hardware to be simplified to reduce costs.
Embedded systems are not always standalone devices. Many embedded systems consist of small
parts within a larger device that serves a more general purpose. An embedded system in an
automobile provides a specific function as a subsystem of the car itself.
The program instructions written for embedded systems are referred to as firmware, and are
stored in read-only memory or flash memory chips. They run with limited computer hardware
resources: little memory, small or non-existent keyboard or screen.
An embedded system uses a hardware platform to perform the operation. Hardware of the
embedded system is assembled with a microprocessor/microcontroller. It has the elements such as
Power Supply
The power supply is an essential part of any embedded systems circuits. An embedded system
may need a supply of 5 volts or if it is low power then maybe 3.3 or 1.8v. The supply may be
provided with the help of battery or we can use any wall adapter. It will depend on the application
need. The power supply circuit can be designed with the help some little knowledge of
electronics. For that, we need a bridge rectifier circuit, capacitor as a filter and a voltage regulator
that provides constant output supply.
Processor
A processor is the main brain inside any embedded systems. This is a major factor that affects the
performance of the system. There are different processors available in the market. An embedded
system may use microprocessor or microcontroller. The processor comes in different architecture
like 8-bit, 16-bit and 32-bit. The 8-bit processor is generally used in a small application where we
need some basic computation like input and output no heavy processing.
Memory
If we are using a microcontroller like AT89s51, AT89s52 or ATmega, the memory is available
on-chip. We generally talk about two types of memory in the embedded systems
Read-Only memory (RAM)
Random Access Memory (ROM)
Electrically Erasable Programmable Read-Only Memory (EEPROM)
RAM memory is volatile memory and used for temporary storage of the data. And the selection
of it depends on the user need and the application. The ROM memory or Code Memory, this is
used for the storage of the program. Once system powered, the system fetches the code from the
ROM memory. The EEPROM is a unique memory. The content can be erased and reprogrammed
by a high voltage pulse input. This is used to store the data by the program itself. Suppose we
have a temperature data logger. And it needs to store the data every one hour. It means we need
the data at runtime after the system is started.
Timers-Counters
If you are working in embedded systems, you must have heard about
What are timer and counter
Why we use timer and counter
What is difference between timers and counter
In some application, we need to generate some delay. Like for blinking an LED, we need a
delay. For making square pulse we need a delay. But there is some issue when we generate the
delay from the normal coding style by making any loop running for a particular time. Definitely,
this will give you some delay but the code after this loop remains in waiting for state and delayed.
Communication Ports
Embedded systems hardware has different types of communication ports to communicate with
the other embedded devicesFor example, popular Arduino UNO board has ATmega328 IC and it
has following communication port:
UART
I2C
SPI
For sending data from one board to other we can use these serial protocols. But for that, we need
to program it.
This operating system is specially designed to run various applications with an exact timing and a
huge amount of consistency. Particularly, this can be significant in measurement & industrial
automation systems where a delay of a program could cause a safety hazard.
We need a program written in assembly or in embedded c language. And then we compile it. This
compiled code converted into HEX code. This hex code is programmed or burned into the ROM
of the system using some programmer.
These are the tools that are generally used in embedded system development
Assembler
Emulator
Debugger
Compiler
Assembler
Your program is in assembly language. This assembly language program is converted into the
HEX code using this utility. Then using some hardware called as a programmer we write the
chip.
Emulator
An emulator is hardware or software tool that has a similar functionality to the target system or
guest system. It enables the host system to execute the functionality and other components. It is a
replica of the target system. And used for debugging the code and issues. Once program or code
is fixed at the host system, it is transferred to the target system
Debugger
Sometimes we are not getting expected results or output due to errors or bug. There are certain
tools that are specifically used for the debugging process. Where we can see the controls flow and
register value to identify the issue. Compiler A compiler is a software tool that converts one
programming language into target code that a machine can understand. The compiler basically
used for translating the high-level language into the low-level language like machine code,
assembly language or object code.
Embedded systems in automobiles include motor control, cruise control, body safety, engine
safety, robotics in an assembly line, car multimedia, car entertainment, E-com access, mobiles
etc.
Embedded systems in telecommunications include networking, mobile computing, and wireless
communications, etc.
Embedded systems in smart cards include banking, telephone and security systems.
Embedded Systems in satellites and missiles include defence, communication, and aerospace
Embedded systems in computer networking & peripherals include image processing,
networking systems, printers, network cards, monitors and displays
Embedded Systems in digital consumer electronics include set-top boxes, DVDs, highdefinition
TVs and digital cameras
CHAPTER-3
EXSSTING SYSTEM:
PRINCIPLE The main principle of this circuit is that the device placed at any particular place can
measure the quality of water based on pH scale and the temperature of water and soil moisture.
These three different sensors plays a major role pH scale to measure the in the scale of 0-14.and
soil moisture sensor is used to measure inform of percentage of 0-100 percentage to check
whether the water is being sent to the fields, tanks etc., and the
Temperature is used to measure the temperature of water to provide to the plants, and within
the limit of temperature to drink the water. These values are displayed on the web browser with
the assist IOT technology.
Proposed system:
There are two parts of programming in this Smart Water Quality Monitoring System using IoT. In the first
part, Arduino UNO is programmed and in the second part, NodeMCU will be programmed. The proposed
IoT based Smart Water Quality Monitoring System the data from the pH value detects the value,
temperature in the form of centigrade and soil moisture sensor in the form of percentage , the data from
the sensors will be displayed on the web page.
LCD DISPLAY
Turbidity sensor
ARDUINO
UNO Node mcu
Ultrasonic sensor
water level
Temperature sensor
Cunductvity sensor
Buzzer
3.2.1 ARDUINO
3.2.1.1 Overview
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 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a USB
cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial
driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a
USB-to-serial converter.
Revision3 Of The Board Has The Following New Features
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage
provided from the board. In future, shields will be compatible both with the board that use the
AVR, which operate with 5V and with the Arduino Due that operate with 3.3V. The second one
is a not connected pin that is reserved for future purposes. Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is
the latest in a series of USB Arduino boards, and the reference model for the Arduino platform;
for a comparison with previous version
The Arduino reference design can use an Atmega8, 168, or 328, Current models use an
ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is
identical on all three processors.
3.2.1.3 SPECIFICATIONS
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage 7-12V (recommended)
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by boot loader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
3.2.1.4 POWER
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's
power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can besupplied
with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of
the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can
damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50mA.
IOREF This pin on the Arduino board provides the voltage reference with which
themicrocontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working with
the 5V or 3.3V.
3.2.1.5 Memory
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the Uno can be used as an input or output, using pin Mode
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. Thesepins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on alow
value, a rising or falling edge, or a change in value. See the attach Interrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with theanalog Write()function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communicationusing
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's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analog Reference () function.
Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using theWirelibrary.
AREF. Reference voltage for the analog inputs. Used withanalog Reference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset buttonto
shields which block the one on the board.
3.2.1.7 Communication
The Arduino Uno has a number of facilities for communicating with a computer, another
The Arduino software includes a serial monitor which allows simple textual data 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 Uno's digital
pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.
3.2.1.8 Programming
The Arduino Uno can be programmed with the Arduino software. The ATmega328 on the
Arduino Uno comes pre burned with a boot loader that allows you to upload new code to it
without the use of an external hardware programmer. It communicates using the original STK500
protocol (reference, C header files).You can also bypass the boot loader and program the
microcontroller through the ICSP (In-Circuit Serial Programming) header; see these instructions
for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy)
and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected computer.
One of the hardware flow control lines (DTR) of theATmega8U2/16U2 is connected to the reset
line of the ATmega328 via a 100 nano farad capacitor. When this line is asserted (taken low), the
reset line drops long enough to reset the chip. The Arduino software uses this capability to allow
you to upload code by simply pressing the upload button in the Arduino environment. This means
that the boot loader can have a shorter timeout, as the lowering of DTR can be well-coordinated
with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software (via
USB). For the following half-second or so, the boot loader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make sure
that the software with which it communicates waits a second after opening the connection and
before sending this data. The Uno contains a trace that can be cut to disable the auto-reset. The
pads on either side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN".
You may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the
reset line.
The Arduino Uno has a resettable poly fuse that protects your computer's USB ports from
3.3Power Supply
Power supply is the circuit from which we get a desired dc voltage to run the other circuits. The
voltage we get from the main line is 230V AC but the other components of our circuit require 5V
DC. Hence a step-down transformer is used to get 12V AC which is later converted to 12V DC
using a rectifier. The output of rectifier still contains some ripples even though it is a DC signal
due to which it is called as Pulsating DC. To remove the ripples and obtain smoothed DC power
filter circuits are used. Here a capacitor is used. The 12V DC is rated down to 5V using a positive
voltage regulator chip 7805. Thus a fixed DC voltage of 5V is obtained.
3.3.1LM35
Here LM35 series is also one of the sensors in precision integrated-circuit temperature. Its result
volts are proportional to linearly the more range of temperature values in Celsius temperature.
The Here to calculate the LM35 thus has an upper hand over linear temperature sensors calibrated
in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to
obtain convenient Centigrade scaling. It doesn’t used exterior adjust to provide 25%°C of room
temperature and ±50%°C and −55 to +150°C is a overall its temperature range.
Features of LM35
1 Vss (Ground) Here using a Ground pin, it is attached with down of the system.
2 Vdd(+5 Volt) Here by using a +5V (4.7V – 5.3V) to power the LCD
5 Reader Write When receive info is grounded to LCD by using read or write
data.
6 Enable For receive data attach the Microcontroller Pin connect between 1
and 0.
7 Data Pin 0-7 When the pins are connected to zero to seven it produce an 8-bit
data line also to connect with microcontroller to give the 8-bit
data. Here by using data pins 4, 5 ,6 and 7 to perform operation
on 4-bit mode.
15 LED Positive Here using a LED of Backlight pin Because it’s positive terminal.
The term LCD stands for liquid crystal display. It is one kind of electronic display module used in
an extensive range of applications like various circuits & devices like mobile phones, calculators,
computers, TV sets, etc. These displays are mainly preferred for multi-segment light-emitting
diodes and seven segments. The main benefits of using this module are inexpensive; simply
programmable, animations, and there are no limitations for displaying custom characters, special
and even animations, etc.
Features of LCD16x2
The features of this LCD mainly include the following.
The operating voltage of this LCD is 4.7V-5.3V
It includes two rows where each row can produce 16-characters.
The utilization of current is 1mA with no backlight
Every character can be built with a 5×8 pixel box
The alphanumeric LCDs alphabets & numbers
Is display can work on two modes like 4-bit & 8-bit
These are obtainable in Blue & Green Backlight
It displays a few custom generated characters
3.3.3Temperature sensors
By definition, “A device, used to measure amount of heat energy that allows to detect a physical
change in temperature from a particular source and converts the data for a device or user, is
known as a Temperature Sensor.” These sensors have been deployed for a long time in a variety
of devices. However, with the emergence of IoT, they have found more room to be present in an
even greater number of devices. Only a couple of years ago, their uses mostly included A/C
control, refrigerators and similar devices used for environmental control. However, with the
advent of the IoT world, they have found their role in manufacturing processes, agriculture and
health industry. In the manufacturing process, many machines require specific environment
temperature, as well as device temperature. With this kind of measurement, the manufacturing
process can always remain optimal. On the other hand, in agriculture, the temperature of soil is
crucial for crop growth. This helps with the production of plants, maximizing the output.
pH sensor:
The pH of a solution is the measure of the acidity or alkalinity of that solution. The pH scale is a
logarithmic scale whose range is from 0- 14 with a neutral point being 7. Values above 7 indicate
a basic or alkaline solution and values below 7 would indicate an acidic solution. It operates on
5V power supply and it is easy to interface with arduino.The normal range of pH is 6 to 8.5. Fig
8.3 pH Sensor
The Model PHE-45P pH Sensor measures the pH of aqueous solutions in industrial and municipal process
applications. It is designed to perform in the harshest of environments, including applications that poison
conventional pH sensors. All seals are dual o-ring using multiple sealing materials. The sensor is designed
for use with the Omega PHTX-45 Monitor/Analyzer.
• A high volume, dual junction saltbridge is utilized to maximize the in-service lifetime of the sensor. The
annular junction provides a large surface area to minimize the chance of fouling. Large electrolyte
• The reference element of the sensor is a second glass pH electrode immersed in a reference buffer
solution. This glass reference system greatly increases the range of sensor applications.
• An integral preamplifier is encapsulated in the body of the sensor. This creates a low impedance signal
output which ensures stable readings in noisy environments and increases the maximum possible
distance between sensor and transmitter to 3,000 feet (914 meters).
• System diagnostics warn the user in the event of electrode breakage, loss of sensor seal integrity or
integral temperature element failure.
• Pt1000 RTD. The temperature element used in the PHE-45P sensor is highly accurate and provides a
highly linear output.
pH Stability 0.02 pH per 24 hours, non-cumulative Wetted Materials PEEK, ceramic, titanium, glass,
Viton, EDPM (optional: 316 stainless steel with 316SS body) Temperature Compensation Pt1000 RTD
Sensor Cable 6 Conductor (5 are used) plus 2 shields, 15 feet (4.6 meters) length standard Temperature
Range -5 to +95 °C (23 to 203 °F) Pressure Range 0 to 100 psig Maximum Flow Rate 10 feet (3 meters) per
second Max. Sensor-Analyzer Distance 3,000 feet (914 meters) Sensor Body Options 1” NPT convertible,
1¼” insertion, 1½” or 2” sanitary-style Weight 1 lb. (0.45 kg) 1.3 Sensor Specifications PHE-45P Notes: 1.
The type of hardware used to mount the sensor may limit the maximum temperature and pressure
ratings. Please consult the hardware manufacturer’s specifications to obtain the relevant temperature
and pressure rating information. 2. The maximum flow rate specification is lower for process solutions
with low ionic conductivity or high suspended solids concentration. High flow rates in low ionic
conductivity processes may cause a measurement error due to static electrical discharge. High flow rates
in processes with high suspended solids concentration may decrease the functional life of the sensor by
eroding the pH-sensitive glass electrode.
What Is Turbidity?
Simply put, turbidity is the measurement of water clarity (i.e., transparency). Suspended
particles – such as silt, algae, plankton, and sewage – can cause water to appear cloudy or
murky. These particles scatter and absorb light rays rather than allowing light to be
transmitted straight through the water.1
A higher turbidity reading represents cloudier and ‘thicker’ water with more particles
throughout. When water is clear, it has low turbidity levels.
NTU represents turbidity readings captured using a white light at a 90-degree detection
angle. Sensors that use this type of measurement method are compliant with EPA Method
180.1.1
In contrast, FNU is the correct unit when using an 860 nm light (near IR) with a 90-degree
detection angle. Sensors using this method are typically compliant with ISO7027.1
Check out the Light Source and the Angle of the Detector(s) sections to learn more!
We also encourage you to check out our technical note on Turbidity Units and Calibration
Solutions, and our blog post on Turbidity Measurements: Tips and Precautions.
As rain and melting snow flow across the landscape, particulate matter is picked up. This
may be pollutants, dust, pet waste, and more in an urban environment. In a rural setting, this
may be loose soil or leaves. As rainfall enters a water body, the velocity will increase,
eroding riverbanks and causing additional sediment influx
Sewer discharge into waterways can occur during large storm events when combined
sewer systems – sewers that collect rainwater runoff and wastewater – become
overwhelmed, resulting in a direct release of sewage into water bodies. Combined sewer
overflow (CSO) events often cause a spike in turbidity.
Animals can contribute to turbidity when their activities stir up silt, cause erosion, or release
solid waste into the water.
Algae in water can be another source of turbidity, as the growth of these organisms
prevents sunlight penetration into the water column. Not only does this increase turbidity, but
it can also negatively impact predators that rely on sunlight to pursue their prey.3
Temperature sensor: Water Temperature indicates how water is hot or cold. The range of
DS18B20 temperature sensor is -55 to +125 °C. This temperature sensor is digital type which
gives accurate reading
CHAPTER-4
CONTROLLER
Arduino
Arduino is a computer hardware and software company, project, and user community that
designs and manufactures microcontroller kits for building digital devices and interactive objects
that can sense and control objects in the physical world. The project's products are distributed
as open-source hardware and software, which are licensed under the GNU Lesser General Public
License (LGPL) or the GNU General Public License (GPL),[1] permitting the manufacture of
Arduino boards and software distribution by anyone. Arduino boards are available commercially
in preassembled form, or as do-it-yourself kits.
Arduino board designs use a variety of microprocessors and controllers. The boards are equipped
with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The boards feature serial communications interfaces,
including Universal Serial Bus (USB) on some models, which are also used for loading programs
from personal computers. The microcontrollers are typically programmed using a dialect of
features from the programming languages C and C++. In addition to using traditional compiler
toolchains, the Arduino project provides an integrated development environment (IDE) based on
the Processing language project.
The Arduino project started in 2005 as a program for students at the Interaction Design Institute
Ivrea in Ivrea, Italy,[2] aiming to provide a low-cost and easy way for novices and professionals to
create devices that interact with their environment using sensors and actuators. Common
The name Arduino comes from a bar in Ivrea, Italy, where some of the founders of the project
used to meet. The bar was named after Arduino of Ivrea, who was the margrave of the March of
Ivrea and King of Italy from 1002 to 1014.
History
The origin of the Arduino project started at the Interaction Design Institute Ivrea (IDII) in Ivrea,
Italy.[2] At that time, the students used a BASIC Stamp microcontroller at a cost of $100, a
considerable expense for many students. In 2004, Colombian student Hernando Barragán created
the development platform Wiring as a Master's thesis project at IDII, under the supervision of
Massimo Banzi and Casey Reas, who are known for work on the Processing language. The
project goal was to create simple, low cost tools for creating digital projects by non-engineers.
In 2005, Massimo Banzi, with David Mellis, another IDII student, and David Cuartielles, added
support for the cheaper ATmega8 microcontroller to Wiring. But instead of continuing the work
on Wiring, they copied the Wiring source code and renamed it as a separate project, called
Arduino.[4]
The initial Arduino core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe,
Gianluca Martino, and David Mellis,[2] but Barragán was not invited to participate. [4] Following
the completion of the Wiring platform, lighter and less-expensive versions were distributed in the
open-source community.[5]Adafruit Industries, a New York City supplier of Arduino boards,
parts, and assemblies, estimated in mid-2011 that over 300,000 official Arduinos had been
commercially produced,[6] and in 2013 that 700,000 official boards were in users' hands.
Hardware
Arduino is open-source hardware. The hardware reference designs are distributed under
a Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino
website. Layout and production files for some versions of the hardware are also available. The
source code for the IDE is released under the GNU General Public License, version 2.
[8]
Nevertheless, an official Bill of Materials of Arduino boards has never been released by
Arduino staff. Although the hardware and software designs are freely available under copy
left licenses, the developers have requested that the name Arduino be exclusive to the official
product and not be used for derived works without permission. The official policy document on
use of the Arduino name emphasizes that the project is open to incorporating work by others into
the official product.[9] Several Arduino-compatible products commercially released have avoided
the project name by using various names ending in -duino.[10]
An Arduino board consists of an Atmel 8-, 16- or 32-bit AVR microcontroller (ATmega8,
ATmega168, ATmega328, ATmega1280, ATmega2560), but other makers' microcontrollers have
Arduino microcontrollers are pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory. The default bootloader of the Aduino UNO is the optiboot
bootloader.[12] Boards are loaded with program code via a serial connection to another computer.
Some serial Arduino boards contain a level shifter circuit to convert between RS-232 logic levels
and transistor–transistor logic (TTL) level signals. Current Arduino boards are programmed
via Universal Serial Bus (USB), implemented using USB-to-serial adapter chips such as
the FTDI FT232. Some boards, such as later-model Uno boards, substitute the FTDI chip with a
separate AVR chip containing USB-to-serial firmware, which is reprogrammable via its own
ICSP header. Other variants, such as the Arduino Mini and the unofficial Boarduino, use a
detachable USB-to-serial adapter board or cable, Bluetooth or other methods, when used with
traditional microcontroller tools instead of the Arduino IDE, standard AVR in-system
programming (ISP) programming is used.
The Arduino board exposes most of the microcontroller's I/O pins for use by other
circuits. The Diecimila,[a] Duemilanove,[b] and current Uno[c] provide 14 digital I/O pins, six of
which can produce pulse-width modulated signals, and six analog inputs, which can also be used
as six digital I/O pins. These pins are on the top of the board, via female 0.1-inch (2.54 mm)
headers. Several plug-in application shields are also commercially available. The Arduino Nano,
and Arduino-compatible Bare Bones Board[13] and Boarduino[14] boards may provide male header
pins on the underside of the board that can plug into solder less bread boards. Many Arduino-
compatible and Arduino-derived boards exist. Some are functionally equivalent to an Arduino
and can be used interchangeably. Many enhance the basic Arduino by adding output drivers,
often for use in school-level education, to simplify making buggies and small robots. Others are
electrically equivalent but change the form factor, sometimes retaining compatibility with shields,
sometimes not. Some variants use different processors, of varying compatibility.
A program for Arduino may be written in any programming language for a compiler that
produces binary machine code for the target processor. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.
The Arduino project provides the Arduino integrated development environment (IDE), which is
a cross-platform application written in the programming language Java. It originated from the
IDE for the languages Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace matching,
and syntax highlighting, and provides simple one-click mechanisms to compile and upload
programs to an Arduino board. It also contains a message area, a text console, a toolbar with
buttons for common functions and a hierarchy of operation menus.
A program written with the IDE for Arduino is called a sketch.[40] Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde. The Arduino IDE supports the languages C and C+
+ using special rules of code structuring. The Arduino IDE supplies a software library from
the Wiring project, which provides many common input and output procedures. User-written
code only requires two basic functions, for starting the sketch and the main program loop, that are
compiled and linked with a program stub main() into an executable cyclic executive program
with the GNU toolchain, also included with the IDE distribution. The Arduino IDE employs the
program avrdude to convert the executable code into a text file in hexadecimal encoding that is
loaded into the Arduino board by a loader program in the board's firmware.
Applications
Technical specs
Programming
The Arduino/Genuino Uno can be programmed with the (Arduino Software (IDE)). Select
"Arduino/Genuino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials. The ATmega328 on the Arduino/Genuino Uno
comes preprogrammed with a bootloader that allows you to upload new code to it without the use
of an external hardware programmer. It communicates using the original STK500 protocol
(reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header using Arduino ISP or similar; see these instructions for details. The
ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available in the
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of
Italy) and then rese ing the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.
Warnings
The Arduino/Genuino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal protection, the
fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port, the
fuse will automatically break the connection until the short or overload is removed.
Power
The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may become unstable. If using
more than 12V, the voltage regulator may overheat and damage the board. The power pins are as
follows:
Vin. The input voltage to the Arduino/Genuino board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
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), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF
pin voltage and select the appropriate power source or enable voltage translators on
the outputs to work with the 5V or 3.3V.
Memory
The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pins are connected to the corresponding pins of the ATmega8U2 USB-to-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. See the attachInterrupt() function for
details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() 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 driven by digital pin 13. When the pin is HIGH value,
the LED is on, when the pin is LOW, it's off.
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. There are a couple of other pins on the board:
o AREF. Reference voltage for the analog inputs. Used with analogReference().
o Reset. Bring this line LOW to reset the microcontroller. Typically used to add a
reset button to shields which block the one on the board.
Communication
Arduino/Genuino Uno has a number of facilities for communicating with a computer, another
Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL (5V)
This setup has other implications. When the Uno is connected to either a computer running Mac
OS X or Linux, it resets each time a connection is made to it from software (via USB). For the
following half-second or so, the bootloader is running on the Uno. While it is programmed to
ignore malformed data (i.e. anything besides an upload of new code), it will intercept the first few
bytes of data sent to the board after a connection is opened. If a sketch running on the board
receives one-time configuration or other data when it first starts, make sure that the software with
which it communicates waits a second after opening the connection and before sending this data.
The Uno board contains a trace that can be cut to disable the auto-reset. The pads on either side of
the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able
to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this
forum thread for details.
CHAPTER-5
SOFTWARE
Software introduction:
Launch Arduino IDE. After your Arduino IDE software is downloaded, you need to unzip the
folder. Inside the folder, you can find the application icon with an infinity label (application.exe).
Doubleclick the icon to start the IDE.
Open your first project. Once the software starts, you have two options:
Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.
Fig 3.5 function of each symbol appearing in the Arduino IDE toolbar
In this chapter, we will study in depth, the Arduino program structure and we will learn more new
terminologies used in the Arduino world. The Arduino software is open-source. The source code
for the Java environment is released under the GPL and the C/C++ microcontroller libraries are
under the LGPL. Sketch: The first new terminology is the Arduino program called “sketch”.
Structure Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software program, step
by step, and how we can write the program without any syntax or compilation error. Let us start
with the Structure. Software structure consist of two main functions:
Setup( ) function
Loop( ) function
Data types in C refers to an extensive system used for declaring variables or functions of different
types. The type of a variable determines how much space it occupies in the storage and how the
bit pattern stored is interpreted. The following table provides all the data types that you will use
during Arduino programming.
CHAPTER-6
Circuit diagram:
In this circuit diagram Arduino UNO is connected to transmitter and receiver in connected to
NodeMCU, then the data of the sensors which are collected from the sensors are transmitted
from the pH sensor, soil moisture sensor and Temperature sensor to connected NodeMCU
The output pin of positive and negative, positive is connected to A0 in Arduino UNO and
negative to the Ground to Ground in Arduino UNO. The input for the pH conversion board is 9v
dc. And the pH sensor probe is connected to the pH conversion board. And the soil moisture
sensor pins connected to chip of moisture positive to positive chip, and negative to negative
chip, from the chip vin,grd,D0 is connected to Arduino UNO , vin to vcc, grd to grd, D0 to A1. The
temperature sensor is positive is connected to A2 of Arduino UNO and negative is connected to
ground of NodeMCU. The output of these sensors sent to NodeMCU and then its connected to
wifi server with the NodeMCU programming the html page is created, the data will be sent and
displayed and at every 5 Seconds the web browser page will be refresh so the new data will
displayed on screen.
Coding :
CONCLUSION
6. Conclusion: Monitoring of soil moisture, PH & Temperature sensors of Water makes use of
water detection sensor with unique advantage and existing network. The system can monitor
water quality automatically, and it is low in cost and does not require people on duty. So the
water quality testing is likely to be more economical, convenient and fast and displayed on
screen. The system has good flexibility. Only by replacing the corresponding sensors and
changing the relevant software programs, this system can be used to monitor other water quality
parameters. The operation is simple. The system can be expanded to monitor industrial and
agricultural production and so on. It has widespread application and extension value. By keeping
the embedded devices in the environment for monitoring enables self protection (i.e., smart
environment) to the environment. To implement this need to deploy the sensor devices in the
environment for collecting the data and analysis. By deploying sensor devices in the
environment, we can bring the environment into real life i.e. it can interact with other objects
through the network. Then the collected data and results will be available to the end user through
the Wi-Fi and the values displayed on screen.
FUTURE SCOPE
Detecting the more parameters for most secure purpose, Increase the parameters by addition of
multiple sensors. Its major limitation is the accuracy. It can be improved by taking a large
number of readings and displaying them. The ultimate goal of this work is to observe the quality
of water samples by designing a IoT based smart water quality monitoring system implemented
in that can detect specific physical parameters: Temperature, pH, Soil Moisture sensors. The
future scope of this project is monitoring environmental conditions, drinking water quality,
treatment and disinfection of waste water etc. This system could also be implemented in various
industrial processes. The system can be modified according to the needs of the user and can be
implemented along with lab view to monitor data on computers.
REFERENCES
[1] Monira Mukta, Samia Islam, Surajit Das Barman and Ahmed Wasif Reza "IoT based Smart Water
Quality Monitoring System," 2019 IEEE 4th International Conference on Computer and Communication
Systems. 669-673, DOI: 10.1109/CCOMS.2019.8821742 [2] Ajith Jerom B, Manimegalai R and Ilayaraja V
“ An IoT Based Smart Water Quality Monitoring System using Cloud”, 2020 International Conference on
Emerging Trends in Information Technology and Engineering (ic-ETITE), 978-1- 7281-4142-8/$31.00
©2020 IEEE,1 to 7, DOI: 10.1109/ic-ETITE47903.2020.450 [3] A. H. Mirza and S. Cosan, "Computer
network intrusion detection using sequential LSTM neural networks autoencoders", Proceedings in IEEE
Signal Process Communication. Application Conference (SIU), pp. 1-4, May 2018. [4] PWTAG, Swimming
Pool Water: Treatment and Quality Standards for Pools and Spas, ISBN 095100766, pg 97 [5]
Sugapriyaa, Tha, Rakshaya, S., Ramyadevi, K., Ramya, M., Rashmi, P.G., 2018. Smart water quality
monitoring system for real-time applications. Int. J. Pure Appl. Math.118, 1363– 1369. [6] Sokratis
Kartakis, Weiren Yu, Reza Akhavan, and Julie A. McCann, 2016 IEEE First International Conference on
Internet-of-Things Design and Implementation, 978-1-4673-9948-7/16 © 2016IEEE [7] Jayti Bhatt,
Jignesh Patoliya, Iot Based Water Quality Monitoring System, IRFIC, 21feb,2016. [8] 8. Godavarthi B,
Nalajala P & Ganapuram V, “Design and implementation of vehicle navigation system in urban