Emerging Tools for Design and Implementation of Water Quality Monitoring Based on IoT

The article provides a conceptual framework for developing real-time water monitoring systems based on IoT technology. The process, strategy and knowledge base for multidisciplinary research on IoT systems and prerequisites for real-world application of IoT technology into continuous water quality monitoring are discussed. The study expands current efforts aimed at leveraging customized IoT solutions for better instrumentation and continued integration of sensor data into networks. The process of system design from scratch and base components of IoT-based water quality monitoring systems for surface water are described. While the focus of this article is on system design, opportunities to improve the system components for the management of water resources with continuous water quality monitoring are much broader. In this view, perspectives and development issues of IoT-based water quality monitoring are also discussed.


Introduction
Water is a natural treasure of our planet. Measuring and monitoring water resources is a hot topic worldwide since water is essential to the health and well-being of both people and the environment. Accurate and well-timed information on water impairment is integral to efforts toward managing water quality and the rational use of water resources. In this context, the Internet of Things (IoT) along with data analysis has opened new horizons and perspectives for the protection of water resources by providing on-time information through its infrastructure. IoT can be used in natural freshwater bodies to monitor water quality and levels in multiple locations providing high level of visibility and awareness that may help in improving resilience as well as mitigating or preventing future disasters. The application of IoT in artificial water basins and aquariums helps the aquatic farmers to control and recycle the water, increase productivity, and reduce environmental impacts.
At the same time, the extensive use of emerging tools [1], [2], [3] for continuous water monitoring remains limited. One reason is the fact that monitoring of water bodies covers the observation and assessment of the ecological status of various aquatic biological systems located on the earth's surface (such as rivers, lakes, transitional or coastal waters, and artificial or substantially modified water bodies). Another reason is the distinctive features of water monitoring including the extensive use of various instruments, sensors and communication infrastructures capable of transmitting and processing data in real-time. In some cases, it leads to inconsistency and disagreement in the functioning of various monitoring subsystems that greatly complicates the actual assessment of the status of water bodies and negatively influences the ability to respond to their changes. Besides, a data collection system with low energy costs and the ability to serve simultaneously a large number of IoT devices is necessary for efficient collection and processing of data on end nodes of information systems based on IoT.
Implementation of IoT-based monitoring could solve several problems that are difficult to implement by existing control methods, namely: • find marker points (places) of control; • determine the optimal number of observation points and organize them into the network for control and tracking changes; • choose and monitor indicative, marker values; • make observations in places not accessible for traditional instrumental methods or places with no identified causes of changes; • comply with the frequency and tracking of the seasonal components; • display the elements of point observations on the summary picture of the state of the object; • provide free access to environmental information.
Focusing on the problem of sound water usage, in 2017 we launched the SmartWater an interdisciplinary research project and developed a customized IoT solution for water quality monitoring along with the real-time analytical software system.
In this article, we describe our approach to system development from scratch focusing on the following two key elements: • The main principles for the development of customized IoT-based systems for surface water monitoring in terms of architecture and baseline configuration of water monitoring stations. • Data processing and visualization tools for various systems involved in the monitoring of water objects.
The technology is primarily targeted at the following water sectors, although not limited by them: environmental monitoring (open water bodies in ecologically sensitive areas, water reservoirs such as rivers and lakes, wastewater monitoring, groundwater monitoring) and aquaculture (extensive, semi-intensive aquaculture farms; land-based aquaculture; controlled environment aquaculture).
Our contribution consists of definition of an overall strategy for the development and implementation of surface water quality monitoring projects that expand the current state-of-theart in IoT technology for environmental monitoring. It enables creating a knowledge base for multidisciplinary research on IoT systems and provides prerequisites for practical use of IoTbased systems for industrial and municipal water monitoring. The proposed solution implements integrated water resources management based on the basin approach, providing (1) an assessment of the individual characteristics of each section of the water body; (2) improvement of the system for monitoring the aquatic environmentthe state of surface and groundwater; (3) constant observation; (4) possibility to survey and determine the state of river basins; and (5) monitoring compliance with standards and discharge standards.

