Implementation of Internet of Things for Water Quality Monitoring

To make sure the safe supply of the drinking water the quality of the water needs to be monitored. As the monitoring of the water parameter is a complex process as it has been going through several laboratory testing processes and though it is time-consuming. The system for monitoring the water quality in the Internet of Things (IoT) consists of a number of sensors which are used for measuring the parameters of the water; these parameters are temperature, pH, turbidity


INTRODUCTION
This At the present time, drinking water is the most precious and valuable for all the human beings, thus the quality of the water needs to be checked continuously; as drinking water utilities face new challenges in real-time operations. This challenges occurred because of limited water resources, growing population, aging infrastructure, global warming, etc. Any imbalance in the water quality would seriously make an impact on the health of human beings.
As we know that the traditional methods for monitoring quality of water involves the manual collection of water sample at various places and followed by laboratory analytical techniques in order to check the quality of water. Such an approach takes a long time and it has been no longer to be considered an efficient way The main objective of the proposed system is to monitor the water quality in real-time. As in the proposed system, Arduino Pro mini is used as a core controller along with a several water quality parameter measuring sensors for measuring the parameters of water. The Arduino pro mini is the main processor of the system which controls and process the data generated by the sensors. The parameter measuring sensors involves the temperature sensor, turbidity sensor, pH sensor, and co2 sensors. These four parameter shows the quality of water, whether it is polluted or not. For viewing the parameter of water in real-time The system have Wi-Fi module ESP8266 for sending sensors parameter value to thinger.io from Arduino mini pro. From this, anyone can log in with given user id and password for viewing the values of the water parameters on a personal computer or mobile.
And also Arduino is connected in parallel with LCD16×2 screens for checking the parameter values.

LITERATURE REVIEW
In the literature, monitoring the water quality are available such as: Monitoring the water quality by the manual collection of water sample at various places and followed by laboratory analytical techniques in order to check the quality of water. Such an approach takes a long time and it has been no longer to be considered an efficient way.
Thus there is a need for continuous monitoring of water quality.
With increasing in the development of Wireless Sensor Network technology parameters of water are remotely monitored by means of real-time data acquisition, transmission, and processing.
[ Akanksha and Ulhaskumar, 2015] The water quality measuring system makes use of multiple sensors, information acquisition module, and data transmission module. Information acquisition module includes microcontroller 8051. Data transmission module includes a GSM module. There are numerous sensors that measure temperature, turbidity, pH, conductivity and total dissolved solids present in the water. This technique conjointly uses ADC. The measured values are then transmitted to the watching center via GSM; it's conjointly shown on LCD by the microcontroller. [Akila et al.,2015] proposed the water quality monitoring system in which pH and Temperature sensors will be kept in the river in this output of all the sensors are in analog and it is to convert into digital value; all the sensed value from the sensor will be given to the Arduino board. The output from sensors is fed to Arduino microcontroller. The microcontroller reads the data and then displays on LCD. After converting, the values are compared to the threshold values. If inference value is above a threshold value, the automated warning SMS alert will be sent to the Pollution Control Board via GSM. [Cho et al., 2017] presents the design of a WSN based reconfigurable smart sensor interface device for water quality monitoring (WQM) system in an IoT environment. The system consists of Field Programmable Gate Array (FPGA) design board, sensors, ZigBee based wireless communication module and personal computer (PC). The FPGA board performs as the heart of the proposed WQM system and it is programmed in very high speed integrated circuit hardware description language (VHDL) and C++ using Qsys tool and Nios-II SBT for Eclipse in Quartus II software.
[Kamalidin and Ismail, 2017] The paper suggests an Internet of Things (IoT) based system implementation by embedding the Radio Frequency Identification (RFID) system, Wireless Sensor Network (WSN) platform and Internet Protocol (IP) based communication into a single platform for water quality monitoring (WQM) purpose. The suggested radio frequency for the proposed WSN communication to be deployed in vegetation area is 920MHz. The measured water parameter in this proposed system is pH level by using an analog pH sensor. The ambient temperature is captured during pH measurement by using an analog temperature sensor. All the WSN nodes are deployed in a real environment at the lake in the campus area of Universiti Sains Malaysia (USM) for performance evaluation. Instead of using 2.4GHz ZigBee protocol, the 920MHz Digi Mesh protocol is proposed to be implemented for water quality monitoring in vegetation area due to its ability to surpass the signal attenuation. This novel proposed system prototype was evaluated in a real environment to ensure that the main functionality on pH measuring process is following the design requirements. Several experimental analysis was conducted including the energy analysis and communication read range analysis to study the overall performance of the proposed system. [Vijaykumar and Ramya, 2015] designed a real-time water quality monitoring system in the IoT environment. The system consists of multiple sensors to monitor water parameters and Raspberry PI B+ model is used as the main controller. The raspberry pi is run on LINUX kernel by using the keyboard and monitors the LINUX OS is a boot on to the Raspberry Pi. The temperature sensor, conductivity sensor, turbidity sensor, dissolved oxygen sensor, Ph sensor can be read directly from the command line. However, this requires to input a command every time to know the sensors reading. For accessing all the terminals of the sensors, a python program is used. The sensor data can be viewed on the cloud using a unique IP address. Additionally, the IOT module also provides Wi-Fi for viewing the data on mobile.

