Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
270 views

Water Quality Monitoring System Using IoT and Machine Learning

This document proposes a low-cost water quality monitoring system using IoT, machine learning, and cloud computing. The system uses sensors to measure water quality indicators like turbidity, pH, and temperature. It then transmits this sensor data to the cloud for storage, analysis, and visualization. The system can also control water temperature using heaters and coolers based on external weather conditions predicted using machine learning.

Uploaded by

BVJ
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views

Water Quality Monitoring System Using IoT and Machine Learning

This document proposes a low-cost water quality monitoring system using IoT, machine learning, and cloud computing. The system uses sensors to measure water quality indicators like turbidity, pH, and temperature. It then transmits this sensor data to the cloud for storage, analysis, and visualization. The system can also control water temperature using heaters and coolers based on external weather conditions predicted using machine learning.

Uploaded by

BVJ
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Water Quality Monitoring System using IoT and

Machine Learning
Nikhil Kumar Koditala Dr.Purnendu Shekar Pandey
Computer Science and Engineering Computer Science and Engineering
BML Munjal University BML Munjal University
Gurugram, India Gurugram, India
nikhil.koditala.15cse@bml.edu.in purnendu.pandey@bml.edu.in

Abstract—World Economic Forum ranked drinking water services. PowerBI which is also a Microsoft platform is used
crisis as one of the global risk, due to which around 200 to display the sensor values in the form of Web page. This
children are dying per day. Drinking unsafe water alone causes paper also uses MQTT client broker architecture to transmit
around 3.4 million deaths per year. Despite the advancements in
technology, sufficient quality measures are not present to measure data from micro controller to external MQTT broker service.
the quality of drinking water. By focusing on the above issue, Turbidity measures the large number of suspended particles
this paper proposes a low cost water quality monitoring system in water that is invisible. Higher the turbidity higher the
using emerging technologies such as IoT, Machine Learning and risk of diarrhea, cholera. Lower the turbidity then the water
Cloud Computing which can replace traditional way of quality is clean. besides turbidity, pH is also an important measure
monitoring. This helps in saving people of rural areas from
various dangerous diseases such as fluorosis, bone deformities etc. which measures the acidic level of drinking water. Temperature
The proposed model also has a capacity to control temperature sensor measures how the water is, hot or cold.
of water and adjusts it so as to suit environment temperature. Other part of this paper is to sense the external temperature
Based on our model we have achieved R-squared score of 0.933. near the water storage and control heater or cooler respectively
depending on temperature. This part of paper uses machine
Index Terms—Water quality monitoring, Internet of Things,
Machine learning, Cloud Computing, MQTT, Rural Development
learning, where the system predicts the weather conditions
using previous labeled dataset and controls heater and cooler
according to external weather conditions. This makes the sys-
tem completely automated without any manual interventions.
I. I NTRODUCTION
Whenever the value of turbidity reaches predefined threshold
Nowadays, Due to limited water resources and increasing an email alert will be sent to concerned authorities informing
population water has become a vital resource for mankind. the situation, forcing them to take immediate action.
Clean and safe drinking water is the most important resource
for mankind. As most of the diseases these days spread II. L ITERATURE R EVIEW
through water there is a need for online real time water quality Pradeepkumar M, Monisha J, Pravenisha R, Praiselin V,
monitoring system. The methods used for water quality assess- Suganya Devi K entitled ”The Real Time Monitoring of Water
ment at present involve collection of random samples of water Quality in IoT Environment”. This paper discusses not only
at various locations weekly or monthly and analyzing them in sensor based system but also it introduces cloud computing
the laboratories. This approach is not much efficient because architecture into IoT which makes the sensor data accessible
they have various drawbacks such as long time consump- worldwide.
tion, only water samples from few areas can be determined Atif A, Wasai Shadab, Mohammad Hassan, Shamim, Alelaiwi
simultaneously. This method also involves manual work to and Anwar Hossain entitled ”A Survey on Sensor-Cloud: Ar-
monitor the quality of water regularly. Theses methods are also chitecture, Applications, and Approaches” discusses about the
costly and are not capable enough in large populated countries sensor-cloud infrastructure, approaches, and different layers of
like India, China. In order to overcome these drawbacks we transferring generated data by connecting sensors with cloud
need a real time system which monitors water quality through services.
sensors such as pH, turbidity and temperature and updates Nikhil Kedia entitled ”Water Quality Monitoring for Rural
those values in Cloud service. This system consists of sensors Areas-A Sensor Cloud Based Economical Project” This paper
which measure the chemical composition of water. These not only highlights embedded sensor systems, but also dis-
sensor values are then passed to NodeMCU micro controller cusses the challenges and economic viability of the system
which has inbuilt WiFi module, using which the data is passed involving Mobile Network Operator and Government. This
over to Azure Event Hub. From Event Hub data is stored in system directly contacts Government to take action based on
Azure Storage hub in the form of structured data. the severity of quality issue.
Thereafter using Stream hub data is streamed to external R.Karthik Kumar, M.Chandra Mohan, S.Vengateshapandiyan,

