Abstract
Assessment of drinking water quality has been an important issue nowadays as the water available is severely polluted and can be the cause of diseases like cholera, diarrhea, dysentery, etc. The traditional methods for water quality monitoring require a high-labor-cost and tine consumption as these methods include a sample collection followed by lab-based chemical testing. In addition, the chemicals used in the testing are toxic and of high-cost. So, there is a need for real-time monitoring and chemical-free testing of water quality parameters. This paper presents a real-time water quality monitoring system based on the Raspberry Pi 3 development board and a Python framework. The water quality parameters utilized for water quality monitoring are temperature, pH, oxidation reduction potential, electrical conductivity, and dissolved oxygen and E. coli. The water quality sensors were interfaced with the designed embedded platform. Finally, the acquired parameters were compared with the benchmark equipment for validation.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
Introduction
Water is an essential resource of living on the planet, whether it is for drinking purposes, industrial purpose, irrigation, or any other application. Globally, we utilize 70% of our water assets for agriculture and irrigation purpose and 10% for residential use [1]. It is consumed carelessly by the human being day by day. The rapid population growth has increased the consumption of water, but the resources (either natural or humanmade) are limited. The level of available water is regularly decreasing and may create a worse situation in the future. In developing countries, as much as 80% of sicknesses are connected to poor water quality and sanitation conditions [2]. India is one of the most water-challenged developing countries in the world. In India, 5% of death in an individual is due to diarrhea, which is among the top ten death causes in India. Death statistics in India are shown in Fig. 1. These are a few of the reasons behind drinking water quality assessment before consumption.
Earlier people were using traditional water quality monitoring techniques involving sample collection on-site and laboratory-based chemical experimentation. This conventional method was time-consuming as well as labor and cost-intensive [3]. So, there was a need to have chemical-free testing and on-site measurement, which could avoid the use of high-cost toxic chemicals. To overcome this, many researchers make efforts that result in real-time and online water quality monitoring.
In this paper, a Raspberry Pi-based real-time water quality parameter measurement is proposed in which different water quality sensors are interfaced with the developed hardware platform to acquire data from various water samples. The results obtained from the developed setup are compared with the benchmark equipment Exo-1 from Sonde [4] for performance validation. The water quality parameters used are pH, Electrical Conductivity (EC), Oxidation Reduction Potential (ORP), Dissolved Oxygen (DO) and temperature.
Related Work
There are numerous papers in the literature claiming the development of water quality monitoring systems. Some of the papers are discussed in this section. Real-time water quality monitoring in the IoT environment has been attempted by many researchers. Vijaykumar and Ramya [5] and Arvind et al. [6] proposed a water quality monitoring system for real-time assessment based on the IoT platform. Vijaykumar used the “ioBridge” as an IoT platform, whereas Arvind used the “ThingSpeak” IoT platform. Das and Jain [7] developed a system using Zigbee and a GSM module for water quality monitoring. The proposed work can also track if someone is polluting the water and intimate the authorities. Chowdury et al. [8] developed a sensor-based system for water quality assessment in wireless sensor networks (WSN). Chowdury also implemented the SMS alert for the agents. Geetha and Gouthami [9] proposed a multi-sensor system for water quality monitoring in the IoT environment using the “Ubidots” server platform. Geetha also discussed a detailed literature survey about the work done in the same field by the researchers. Priya et al. [10] implemented IoT based real-time monitoring for contamination detection. Meyer et al. [11] attempted real-time monitoring for river pollution detection. Gopavanitha et al. implemented real-time monitoring and controlling of water [12].
The application of the Raspberry Pi board has also been increased in recent years. It has been used in increasing efficient usage of real-time traffic transportation [13], design of wireless vision sensor network for smart home [14], communication network for Multi-unmanned aerial vehicle networks [15]. The Raspberry Pi has also been used in the implementation of 3D wavelet transform [16], screening of skin cancer [17], and air quality monitoring [18]. More applications of Raspberry Pi are real-time video surveillance systems [19], video stenography allocation [20], biometrics implementation [21], and automatic logging of telephone calls in the reading room [22]. It can be observed from the above-mentioned paper that the Raspberry Pi has been used in numerous applications.
Based on the discussed literature survey, it can be stated that there is a need for a system, which can assess the water quality parameters in a real-time environment. In addition, which can reduce the labor cost as well as time consumption and the chemical used in the testing should be minimized or removed. And the processor should be capable of acquisition, analysis, and decision-making. So, we are exploring the hardware platform based on Raspberry pi for the assessment of water quality parameters.
Organization of the Paper
The organization of the entire paper is as follows. First, the introduction and literature review are presented. Second, the materials and methods detailing the selection of water quality parameters and embedded board and hardware platform design are described. Third, the experimental results are presented, and finally, discussions are described, followed by a conclusion.
Materials and Methods
Water Quality Parameter Selection
The parameters used in this study are decided by Central Pollution and Control Board (CPCB), New Delhi, India, as shown in Table 1 [23]. There are different categories of water that CPCB has defined for various purposes. In this paper, Type ‘C’ water is used for water quality parameter measurement.
Methodology
In this section, we will discuss the block diagram of the proposed system, hardware setup, and software framework.
Block Diagram of the Proposed System
The block diagram of the overall proposed system is shown in Fig. 2. The different water quality sensors to be interfaced, are purchased from Atlas Scientific, USA [24]. The sensors are pH sensor, electrical conductivity (EC) sensor, dissolved oxygen (DO) sensor, oxidation reduction potential (ORP) sensor, and temperature sensor, as shown in Fig. 3. Raspberry Pi board is used as a core controller, and the sensors are interfaced with it through serial port expander followed by python framework. There is only one hardware I2C for serial communication, and hence to extend the port, a multiplexer (serial port expander) is used so that all the sensors can be communicated simultaneously.
Hardware and Software Framework Design
After the selection of the water quality sensors, there is a need to acquire the parameters from the water sample. A Raspberry Pi-based hardware platform is developed. Raspberry Pi is a single board credit card-sized micro-computer with ARM cortex A-53 processor with many onboard peripherals such as USB port, video card, HDMI port, audio jack, and GPIO [25]. All the sensors are connected to Raspberry Pi through the signal conditioning circuit. The advantage of Raspberry PI is its inbuilt Wi-Fi module, which enables it for IoT implementation, cloud storage, and remote access as well. The sensors and signal conditioning circuit require a 5 V DC supply, which is available on the Raspberry Pi board. Only the Pi board is required to power using a 5 V adapter.
In continuation of the hardware development, a software framework has been designed based on Python. A program for the acquisition of water quality parameters is written in Python v3.7. Python is a high-level, general-purpose programming software with a wide variety of open-source libraries such as sklearn, NumPy, Panda, Matplotlib, and SciPy for data preprocessing, analysis, and visualization as well. Python is also adopted for various platforms ranging from environmental to complex applications, such as database access, GUI development, network programming, web development, scientific applications, software, and game development. The flow diagram for water quality parameter acquisition is shown in Fig. 4. Initially, the sensors have to be awakened from sleep mode. After that, I2C communication needs to be established. Once the communication is established, water quality parameters can be acquired. Finally, the sensors can be set in sleep mode again. For live plotting of water quality parameters, the Matplotlib library is used.
Experimental Results
A Raspberry Pi-based hardware platform for quality parameter measurement has been proposed in this paper. The developed setup consists of different water quality sensors, a serial port expander, and a Raspberry Pi development board, followed by Python software. All sensors have been calibrated before testing with the reference solution given for each sensor to avoid uncertainty in measurement. The reference solutions used for calibration were of analytical grade and non-toxic. The developed hardware setup has been tested for various water samples. The obtained parameters have been compared with the results obtained from the sonde sensor and are shown in Table 2. The procedure of data acquisition is implemented on the Raspberry Pi development board using Python programming. Along with the acquisition of water quality parameters, plotting of the same parameters has been done in real-time. One of the parameters (conductivity) plot is shown in Fig. 5. The x-axis corresponds to the time in seconds, and the y-axis corresponds to the water quality parameter.
Performance Validation
To ensure the accuracy of the used water quality sensors, the obtained results were compared with the benchmark. The performance analysis of water quality sensors was done by calculating the Absolute Percentage Relative Error (APRE) [26]. APRE expresses the error in percentage to determine the accuracy and is given by Eq. (1):
Here the actual reading is the one obtained from the benchmark, and the observed reading is derived from the developed setup. The absolute PRE is calculated for various water samples and is shown in Table 2. The maximum absolute error obtained is 2.56, and the minimum is 0.11 for DO and pH sensor, respectively. The entire APRE ranges from 0 to 3% for all the water quality sensors. The lower PRE shows better accuracy of the water quality sensor and vice versa. The APRE is also displayed in graphical form in Fig. 6. The x-axis represents the sampling locations, and the y-axis represents the APRE in percentage.
Discussion
The suitability of the Raspberry Pi development board based developed hardware for water quality parameter measurement has been investigated in this paper. Five water quality parameters have been monitored in this work, namely temperature, pH, ORP, DO, and EC. More parameters can be derived from these parameters for, e.g., Total dissolved solids (TDS), and salinity can be derived from the conductivity [27]. While observing the results acquired from the developed setup, it can be stated that Raspberry Pi could be the future of water quality monitoring. Many more features can be further implemented in the Raspberry Pi, such as IoT and cloud-based monitoring, data analysis, wireless sensor network, and machine learning. An interactive user interface can be designed for live plotting and parameter measurement.
Currently, we have not added the E. Coli. and turbidity in measurement. No literature found citing the presence of E. Coli. in the Rajasthan Province of India as the study area has dry weather conditions, where the chance of growth of E. Coli. is very less. E. Coli is presented only, where the storage container is not appropriately cleaned or old distribution pipeline or the pipeline leakage or bad sanitation condition [28, 29]. The turbidity can be added in the future as low-cost sensors are available easily.
Cost-Effectiveness of the Developed Setup
The cost of any water quality monitoring system is the combined cost of hardware and software. Many companies charge a considerable amount for the device as well as software. The benchmark used in this paper costs us 800 K INR, which includes the cost of both the instrument and the software as well. In comparison, the developed setup cost was less than 60 K INR, including water quality sensors and Raspberry Pi development board. There is no cost for software as the Python is open-source software, which reduces the overall system cost and makes the system cost-effective.
Comparison with Other Work
Various papers are discussed in the “Related work” section. Some of the authors have used the Arduino development board; some have used the older versions of Raspberry Pi. In the case of IoT implementation, these development boards need additional Wi-Fi modules to be interfaced. Whereas in the proposed work, the latest version of Raspberry Pi is used, which does not require any additional module as it has inbuilt Wi-Fi and Ethernet module as well. The only requirement is either wired or wireless internet connection. An additional advantage of the Raspberry Pi is that it could operate on 12 V DC supply, which enables it for field and remote area deployment. A comparison of the proposed method with the existing state of the art technologies has been performed in Table 3. The comparison is made based on sensor accuracy, communication technology of the system, and the software used. It can be observed from the table that the water quality sensors have higher accuracy in the proposed method except for pH. In addition, there is no need for external module integration for communication, and open-source software is used for the cost-effectiveness of the system, as discussed earlier.
Conclusion
Traditional water quality measurement methods are now obsoleting due to the development of real-time in-situ water quality monitoring systems. This paper demonstrates the Raspberry Pi-based real-time water quality parameter measurement using different water quality sensors. This approach can be an efficient way for water quality monitoring in smart cities as compared to a manual approach. The developed setup consists of a multi-sensor array, Raspberry Pi as a hardware platform, and Python as a software framework. The results obtained from the setup were compared with the benchmark for validation. The developed setup can be used for logging, processing, and analyzing the data in a real-time environment. Real-time monitoring is essential for several applications such as environmental monitoring, lake, and river water quality monitoring, distribution networks monitoring, and contamination detection in drinking water. The proposed work can be modified according to the required application such as urban, rural, and environment. In the future, the focus will be on the implementation of water quality monitoring using fuzzy logic in the IoT environment and distribution networks.
References
UN F and AO of the. AQUASTAT. 2016. https://www.fao.org. Accessed 25 Aug 2017.
Anan K. Water-Related Diseases Responsible For 80 Per Cent of All Illnesses, Deaths In Developing World, Says Secretary-General In Environment Day Message. UN. 2003;1.
Korostynska O, Mason A, Al-Shamma’a AI. Monitoring pollutants in wastewater: traditional lab based versus modern real-time approaches. In: Smart sensors, measurement and instrumentation. Berlin, Heidelberg: Springer; 2013. p. 1–24.
Yellow Springs Inc. EXO user manual: advanced water quality monitoring platform. Yellow Springs: Yellow Springs Inc; 2016. p. 1–154.
Vijayakumar N, Ramya R. The real time monitoring of water quality in IoT environment. In: 2015 International Conference on Innovations in Information, Embedded and Communication Systems (ICIIECS). 2015. IEEE: 1–5.
Arvind A, Paul R, Bhulania P. Implementation of water quality sensing system using internet of things. Piscataway: Institute of Electrical and Electronics Engineers (IEEE); 2020. p. 1025–8.
Das B, Jain PC. Real-time water quality monitoring system using Internet of Things. In: 2017 International conference on computer, communications and electronics (Comptelix). 2017. IEEE: 78–82.
Chowdury MSU, Emran T Bin, Ghosh S, Pathak A, Alam MM, Absar N, et al. IoT based real-time river water quality monitoring system. In: Procedia Computer Science. 2019. Elsevier B.V., pp 161–168.
Geetha S, Gouthami S. Internet of things enabled real time water quality monitoring system. Smart Water. 2016;2(1):1.
Priya SK, Shenbagalakshmi G, Revathi T. IoT Based Automation of Real Time In-Pipe Contamination Detection System in Drinking Water. In: 2018 International conference on communication and signal processing (ICCSP). 2018. IEEE: 1014–1018.
Meyer AM, Klein C, Fünfrocken E, Kautenburger R, Beck HP. Real-time monitoring of water quality to identify pollution pathways in small and middle scale rivers. Sci Total Environ. 2019;651:2323–33.
Gopavanitha K, Nagaraju S. A low cost system for real time water quality monitoring and controlling using IoT. In: 2017 International conference on energy, communication, data analytics and soft computing (ICECDS). 2017. IEEE: 3227–3229.
Harini BK, Parkavi A, Supriya M, Kruthika BC, Navya KM. Increasing efficient usage of real-time public transportation using IOT, cloud and customized mobile app. SN Comput Sci. 2020;1(3):159.
Tsai TH, Huang CC, Chang CH, Hussain MA. Design of wireless vision sensor network for smart home. IEEE Access. 2020;8:60455–67.
Pereira DS, De Morais MR, Nascimento LBP, Alsina PJ, Santos VG, Fernandes DHS, et al. Zigbee protocol-based communication network for multi-unmanned aerial vehicle networks. IEEE Access. 2020;8:57762–71.
Bernabé G, Hernández R, Acacio ME. Parallel implementations of the 3D fast wavelet transform on a Raspberry Pi 2 cluster. J Supercomput. 2018;74(4):1765–78.
Diaz S, Krohmer T, Moreira A, Godoy SE, Figueroa M. An instrument for accurate and non-invasive screening of skin cancer based on multimodal imaging. IEEE Access. 2019;7:176646–57.
Alkandari AA, Moein S. Implementation of monitoring system for air quality using raspberry PI: experimental study. Indonesian J Electr Eng Comput Sci. 2018;10(1):43–9.
Fawzi LM, Ameen SY, Alqaraawi SM, Dawwd SA. Embedded real-time video surveillance system based on multi-sensor and visual tracking. Appl Math Inform Sci. 2018;12(2):345–59.
Karthika P, Vidhya SP. IoT using machine learning security enhancement in video steganography allocation for Raspberry Pi. J Ambient Intell Humaniz Comput. 2020;1:3.
Shah D, Haradi V. IoT Based Biometrics Implementation on Raspberry Pi. In: Procedia Computer Science. 2016. Elsevier B.V., pp 328–336.
Chen PH, Cross N. IoT in radiology: using raspberry pi to automatically log telephone calls in the reading room. J Digit Imaging. 2018;31(3):371–8.
Central Polution Control Board. Central polution control board; environmental standards; water quality criteria. 2007. https://cpcb.nic.in/Water_Quality_Criteria.php. Accessed 25 Nov 2017.
Atlas Scientific LLC. Atlas scientific environmental robotics. 2019. http://www.https://atlas-scientific.com. Accessed 2 Feb 2020.
Raspberry Pi Foundation. Raspberry Pi documentation. 2014. http://www.raspberrypi.org/documentation. Accessed 15 Dec 2019.
Lee S. Percentage error. MathWorld. 2016. http://www.https://mathworld.wolfram.com/PercentageError.html. Accessed 17 Feb 2020.
Wagner RJ, Jr. RWB, Oblinger CJ, Smith BA. Guidelines and standard procedures for continuous water-quality monitors: Station operation, record computation, and data reporting. 2006 doi:https://doi.org/10.3133/TM1D3.
Soni N, Bhatia A. Analysis of quality of drinking water of private bore-well and piped water supply in Jaipur city, Rajasthan, India. Res J Recent Sci. 2014;4:313–6.
Chandra S, Saxena T, Nehra, Sampat, Mohan, M Krishna. Quality assessment of supplied drinking water in Jaipur city, India, using PCR-based approach. doi:https://doi.org/10.1007/s12665-015-4809-5.
Lambrou TP, Anastasiou CC, Panayiotou CG, Polycarpou MM. A low-cost sensor network for real-time monitoring and contamination detection in drinking water distribution systems. IEEE Sens J. 2014;14(8):2765–72.
Lambrou TP, Panayiotou CG, Anastasiou CC. A low-cost system for real time monitoring and assessment of potable water quality at consumer sites. Sens J IEEE. 2012;14(8):2765–72.
Riis TS. Modeling water distribution systems integration between SCADA systems and hydraulic network simulation models. 2016.
Acknowledgements
The authors are pleased to acknowledge the Birla Institute of Technology and Science for providing an enabling environment for carrying out the research work. The authors also thank the anonymous reviewers for reviewing the manuscript.
Funding
The funding was provided by the Council of Scientific and Industrial Research-Human Resource Development Group (CSIR-HRDG), New Delhi, India (Award No. 09/719(0101)/2019-EMR-1) as a fellowship.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Khatri, P., Gupta, K.K. & Gupta, R.K. Assessment of Water Quality Parameters in Real-Time Environment. SN COMPUT. SCI. 1, 340 (2020). https://doi.org/10.1007/s42979-020-00368-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s42979-020-00368-9