Related Work
There are dozens of IoT-based water monitoring systems that have been proposed recently for different areas of applications for river and seawater monitoring [1], [2], [3]. Some of them are actively used for fish farms and aquaculture centers [4], [5]; others are used for monitoring drinking water distribution systems [6] and contamination in drinking water [7]. The detailed surveys on the approaches, tools and techniques employed in existing IoT-based water quality monitoring solutions can be found in [8] and [9]. The IoT system for wastewater monitoring and treatment and its application for household activities is discussed in [10]. Gerson et al. [11] proposed biosensors on the Arduino microcontroller to monitor changes in animal behavior caused by water pollution. Another important application of this technology is to control water quality in natural and artificial fish farms [12], [13], [14]. The approaches to development, system architectures, sensors used and dashboards also vary [15].
There are different types of sensors used for measuring water parameters. Their choice largely depends on the purpose, cost, efficiency and water quality attributes required for analysis. Up to now, water probes are still one of the most costly components of water monitoring systems. The new generation of smart in-line water sensor probes enables performing continuous multiparameter water monitoring. Table 1 summarizes information on multi-parameter water probes. Lab-on-chip [19] In more detail, in [20] kapta 3000 AC4 is used for management and control of the drinking water distribution network. Each probe provides the measure of chlorine, conductivity temperature, and pressure and costs approximately EUR 3,700. The spectro::lyser [21] is another device developed to monitor multiple parameters. It is operated via s::can terminals and s:can software and costs around EUR 12,500. Another instance of compound water quality sensors is the Smart Water system from Libelium [22]. This solution detects water contaminants and costs approximately EUR 5,800. Besides, the new Smart Water Xtreme Monitoring Platform from Libelium provides a set of smart sophisticated sensors applicable for fish farms management [14], chemical leakage detection [23], potable water monitoring, remote measurement of swimming pools, and monitoring seawater pollution [24].
As can be seen, all these solutions could be effective for a particular task but are very expensive. Moreover, due to the specifics of water environment, all electrical parts are corroded and probes become dirty rapidly; this fact increases the maintenance costs and limits the monitoring scope. Finally, the current water quality monitoring and prediction methods used in many systems have high computational complexity, that also needs improvements. As a way of solving this challenging task, our solution proposes an option for developing real-time water monitoring systems expanding existent practices and strategies of IoT implementation. The main goal of this article is to increase the interest of the IT-community to realize real-time systems for water quality monitoring and prediction at a reasonable charge with low computational complexity, high prediction accuracy and high generalization ability.

The Overall Strategy for Designing Surface Water Quality Monitoring Systems
The proposed design methodology for IoT-based systems for surface water monitoring is composed of three main stages (see Figure 1). The first stage is focused on system design and includes two tasks; (1) variables identification (pollutant sources, key parameters, areas for the location of online monitoring stations, priorities, a station number, monitoring methods, sampling frequency); and (2) system development (an architecture, core system components, a network, interconnection, a base configuration of the observing station, etc.). The second stage deals with the development of tools for real-time data access, data storage, processing and visualization. During the third stage, the development of analytic models and decision-making algorithms for real-time and long term monitoring is performed. The two basic issues, namely, (1) system design and (2) tools for data processing and visualization that can be launched almost simultaneously by two different developer teams are discussed below. Additional information on the processes related to design can be found in our previous work [25].

System Design
Depending on the customer and the current situation, the purpose of developing and implementing an online monitoring system can be: (1) identification of incidents of water pollution; (2) optimization of cleaning processes; (3) monitoring of threats and assessment of long-term trends in water quality due to natural changes and anthropogenic impact. Each goal influences the choice of parameters that will be monitored by the system. At the same time, it is possible to allocate a group of parameters that can provide the low level of water quality control and become the basis for the development of monitoring stations.

