Nothing Special   »   [go: up one dir, main page]

Heliyon: Sathish Pasika, Sai Teja Gandla

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Heliyon 6 (2020) e04096

Contents lists available at ScienceDirect

Heliyon
journal homepage: www.cell.com/heliyon

Research article

Smart water quality monitoring system with cost-effective using IoT


Sathish Pasika *, Sai Teja Gandla
Department of Electronics and Communication Engineering Chaitanya Bharathi Institute of Technology, Hyderabad (TS), India

A R T I C L E I N F O A B S T R A C T

Keywords: Wireless communication developments are creating new sensor capabilities. The current developments in the field
Electrical engineering of sensor networks are critical for environmental applications. Internet of Things (IoT) allows connections among
Environmental science various devices with the ability to exchange and gather data. IoT also extends its capability to environmental
Systems engineering
issues in addition to automation industry by using industry 4.0. As water is one of the basic needs of human
Control systems
Wireless network
survival, it is required to incorporate some mechanism to monitor water quality time to time. Around 40% of
Communication system deaths are caused due to contaminated water in the world. Hence, there is a necessity to ensure supply of purified
Water treatment drinking water for the people both in cities and villages. Water Quality Monitoring (WQM) is a cost-effective and
WQM efficient system designed to monitor drinking water quality which makes use of Internet of Things (IoT) tech-
Temperature nology. In this paper, the proposed system consists of several sensors to measure various parameters such as pH
Wireless communication value, the turbidity in the water, level of water in the tank, temperature and humidity of the surrounding at-
Turbidity mosphere. And also, the Microcontroller Unit (MCU) interfaced with these sensors and further processing is
Humidity
performed at Personal Computer (PC). The obtained data is sent to the cloud by using IoT based ThinkSpeak
pH
application to monitor the quality of the water.
MCU.
IoT

1. Introduction of a microcontroller and basic sensors, is compact and is very useful for
pH, turbidity, water level detection, temperature and humidity of the
Freshwater is a world resource that is a gift of nature and important to atmosphere, continuous and real-time data sending via wireless tech-
farming, manufacturing, and the life of human beings on earth. nology to the monitoring station (Sugapriyaa et al., 2018) (Barabde &
Currently, drinking water facilities face new real-world problems (Shafi Danve., 2015).
et al., 2018) (Siregar et al., 2017). Due to the limited drinking water
resources, intensive money requirements, growing population, urban 2. Literature survey
change in rural areas, and the excessive use of sea resources for salt
extraction has significantly worsened the water quality available to Lambrou et al. (2014) discussed the development and implementa-
people (Chen & Han, 2018) (Meng et al., 2017). The high use of chem- tion of a portable, mobile, cost-efficient and reliable water level control
icals in manufacturing, construction and other industries, fertilizers in system. Here the authors used two transceivers of radio frequency (RF)
farms and also directly leaving the polluted water from industries into and a transmitter mounted on the tank and sump at the place where they
nearby water bodies have made a huge contribution to the global water wanted to check the quality of water. The RF transceivers used for
quality reduction, which has become an important problem (Cloete et al., wireless communication to the internet server. With the help of a mi-
2014). Even due to containment water various water born are increasing crocontroller, the system is fully programmed of the user unless the water
day by day, due to which many human beings are losing their lives. the bottle is drained or overflowed. The sensor array is used to measure
Traditionally, detection of water quality was manually performed various parameters such as dissolved Oxygen, Tumble, pH, Temperature,
where water samples were obtained and sent for examination to the etc. Sensor array. Costs of installation are reduced because of the wireless
laboratories which is time taking process, cost and human resources (Das system.
& Jain, 2017) (He & Zhang., 2012). Such techniques do not provide data Prasad et al. (2015) the smart Water Quality Monitoring (WQM)
in real-time. The proposed water quality monitoring system is consisting device for Fiji using IoT and remote sensing technologies is shown in this

* Corresponding author.
E-mail addresses: satish35ece@gmail.com, psathish_ece@cbit.ac.in (S. Pasika).

https://doi.org/10.1016/j.heliyon.2020.e04096
Received 27 May 2019; Received in revised form 21 September 2019; Accepted 26 May 2020
2405-8440/© 2020 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-
nc-nd/4.0/).
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

