Solar Powered Wireless Sensor Network for Water Quality Monitoring and Classification

: Water is essential not only for human beings but also for animals and plants. In some countries, many residents live on riverbanks with poor water conditions and they frequently use river water for daily activities. To determine water quality, samples are usually taken and tested in laboratories, which can be less efficient and costly. This paper discusses the use of a Wireless Sensor Network (WSN) to monitor water quality remotely using self-powered sensor nodes. One of the challenges in developing WSNs is energy supply, which can be addressed by using solar panels in outdoor implementations. This study uses three indicators - pH, TDS, and turbidity - to determine water quality based on Health Regulation Standards. The results examine the WSN's performance and analyze solar energy supply for each sensor node. The WSN successfully detects and classifies water quality categories and displays them in the monitoring center or to users. The sensors are calibrated and work within a tolerable error of 5.1% in sensor readings. The WSN node is equipped with a solar panel to supply energy to network devices, extending their lifetime and implementing a Green WSN.


Introduction
The main concern in water resources is water quantity and quality. There are regulations or standards about water quality. Globally, there are guidelines or criteria for five additional areas of water use: public water supplies, fish and wildlife, agriculture, recreation and aesthetics, and industry [1]. WHO provides recommendations regarding water quality for managing the risk of hazards that may compromise the safety of drinking water [2]. Every national drinking water quality regulation is recommended to be aligned with the principles outlined in WHO guidelines. Some parameters may indicate the quality of water. The regulations regarding the water quality requirements, specifically for drinking water quality, are usually regulated under the Ministry of Health [3,4]. In this study, water quality is classified into three groups according to its designation [4]. The classification of water used in this study includes (1) Category 1: water with pH 6.5 -8.5, turbidity < 5 NTU, and Total Dissolved Solids (TDS) < 500 mg/l or equivalent to 50 ppm. This category is water that can be used as drinking water without preprocessing. (2) Category 2: water with pH 6.5 -9.0, turbidity < 25 NTU, and TDS < 1500 mg/l or equivalent to 150 ppm. This water can be used for agricultural purposes, urban businesses, and industry [2]. (3) Category 3: water with parameter values not included in categories 1 and 2, which is recommended not to use or must be processed first. The qualification of water is crucial to ensure that the designation of water according to its quality is safe for human health and the environment. This paper discusses the implementation of a WSN to monitor the quality of water, especially along the river banks, and classify it into three categories as mentioned before. This system can be used by people who live around the river or the government in taking action to prevent water pollution. This study contributes to the idea of a WSN that is environmentally friendly with low power consumption by optimizing the sensor deployment based on the sensing parameter profile and the use of renewable energy to supply energy. Regarding the profile of data from the sensors, the location of the sensor, the timing of data retrieval, or other node management can be determined to minimize power consumption. Besides that, since this WSN is deployed outdoors, the proposed WSN node is designed with a solar panel to supply energy for all components in each sensor node. Therefore, it is able to extend the lifetime of the network devices with renewable energy and it is aligned with the concept of green WSN.
Green WSN has become a consideration in designing sensor network systems. A research investigates the performance of a hybrid RF-Solar harvesting for remote sensing devices [5]. This study builds RF and solar harvester circuits to create hybrid harvesting for all elements in the sensing networks. Previous study [6] discusses solar energy harvesting for the environment by sensing some parameters such as ambient temperature, relative humidity, atmospheric pressure, and ultraviolet (UV) index. Another study [7] also discusses solarpowered wireless sensors for Soil Water Monitoring. Solar energy harvesting has become the most widely used renewable energy source for outdoor WSN applications.

Materials and Methods
This study begins with the design of a prototype, followed by experiments carried out in both the laboratory and the river. The prototype design stage involves several steps, including defining the system design, preparing and programming the sensors for pH, TDS, and turbidity, and calibrating the sensors using a reference tool. These steps are carried out in the laboratory using multiple water samples with varying pH levels, turbidity, viscosity, and solution types. Additionally, the microcontroller is programmed, the Zigbee network is configured and built for data transmission, the solar panel is integrated, and the sensor networks are deployed. The component of the sensor node is presented in Figure 1. The energy system comprises several components, including the solar panel, regulator circuit, and battery. The solar panel harvests solar energy, which is then conditioned and managed by the regulator circuit. The energy from the solar panel can be stored in the battery or used directly to power the node components. The circuit design for the solar panel, sensor, and other components is illustrated in Figure 2.  Figure 3, where sensor nodes are deployed along the river to detect pH, TDS, and turbidity levels at certain locations. The experiment was carried out in a river area to investigate the water parameter levels and perform classification. The WSN nodes were placed at ten locations along a 100-meter of the river, with one coordinator node. The coordinator node collects the data and transmits it to the monitoring system via the Zigbee Gateway. The data is then displayed on the user's equipment. Figure 3 shows the deployment of the WSN for river water quality monitoring.

Results and Discussion
The discussion section begins with an analysis of the performance of each sensor in detecting the parameters of water quality, including pH, TDS, and turbidity. The profile value and network performance are also analyzed, followed by an examination of solar energy harvesting and the minimum requirements to fulfill energy consumption for each WSN node.

