0% found this document useful (0 votes)
16 views20 pages

Water Quality Monitoring Using Iot With Raspberry Pi

The document presents a low-cost IoT-based drinking water quality monitoring system using Raspberry Pi and NodeMCU, which measures various parameters such as pH, temperature, and water flow. The system processes sensor data and uploads it to the cloud for real-time monitoring, addressing issues of water wastage and quality assurance. The proposed solution aims to provide an efficient and user-friendly method for monitoring drinking water quality.

Uploaded by

Mukesh Mugi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views20 pages

Water Quality Monitoring Using Iot With Raspberry Pi

The document presents a low-cost IoT-based drinking water quality monitoring system using Raspberry Pi and NodeMCU, which measures various parameters such as pH, temperature, and water flow. The system processes sensor data and uploads it to the cloud for real-time monitoring, addressing issues of water wastage and quality assurance. The proposed solution aims to provide an efficient and user-friendly method for monitoring drinking water quality.

Uploaded by

Mukesh Mugi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Drinking Water Quality Monitoring

System Using Raspberry Pi And Iot

Department of Electronics and Communication


Engineering
Submitted by

NAME REGISTER NUMBER

MukeshKumar.B 410822106308

TRAINER

AHAMAD THOWFEEK.B

GKM COLLEGE OF ENGINEERING AND TECHNOLOGY

CHENNAI
CONTENTS

Chapter No Title Page No

1 Introduction 1

1.1 Literature Survey 2

2 Existing System 4

2.1 Proposed System 4

2.2 Block Diagram 5

3 Hardware & Software 7

3.1 IoT

3.2 (EMBEDDED SYSTEMS) IOT 10

3.3 Node MCU 20

3.4 PH Sensor 22

3.5 Temperature Sensor 23

3.6 Gas/Smoke Sensor 24

3.7 Relay & DC Motor 27

3.8 Arduino IDE

3.9 Arduino Software

4 Results & Code 39

5 Summary & Conclusion 40

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).

The system consist of several sensors is used to measuring physical and


chemical parameters of the water. The parameters such as PH, and prototype setup for
temperature of the water can be measured. The measured values from the sensors can
be processed by the controller. The NodeMCU model can be used as a core controller
and the NodeMCU is act as a server to send data to cloud. Finally, the sensor data can
be viewed on internet using cloud.
1.1 Introduction:

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:

Water is typically referred to as polluted when it is impaired by anthropogenic


contaminants and either does not support a human use, such as drinking water, or
undergoes a marked shift in its ability to support its constituent biotic communities, such
as fish.

Problem statement:

Water tank monitoring systems are only provided for PC environment. Manual

operations.

We need a pc to monitor the water level. High

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:

Easy installation. Low

maintenance.

Compact elegant design.

Block diagram:

Hardware required:

Nodemcu

PH level Level

sensor

Temperature sensor

Smoke sensor Relay

Monitoring unit Motor

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.

Samsung Gear Fit:

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.

Bluetooth Low Energy (BLE) Intelligent Beacon:

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.

Major IoT Boards in Market

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:

The ESP8266 is a low-cost Wi-Fi microchip with 32-bit microcontroller capability,


standard digital peripheral interfaces. There are different types of ESP8266 boards are
available for different needs. The primary goal of this board is to deal with the built-in
Wi-Fi through AT commands if used as device module, but you can 'program' using
Arduino board however it also read and controls input/output, digital and analog.

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:

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.

+5V: This is the supply pin for connecting +5V.

GND: It is the ground pin.

TX: It is the transmitter pin of the UART communication.

RX: It is the receiver pin of UART communication.

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:

Cloud IoT Core Speed

up IoT devices

Cloud publisher-subscriber Cloud

Machine Learning Engine

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:

Real-time data exchange

Device management Secure

Communication

Data sensor and weather data services

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 IoT Suite:

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.

How IoT platform help:

IoT Platform connects sensors and devices.

IoT platform handles different software communication protocol and hardware. IoT

platform provides security and authentication for sensors and users.

It collects, visualizes, and analyzes the data gathered by the sensor and device.

NODE MCU

ESP8266 Arduino Core:

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 Development Board/kit v1.0

NodeMCU Dev Kit has Arduino like Analog (i.e., A0) and Digital (D0-D8) pins on its
board.

It supports serial communication protocols i.e., UART, SPI, I2C etc.

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.

Difference in using ESPlorer and Arduino IDE

Well, there is a programming language difference we can say while developing


application for NodeMCU using ESPlorer IDE and Arduino IDE.

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.

The meter must be calibrated by using standards of known pH before an unknown is


measured. Since the unknowns are acidic, the pH 4.00 and pH 7.00 standards should
be used. An accurate pH reading depends on standardization, the degree of static
charge, and the temperature of the solution.

TEMPERATURE SENSOR (LM35)

FEATURES DESCRIPTION

● Calibrated Directly in ° Celsius (Centigrade)

● Linear + 10 mV/°C Scale Factor

● 0.5°C Ensured Accuracy (at +25°C) LM35 has an advantage over linear
temperature

● Rated for Full −55°C to +150°C Range

● Suitable for Remote Applications

● Low Cost Due to Wafer-Level Trimming

● Less than 60-μA Current Drain

● Low Self-Heating, 0.08°C in Still Air

● Nonlinearity Only ±¼°C Typical

● Low Impedance Output, 0.1 Ω for 1 mA Load

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

You might also like