Real-Time and not economical. The water quality measuring system

Real-Time Water Quality Monitoring System using Internet of ThingsMourvika Shirode,Monika Adaling,Jyoti Biradar and                            Trupti Mate       Department of Electronics & Telecommunication                Keystone School of Engineering                Email:[email protected],                            [email protected] conventional method of testing water quality is to gather samples of water manually and send to the lab to test and analyze. This method is time consuming, wastage of man power, and not economical. The water quality measuring system that we have implemented checks the quality of water in real time through various sensors (one for each parameter: pH, conductivity, temperature, turbidity) to measure the quality of water. As a variation in the value of this parameter points towards the presence of pollutants. The Wi-fi module in the system transfers data collected by the sensors to the microcontroller, and transfers the data to the smart phone/PC. This system can keep a strict check on the pollution of the water resources and be able to provide an environment for safe drinking water.Keywords:-Waterquality,PH,Conductivity,Temperature,Turbidity,IOT,Wi-fi(ESP8266).1.                INTRODUCTIONWater is one of the most essential natural resource that has been gifted to the mankind. But the rapid development of the society and numerous human activities speeded up the contamination and deteriorated the water resources. For above water quality monitoring is necessary to identify any changes in water quality parameters from time-to-time to make sure its safety in real time. The Central Pollution Control Board (CPCB) has established a series of monitoring stations on water bodies across the country which monitor the water quality on either monthly or yearly basis. This is done to ensure that the water quality is being maintained or restored at desired level. It is important that it is monitored on regular basis. Water quality monitoring helps in evaluating the nature and extent of pollution control required, and effectiveness of pollution control measures. CPCB has plans to establish water quality monitoring network across Ganga river basin. All the stations will operate in real time and central station can access data from any of the above stations using GPRS/GSM or 3G cellular services. State pollution boards and CPCB zonal offices can also access data from central station. Large amount of data can help to take right decisions and also to implement in time accordingly 1,2. Cost of the system depends on number of parameters to be measured. Water quality monitoring systems need to quickly identify any changes in the quality of water and report the same to the officials for immediate action. The system is designed for continuous onsite sensing and real time reporting of water quality data where the officials can access the data on the smart phone/PC through Internet. Our proposed system employs use of multiple sensors to measure the parameters, measures the quality of water in real-time for effective action, and is economical, accurate, and required less manpower. In this paper section 2 discusses about literature survey on water quality monitoring while section 3 discusses on Internet of Things. Section 4 discusses implementation of water quality monitoring system, and results obtained through the system are discussed in section 5. Section 6 concludes the paper. LITERATURE SURVEY The available water resources are getting depleted and water quality is deteriorated due to the rapid increase in population and need to meet demands of human beings for agriculture, industrial, and personal use. The quality of ground water is also affected by pesticides and insecticides. The rivers in India are getting polluted due to industrial waste and discharge of untreated sewage.  In order to eliminate problems associated with manual water quality monitoring, CPCB has planned to go hi-tech and plans to establish ‘Real Time Water Quality Monitoring (WQM) Network’ across Ganga Basin. Stephen Brosnan, 2007 3 investigated a wireless sensor network (WSN) to collect real time water quality parameters (WQP). Quio Tie-Zhn, 2010 4 developed online water quality monitoring system based on GPRS/GSM. The information was sent by means of GPRS network, which helped to check remotely the WQP. Kamal Alameh, 20115 presented web based WSN for monitoring water pollution using ZigBee and WiMAX networks. The system measured various WQP. It collected, processed measured data from sensors, and directed through ZigBee gateway to the web server by means of WiMAX network to monitor quality of water from large distances. System was capable of monitoring water pollution in real time. Dong He, 2012 6 developed WQM system based on WSN 7. The remote sensor was based on ZigBee network. WSN tested WQP and sent data to Internet using GPRS. With the help of Web, information was gathered at remote server. Kulkarni Amruta, 2013 8 created solar powered WQM utilizing remote sensor network. The Base station (BS) gathered information from distant remote sensors. The BS associated with ZigBee module was powered by sunlight baseboard (Energy harvesting). INTERNET OF THINGS Internet of Things (IoT) is defined as the network of physical objects/things – devices, vehicles, buildings embedded with sensor, micro-controller, and network connectivity that enables these objects to collect and exchange data. The IoT can be described as a huge web of embedded objects designed with built-in wireless technologies such that they can be monitored, controlled and linked within the existing Internet infrastructure. Each device has a unique identification and must be able to capture real-time data autonomously.  Basic building blocks of IoT consist of sensors, processors, gateways, and applications. It is estimated that by 2020, 50 billion ‘things’ will be connected to the Internet 9. Wireless technologies such as the Wi-Fi, Bluetooth, ZigBee, RFID, 6LoWPAN (IPv6 Low power Wireless Personal Area Network) allow the devices to be connected to the Internet and to each other. The cloud services collect, store, and analyze the data collected by the sensors and allow people to take a decision accordingly.  Mobile data management applications are being increased because of the rapid spread of mobile phones. Smart phones now has become platform both for computing and communication. Mobile phones are becoming cheaper, easier to use, and can be used for multiple types of information transmission. The mobile data applications along with sensor technology can improve the efficiency as well as accuracy of the data reporting for water quality monitoring system. Smart phones/tablets having sensors embedded with display and keypad can be connected to the Internet with an IP address (satisfies every requirement of an IoT device). They will serve as the hub/remote control for IoT. In Ubiquitous Network Architecture smart things are part of the Internet; authorized users have access to information; servers act as a sink to collect data from each object. A. ThingSpeak ThingSpeak is an IoT applications open source (OS) which can store and retrieve data from sensors or things using Local Area Network (LAN) or HTTP over Internet. One can create applications like sensor logging, location tracking, and social network of things with status updates with the help of ThingSpeak 10. API of ThingSpeak permits processing of numeric data like averaging, median, summing, rounding and time scaling. ThingSpeak channel supports 8 data fields, elevation, latitude, longitude, and status. ThingSpeak can send sensors data to cloud to store data in a channel using sensors and websites. Cloud provides easy access to the stored data. ThingSpeak channel data now can be analyzed, visualized, can calculate new data, or interact with web sites and social media. With this one can calculate new data, and visualize data in the form of plots, charts, and gauges using analytical tools online. ThingSpeak can access MATLAB to provide sensor data. It uses tools for devices to communicate for actions. One can react both to raw data and new data in a channel and also can help devices to execute by queuing the commands. IV.        IMPLEMENTATION This system makes use of three sensors (pH, conductivity, turbidity, temperature), processing module microcontroller, The four sensors capture the data in the form of analog signals. The ADC converts these signals into the digital format. These digital signals are sent to the microcontroller via a Wifi module. The microcontroller will process the digital information, analyze it, and further communication is done by the Wifi module, which sends an Information with the water quality parameters onto the smart phone/PC, which also displayed on the LCD of the micro controller. Fig. 1 shows the water quality monitoring system. Microcontroller accepts and processes the data collected from the sensors to the Web page via Wi-Fi module. This is carried out with the help of coding. The code is written in Embedded-C and using the Arduino software to simulate the code. System DesignFig, 1. Water Quality Monitoring System  The water quality monitoring system shown in Fig. 2 employs sensors to collect the data (parameters: pH, temperature, Electric Conductivity (EC). This data is processed through the LPC2148 microcontroller module and transferred via the ESP8266 Wi-Fi data communication module to the central server. This data can be accessed by the authorized users by logging into their accounts using a User ID and password to view data. The data is collected, processed, analyzed, and transmitted and displayed all in real time. The Arduino Uno microcontroller is based on real time emulation and embedded trace support. It supports embedded high speed flash memory. Due to its low power consumption and small size, it is good to use where size is a key requirement for access control and point-of-sale applications. It is suitable for gateways and protocol converters in communication, soft modem, voice recognition, low resolution imaging, and provides high processing power and large buffer size 11. The ESP8266 is a low cost Wi-Fi module consists of  Wi-Fi chip with full TCP/IP stack and micro controller chip manufactured by M/S Espruino 12. Above module is a WLAN network, which hosts the applications or offload WiFi network functions from other application processor. During hosting the applications it boots up directly from external flash. Performance of the system is improved and memory requirement is also minimized because of its integrated cache. Wireless Internet access can be introduced to any microcontroller based design using CPU AHB bridge interface or UART interface when Wi-Fi module works as Wi-Fi adapter. ESP8266 uses serial transceiver (Tx/Rx) to send and receive data in Ethernet buffers, and serial commands to query and change configurations of the Wi-Fi module. It only requires two wires (Tx/Rx) to communicate between a microcontroller and Wi-Fi module. It offloads Wi-Fi-related tasks to the module, allowing the microcontroller code to be very light-weighted. Wi-Fi Module is addressable over SPI and UART, making it easy to build an Internet of Things application. We use AT commands to connect to Wi-Fi networks and open TCP connections without need to have TCP/IP stack running in our own microcontroller. By just directing connecting the microcontroller to this module, we can start pushing data up to the Internet (Central server). A. Sensors A sensor is a transducer device to detect events or changes in its environment, and then provide a corresponding electrical output. The most important characteristics of a sensor are precision, resolution, linearity, and speed. Sensor calibration improves the sensor performance. The performance can be enhanced by removing structural errors in the sensor outputs. Structural errors can be find out by taking difference between sensor’s measured output and its expected output. Above repeatable errors calculated during calibration are compensated in real time during measurements carried out by sensors.  1) pH Sensor pH is a measure of how acidic or basic alkaline the water? It is defined as the negative log of the hydrogen ion concentration. The pH scale is logarithmic and goes from 0 to 14. The pH term translates the values of the hydrogen ion concentration. It is low for acidic and high for alkaline solutions. A natural source of water pH is around 7. For each increase in number of pH, the hydrogen ion concentration decreases ten-fold and water becomes less acidic. A pH sensor has measuring electrode and a reference electrode. A battery positive terminal connected to the measuring electrode and negative terminal to the reference electrode. The reference electrode provides fixed potential and when pH sensor immersed in the solution, the reference electrode does not change with changing hydrogen ion concentration. The measuring electrode sensitive to hydrogen ion develops a potential directly related to the hydrogen ion concentration of the solution. The differential voltage of electrodes changes with the temperature, so a temperature sensor is also necessary to correct the change in voltage. 2) Electric Conductivity Sensor Salts dissolve in water breaks into positive and negative ions. Dissolved ions are the conductors and conductivity is the ability of water to conduct an electrical current. The major positively charged ions are sodium, calcium, potassium, and magnesium and the major negatively charged ions are chloride, sulfate, carbonate, and bicarbonate. Nitrates and phosphates are minor charged ions to the conductivity. Electric conductivity is measured with the help of a probe and a meter. The probe consists of two metal electrodes spaced 1 cm apart (unit: mili- or micro-Siemens per cm). A constant voltage is applied across electrodes. The current flow through the water is proportional to the concentration of dissolved ions in the water, which measures the electrical conductivity. The dissolved salts concentration is directly proportional to electrical conductivity. Total dissolved solid (TDS) determines the quantity of minerals and salts reside within the water. TDS in water is determined by multiplying the conductivity by a factor of 0.67. B. Working with ThingSpeak Getting started  x     Sign-up to create a new account in ThingSpeak  x     Create a new channel to store the data from sensors  x     ThingSpeak has a ‘status update field’ to send any additional information required on the page  x     Give the field names: pH, Temp, conductivity, TDS  x     If you check ‘public’, other people can access your data  x     Click on ‘Save channel’ x     An API key is created. An application programming interface (API) key is a code passed in by computer programs calling an API to identify the calling program (its developer, or its user to the Web site.)  Sending data to ThingSpeak channel  x     Chrome Poster- a developer tool that allows us to interact with the http server  x     Copy the URL provided in Poster  x     Enter ‘key=APIkey&pH=3.5’ in the ‘Content body’. This will put the data (3.5) into the pH field  x     Click on ‘Post’ x     If everything is successful, ThingSpeak API status will be ‘200 OK’. x     We can keep adding any number of values. The status window shows the number of values.  x     Select ‘View Charts’ to create a chart out of the data sent to ThingSpeak channel.  x     Through ‘Embed code’ given at the bottom of the window, we can give other people access to the channel.  x     Data importing from the sensors, and then exporting the data onto the channel, all takes place in real-time basis.  RESULTS Authorized users can access data by logging on ThingSpeak website as shown in Fig. 3. On entering the registered user ID and password, it goes to the web page where the parameters are displayed in real-time in the form of plots.  Fig. 3. Data Logging on ThingSpeak To demonstrate the quality of water, the pH sensor and EC sensor is put into a container filled with tap water, to which 34 drops of acid is added. From the graphs in Fig. 4 shown below, we can see that the pH of the water remains at around 3 to 4.5 means the water is acidic in nature. The temperature of the surrounding stays between 32 to 34 degrees. The conductivity of water is at 7 to 9 microSiemens/centimeter. Total Dissolved Solids are 0.67*electrical conductivity which can be measured from the graph. CONCLUSIONS The low cost, efficient, real-time water quality monitoring system has been implemented and tested. Through this system, the officials can keep track of the levels of pollutions occurring in the water bodies and send immediate warnings to the public. This can help in preventing diseases caused due to polluted water and presence of metals. Quick actions can be taken to curb extreme levels of pollution like in the case of the Ganga and Yamuna rivers. The system can be easily installed, with the base station kept close to the target area, and the task of monitoring can be done by less-trained individuals. Performance modeling in different environment is important to study in future because different kind of monitoring application requires different arrangement during system installation.  Internet of Things (IoT) and its services are becoming part of our everyday life, ways of working, and business. There is a great deal of research on developing crucial building blocks and models for the next generation Internet services supported by a plethora of connected things. With the help of efficient and intelligent use of mobile network, IoT has revolutionized the world. It is changing the future of technology and how objects behave around us? It won’t be long when we can access any information and command objects at the touch of fingertips. ACKNOWLEDGEMENT The authors are thankful to Prof. Dinkar Prasad, Head, EE Dept., and Associate Director, School of Engg., Shiv Nadar University, G. Noida (UP), India for providing necessary resources and infrastructure to conduct this project work and for his encouragement, and permission to publish this paper. REFERENCES R.M. Bhardwaj, “Overview of Ganga River Pollution”, Report: Central Pollution Control Board, Delhi, 2011 Nivit Yadav, “CPCB Real time Water Quality Monitoring”, Report: Center for Science and Environment, 2012 Tuan Le Dinh, Wen Hu, Pavan Sikka, Peter Corke, L. Overs, Stephen Brosman, “Design and Deployment of a Remote Robust Sensor Network: Experiences from Outdoor Water”, 32nd IEEE Conf. on Local Computers, pp 799-806, Feb., 2007 Quio Tie-Zhn, Song Le, “The Design of Multi-parameter On line Monitoring System of Water Quality based on GPRS”, Report:        Advanced Transducers and intelligent Control System Lab, Taiyuan Technical University, Taiyuan, China, 2010 Steven Silva, Hoang N Ghia Nguyen, Valentina, Tiporlini, Kamal Alameh, “Web based Water Quality Monitoring with Sensor Network: Employing ZigBee and WiMAX Technology”, 36th IEEE Conf. on Local Computer Networks, 2011 Donge He, Li-Xin Zhang, “The Water Quality Monitoring System based on Wireless Sensor Network” Report: Mechanical and Electronic Information Institute, China University of Geo- Science, Wu Hen, China, 2012 Pavlos     Papageorgiou,     “Literature     Survey     on     Wireless     Sensor Networks”, Report: University of Maryland, 16 July 2003 Satish Turken, Amruta Kulkarni, “Solar Powered Water Quality Monitoring System using Wireless Sensor Network”, IEEE Conf. on Automation, Computing, communication, control, and compressed sensing, pp281-285, 2013 Liang Hu, Feng Wang, Jin Zhou and Kuo Zhao “A Survey from the Perspective of Evolutionary Process in the Internet of Things”, International Journal of Distributed Sensor Networks, Article ID 462752, 2015 ThingSpeak-Understanding your Things-The open IoT Platform with MATLAB analytics, MathWorks. User Manual Arm7-LPC2148 Development kit – Pantech Solutions. ESP8266 serial Wi-Fi     wireless Transceiver Module for IoT, ESPRUINO-Wireless.