SYSTEM DESIGN
The system is implemented in the IoT environment where the microcontroller Arduino Mini Pro is used as a microcontroller, in the system sensors are used to measure the parameters of water and are connected to the Arduino microcontroller, the result of the sensors is shown on the LCD2×16 which is connected to the Arduino. The parameter from Arduino sends to the cloud server named thinger.io by using the wi-fi module ESP8266. The end user can log in to thinger.io from anywhere and see the real-time parameter of water on their personal computer or mobile phone.
The basic block diagram of monitoring the water quality parameter is as shown in the below figure which has a pH sensor, turbidity sensor, temperature sensor, and CO2 sensor along with Arduino Mini Pro microcontroller, wi-fi module ESP8266, and the end user which is either mobile or computer.

Arduino Pro Mini
The Arduino pro mini is also known as the UNO strong. The microcontroller uses ATmega328 datasheet. The Some visible improvement on hardware make more flexible and easier to use. SPI, COM and IIC bus breakout make bus connect easier. The UNO strong 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 crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.

Figure 2: Arduino Pro Mini
It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or with external power supply or battery to get started. And operating at 3.3V or 5V, Arduino has Flash Memory 32KB of which 2 KB used by boot loader, it also has SRAM of 2 KB and EEPROM is 1 KB. The Clock Speed is 16 MHz (5V versions) The Arduino Pro can be programmed with the Arduino software. The ATmega328 on the Arduino Pro comes preburned with a boot loader that allows you to upload new code to it without the use of an external hardware programmer.

Power Supply circuit
The power supply circuit converts 230 VAC to 5 V DC. It uses bridge circuit and 1C 7805 voltage regulator.230VAC from the step-down transformer is first to step down into 12V AC which is further converted into 5V DC.

Sensors pH Sensor
The pH sensor is used to check the pH range of the water. The pH range varies from 0 to 14. The value range from 0 to 6 then the water is acidic, the value range from 7 is for neutral and above 7 is basic in nature.

Figure 3: pH Sensor
In the most basic sense, a pH probe is a very simple single cell battery with a very high resistance, where the voltage produced is proportional to the hydrogen ion concentration around the probe and therefore proportional to the Log of the hydrogen ion concentration as expressed here: pH = − log10(ah) All this really means is when the concentration is greater on either side of the probe, the ion flow will induce a slight voltage between the probe's electrodes, this voltage can swing both +/-which will indicate either an acid or base.

Turbidity Sensor
Turbidity refers to the haziness of a fluid caused by the increased number of very tiny particles which, individually, is invisible to us. Moreover, turbidity measurement is important in testing the quality of water.