article. The Pacific Islands of Fiji require regular collection and analysis
of collected data for the water quality monitoring and uploading this data
into the server. In order to monitor water quality, the authors have used
IoT and remote sensing technologies. The current measurements can be
enhanced by remote sensing. During the entire test period, the system has
been proved worth by delivering accurate and consistent data using IoT
for water monitoring in real-time. The system proposed by these authors
also used a GSM module to forward the data to the mobile user via SMS.
Omar Faruq et al. (2017) A water quality monitoring system based on
microcontrollers for people living in Bangladesh's outskirts, where safe
drinking water is not available, is provided in this paper. The device has
been designed with a high degree of accuracy and is sensitive to several
water parameters such as temperature, turbidity and hydrogen potential.
(pH) displayed on the LCD monitor. Finally, in this paper, each of the
parameter values is compared with the predefined equipment, and sensor
values and error are calculated.

3. Measurement parameters of WQM system

Basically, there are many parameters that are needed to be measured


for water quality analysis. However, the WQM system proposed measures
the key water parameters:
Figure 2. Overall Algorithm for the proposed system.
➢ Water's pH value.
➢ Turbidity of the water.
password for accessing data on the ThingSpeak server by logging into
➢ Water level present in the tank.
their accounts. The information is gathered, stored, analyzed and trans-
➢ Temperature and humidity of the surrounding atmosphere.
mitted in real-time.
The ESP8266 is a low-cost Wi-Fi module consists of a full TCP/IP
4. Methodology of the proposed system stack Wi-Fi chip and microcontroller chip which is manufactured by M/S
Espino. The code boots from external flash directly during the processing
The proposed system uses four sensors which are pH, turbidity, ul-
trasonic, DHT-11, microcontroller unit as the main processing module
and one data transmission module ESP8266 Wi-Fi module (NodeMCU).
The microcontroller unit is a significant part of the system developed for
water quality measurement because The Arduino Mega consumes low
power, and it is a small size, where the size is a good use for a crucial
point-of-sale technology criterion. Among four sensors, two of the sen-
sors collect the data in the form of analog signals; the MCU has an on-chip
ADC that translates the sensor analog signals into the digital format for
further study. So, to get this analog output from the sensor, the sensor's
analog output of will be connected to the MCU's analog pins. Whereas the
other two sensors output directly connected to the digital pins of the
MCU units. All the sensors data processed by the MCU and updated to the
ThingSpeak server using the Wi-Fi data communication module ESP8266
(NodeMCU) to the central server (Daigavane & Gaikwad, 2017). The
block diagram of the system proposed for water quality measurement is
shown in Figure 1.
The whole system is designed in Embedded-C and simulating the
written code using Arduino IDE. In order to collect data on pH, turbidity,
level of water, temperature, and humidity of the surrounding atmo-
sphere, the water quality monitoring system employs sensors (Moparthi
et al., 2018). Authorized users can access these data using a user ID and

Figure 1. System block diagram. Figure 3. Algorithm for pH sensor data processing.

2
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 4. Turbidity sensor algorithm.

of the program, thereby increasing the system performance and the


storage requirements due to their optimized cache capacity. ESP8266
uses Tx and Rx serial transceiver pins for sending and receiving data, for
changing wireless module settings, for changing serial query commands.
Two pins (Tx/Rx) are required to communicate, but only attached,

Figure 6. pH output in ThingSpeak Server with field 1 voltage vs. Time and
field 2 pH vs. Time.

between a Wi-Fi module and a microcontroller but connected oppositely.


It is easy to set up an IoT application via Wi-Fi Module via SPI and UART.

4.1. Target boards

The target board is a device on which a microcontroller, ADC, DAC,


crystal oscillator, etc. are fabricated on it. The two target boards are
Arduino Mega and NodeMCU which are used in the proposed system.

4.1.1. Arduino Mega


The Arduino Mega is an ATmega2560-based microcontroller. There
are 54 input/output digital pins, 14 of which were used as PWM output.
In addition, it has 16 analog inputs, a USB connection, 4 USARTs, and a
clock generator crystal oscillator of 16 MHz. It is easy to connect or link it
with an AC/DC adapter or battery to a device with a USB cable (Siddula
et al., 2018).