Variable Identification
Surface water monitoring covers the observation and assessment of the environmental balance of various aquatic biological systems located on the Earth's surface (rivers, lakes, transitional or coastal waters, artificial or substantially modified water bodies). Depending on the goal, a system for surface waters monitoring can implicate various stages from exploratory monitoring to research monitoring with a certain frequency and assessment of results to classify ecological and chemical states. For large-scale assessment of the water basin, it is advisable to carry out zoning, i.e. dividing the area of the reservoir into zones, based on the results of control observations, and further combining these zones into a whole network of observation points in the aisles of each site. In such way, a holistic assessment of the ecological status of the reservoir, in the aisles of each river basin, could be implemented.
Such a network assessment will make it possible to qualitatively determine the elements and parameters that will optimally reflect the state of surface waters, starting from their reference values to the existing states. Then, on the basis of characteristics and impact assessments for each period, the appropriate assessment procedures for the selected values should be determined.
Both, the assessments of the presence of any changes in the state of water and the assessment of long-term changes in terms of control parameters, are relevant and can be based on the following parameters [26]: • indicative parameters in terms of their physical and chemical quality; • priority parameters in connection with anthropogenic impact on the river basin; • outliers, peak, quantitative, unusual parameters for the assessed area. Table 2 provides a list of some water quality parameters and related measurement techniques. The physical parameters of water quality include temperature, turbidity and conductivity. The most common chemical factors measured in water are aluminium, ammonia and ammonium ions, anionic surfactants, biochemical oxygen consumption (BOD), calcium, carbonates, chemical oxygen demand (COD), chlorides, chromates (total), chromaticity, dissolved oxygen (DO), dry residue, fluorides, frothiness, heavy metals (copper, lead, zinc), hydrocarbons, nickel, nitrates, nitrites, transparency, petroleum products, phenols, phosphate (polyphosphates, total P), odor (without heating), oxidation-reduction potential (ORP), pH, sulphates, permanganate oxidation, sulphurous sulphide genus (sulphides), suspended solids, taste, total iron, and total hardness [8], [27].
The measured biological factors include the presence of bacteria, virus, algae and pesticide forms [8].
Another specific group of water parameters consists of the quantity factors such as water level, water flow pressure, and velocity. In case of flood accidents, measuring and monitoring these parameters are vital [28].
In terms of specific pollutants, they can be selected depending on the types of contaminants found in certain water bodies subjected to the control.

Design of Overall System Architecture and IoT Device Specification
The system design phase is related to the physical construction of the IoT system and covers the series of procedures such as establishing an overall system architecture, designing of monitoring devices, network configuration, designing of interfaces, etc. Below, we discuss the first two phases.

Establishing an Overall System Architecture
There are several approaches in developing architectures of IoT water monitoring. The simplest architecture includes three layers, namely, the sensor or perception layer, network or communication layer, and application layer (see Figure 2).
The bottom layer includes the sensing equipment for data acquisition; the middle layer performs data transmission; and the top layer is designed for applications. Three layers represent the earliest and the simplest structure of IoT systems. The further enhancements additionally may leverage the processing, transport, business and security layers. The examples of more complex architectures can be found in [25] where five-layers based on the telecommunication management network were suggested or in [29] where the six-layered architecture, which combines Web services, RFID and WSN, is discussed.
Another view on IoT architectures enables classifying them in two other types, namely cloud and fog or edge computing. The first type assumes that data processing will be done by cloud computers in a centralized manner. It means that everything including monitoring, data storage, preprocessing, data mining, and visualization comes through the cloud, while the second architecture enables sharing some functions, e.g. monitoring, preprocessing and storage between the physical and transport layers. In systems based on the fog computing paradigm, the monitoring and pre-processing are done on the edges.

Designing a Baseline Configuration of Water Monitoring Stations
The development stage of water quality monitoring stations begins just after selecting the monitored parameters, locations, and the overall system architecture. Each water monitoring station includes sensors used for measuring selected parameters and auxiliary equipment necessary to provide power to the station, transmit data to the network, and protect against unwanted interventions and environmental influences. When designing IoT water monitoring stations, it is necessary to set up the following components: • Devices and/or sensors for measuring the selected parameters; • The method of placement of sensors that will be constantly in contact with water; • The sources for power supply; • Data transmission facilities; • Housing for installation and protection of measuring instruments and accessories; • Tools to protect the station from possible interference and the environment.
There are different approaches for measuring water quality parameters; in relation to IoT monitoring stations, one can use immersion of sensors and / or water injections into sensors located in the current cell. In the proposed system, an approach with immersing devices directly in water was applied. This ensures that the sensors measure the water parameters with minimal disruption without altering samples. Figure 3 shows some possible examples of the placement of the immersing IoT devices in water.
This sampling method is particularly useful for measuring soluble oxygen, since its amount may vary due to mixing and transporting to the measurement site. The drawback of this approach is that the sensor designed for use in this way must be equipped with a protective housing and periodical cleaning of the probe is necessary.