Figure 4: Turbidity sensor
Temperature Sensor Thermistors are simple, inexpensive, and accurate components that make it easy to get temperature data. Thermistors are variable resistors that change their resistance with temperature. They are classified by the way their resistance responds to temperature changes.

Figure 5: Temperature Sensor
Since the thermistor is a variable resistor, we'll need to measure the resistance before we can calculate the temperature. However, the Arduino can't measure resistance directly, it can only measure voltage.

CO2 Sensor
CO2 is colorless, odorless gas and non-combustible gas. MQ135 sensor is used for detecting a wide range of gases, including NH3, alcohol, benzene, smoke, and CO2 on the surface of the water. The gas sensor module consists of a steel exoskeleton under which a sensing element is housed. This sensing element is subjected to the current through connecting leads. This current is known as the heating current through it, the gases coming close to the sensing element get ionized and are absorbed by the sensing element. This changes the resistance of the sensing element which alters the value of the current going out of it.

Wi-Fi Module
The ESP8266 WiFi Module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your Wi-Fi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. Each ESP8266 module comes preprogrammed with an AT command set firmware. The ESP8266 module is an extremely cost-effective board with a huge, and ever-growing, community.

Figure 7: ESP8266 Wi-Fi module
The ESP8266 is a 3.3V device so you must use 3.3V to power it. Use a 3.3V power supply with at least 500 mA of current. There is also an 'ESP8266 wifi library and Arduino IDE' addition you can add that includes libraries for using the ESP8266 which you can use to directly program instead of just sending commands with a prompt.

Server (Thinger.io)
Thinger.io is an open source platform for the Internet of Things, it provides a ready to use scalable cloud infrastructure for connecting things. For showing the sensors data to the end user on there mobile or on the personal computer there is a requirement of the server which can shows these values in real-time. For that, we use the thinger.io platform The system is using Wi-Fi module ESP8266 to send the sensor data to the IoT platform thinger.io. All the sensors are connected with the Wi-Fi module. Wi-Fi module needs the internet. So Mobile data or Wi-Fi is the access point for the internet. And after all this data sends to the cloud. There are various aspects of Thinger.io platform in terms of hardware integration, cloud console, server API, and server deployment. The first step to start building thinger.io devices is to install the required libraries in the Arduino IDE to support exposing device resources like sensor values, lights, relays, and so on. The thinger.io platform is designed to support almost any microcontroller or device with communication capabilities. Almost any device can be integrated into the cloud.

End User
The end user can be a mobile phone or personal computers. Anyone who wanted to know the parameters of water they can use the provided user id and password to login into open source IoT platform thinger.io.

IMPLEMENTATION
Before Water Quality monitoring system uses Arduino Mini Pro microcontroller, four sensors pH, Turbidity, temperature, and CO2; ESP8266 WiFi module, LCD16×2 and thinger.io platform. The result is shown on LCD16×2 and thinger.io platform at the same time. For seeing the result on personal computer or mobile we have to login into the thinger.io platform, The prototype of the water quality monitoring system is as shown in the figure.

Figure 8: Prototype of Implementation of Internet of things for water quality monitoring
All the sensor are connected to the Arduino turbidity sensor one terminal is connected to the analog pin A0 of Arduino mini pro and one terminal is connected to 5v supply and one terminal is connected to GND. Temperature sensor one terminal is connected to analog pin A1 of Arduino and another terminal goes to GND. The pH sensor is connected A2 of the microcontroller. And the co2 sensor one terminal is connected analog pin A3 of Arduino one goes to VCC and another to GND. The external power supply is given to the Arduino for starting it; we use the step-down transformer to convert 230v Ac to 12v DC; rectifier converts that 12v Ac power into 5v DC power.
The schematic circuit is represented as: To monitor the water quality in real time firstly turn on your Hotspot which is required to connect the sensors to the Wi-Fi module ESP8266 and then give the power supply to Arduino board to start it. Then deep the sensor into the water to check the parameters and observe the LCD screen which shows the varying parameter of the water. At the same the sensed data will be automatically sent to the open source IoT platform when a proper connection is established with server device; for watching the result on remote location where the end user is situated he or she must log in into the thinger.io with a provided user id and password on their personal computer or mobile and monitor the parameter of water.