978-1-5386-2599-6/18/$31.00 ©2018 IEEE


M.Mathan Kumar, R.Eswaran entitled âSolar based advanced • Layer 1: Layer 1 consists of all the sensors such as
water quality monitoring system using wireless sensor net- Turbidity sensor, Temperature sensor and actuators such
workâ uses solar node to power the wireless sensor network as heater or cooler LEDs.
and displays results using GUI created through Matlab.
Jayti bhatt, Jignesh patoliya entitled ”IoT based water quality • Layer 2: To ensure reliable communication between
monitoring system”. This paper shows the design of wa- devices and cloud we choose WiFi as connecting
ter quality monitoring system using pH, turbidity, dissolved technology such that there is reliable delivery of
oxygen and temperature sensor. It uses raspberry Pi as core messages across the network.
controller and used Zigbee protocol to transmit data remotely.
Fiona Regan, Antoin Lawlor and Audrey McCarthy, ”Smart • Layer 3: Azure Event hub only accepts the data which
Coast Projectâ Smart Water Quality Monitoring System”, is in structured format. So, Before sending the data to
designed smart water quality monitoring system. In that system cloud, it is formatted to a JSON packet and then sent to
they made water quality smart sensors so the sensors send data Azure Event Hub.
wireless to the device which collects data from all the nodes.
This system is highly scalable, faster and user friendly, but it • Layer 4: For data accumulation we are using Azure
is costly because of type of sensors used. storage hub to store the data on cloud servers which
Vaishnavi V. Daigavane, Dr. M.A Gaikwad entitled ”Wa- ensures reliability and cost effective. Several instances
ter Quality Monitoring System Based on IOT”. This paper of data is also made which ensures backup ability in
measures Turbidity, pH and also flow of water using flow case of physical damage of main server.
sensor. This paper shows the most economical and convenient
method of water monitoring system by using the existing GSM • Layer 5: Data from Storage hub is transmitted to Azure
network to transmit sensor values. stream analytic which makes data accessible to other
ZulhaniRasin and Mohd Rizal Abdullah, ”Water Quality Mon- devices outside azure who have access to data.
itoring System Using Zigbee Based Wireless Sensor Network”.
This paper uses ZigBee based wireless sensor network to • Layer 6: For analysis and reporting we are using
develop water quality monitoring system. This paper also PowerBI which is a Microsoft tool for data analysis and
shows the usage of c++ to create a GUI to make the data visualization part of data.
publicly accessible.
• Layer 7: We built a web application where user can
III. I OT A RCHITECTURE
enter his credentials and login into web page, where he
This section presents the IoT architecture based on which can access all the visual charts which depict the quality
the system is built. Fig. 1 explains the layer wise architecture of water. Besides web page to demonstrate working of
of our model according to reference model of IoT world Forum MQTT we used an MQTT broker to transmit the data
[2] from layer 1 at bottom to layer 7 at top. from client which is our gateway to broker which is
cloudMQTT.

IV. P ROPOSED M ODEL


This section explains the algorithms used in our system for
adjusting temperature and e-mail sending algorithm.

A. Adjusting Temperature
Algorithm. 1 demonstrates the temperature control module
of the system. External temperature is calculated from ge-
tExternal() function, which is explained in detail at machine
learning section. We also calculate the temperature of water
using DS18B20 waterproof temperature sensor. If the external
temperature is hot i.e. greater than 25 ◦C and water tempera-
ture is hot( >15 ◦C) then cooler gets turned ON and heater gets
turned OFF. Similarly in cold climates the second if statement
controls the temperature.