4.1.2. NodeMCU
It's an IoT platform open-source. It consists of the Espressif System's
ESP8266 Wi-Fi Chip (SoC) on-chip and ESP-12 modulus-based hardware.
With Wi-Fi, analog pins, digital pins and serial communication Protocols,
the NodeMCU Development Board has been featured. The board is used
for wireless communication since this technology has evolved to such a
level that largenetworks of low-cost devices are used to track infra-
Figure 5. Hardware setup of WQM system. structure in real-time (Whittle et al., 2013).

3
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 7. pH values on the serial monitor.

Figure 9. Turbidity values on the serial monitor.

4.2. Sensors

The various sensors used in this work are explained in the following
section.

4.2.1. pH sensor
The pH of the ion of the hydrogen is the negative measure. The
calculation is an acidity balancing test or the alkaline content of the ions
of hydrogen in the water (Cloete et al., 2014). The source of pH natural
for water is about 7; pH ranges from 6.5 to 9.5 which can be considered
safe water for drinking (Bande & Nandedkar, 2016). The source of pH is
low (0) for acidic and high (14) for alkaline solutions. For each increase
in several ph values, the concentration of hydrogen ion decreases
ten-fold, and water becomes less acidic. A pH sensor has an electrode of

Figure 8. Turbidity output in ThingSpeak Server with field 3 voltage vs. Time Figure 10. Ultrasonic Sensor output in ThingSpeak Server with field 5 distance
and field 4 Turbidity vs. Time. vs. Time.

4
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 11. Water Level on the serial monitor.

Figure 13. Temperature and Humidity values on the serial monitor.


measurement and reference. The ion of hydrogen is sensitive to electrode
measurement that has a potential directly linked to the hydrogen solution
ion concentration. The electrical differential tension depends on the
4.2.2. Turbidity sensor
temperature so that the temperature sensor is also needed to correct the
Turbidity is the calculation of the water clearness, i.e. the number of
voltage shift (Zin Myint et al., 2017).
particles suspended in the water. It uses light to detect suspended par-
ticles to evaluate light transmit and dispersion rate. The calculation
measures the numbers of water particles floating in the water, for
example, plant waste, sand, silt and clay, impacting the sunlight in water
(Daigavane & Gaikwad, 2017). Excess turbidity can reduce marine life
reproduction and lead to various types of human illness (Srishaila Mal-
likarjuna Swamy & Mahalakshmi, 2017). The rate changes with the total
number of particles suspended in water. Total Suspended Solids (TSS)
increases in water with increasing turbidity. The sensor produces both
digital and analog mode output (Shafi et al., 2018). The input voltage of
the sensor is 5V with an analog output voltage ranging from 0 to 4.5V. It
can withstand a maximum temperature of 100 C–900 C. The NTU
(Nephelometric Turbidity Units) is its units. In essence, the sensor is
positioned to the side of the beam. When light reaches the sensor, if many
small particles are dispersed in the water, this small particle will be
detected by the source beam.

4.2.3. Ultrasonic sensor


The ultrasonic sensor provides a 2cm - 4m measurement range. The
sensor fabricated on a module that includes an ultrasonic transmitter
(Trigger pin), receiver (Eco pin) and a control circuit. It generates a high-
frequency sound wave of frequency 40 kHz, and it will be the valuation of
the echo received by the sensor measures the interval between signal
transmission from the pin trigger and receiving it back to the echo which
further determines the distance to an object (Zin Myint et al., 2017).

4.2.4. DHT-11 sensor


The DHT11 commonly used for the measurement of temperature and
humidity values of the surrounding atmosphere. The sensor comes with a
Negative Temperature Coefficient (NTC) for temperature measurement
and has an 8-bit microscope to output so that the temperature and hu-
midity values sent to the microcontroller are serial data. The sensor has
the same temperature and humidity value. It is also calibrated by the
factory so that it doesn't need to be calibrated again and thus easy to
Figure 12. DHT-11 output in ThingSpeak Server with field 6 temperature vs. interface. The sensor can calculate temperatures of between 0  C to 50  C
Time and field 7 Humidity vs. Time. and humidity levels between 20% and 90%, with an exactness of

