On the Development of a Real Time Water Monitoring System

. The goal of the paper starts from the need for real-time monitoring of both running water and its affluents and urban sewerage systems with a role in discharging wastewater. The idea is to assess water quality and to determine the sources of pollutants resulting from human activity. The data quality will be obtained by purchasing them with a high resolution, both spatial and temporal, using multi-parametric sensors on a hardware platform of its own multisensory acquisition. The acquired data is stored in CLOUD or local server for storage, analysis and interpretation. There will be a software application based on artificial intelligence technologies that serves to identify and classify different polluted areas, locate pollution sources, predict their extinction, degree of pollution and help make decisions based on real-time detection. A web application will provide all the data collected in the field and it can be accessed on a common online platform. This allows researchers or employees of relevant agencies as well as city sewer system operators to validate the quality of data purchased from sensors and end users to be sure of their correctness.


Introduction
River water is the main source of drinking water for most localities in our country and it is obvious that their quality level directly influences the drinking water treatment and the water distribution systems in populated centers. Rivers and their tributaries are subject to high dynamics that change both in time and space. In addition to daily and seasonal natural variations [1], the rivers are influenced by changing discharge regimes (flow, rainfall) and very often, unpredictably, by the impact of different types of pollutants resulting from human activity [2]. Basically, the pollution is more harmful to the ecological and chemical status of the river the smaller the river is. It should also be borne in mind that the quantity of pollutants coming from small tributaries accounts for most of the pollution in large running waters. Another very important factor that leads to the increase of the degree of pollution of the running waters in Romania is the discharges of the insufficiently treated wastewater. There are two main categories of wastewater, insufficiently or not treated urban wastewater in urban environment or industrial wastewater treatment plants. The industrial wastewater is characterized by loads of specific pollutants which can be discharged untreated both in urban sewage systems and directly into running water. The latter are particularly dangerous if they are accidentally or intentionally spilled, often leading to real environmental disasters.
In Europe, since 2000, based on the requirements of the European Commission, the situation of small and medium-sized rivers has been analyzed according to the "EU-Water Framework Directive" (WFD) [3]. Assessing the impact of pollution on running water is done through a combined approach that involves analyzing the different sources of pollution and how they drain. It is necessary to identify the sources and routes of pollutants in running water in order to allow a correct planning of measures to eliminate them and to improve the chemical and ecological status of the water. In Romania there are maximum values of the concentrations of pollutants that can be discharged into natural waters, based on the NTPA001 norms, and maximum values of the concentrations of pollutants that can be discharged into the urban sewerage networks based on the NTPA002 norms. The traditional approach to water quality monitoring is achieved by the laboratory testing of water samples collected both in the case of natural running water and in the case of sewerage systems. This technique offers a full range of testing, including biological, chemical and physical parameters. Due to the high dynamics, non-linear behavior in time and space of running water as well as sewerage systems, traditional sampling methods fail to identify sources of pollution in real time.
To identify and monitor pollutants in real time, it is necessary to take samples using automated systems; they provide information on the water quality of a river or sewer system and allow the detection of both short-term events and long-term changes. Moreover, they allow the distinction of different paths and sources of pollution that can be categorized to be point or diffuse.
Currently, in many countries, running water is monitored by permanent stations specializing in monitoring standard physic-chemical parameters of water quality, administered by public agencies. The main parameters monitored are physical -pH, temperature, color, turbidity, conductivity, radioactivity and bio-chemicals -biological oxygen consumption, chemical oxygen consumption, dissolved oxygen, solid suspensions, nitrates, nitrites, sulfates, phosphates, various dissolved elements. Among these elements, total nitrogen, ammoniacal nitrogen, total phosphorus, lead, cadmium, total chromium, hexa-valent chromium, tri-valent chromium, copper, nickel, zinc, manganese can be listed as the main industrial pollutants. chlorides. An important part of these pollutants are the heavy metals (listed above) that have already reached the city treatment plants and they will be found in the composition of the sludge resulting from the treatment process, making it considerably more difficult to process. Many of the necessary sensors, especially electrochemical ones, require continuous maintenance, frequent calibration procedures and cleaning to ensure safe and accurate data. In addition, various problems may arise when integrating them into a common software platform (data collection, processing, etc.), which has implications for the end user in making decisions about water quality and how to act in the event of an incident.