B. Sending Email
Algorithm. 2 explains the email module of the system. Tur-
Fig. 1. IoT Architecture bidity is calculated from getTurbidity() function and whenever
the turbidity is greater than 4.0, the system sends the email to
Result: Water temperature adjusted according to TABLE I
Environment M ONTHLY AVERAGE OF N EW D ELHI , I NDIA
External temperature = getExternal();
Year Month New Delhi
Temperature = getTemperature(); 1931 1 15.4
if Externaltemperature > 25 then 1931 2 15.2
if temperature > 15 then 1931 3 21.2
1931 4 29.7
heater = OFF; 1931 5 33.1
cooler = ON;
end
end module, we designate the vector as coef and as intercept.
if Externaltemperature < 10 then
if temperature < 15 then y(w, x) = w0 x0 + w1 x1 + ....wn xn
heater = ON;
cooler = OFF;
end According to our dataset, sklearn linear regression module
end predicted coef as [-0.00056244 , 0.19589288] and intercept as
Algorithm 1: Algorithm for adjusting temperature 24.80431407431011. So, our equation to predict temperature
is as follows:
y(year, month) = 24.80431407431011 + year(-0.00056244) +
concerned authorities. At the same time it also keeps a check month(0.19589288)
on count so that the authorities are not flooded with emails
continuously. VI. E XPERIMENT A ND S IMULATION S ETUP
As this paper involves various technologies such as IoT,
Result: Sending email to authorities machine learning and cloud computing it requires a large
turbidity = getTurbidity(); hardware and software pipe lining. This section explains the
count = Threshold limit; hardware and software setup of the model.
if turbidity > 4.0 then
if count > 0 then A. Block Diagram
sendEmail(); Fig 2 explains the complete structure of the project in
count = count - 1; the form of a block diagram. The block diagram consists
end of temperature sensor, turbidity sensor, external temperature
polluted = true; sensor, NodeMCU microcontroller, power supply, Azure cloud
end platform and a webapp built through powerBI. Azure cloud
Algorithm 2: Algorithm for sending Email to authorities platform has 3 sub blocks, Event hub, Storage unit and Stream
hub. The event hub acts as a first line of interface between the
sensors and azure cloud. Event hub then transfers the data to
V. M ACHINE L EARNING storage unit of azure. Then we use stream hub to export the
Providing temperature controlled water is also important data to powerBI.
besides quality, in areas near the equator due to extreme B. Hardware and Software Components
climatic conditions. This model uses machine learning to
predict temperature of environment near the water storage Different hardware and software components used in this
system. paper are listed below:

A. Data Source 1) NodeMCU: NodeMCU is a microcontroller with inbuilt


wifi module present. This makes it suitable for IoT models
The dataset [8] contains monthly temperature records across involving less number of sensors or actuators. it runs on
all major cities all over the world from Jan 1701 to May 2011. 3.3v. It has 17 GPIO pins and 1 analog pin. It supports
The dataset is scrapped from DataMarket. Table I shows the 802.11 b/g/n. It is also economical when compared to other
top 5 rows of the dataset. The first coloumn refers to year, microcontrollers.
second refers to month and the third refers to Temperature at
the specific city. 2) Turbidity Sensor: Turbidity is the quantitative measure
of suspended particles in a fluid. When the value of
B. Algorithm turbidity is less than 3.5 NTU then water is said to have
In multi variable linear regression the target value is dissolved solids in it. If it is greater than 3.5 NTU then
expected to be a linear combination of the input variables. water is safe to drink. It consumes operating current of 40mA.
In mathematical notation, if is the predicted value.Across the
Fig. 2. Block Diagram

3) LM35: To sense the external temperature we used


LM35 module. It has temperature range of -55 to 150 degrees
centigrade with an accuracy of 0.5 degree centigrade. It
operates from 3V to 30V voltage range.

4) DS18B20: Water Temperature indicates how water is


hot or cold. To measure temperature we are using waterproof
DS18B20 temperature sensor which has are range from -55 to
+125 degrees. This temperature sensor is digital type which
gives accurate reading.

5) Microsoft Azure: Azure is a cloud platform created by