Data Processing and Visualization Tools
To achieve robust and reliable results of monitoring, data received from the IoT devices and monitoring stations must be converted into management information. The information management system should provide the capabilities of storing, accessing, analyzing, reporting and visualizing the data. From this perspective, methods of analysis and visualization can vary for each goal. Thus, for detection of contamination incidents the following two data processing techniques can be used: (1) the threshold analysis and (2) automated detection systems for anomalies. The analysis of threshold values is the easiest way for detecting contamination. The thresholds are based on the normal variability of each parameter in each location; thus exceeding the threshold indicates an anomaly of water quality. As a rule, thresholds are set up through statistical analysis of historical data collected during the representative period. In order to detect the presence of significant changes in water quality (such as seasonal variability for each period characterized by significant differences) basic and unique thresholds can be set up. Automated detection systems use special software algorithms to analyze the behavior of several parameters, measured at one monitoring station, in order to detect anomalies. To support real-time data analysis, information about water quality should be delivered regularly. If the main target of real-time data monitoring is water purification from pollutants, a deep understanding of the relationship between the water quality and the need for its adjustment is required.
Similarly, the task of detecting pollution incidents (to support the optimization of cleaning processes) can be used in two ways: (1) the threshold analysis and (2) cleaning processes modeling and adjusting. The thresholds should be defined for each monitored parameter and each purge process. The use of threshold values to optimize the purification processes involves real-time monitoring of parameters that affect the performance of the purification process and process setup when the monitored metrics cross the previously defined thresholds. Since the most processes affect multiple parameters, individual thresholds are generally not considered singly. In this case, a combination of statistical analysis of historical water quality data and knowledge about efficiency of the purification process can be used to establish thresholds. According to the recommendations [15], a five to ten percent safety factor should be set up for thresholds in order to guarantee some time for the decision-maker to study and respond to changes in water quality.
In case of monitoring the long-term threats of water quality, the continuous analysis of data over several years is needed. This enables identification of trends and ongoing changes in the baseline scenario. In the long run, a systematic analysis is performed in order to determine whether the baseline for several parameters has been changed at a specific location where the metering station is located and how the baseline for this parameter has changed in several places. These results can, for instance, help to understand whether these changes are widespread throughout surface water and water distribution or they are isolated to a specific area.
Whatever the subject of monitoring, analytic and visualization tools are absolutely necessary.
The visualization tool development starts from creating the features that address the most critical parameters and areas. The initial planning process also includes designing the prototypes in order to get better understanding of the current design, and to investigate how the key components of interface enable interaction with users.

Case Study
The proposed approach for development of the real-time water monitoring system was used during the designing phase of the SmartWater system. For the case study, the segment of Siverskyi Donets river (area of the Don river basin, number of the massif, code UA_R_16_XL_1_SI, number of the massifUA_M6.5.1_0007, lowland location, silicate geology, sampling points 440, 444, and 454 km) is taken.
The Siverskyi Donets River is the main waterway in the East of Ukraine and the most sensitive in terms of water management, due to the large number of releases of return water from the chemical and coal industries, utilities, and other industries. Hence, the rather high level of river pollution is observed in such indicators as mineralization, sulphates and nitrites. In the river valley, there are groundwater intakes, which are also used for centralized drinking water supply to the population of the region. The company's wastewater discharge into the Siverskyi Donets River is located in the area below the confluence of the Chervona River and above the confluence of the Borova River.
The section of the Siverskyi Donets River above the return water outlet is subject to the influence of industrial enterprises and wastewater outlets of regional companies, mostly chemical and coal industry. In addition to these discharges, the water quality, in the river, is influenced by surface runoff from the agricultural lands and settlements and self-purification processes. The hydrographic scheme of the location of wastewater discharges, background and control lines is presented in Figure 4. In the case-region the monitoring program is carried out both by the stationary monitoring stations and the SmartWater system. The stationary stations are off-line measurement facilities where samples of water are collected from the river and then analyzed in the laboratory. Information about the SmartWater system is given below.