State of the art
Nowadays there are different systems that monitor the water quality from the point of view of its pollution level. Some of these are made only for pollutants from the agricultural sector, especially for the flow of nutrients from rivers [4]; other systems focus on assessing the ecological status of rivers or the impact of river pollution on drinking water. Most studies have been performed using in-situ sensor placement [5] . However, the precision water monitoring devices, such as chemical analysers, are not widely used due to the high investment and maintenance costs, as they are used to monitor river basins through analysis stations of national agencies [6]. These types of analysers are used, for example, to determine the amount of phosphorus in water. However, ammoniacal nitrogen (NH4-N) and organic carbon (TOC) are of significant relevance to the chemical and ecological status of rivers, as well as to the identification of their sources.

System description
This paper describes the conception of a system dedicated to the acquisition and the interpretation of an extensive set of data from several types of pollutants, the characterization and the classification of the full spectrum of pollution sources, using the latest methods and technologies. The system architecture could be presented from the hardware or software point of view. Generally, the system is composed from the following subsystems (see figure 1):  Multi-sensor hardware platforms that read the water quality parameters and send them to the data storage, processing and analysis software application;  Weather station that provides data necessary to increase the accuracy of prediction of analysis algorithms;  River pollution monitoring software application that ensures the storage, processing and analysis of purchased data (resident in a cloud or local server) and recognition using artificial intelligence algorithms;  Web software application for visualizing the state of the equipment in the composition of the system, in order to manage and maintain them;  Research software application that provides all the data collected by the multi-sensor hardware platforms for the research institute and the university, visualization and production of reports, statistics and predictions on pollution events;  Alert service software application used to transmit real-time pollution events to the authorities. The general tasks of the system are described below:  real-time monitoring of water pollution  storage of data purchased from multi-sensor hardware platforms.  preprocessing and analysis of data taken from multi-sensor hardware platforms;  data fusion from all data from multi-sensor hardware platforms;  generating information for pre-warning services;  generating alerts for emergency services;  allows access to raw data and results from their processing and analysis to make detailed statistics and predictions about pollution, and provide reports on pollution events;  allows the connection of a wide range of sensors, in order to collect and record data from them;  allows its programming so that the software interface can be interfaced with the connected sensors;  communicate through several communication technologies;  allows the configuration of smart sensors connected by the user;  allows the calibration of the sensors connected by the user;  allows monitoring the status of all component hardware equipment. We will describe below the role and the architecture of the main components of the system.