Microsoft for deploying and testing applications. Azure has
an IoT portal which helps to transfer sensor values from
gateway to websites or database in the form of JSON packets.
Fig. 3. Hardware Components
6) PowerBI: Power BI is a business analytics service
provided by Microsoft. It provides interactive visualizations data loss and also the efficiency of transmission is increased.
where end users can create reports and dashboards. We used Whenever the quality of water is below threshold an email
powerBI for visualization and analytic part of our project. will be sent alerting concerned authorities.
Fig 3 shows the complete hardware setup of the project,
VII. R ESULTS AND A NALYSIS
which includes NodeMCU, turbidity sensor, DS18B20 and
In this project, the implemented several sensors that are LM35 temperature sensors connected through breadboard.
used to determine the contamination of water and the results Fig 4 shows the log in screen of the web portal. It consists of
were produced. We used low cost sensors and hence the a text box for user name and for password. On entering correct
implementation cost for this system is minimal. Moreover, combination, authorized users can enter into the system.
efficient algorithms are also being used here to co-ordinate Fig 5 shows the web page visualization of sensor data.
the information collected by the sensors and hence there is no Microsoft powerBI service is used to display the data in the
IX. C ONCLUSION
This paper presented a practical and economical solution
to monitor the quality of water especially in rural areas
without any human intervention. To solve this problem this
paper presented various contemporary technologies such as
IoT, cloud computing and Machine learning. On combining
these technologies we are able to solve one of the basic and
emerging problem of human survival to certain extent.
X. F UTURE W ORK
• On integrating this system with state and central govern-
ment work flow, we can enable fast response rate from
government officers thus improving the quality of life in
rural as well as urban areas.
• Since most of the villages in India doesn’t have WiFi
Fig. 4. Login portal of Website
access we can add a Mobile GPRS module to our system
enabling it to transmit data over 3G or 4G channels.
• Adding more quality sensors which can detect other
chemical and physical parameters effecting the quality
of water can improve our results and thus making our
system effective.
R EFERENCES
[1] Pradeepkumar M, Monisha J. ”The Real Time Monitoring of Water
Quality in IoT Environment” 2016 International Journal of Innovative
Research in Science, Engineering and Technology, 2015 ISSN(Online)
: 2319-8753
[2] Atif Alamri, Wasai Shadab Ansari, Mohammad Mehedi Hassan, M.
Shamim Hossain, Abdulhameed Alelaiwi, and M.Anwar Hossain, ”A
Survey on Sensor-Cloud: Architecture, Applications, and Approaches”,
International Journal of Distributed Sensor Networks, Volume 2013
[3] Kedia, Nikhil. ”Water Quality Monitoring for Rural Areas- a Sen-
sor Cloud Based Economical Project” 2015 1st International Con-
ference on Next Generation Computing Technologies (NGCT), 2015,
doi:10.1109/ngct.2015.7375081.
[4] Vijayakumar, N, and R Ramya. ”The Real Time Monitoring of Wa-
ter Quality in IoT Environment” 2015 International Conference on
Fig. 5. Visualization of Sensor Data Circuits, Power and Computing Technologies [ICCPCT-2015], 2015,
doi:10.1109/iccpct.2015.7159459.
[5] R.Karthik Kumar, M.Chandra Mohan, S.Vengateshapandiyan, M.Mathan
Kumar, R.Eswaran. ”Solar based advanced water quality monitoring
form of graphs and charts. The displayed data will update auto- system using wireless sensor network” 2014, International Journal of
Science, Engineering and Technology Research, 2014
matically 5 times every day providing an updated information [6] Fiona Regan, Antoin, McCarthy. ”Smart Coast Projectâ Smart Water
to users. Quality Monitoring Systemâ 2006, Marine Institute/Environmental Pro-
tection Agency Partnership, 2006
VIII. C OMPARISON WITH EXISTING RESEARCH [7] Vaishnavi V. Daigavane, Dr. M.A Gaikwad. ”Water Quality Monitoring
System Based on IOT” 2017 Advances in Wireless and Mobile Com-
munications, Nov 2017 ISSN 0973-6972
All the previous work on water monitoring system has [8] ”Resources.” Resources — Internet of Things World Forum,
focused solely on measuring the quality of water using sensors www.iotwf.com/resources/72
such as pH and turbidity. Some of them have included cloud [9] ”Average Monthly Temperatures across the World.” DataMar-
ket, datamarket.com/data/set/1loo/average-monthly-temperatures-across-
based module into their system for online view of sensor data. the-world!ds=1loo!1n6s=1nq.3jsdisplay=line.
This paper also focuses on usability besides water quality
monitoring. For usability we are controlling water temperature
so as the users get water suitable to the climatic conditions.
This is done by predicting external temperature using machine
learning algorithms. All the previous models in this field have
used heavy computing devices such as Arduino UNO and
Raspberry Pie, whereas this paper uses NodeMCU which is
light weight and also cost effective. This paper also includes
Email alerts and Real time access to data visualization for
authorized users.

You might also like