RESULT
Implementing the system is not only valuable work; it becomes successful only when the appropriate results are obtained. For that, we conduct the practical test on this project to evaluate the real-time performance and parameter values and better result of the wireless system. For that, we successfully design and implement the hardware and gets the result from the hardware. We show the result on hardware and through open source IoT platform on a personal computer. So the experiment is carried out, For that, we need to connect that temperature sensor, turbidity sensor, pH sensor and Co2 sensor to Arduino pro mini. We also need to connect the ESP8266 to Arduino pro mini so that the Arduino pro mini can send the parameter values to ESP8266. For carrying out the actual task of monitoring the quality of water we need to give power supply to the Arduino pro mini, as we give the external power supply of 230V AC to microcontroller Arduino pro mini which required only 5V DC power supply so that to convert that 230V AC to 5V DC we uses the power supply circuit which includes the PCB board, transformer, voltage regulator, capacitor, diode, and rectifier. After that the microcontroller Arduino pro mini start its working and send the sensed parameter values to ESP8266 and from here the parameter values are sent to the server, for that Wi-Fi module ESP8266 required internet to send the data to the cloud server thinger.io which is open source IoT platform, and the mobile phones or personal computer is connected to server by using internet and they can log in to thinger.io by using the user id and the password and view the real-time parameters of water from remote location. Also, the result will be shown hardware which is connected to the Arduino pro mini that is LCD16×2.
Here we take a water sample of drinking water and add very small amount of mud mud in it, and the system will give the real-time values of parameters of water. In the displaying of the result, we use the text/ value formate for showing the result. One result is display progress bar formate. We can also display the result in different formats on the thinger.io.
For obtaining the real-time values of a parameter of water we can take the different water for checking the performance of the system.

Screenshot 1: parameter values on the thinger.io in text/ value formate
From the values of the parameters which are shown on the thinger.io we observe that water has temperature 24.38 degree Celsius, turbidity is 40 as we add some mud in it; turbidity sensor gives only the qualitative analysis of water and not the quantitative, pH of water is 8.92 and amount of CO2 is 18 ppm. From the result, we can say that as the pH of water is shows the alkaline nature of water.
As we connect the microcontroller to the LCD16×2 the result will also be shown on it. The result on the LCD16×2 is shown below, which shows the same result as we have seen on the thinger.io.

Figure 10: Parameter values on LCD16×2
So to check whether the sensors are working properly or not we can take some more result to ensure the sensors are working properly.
In another sample of water we take cold water which shows the water parameter values such as temperature is 13.41-degree Celsius, turbidity is 38, pH value is 8.93 and the amount of CO2 is 20 ppm.

Screenshot 2: parameter values on the thinger.io in text/ value formate
In the third sample of water we take normal water and the result is shown in the progress bar format as shown below for different water sample the parameter values are different. Here the temperature of the water is 25.32degree Celsius, turbidity is 29, pH of water is 8.33 and the amount of CO2 is 16ppm.

Screenshot 3: parameter values on the thinger.io in progress bar formate
From that we can say that, the system gives the accurate value of parameters of water. So we can say that the system works efficiently as compare to the tradititional method of water monitoring method as it takes longer time to produce the results and required more manpower as compare to the IoT approach of monitoring the water quality parameter values. System produces the result in less time with accuracy.

CONCLUSION
The Prototype presents the implementation of IoT for water quality monitoring. For these four sensors are used. The collected data from all the sensors are used for analysis purpose for better solution of water problems. With the use of microcontroller Arduino pro mini we can measure the values from sensor; and data is sent to cloud server thinger.io via Wi-Fi module ESP8266 and also shown on the LCD16×2 which is connected in parallel with the Arduino and the parameter values obtained shows the values of the real-time parameters of water which changes as the resource of water changes every time.