5
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 14. ThingSpeak app installation.

between 1  C and 1% (Zin Myint et al., 2017). The sensor is used to calculated using Eq. (1). The DHT 11 Sensor reads the analog values of
determine the temperature of the atmosphere so that the pH and temperature and humidity. Later the same values are sent into the Thing
turbidity sensors are worked correctly over a long time. Temperature Speak server and the same values are updated in the Serial monitor.
measurement can also determine the kinds of marine organisms that can
survive in the water (Cloete et al., 2014). Distance ¼ (Duration) / 58.8 (1)

As shown in Figure 3, the algorithm for pH sensor data processing is


4.2.5. ThingSpeak server initialized with the required parameters. In the flow, the value of i will be
ThingSpeak is an IoT data collection application for analysis of assigned with zero initially and the analog values of 10 samples will be
various sensors, e.g. pH, turbidity, voltage, temperature, moisture, dis- considered. Later all the 10 samples will be calculated as a single average
tance, etc. The data collector collects data from edge node devices (this value. The pHVol and pHValue will be calculated. Later the same values
happens with the NodeMCU/ESP8266) and also allows the data to be are sent into the Thing Speak server and the same is shown on the Serial
modified for historical data analysis in a software environment. First, the monitor.
user must log in with details on his/her server. The channel containing As shown in Figure 4, the algorithm for turbidity sensor data pro-
data fields and a status field is the primary component of ThingSpeak cessing is initialized with the required parameters. In the flow, the value
activity. After a ThingSpeak channel has been developed, data is modi- of the parameter sensor Value is read with analog value. The voltage
fied, processed, and interpreted with MATLAB code, and the data is value (volt) should be converted into a digital value. If Volt <2.5 either of
reacted by tweets and other alerts (Das & Jain, 2017). NTU value will be considered. Later the same value is sent into the Thing
Speak server and the same is displayed on the Serial monitor.
5. Algorithm of the proposed system
6. Results and discussion
The proposed system's entire algorithm is shown in Figure 2. Initially,
the serial monitor of Arduino is initialized with 115200 baud rate. Later The experimental setup consists of an MCU with a sensor network that
the ESP Wi-Fi module and the Thing Speak Server is also initialized. The takes samples for every 10s from the water storage tank and the pa-
four sensors are being connected and the values are read into the sensors. rameters are displayed on the Arduino IDE serial display. For the real-
The algorithm flow of the ultrasonic and DHT 11 sensor flow is explained. time monitoring, a Wi-Fi module used which will be updating the
The Ultrasonic sensor reads the digital value directly so it is considered as ThingSpeak server forever 20s with different parameters. The water
the duration of time in seconds. With the help of the duration, distance is

6
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 15. ThingSpeak mobile app.

sample from Hyderabad Metropolitan water supply and sewerage board 6.2. Turbidity sensor results
and groundwater tested. The entire hardware setup of the WQM system is
shown in Figure 5. The turbidity values in NTU, as well as the voltage of water, are being
calculated and updated in the Server, as shown in Figure 8. It is observed
6.1. A. pH sensor results that the value of field 3 at time 21:08h is 4.0V and its corresponding
value of turbidity is 676 NTU as shown in field 4. As shown in Figure 8,
As shown in Figure 6, the two fields in the ThingSpeak Server are the server data is updated with the voltage of water and turbidity value of
updated with their corresponding values. The server is getting updated water in field 3 and field 4 respectively. According to Eq. (3), the
every 20 s. Infield 1 the voltage of water is being calculated from the Turbidity of water is inversely proportional to the voltage water.
sensor and being updated. Whereas in field 2 the pH value of water is
y ¼ -1120.4 x2 þ 5742.3x – 4352.9 (3)
being updated. According to the Nernst equation, as shown in Eq. (2), the
pH of water is directly proportional to the voltage water. In Eq. (3), y is the turbidity value and x is the voltage. The practical
E ¼ EO þ (RT/zF) pH (2) proof for the above Eq. (3) is verified by using field charts 3 and 4 the
relationship between turbidity of water and the voltage of water is
In Eq. (2), E is the cell potential in the conditions that prevail, Eo inversely proportional. The turbidity sensor output also monitored in the
is the cell potential in the standard temperature and pressure condi- serial monitor of Arduino IDE as shown in Figure 9.
tions, R is the universal gas constant, T is the temperature, z is the
number of electric moles that are transferred to the reaction, and F is 6.3. Ultrasonic sensor results
the constant Faraday. The voltage of water is linearly related to the
pH value of water by comparing the two graphs. is the practical proof The storage tank water level is measured in cm using the ultrasound
for Eq. (2). It is noticed that the voltage of water is 2.39V at 20:28h sensor and the water level is updated into the ThingSpeak Server as
and for that the corresponding pH value is 5.74pH. The output of the shown in Figure 10. The time at which 21:12h the water level is around
pH sensor also observed in the serial monitor of the Arduino IDE as 44cm in the tank. The water level of the tank is also monitored in the
shown in Figure 7. serial monitor of Arduino IDE as shown in Figure 11.

