Water Quality Monitoring Using Iot With Raspberry Pi
Water Quality Monitoring Using Iot With Raspberry Pi
MukeshKumar.B 410822106308
TRAINER
AHAMAD THOWFEEK.B
CHENNAI
CONTENTS
1 Introduction 1
2 Existing System 4
3.1 IoT
3.4 PH Sensor 22
References 41
ABSTRACT
In order to ensure the safe supply of the drinking water the quality needs to be monitor
in real time. In this paper we present a design and development of a low-cost system for
real time monitoring of the water quality in IOT (internet of things).
Currently drinking water is very prized for all the humans. In recent times water
levels are very low and water in the lakes are going down. So its too important to find
the solution for water monitoring & control system. IoT is a solution. In recent days,
development in computing and electronics technologies have triggered Internet of
Things technology. Internet of Things can be describe as the network of electronics
devices communicating among them by the help of a controller.
The IoT is a collection of devices that work together in order to serve human tasks in a
efficient manner. It combine computational power to send data about the environments.
These devices can be in form of sensors, appliances, embedded systems, and data
analysis microchips. This paper present a low cost water monitoring system, which is a
solution for the water wastage and water quality. Microcontrollers and sensors are used
for that system. Ultrasonic Sensor is used to measuring water level. The other
parameters like pH, TDS, and Turbidity of the water can be calculated using different
corresponding sensors. This system use the flow sensor which can measure the water
flow and if the necessary quantity of water flow through the pipe then water flow can be
stopped automatically.
The calculated values from the sensors can be processed by the Microcontrollers and
uploaded to the internet through the Wi-Fi module (ESP 8266). Analysis we can do by
this process, how much water is used in certain time, in a day or in a month. Alerts
messages and data generated by the sensors are transmitted over the Internet to a
cloud server and can be received by user terminal owned by consumers. The data
which is obtained from the sensors can be shown on the internet and provides facilities
for screening the data on mobile phones or web application.
1
Conventional Methods
Existing system:
Problem statement:
Water tank monitoring systems are only provided for PC environment. Manual
operations.
cost.
Low efficiency.
Complex installations.
Proposed system:
In this project, the water quality analysis in real time is implemented using the micro
controller. Which consist of Nodemcu. There are various sensors are connected in
Nodemcu to analyze the water quality, and assurance of purity. The following sensors
like DHT11 sensor, pH sensor, level sensors are used to analyse the water quality in
various stages. A very important measurement in many liquids chemical processes
(industrial, pharmaceutical, manufacturing, food production, etc.) is that of pH: the
measurement of hydrogen ion concentration in a liquid solution. The pH sensor is used
to find the liquid is the neutral form of acid and caustic (alkaline) approximately the water
will be in the scale of 7 the common pH scale extends from 0 (strong acid) to 14 (strong
caustic), with 7 in the middle representing pure water (neutral). And level sensor is used
measure the water content in the tank.
2
Advantages:
maintenance.
Block diagram:
Hardware required:
Nodemcu
PH level Level
sensor
Temperature sensor
3
Arduino Device:
Arduino devices are the microcontrollers and microcontroller kit for building digital
devices that can be sense and control objects in the physical and digital world. Arduino
boards are furnished with a set of digital and analog input/output pins that may be
interfaced to various other circuits. Some Arduino boards include USB (Universal Serial
Bus) used for loading programs from the personal computer.
4
Intel Galileo:
The Intel Galileo Gen 2 Board includes the parts such as Intel Quark SoC processor,
256MB RAM, multiple ports and supports for Arduino device.
A Samsung Gear Fir device is a dustproof, water-resistant with fitness tracker features,
a curved display, and long-lasting battery. This device receives alerts about emails and
text messages, and it integrates with Samsung's S Health app.
5
Sensor:
A sensor is a device that reads the surrounding temperature, humidity, light, air quality
control etc. There are different types of sensors available that reads different types of
data. The sensors transmit these data over the networks or through which it is
connected.
A Bluetooth low energy beacon device is used to track the object located at a real time.
Many companies use it to track the location of employees, assets, patients, and more in
real time. This service primarily focuses on manufacturing, retail, and healthcare
services.
Send and receive data: IoT devices are able to send and receive the data over the
network connection.
6
Analyze: The devices can able to analyze the data that received from the other device
over the internet networks.
Controlled: IoT devices may control from some endpoint also. Otherwise, the IoT devices
are themselves communicate with each other endlessly leads to the system failure.
There are several IoT boards available in the market to build the project. Some of the
major IoT Boards are described below:
Raspberry Pi:
Raspberry Pi is a much popular device used in building IoT project. The recently
launched Raspberry Pi 3 includes built-in Wi-Fi and Bluetooth making the most compact
and standalone computer. It provides a powerful environment to install a variety of
programming packages such as Python, Node.js, LAMP stack, Java and much more.
Using 40 GPIO pins, and four USB ports you can connect many peripherals and
accessories to the Pi.
7
Arduino:
Arduino boards are the microcontrollers and microcontroller kit for building digital
devices that can be sense and control objects in the physical and digital world. Arduino
boards are furnished with a set of digital and analog input/output pins that may be the
interfaced to various other circuits. Some Arduino boards include USB (Universal Serial
Bus) to load programs from the personal computer.
ESP8266:
Raspberry Pi Sense HAT sensors. The Sense HAT has an 8×8 RGB LED matrix includes the
following sensors:
8
● Gyroscope
● Accelerometer
● Magnetometer
● Temperature
● Barometric pressure
● Humidity
Bluetooth Module HC-05 device is a 6 pins Bluetooth device that is used for wireless
communication. Usually, this device connects small devices like mobile phones, PDAs
and TVs using a short-range wireless connection to exchange data. It communicates
with the microcontroller using the serial port (USART).
Pin Description:
EN: It is the enable pin, when it is connected to 3.3V then model is enabled.
STATE: It indicates whether the module is connected or not. It acts as a status indicator.
9
IoT – Platform:
As in IoT, all the IoT devices are connected to other IoT devices and application to
transmit and receive information using protocols. There is a gap between the IoT device
and IoT application. An IoT Platform fills the gap between the devices (sensors) and
application (network). Thus, we can say that an IoT platform is an integrated service that
fulfills the gap between the IoT device and application and offers you to bring physical object
online.
There are several IoT Platforms available that provides facility to deploy IoT application
actively. Some of them are listed below:
Amazon Web Services (AWS) IoT platform: Amazon Web Service IoT platform offers a set
of services that connect to several devices and maintain the security as well. This
platform collects data from connected devices and performs real-time actions.
10
that support bi-directional communication between connected devices and platform.
Azure IoT platform has an Azure Stream Analytics that processes a large amount of
information in real-time generated by sensors. Some common features provided by this
platform are:
Information monitoring A
rules engine
Device shadowing
Identity registry
Google Cloud Platform IoT: Google Cloud Platform is a global cloud platform that provides
a solution for IoT devices and applications. It handles a large amount of data using
Cloud IoT Core by connecting various devices. It allows to apply BigQuery analysis or to
apply Machine learning on this data. Some of the features provided by Google Cloud
IoT Platform are:
up IoT devices
IBM Watson IoT platform: The IBM Watson IoT platform enables the developer to deploy
the application and building IoT solutions quickly. This platform provides the following
services:
Communication
Artik Cloud IoT platform: Artik cloud IoT platform is developed by Samsung to enable
devices to connect to cloud services. It has a set of services that continuously connect
11
connected devices and combines this information. This platform contains a set of
connectors that connect to third-party services.
Bosch cloud IoT Suit is based on Germany. It offers safe and reliable storing of data on
its server in Germany. This platform supports full app development from prototype to
application development.
IoT platform handles different software communication protocol and hardware. IoT
It collects, visualizes, and analyzes the data gathered by the sensor and device.
NODE MCU
As Arduino.cc began developing new MCU boards based on non-AVR processors like
the ARM/SAM MCU and used in the Arduino Due, they needed to modify the Arduino
IDE so that it would be relatively easy to change the IDE to support alternate toolchains
to allow Arduino C/C++ to be compiled for these new processors. The Arduino IDE to
compile an Arduino C/C++ source file for the target MCU's machine language. Some
ESP8266 enthusiasts developed an Arduino core for the ESP8266 WiFi SoC, popularly
called the "ESP8266 Core for the Arduino IDE". This has become a leading software
development platform for the various ESP8266-based modules and development
boards, including NodeMCU’s.
Introduction:
NodeMCU is an open-source LUA based firmware developed for ESP8266 Wi-Fi chip.
By exploring functionality with ESP8266 chip, NodeMCU firmware comes with
12
ESP8266 Development board/kit i.e., NodeMCU Development board.
NodeMCU Dev Kit has Arduino like Analog (i.e., A0) and Digital (D0-D8) pins on its
board.
Using such serial protocols, we can connect it with serial devices like I2C enabled LCD
display, Magnetometer HMC5883, MPU-6050 Gyro meter + Accelerometer, RTC chips,
GPS modules, touch screen displays, SD cards etc.
We need to code in C\C++ programming language if we are using Arduino IDE for
developing NodeMCU applications and Lua language if we are using ESPlorer IDE.
Basically, NodeMCU is Lua Interpreter, so it can understand Lua script easily. When we
write Lua scripts for NodeMCU and send/upload it to NodeMCU, then they will get
executes sequentially. It will not build binary firmware file of code for NodeMCU to write.
13
In Arduino IDE when we write and compile code, ESP8266 toolchain in background
creates binary firmware file of code we wrote. And when we upload it to NodeMCU then
it will flash all NodeMCU firmware with newly generated binary firmware code. In fact, it
writes the complete firmware.
That’s the reason why NodeMCU not accept further Lua scripts/code after it is getting
flashed by Arduino IDE. After getting flashed by Arduino sketch/code it will be no more
Lua interpreter and we got error if we try to upload Lua scripts. To again start with Lua
script, we need to flash it with NodeMCU firmware.
Since Arduino IDE compile and upload/writes complete firmware, it takes more time
than ESPlorer IDE.
PH SENSOR:
A pH meter is essentially a voltmeter with a high input impedance which measures the
voltage of an electrode sensitive to the hydrogen ion concentration, relative to another
electrode which exhibits a constant voltage. The key feature of the pH-sensitive
electrode is a thin glass membrane whose outside surface contacts the solution to be
tested. The inside surface of the glass membrane is exposed to a constant
concentration of hydrogen ions (0.1 M HCl).
14
Solution depends on the chloride ion concentration, but, since this is constant (0.1 M),
the electrode potential is also constant.
FEATURES DESCRIPTION
● 0.5°C Ensured Accuracy (at +25°C) LM35 has an advantage over linear
temperature
15
Summary and Conclusion
Summary
The basic idea about is to measure the water quality in low cost however a normal
people can afford. Water measurement plays a key role in day-to-day life. The low-cost
water monitoring system, which is a solution for the water wastage and water quality.
Conclusion
Finally, we have designed in such a way that the drinking Water quality can be
measured with the help of ESP 8266 microcontroller (NODE MCU). we were able to
analyse the quality of the water in an accurate manner by using the system. In addition
to that it is budget friendly.
16
17