Sensor reading.
Three sensors are used to measure water quality: the pH sensor SEN0161 [8], which measures the acidity or alkali content of a solution; the Total Dissolved Solids (TDS) SEN0244, which measures the soluble solids dissolved in water; and the turbidity sensor SEN0189, which uses light to detect particles in water by measuring the light transmittance and scattering rate, which changes with the amount of total suspended solids. These sensors were calibrated and compared with reference measuring instruments provided in the water testing laboratory. Each sensor was calibrated by testing five water samples with varying pH, turbidity, and TDS levels. The measurement value obtained from the sensor reading and reference tool was compared, and the difference was considered as the error from the sensor reading. The error rate was observed by taking the average from all samples with repeated measurements for each sensor.
The pH sensor measures the degree of acidity of a solution, with an error sensor reading of 2.95%. The TDS sensor works well in indicating the purity of water by detecting the TDS level, with an error sensor reading of about 2.3%, and the detectable TDS range is 0~1000ppm. The turbidity sensor detects the turbidity level with an error sensor reading of 10.63%, which is relatively high. However, the average error for all sensors is about 5.1%.
After calibration, the measurement was conducted in a real environment along the river. Figure 4 shows the measurement results of pH, TDS, and turbidity values along 100 meters from ten nodes in the river. From this result, it can be observed that the profile of pH value along the river remains the same at about 5.98, while the turbidity values and TDS values vary. The classification algorithm also works well to define the category of water quality. Along 100 meters of monitoring, the water was classified as group 3, which means that it cannot be used directly for household activities and must be processed first to be suitable for daily use.    Figure 4. By analyzing the variations in pH, turbidity, and TDS values, further analysis can be conducted for sensor deployment. The sensor deployment should be designed in a way that is adequate yet still represents the actual condition by optimizing the distance between sensors for parameters whose values do not vary greatly around a certain area. Additionally, the timing of data retrieval for such a sensor can be reduced or adjusted to reduce power consumption. For instance, as shown in Figure 5, the pH value in all observation points is relatively the same, making it possible to locate the sensor at a greater distance. Therefore, in WSN deployment, it is suggested to conduct initial research to determine the characteristics of the data for node location and data retrieval optimization. Determining the sampling frequency becomes the main consideration of network designers, and one approach studied in [9] introduces Analytic Hierarchy Process (AHP) as a decision analysis and calculation of weighting factors based on multiple criteria to calculate the sampling frequency of river water quality. This approach was implemented in 12 node stations located in Jingmei and Xindian rivers, Taipei, Taiwan. This study combines the weighting factors of variables with the relative weights of stations to select the sampling frequency for each station, monthly and yearly.
Currently, machine learning or artificial neural networks are being developed for the prediction of water quality parameters, as seen in the implementation carried out in Malaysia [10]. A study on WSN for river water monitoring systems with high frequency, high mobility, and low power uses Deep learning neural network models [11]. Another study [12] reviews and investigates the ANN-based water quality prediction from three aspects, namely feedforward, recurrent, and hybrid architectures. This work concludes that ANN models are capable of dealing with different modeling problems in rivers, lakes, reservoirs, wastewater treatment plants, groundwater, ponds, and streams.

Zigbee networks performance.
The WSN employs Xbee with Zigbee standard as a transceiver to send data, and XCTU software is used to configure the Xbee node. The router nodes collects data and sends it to the coordinator, which then processes the data with a microcontroller. Data is sent as a frame or packet, specifically the IO Data Sample RX Indicator that contains analog data from the sensor sent by the router. The console window displays the communication history between coordinators and routers based on transmitted API frames. The network functions well in transmitting data between the sensor node and the coordinator node, however based on the experiment results, the maximum range of this network connection is around 130 meters. For longer ranges, the signal becomes weak and unable to connect. Regarding solar energy harvesting, the WSN design employs a solar cell with a dimension of 180 x 81 x 1.55 mm. The experiment aims to investigate the power harvested by solar panels throughout the day to observe the light intensity and power conversion efficiency. The results indicate that at the highest intensity of light, in one hour, the solar panel can produce a current of about 2.886 mA and power of about 15.803,06 mW, which is sufficient to cover the power needs of one sensor node. Figure 6 presents the variation of voltage and current in one hour at the highest light intensity (at 01.00-02.00 pm). However, the average voltage is about 5.47V, and the value is unstable, so a regulator and storage system or battery are necessary before using it to supply the sensor node.   Table 1 displays the energy consumption of one sensor node utilized in this WSN design, consisting of three sensors, one transceiver, and one microcontroller. The power required may vary depending on whether the transceiver is in transmit, receive, or idle mode. This also depends on the timing configuration of data retrieval to minimize power consumption. The more active the node is in sending data, the more power it requires.  A WSN system was designed and implemented to monitor and classify the quality of river water, with solar panels used to harvest energy and supply power to the WSN nodes. This study focuses on identifying the water quality based on three parameters: pH, turbidity, and TDS. The summary of the design is presented as follows:

Conclusions
This study conducted a real experiment of river water monitoring using three parameters, namely pH, turbidity, and TDS, to determine the classification of water quality based on these parameters. In the WSN, the values of different sensing parameters may vary at different rates. By observing their characteristics, it is possible to adjust the timing of data retrieval and the deployment of sensor nodes to reduce the number of sensors deployed and power consumption. Additionally, another way to achieve a green WSN is by utilizing self-powered nodes that use renewable energy.