7
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Figure 16. Screenshot of all the parameters on the Serial Monitor.

6.4. Temperature and humidity sensor results with a time delay of 20 s because to upload into the server a minimum of
15 s delay is needed.
Finally, the surrounding environment temperature and humidity
calculated from the DHT-11 sensor module and updating it into the 7. Conclusion
ThingSpeak Server as shown in Figure 12. In field 6 the temperature
value updates whereas in field 7 the humidity value of the atmosphere is The system proposed in this paper is an efficient, inexpensive IoT
being updated respectively. Temperature measured in degree C, and solution for real-time water quality monitoring. The developed system
humidity measured in percentage. The temperature of the surrounding having Arduino Mega and NodeMCU target boards are interfaced with
calculated because the pH sensor and turbidity sensor will give accurate several sensors successfully. An efficient algorithm is developed in real-
value in a specific atmospheric condition. In Figure 12, consider the time, to track water quality. The measured pH value ranges from 6.5 to
temperature value at the time instance of 20:26h is 34.2 0C and from 7.5 for Hyderabad Metropolitan city supply water and 7 to 8.5 for
field 7 at the same instance of time is 33%. The temperature and moisture groundwater. The measured value of turbidity ranges from 600 to 2000
of the environment are also monitored in the serial monitor of Arduino NTU for both Hyderabad Metropolitan city supply water and ground-
IDE as shown in Figure 13. water. A web-based application i.e., ThingSpeak is used to monitor the
parameters such as pH value, the turbidity of the water, level of water in
the tank, temperature and humidity of the surrounding atmosphere
6.5. ThingSpeak mobile application
through the webserver. Further, these measured parameters also moni-
tored in ThingSpeak mobile application. Also, this work needs to be
The usage of the ThingSpeak mobile application for monitoring the
carried out to analyse several other parameters like electrical conduc-
water quality will be very useful for the water quality commission au-
tivity, free residual chlorine, nitrates, and dissolved oxygen in the water.
thorities. After installation, the authorized users can access this infor-
mation can be accessed using a user identification ID and password to
Declarations
view ThingSpeak data in their account. app as shown in Figure 14 and
add the channels that need to be monitored. As shown in Figure 15, after
Author contribution statement
installation of the channels which are to be monitored need to add in the
app with its channel ID. After adding the channel ID, all the graphs will be
G. Sai Teja & P. Sathish: Conceived and designed the experiments;
displayed in the application.
Performed the experiments; Analyzed and interpreted the data; Wrote
The serial monitor of the Arduino IDE with the respective parameter
the paper.
values is updated as shown in Figure 16 where all the WQM system pa-
rameters are updated which is further uploaded in the ThingSpeak server

8
S. Pasika, S.T. Gandla Heliyon 6 (2020) e04096