Multi-senzor hardware platform
The role of multi-sensor hardware platforms is to take data from sensors that measure water quality parameters and transmit them to the data storage, processing and analysis software application. The hardware architecture of a multi-sensor platform is illustrated in Figure 2. The multi-sensor platform consists of two main components: (1) the system for collecting data from sensors and (2) sensors for measuring water quality parameters. The data collection system is built with a Toradex Colibri iMX6ULL module. It is a system-onmodule (SoM) microsystem that provides the digital interfaces, computing power and power consumption necessary to meet the functional requirements of the platform. It also ensures the flexibility of software programming by offering the possibility to access lowlevel digital interfaces (eg SPI, I2C, etc.) and to allow programming using high-level languages (eg C #, Python, etc.). ) In general, the data collection system consists of the following components: central unit (Colibri iMX6ULL), sensor interfaces (RS-232, RS-485, SDI-12, I2C, SPI, UART, analog, digital, power supply), communication interfaces (USB slave, USB master, Ethernet, 3G / 4G modem, WiFi), memory (micro SD card, flash), display. The functions of its components are the following:  Micro SD card -for local storage of data from sensors; this function is particularly important when the communication link with the server on which the data storage, processing and analysis software application resides cannot be established; the micro SD card is connected to the MMC interface of the SoM;  RJ45 connector -to ensure Ethernet communication at speeds from 10 to 100 Mb / s; it is connected to the Ethernet interface of the SoM;  2 USB connectors -to offer the possibility of local download of data stored on the micro SD card on an external memory support;  3G / 4G modem -it ensures communication with the server through mobile data networks, having the possibility to operate in 4G networks, but also 3G when there is no 4G coverage in the areas where the platform is installed;  General purpose button -for performing software configurable functions (eg system reset); it is connected to the GPIO port of the SoM;  Accelerometer -it has the role of detecting if the platform has changed its installation position; this can happen in case of theft or fall of the platform;  Real time clock -it is responsible for maintaining the system time;  I2C-UART converter -the converter has the role of providing several serial communication ports to ensure flexibility regarding the types of sensors that can be connected to the data logger;  I2C interface B -is used to allow the connection of digital sensors with I2C interface;  I2C-SPI converter -it is used to allow the connection of digital sensors;  Power supply -ensures the supply of the system with the necessary voltages and currents;  Start / stop button -allows the system to start / stop;  External board -it is located in the vicinity of the data logger, it is connected to it by ribbon cable;  Analog-to-digital converter -this block contains the analog-to-digital converters used for interfacing with analog sensors;  Frequency counters -allow the reading of data from sensors that provide them in the form of pulses;  Digital inputs / outputs -for interfacing with sensors; they are connected to the GPIO port of the SoM;  Sensors for measuring water quality parameters -they can be digital or analog. The multi-sensor hardware platform must perform the following functions:  allows the transmission and reception of settings to / from a software application resident on a server;  communicate via standard protocols so that it can interface with any software application;  allows the user access through a display in order to calibrate the sensors, enter the data, respectively view the recorded data and its settings;  is able to detect when his position has changed (eg, fell from the stand, was stolen) and record this event;  allows the setting of different parameters for each channel (sensor) -independent channels;  allows the monitoring of limit values, with several thresholds for a single sensor;  allows the transmission of alarms when the threshold values are exceeded and the measurement and data transmission range is changed;  allows the transmission of alarms via SMS;  allows the synchronization of his watch with that of the 3G / 4G network;  allows remote configuration;  allows the firmware update;  allows data to be downloaded and deleted;  allows the deactivation of the LEDs to reduce energy consumption. Software application for river pollution monitoring, data storage, processing and data analysis This application is intended for real-time pollution monitoring. This application is resident on a server or cloud and can be this by:  web application software for alerting services  web application for research The functional requirements are as follows:  retrieval and storage of data from multi-sensor hardware platforms  preprocessing of acquired data  data analysis using specific algorithms  merging data from all multi-sensor hardware platforms (simulated platforms)

Web application for alerting services
This application is made on a web platform for its accessibility to any electronic device such as (computers, tablets, smartphones). It is dedicated to pre-warning services, respectively emergency services. The functional requirements are as follows:  Communication with river pollution monitoring application, data storage, processing and analysis  Arranging through the web interface the information necessary for pre-warning services  Disposition via the web interface of the information necessary for the emergency services  Displaying alerts on the web interface with the signaling of the location where the detection was made (station), of the type of alert (exceeding the threshold, technical alert, etc.) and of the registered values.  Recording alerts in a history and the possibility to navigate through the history  Acknowledge an alert after a plan of action has been completed  Sending alerts via SMS or e-mail to a list of operators.

Web application for research
This application is made on a web platform for its accessibility to any electronic device such as (computers, tablets, smartphones). It is dedicated to institutes and universities in order to take the raw data on pollution to make detailed statistics and predictions about pollution, reports on pollution events.
The functional requirements are as follows:  Display data as dashboard charts embedded in a web page,  Possibility to configure the dashboard by changing the position of the viewers (tables, graphs) in the dashboard and by changing the viewer  Possibility to import data in a csv format that can then be displayed in excel.

A. Web application for administration and maintenance
This application is made on a web platform for its accessibility to any electronic device such as (computers, tablets, smartphones). It is dedicated to ensuring the configuration and monitoring of system equipment. The functional requirements are as follows:  Configuring the component equipment of the SmartMonWater system,  Monitoring the component equipment of the SmartMonWater system,  Generation of operation reports  Possibility to generate technical alerts in case certain SmartMonWater components have operating problems  Recording technical alerts with details on the time, type of equipment and the problem that occurred.

Conclusions and perspectives
The system architecture is now ready to use in laboratory conditions at the beginning and in natural environment lately. The data quality will be obtained by purchasing them with a high resolution, both spatial and temporal, using multi-parametric sensors on a hardware platform of its own multisensory acquisition. The acquired data is stored in CLOUD or local server for storage, analysis and interpretation. A software application based on artificial intelligence technologies that serves to identify and classify different polluted areas, locate pollution sources, predict their extinction, degree of pollution and help make decisions based on real-time detection. A web application will provide all the data collected in the field and it can be accessed on a common online platform. The next step is the connection to the sensors and the validation of data.
This work was supported by a grant of UEFISCDI -54PTE/2020 -Intelligent System for Water Quality Monitoring -SmartMonWater.