SmartWater System Architecture
The point of release of the SmartWater system is based on a cloud-centric architecture shown in Figure 5. It comprises three reference layers (perception, network and application) and some elements of the processing, business and security layers.
The perception layer includes sensors, the StartWater IoT devices and energy harvesting tools. The SmartWater network layer is based on IPv6 protocol to perform transmission, managing, and processing data passed from the perception layer. For communication in IoT we have chosen the following technologies: (1) 6LoWPAN because it supports both star and mesh topology, is cheap and has low power consumption; (2) Zigbee which is a wireless 1494 protocol that provides low cost, low power consumption and high security during communication and supports star, mesh and tree topology; and (3) LoRa (Low Power Wide Area Network). LoRa also has low power consumption, low cost and high data rate, and supports the star topology.
Application layer manages the applications used in the SmartWater and is based on MQTT protocol. Specifically, it is adopted to construct the online platforms and services for information processing, data management, intelligent computing, middleware, etc. All of the IoT data processing is done in the cloud or a remote server.

SmartWater IoT Devices
The SmartWater leverages the set of custom IoT devices for periodic measurement of water quality parameters such as pH, turbidity, conductivity, dissolved oxygen, and temperature. The device is a sealed submersible capsule (see Figure 6) that contains sensors for measuring water parameters, real time clock board, battery, Micro-SD, and data transmission facilities. Each device may contain from 3 to 5 sensors depending on their size and requirements to mutual interference. The parameters are measured on a schedule, sent to a central server, and displayed on the dashboard in real time. Table 3 shows the sensor part of the IoT device with their approximate cost.

SmartWater Dashboard
Data collected by the IoT devices are forwarded by the gateway to the cloud and thereafter are used for analytics and displayed in the web-based dashboard. The snapshot of the main screen is shown in Figure 7. The key parameters, namely, pH, ORP, EC and DO are continuously displayed on the main screen. Additional information that supports the interpretation of water quality data, such as weather data, is also included in the panel.
When anomalies are detected, the system generates alerts about changes in water quality. All warnings are provided through special messages on the dashboard screen and duplicated as the text messages on a smartphone connected to the system. Notifications include time, a device / metering station location, and a parameter and its current value.

Water Quality Analytics
The system is used to detect pollution caused by accidents (e.g. discharges of chemicals or spills into water sources), unusual emissions (e.g. untreated wastewater) and natural events (e.g. algae blooms). Data received from the SmartWater system along with data from stationary monitoring stations support procedures of the current status assessment, long-term statistical analysis, and forecasting the state of river waters. The existing seasonal effects from natural and anthropogenic activities are also considered. Figures 8 and 9 show examples of water quality indicators and results of data analysis.
The results obtained through the SmartWater significantly increase the efficiency of data processing by providing the latest information about the surface water status. The results enable identification of significant changes in water quality and implementation of changes in particular management strategies to protect surface waters more efficiently.

Conclusion and Future Work
The proposed framework for water quality monitoring is targeted on data specific features that enable utilization of well-known algorithms best suited for continuous, real-time water quality data. This approach is fully implemented and has successfully passed beta testing on several ecologically sensitive areas of the Siverskyi Donets River, Ukraine during 2019-2020. We tested three immersing devices and one base station in the Luhansk region (Rubizhne and Severodonetsk cities). The results obtained prove that the new solutions to the data transmission, storage and processing by the IoT device combination enable better understanding of the sources of different water pollutants, effects of water control policies, and exposure of various substances in the water sources. However, to get a more efficient system, many issues and tasks should be solved further, such as: 1. Cost of the IoT solutions (initial costs, the cost of IoT enabled sensors, instruments and technology for real-time monitoring and storage in the cloud or remote centers for analysis). At the present time, the cost of the custom immersive device varies from EUR 150-600 which is one of the main limitations for its widespread adoption. 2. Interoperability of the devices from different manufacturers or even from a single brand with different protocols. 3. Availability of reliable electricity and mobile internet to the IoT based water monitoring. 4. Security issues (in the absence of a secure and properly encrypted network, the adoption of the IoT could lead to security challenges and vulnerabilities). We did not have any security incident during the testing stage; however, for commercial usage, security should be one of the top priorities; 5. The lack of highly qualified specialists in setting up and maintaining systems.
Another challenge we faced during the testing phase was the real-time sensor data management. The difficulty arose from different test probes as well as techniques to transmit and handle the data. Therefore, in future, we plan to use a hybrid approach with an efficient compression technology to manage and efficiently filter real-time data to reduce the cost of transmission in the network layer. To solve the problem of the efficient collecting, storage and transmitting of data from a large number of source nodes we plan to use the compressive sensing models. With relation to the advantages of compression measurement models, we are going to leverage this technique for the next version of the SmartWater.