Funding statement Lambrou, Theofanis P., Anastasiou, Christos C., Panayiotou, Christos G.,
Polycarpou, Marios M., 2014. A low-cost sensor network for real-time monitoring and
contamination detection in drinking water distribution systems. IEEE Sensor. J. 8,
This research did not receive any specific grant from funding agencies 2765–2772.
in the public, commercial, or not-for-profit sectors. Meng, F., Fu, G., Butler, D., 2017. Cost-effective river water quality management using
integrated real-time control technology. Environ. Sci. Technol. 51, 9876–9886.
Moparthi, Nageswara Rao, Mukesh, Ch, Vidya Sagar, P., 2018. Water quality monitoring
Competing interest statement system using IoT. 4th International Conference on Advances in Electrical, Electronics,
Information, Communication, and Bio-Informatics.
The authors declare no conflict of interest. Omar Faruq, Md., Hoque Emu, Injamamul, Nazmul Haque1, Md., Dey, Maitry, Das, N.K.,
Dey, Mrinmoy, 2017. Design and implementation of a cost-effective water quality
evaluation system. In: IEEE Region 10 Humanitarian Technology Conference, Dhaka,
Additional information Bangladesh, pp. 860–863.
Prasad, A.N., Mamun, K.A., Islam, F.R., Haqva, H., 2015. Smart water quality monitoring
system. In: The University of the South Pacific. 2nd Asia-Pacific World congress on
No additional information is available for this paper. Computer Science and Engineering IEEE Conference.
Shafi, Uferah, Mumtaz, Rafia, Anwar, Hirra, Mustafa Qamar, Ali, Khurshid, Hamza, 2018.
References Surface Water Pollution Detection Using the Internet of Things. School of Electrical
Engineering and Computer Science, National University of Science and Technology,
IEEE Conference, pp. 92–96.
Bande, Priyanka N., Nandedkar, S.J., 2016. Low-Cost sensor network for real-time water
Siddula, Sai Sreekar, Babu, Phaneendra, Jain, P.C., 2018. Water level monitoring and
quality measurement system. Int. J. Innovat. Res. Sci. Eng. Technol. 5, 20691–20696.
management of dams using IoT. In: IEEE, EE Department Shiv Nadar University.
Barabde, M.N., Danve, S.R., 2015. Continuous water quality monitoring system for Water
Siregar, Baihaqi, Menen, Krisna, Efendi, Syahril, Andayani, Ulfi, 2017. Monitoring quality
resources at remote places. IJIRCEE 3, 2320–9798.
standard of waste water using wireless sensor network technology for smart
Chen, Yiheng, Han, Dawei, 2018. Water quality monitoring in the smart city: a pilot
environment. In: The International Conference on ICT for Smart Society (ICISS).
project. Automat. Construct. J. 89, 307–316.
Srishaila Mallikarjuna Swamy, P.M., Mahalakshmi, G., 2017. Real-Time Monitoring of
Cloete, Niel Andre, Malekian, Reza, Nair, Lakshmi, 2014. Design of smart sensors for real-
Water quality using the smart sensor. JETER J. 4, 139–144.
time water quality monitoring. Department of electrical, Electronic and Computer
Sugapriyaa, Tha, Rakshaya, S., Ramyadevi, K., Ramya, M., Rashmi, P.G., 2018. Smart
Engineering, University of Pretoria, Pretoria, South Africa. IEEE J. 13, 1–16.
water quality monitoring system for real-time applications. Int. J. Pure Appl. Math.
Daigavane, Vaishnavi V., Gaikwad, M.A., 2017. Water quality monitoring system based
118, 1363–1369.
on IoT. Adv. Wireless Mobile Commun.. ISSN 10, 1107–1116.
Whittle, A.J., Allen, M., Preis, A., Iqbal, M., 2013. Sensor Networks for Monitoring and
Das, Brinda, Jain, P.C., 2017. Real-time water quality monitoring system using the
Control of Water Distribution Systems. Coventry University, Coventry, UK. MIT
internet of things. Int. Conf. Comput. Commun. 78–82.
article.
He, Donge, Zhang, Li-Xin, 2012. The water quality monitoring system based on wireless
Zin Myint, Cho, Gopal, Lenin, Lin Aun, Yan, 2017. Reconfigurable smart water quality
sensor network. In: Report: Mechanical and Electronic Information Institute, China
monitoring system in an IoT environment. IEEE ICIS 435–440.
University of GeoScience, Wu Hen, China.

You might also like