Integration of sensors for dam water quality analysis – a prototype

Water consumed is stored in several water bodies in and around us, out of which dams accommodate a major portion of water. The quantity and quality monitoring of water in dams is troublesome due to their large surface area and high depths. Although groundwater resources are the primary water source in India, dams plays a vital role in water distribution and storage network. The Central Water Commission in India has identified more than 5,000 dams of which a major portion is persistently consumed by the rural and urban populations for drinking and irrigation. The water quality of these reservoirs is of serious concern as it would not only affect the socio-economic status of the nation but the aquatic systems as well. Water quality control and management are vital for a delivering clean water supply to the general society. Because of their size, collecting, assessing, and managing a vast volume of water quality data are critical. Water quality data are primarily obtained through manual field sampling; however, real-time sensor monitoring is increasingly being used for more efficient data collection. The literature depicts that the methods involving remote sensing and image processing of water quality analysis consume time, and require sample collection at various depths, analysis of collected samples, and manual interpretations. The objective of this study was to propose a novel cost-effective method to monitor water quality devoid of considerable human intervention. Sensor-based online monitoring aids in assessing the sample with limited technology, at various depths of water in the dam to analyze turbidity which gives the major indication of pure water. The quality analysis of the dam water is suitable if the water is assessed at the distribution end before consumption. Hence, to enhance the water management system, other quality parameters like pH, conductivity, temperature are sensed and monitored in the distribution pipeline. An unstable pH can alter the chemical and microbiological aspects of water, resulting in a variation of other water quality parameters. Temperature variations affect the amount of dissolved oxygen in the water bodies and results in unstable quality parameters. The change in dissolved solvents and the ionic concentration alters the electrical conductivity of the water and the increased concentration of salts also results in turbidity. The data from all the sensors are processed by the microcontroller, transmitted, and displayed in a mobile application comprehensible to the layman.


GRAPHICAL ABSTRACT INTRODUCTION
Damming is the main threat to aquatic biodiversity; however, economic contributions in terms of renewable energy, water hazard prevention, and protection of water supply engender to occlude the precious resource (Barbarossa et al. 2020). India has 2.45% of the world's surface area, 4% of the world's water resources, and around 16% of the world's people. In a year, the country receives roughly 4,000 cubic km of water from precipitation. The total amount of water available is 1,869 cubic km from surface water and replenishable groundwater. Only 60% of this is usable. In order to meet rapidly rising demand, surface water is being taken from dams and its quality is of high concern (Indian Reforms Initiatives in Water Sector 2002). Water quality has been defined as a measure of water suitability for a specific purpose based on physical, chemical, and biological parameters. The World Health Organization has described guidelines to assess water quality (WHO 2017). The water quality index has a great influence on the physical parameters present in the aquatic system, or the combination of physical and organic quantities, or inorganic substances present in water, and the hazardous wastes from the industries as well (Vadde et al. 2018;Son et al. 2020). The parametric fluctuations in temperature, pH, and turbidity characterize the utilization of drinking water and domestic water. Hence water quality is defined as a parameter specific to the user by the scope of the aforementioned factors. Manual interventions have degraded the water quality index to a greater extend (Leong et al. 2018). Although there exist various quality measurement systems, effective and efficient monitoring has always been a question for the past several years. This spurs the user and the designer to propose new measurement techniques to monitor a safe grade for water for consumption. The recent developments have given an insight into quality measurement equipment but lack the accuracy and precision of the measurement setup (Park et al. 2020). When water quality is disturbed it alters the surroundings of the natural habitat including humans. Among the physical properties, the most significant are temperature and turbidity. The other parameters like density, viscosity, surface tension, and pressure are least discussed due to their lesser or no effect on the ecosystem. The chemical properties of water include pH, conductivity, toxicity, salinity, and dissolved oxygen content. The hydrogen ion concentration otherwise termed as pH determines the acidic or basic condition of the water. An unstable pH can alter the chemical and microbiological aspects of water, resulting in a variation in other water quality parameters. A strong acid or base concentration induces high chemical reactions that affect other parameters like conductivity and salinity. The water distribution systems are the primary source of the supply of low-quality water. Hence a technique to measure the parameters at the distributor end has great significance in these context. Rural populations often restrict their approach a quality lab to test the water before consumption. They often check the color of the water to analyze the purity or clearness of the water, referred as turbidity. In this regard, the study primarily aims to develop a sensor array to monitor the reservoir water turbidity at various depths. The water from a reservoir is stored in a public water tank which has a central distribution pipeline before local supplying water to the households.
Turbidity recognition assumes a significant research area in water science; the conventional turbidity monitoring techniques have several limitations in parts of cost, convenience, and space-time inclusion. In light of the above reasons, scientists are given to creating picture-based turbidity location techniques as a correlative or even option in contrast to the conventional turbidity identification strategy. The advancements in wireless sensor networks and the internet of things have created a high impact on technological innovations in the water sector . The constraints in selecting an LED with a particular wavelength limit the usage of such systems, irrespective of the advantages. Apart from the wireless technologies, remote sensing and microwave sensing have also paved the way for efficient monitoring online compared with manual measurements (Alparslan et al. 2010;Bresciani et al. 2019;Ameur et al. 2019;Zhang et al. 2019). Gholizadeh et al. (2016) reviewed several strategies of measurements and gave an insight into various methods adopted considering the cost, flexibility, and complexity of the sensor development, its usage, and interpretation. Damming results in adverse quality conditions for aquatic life (Scott Winton et al. 2019). Although dams are built to develop a stable ecosystem economically and practically, serious impacts are yet to be considered. Nutrient-based monitoring has also been marked in estimating quality. The biological changes and their understanding are highly needed for such a study (Kashefi Alasl et al. 2012). The discussions on the sensors gradually resulted in cost-effective and efficient sensors for quality parameter measurement. The significant impact of turbidity clearly addresses the need for low-cost devices. Srivastava et al. (2018) has illustrated a smartphone-based sensor setup for quality measurement; usage of ANN for prediction of water quality index is praiseworthy. However, the work focused on a smart sensor meter that collects water samples from the surface rather than downstream. Early findings on suspended solid transports and turbidity analysis (Langeveld et al. 2005) aids the researchers in modeling an efficient water management system. Studies of specific water bodies would enhance the understanding of urban usage and prevention of various hazards found today by degraded water consumption and use (Lkr et al. 2020), (Pujar et al. 2020). The literature clearly shows that most studies have focussed on the offline method of data collection for quality analysis primarily in the river basins and catchment areas (Olsen et al. 2012). The sample collection at various depths is rarely discussed. Although image processing and remote sensing are used, it requires sophisticated sensors and equipment to be installed at the site (Ignatius & Rasmussen 2016). These have led to a need for a new method for data collection and monitoring of water quality parameters. An integrated approach for connecting sensors for pH, temperature and conductivity at the distribution end will aid the local authorities to monitor water quality before consumption, ensuring a healthy society. Accordingly, the objective of the research could be highlighted in two sections: the first investigation was to measure the purity of water in the dam at various depths and second to monitor the water quality parameters at the distributor end. The work focussed on developing a prototype of integrating sensors for real time dam water quality analysis. In this, the array of sensors were placed along the walls of the reservoir. The downstream water outlet was opened to a distribution canal, which further was stored in the public tank before supplying to local households. The turbidity data from the sensor array and pH, conductivity and temperature data from the integrated sensors at the distribution system were fed to the microcontroller for further processing. The measured data were transmitted through a wireless network to a mobile display. The overall picture of the prototype is depicted in Figure 1.

METHODOLOGY
The measurement and intimation of parameters such as turbidity, pH and conductivity help to ensure that the water is good for drinking purposes (Bhardwaj 2005). The prototype consists of water quality sensors and wireless communication devices resulting in a water quality monitoring system. Conductivity is the ability of water to conduct current which is also an indicator of total dissolved solids. The ionic strength enables the solution to conduct and there arises a potential that could be measured in terms of voltage. The presence of minerals, soluble and insoluble salts and other organic matter causes ionic strength to vary and thereby conductivity. The principle of any conductivity sensor is Ohm's law; an alternating current applied to the measuring electrodes gives rise to a change in impedance across the electrodes which changes with the conductivity. The circuit consists of an amplifier and a conversion unit to read the potential difference between the electrodes. The sensitivity of the electrodes depends on the electrode material and the efficiency of the amplifier (Rodríguez-Rodríguez et al. 2018). pH is termed as the measurement of acidity or alkalinity of drinking water. A glass electrode is used for the measurement of pH. The allowable pH range is 6.5-8.5. Due to the limitations of developing a complex glass insulator and ion-selective membrane, a commercially available pH sensor is used for a better outcome. The sensor consists of an integrated two-electrode setup and an analog readout module. The chemical and biological nature of aquatic systems is highly dependent on the thermal conditions of the water. Temperature variations affect the amount of dissolved oxygen in the water bodies which results in unstable quality parameters. Hence temperature monitoring is essential in any water quality measurement system. LM35 temperature sensor is used to monitor the temperature. The measurement of these quantities in the distribution system helps in ensuring the quality at the distributor end. The individual sensors were tested and calibrated before the integration and Corrected Proof incorporation into the distributor system. The reservoir (experimental dam setup) understudy contributes water to local panchayats, municipalities and towns as well. The work focussed on the pre-monitoring of quality parameters before consumption and hence the distributor pipelines are equipped with sensors as depicted in the block diagram. As stated, the primary objective is to determine the dam water quality, in which turbidity plays a significant role. Depending on the reservoir's geographical condition, the turbidity changes. It also influences the chemical and biological factors as well. In addition, the sediment bed underneath and the turbulent flow at the penstock also affect quality to a greater extent (Tundu et al. 2018). Turbidity is the shadiness or cloudiness of a liquid brought about by vast quantities of different individual particles that are commonly undetectable to the naked eye. Estimation of turbidity in drinking water is a must for the need for clean water. Liquids can contain suspended strong materials comprised of particles of various sizes. While some suspended material will be sufficiently huge and sufficiently substantial to settle quickly to the bottom of the compartment if fluid is left to stand, small particles will settle, also if the particles are relocated due to any factors or the particles are colloidal (Soros et al. 2019). These small strong particles cause the fluid to seem turbid. The turbid properties of water can be more easily seen than measuring the voltage across it. Although turbidity is a result of soluble and insoluble materials and has an ionic strength and polarity, the results could be confusing for conductivity. Both conductivity and turbidity are not the same, as the former represents the physical property of water whereas the latter is the chemical. Hence the measurement of clearness was performed using the optical method rather than potentiometry.
The sensor array denoted as S 1 …S n ….S m ….S x is fixed to the reservoir walls and is used to measure turbidity at various depths of the reservoir. The sensors for pH, conductivity and temperature are fixed to the distribution pipeline. This will ensure the quality measurement at the distribution end before dispensing water to the public. The data from sensor array and integrated sensor module are fed to the Arduino microcontroller, and are further transmitted through a wireless system comprising of a Bluetooth module or a Wi-Fi network depending on the distance from transmitter to receiver for wireless data transmission. The measured data from the wireless receiver are given to a mobile display through an application. The block diagram of the prototype is illustrated in Figure 2.
The work includes the development of a Turbidity Sensor and fixing the sensors in different water levels. The authors have carried out the experimental analysis of groundwater quantity measurement. Although the recharging rate of an aquifer can be monitored, the quality of water in the aquifer is always an important question. An Corrected Proof array of turbidity sensors are fixed to the wall of the dam, whose measurement voltages are fed to the ESP32 microcontroller chip using the Arduino Integrated Development Environment (IDE) setup. The Arduino Uno is then interfaced with the Bluetooth module HC-05. The measured output is then sent to a mobile using Bluetooth. The setup is fixed in the dam to measure the turbidity in different levels of dam. The device measures the parameter Turbidity and the message is sent to the mobile Application continuously. Similarly, the parameters as conductivity, pH and temperature were also measured at the distributor pipeline. These outputs are also analog voltages and are send to Bluetooth via an ESP32-Arduino microcontroller interface. The wireless network (Wi-Fi) module can also be used to transmit the data to a mobile application. The measurement of these quantities in the distribution system helps in ensuring the quality at the distributor end.

RESULTS AND DISCUSSION
Conductivity is the measure of the suspended particles in the water. When salts and other organic particles dissolve in water, they break down into tiny charge carriers called ions. This conducts electric current and is termed conductivity. The conductivity sensor was developed as shown in Figure 3, using a simple circuit that comprises an oscillator, differential amplifier, filter, and rectifier to give analog DC output voltages. The oscillator is used to convert the resistance offered by the liquid (or otherwise termed as electrical conductivity) to a voltage depending on the frequency of oscillation. The voltage measured across the probe was small and hence a high gain differential amplifier was equipped together with a low pass filter to attenuate low frequency noise. To convert AC voltages to constant DC voltage, the rectifier was incorporated. Any output voltage fluctuations was eliminated using a regulator.
In comparison with the standard device, the conductivity varies concerning the solute concentration. Table 1 illustrates the calibration of conductivity meter with the standard sensor. The calibration response of the standard meter and developed sensor is illustrated in Figure 4. The samples with various concentrations were prepared constituting sand conc1, sand conc 2, etc. Here, 2 mg of sand was mixed with 10 mL of distilled water for calibration of the sensor. Similarly each sand concentration was produced by increasing the weight of the sand by two-fold and keeping the liquid level constant at 10 mL. The standard meter reads the conductivity in milli Siemens (mS). The conductivity sensor circuit developed reads the voltage (millivolt) at the output probe. The conductivity of CaCo 3 seems to be a false-negative value. The electric charge of the compound varies with the surface in contact. The greater the conductivity, for an aquifer rich in mineral deposition and less conductive if the carbonate is mixed with distilled water. This is because the chemical properties of calcium carbonate do not exist if it is dissolved in the solution (Giammaria & Lefferts 2019;Mangal et al. 2021) Except for carbonates, all other concentrations gave a satisfactory response with the standard device. The calibration gives a linear relationship of electrical conductivity in mV and conductivity in mS using a standard device which was used in measurements.

Corrected Proof
The development of a pH sensor of high accuracy requires much cost and time. A gravity analog pH sensor was used for this purpose. The sensor was then calibrated with the standard analog pH meter for precision for various samples. The various constituents of samples were taken for study and calibration. Sixteen samples were taken for acid and alkaline tests. However the concentration of the 32 samples varied and thus these were termed as S1, S2, and so on. After each measurement, the sensor was measured with a neutral solution before the next measurement to ensure precision and accuracy. pH was measured in accordance with the pH scale and hence no units. pH scale reads the solution as acidic if pH falls between 0 and 7 and designates the solution as basic if the pH falls between 7 and 14. The LM35 temperature sensor was also calibrated and integrated into the measurement setup. Here, 32 samples of unknown concentration were analysed and pH was measured and was compared with a standard pH meter. It can be observed that the standard meter measured the acidic or basic solution precisely whereas the used sensor read uncertainly. However, when calibrated with a standard, the pH sensor also was found to have a relationship and was used for further analysis. Table 2 depicts the calibration of pH meter with a standard meter under three pH conditions such as acidic, basic and buffer solution.
The water quality parameters were measured and transmitted through a ESP32 Wi-Fi module to a mobile display. ESP32 was used due to its advantages over other interfaces in handling high power, efficiency and bandwidth. The speed of the processor and the Wi-Fi signal range was also pretty good compared with other devices (Foltýnek et al. 2019). The HC-05 is a flexible module that can include two-way (full-duplex) remote usefulness. One can utilize the module to impart between two microcontrollers such as Arduino or speak to any gadget with Bluetooth usefulness such as a phone or laptop ( Jacob et al. 2015). Numerous android applications are as of now accessible, which makes the procedure much simpler. The sensors were integrated into one T-shaped pipe which was assumed to be the distribution line of the reservoir. The integration of sensors and interfacing of these sensors with Arduino Uno is illustrated in Figure 5. The sensors were placed on a T-shaped groove   Corrected Proof made on the distribution pipeline and the sensor data were read using the Arduino controller for processing and mobile application display. A turbidity sensor was developed using a simple light-emitting diode photodiode-based optic sensor. An LED is a semiconductor light source that radiates light when current is passed through it. Electrons in the semiconductor  recombine with electron openings, liberating photons. This phenomenon is referred to as electroluminescence.
The photons, otherwise termed as emitted light, are controlled by the energy required for electrons to cross the band gap of the semiconductor. A photodiode is a semiconductor device that converts light into an electrical current. The absorption of light by photons generates a current. Photodiodes may contain optical channels, worked in focal points and may have very large or small surface territories. Photodiodes for the most part have a slower reaction time based on their surface territory increments. The turbid water was placed between the photodiode and LED, the clearness   of the liquid determines the amount of light transmitted and reflected. This is read as an analog voltage at the end of the differential amplifier, the voltage measured is then calibrated with the standard turbidity meter to obtain the nephelometric turbidity units (NTU). The schematic of the turbidity sensor and the developed sensor is depicted in Figures 6 and 7. The output voltage from the turbidity circuit is measured in mV. The standard turbidity meter measures the turbidity in terms of NTU. The same samples for conductivity were taken for turbidity analysis. Table 3 shows the calibration of turbidity sensor with the standard turbidity meter. The calibration response of the turbidity   Corrected Proof meter is depicted in Figure 8. The turbidity increases, conductivity increases and the ionic strength of the solution varies.
The sensor measures the parameter and gives the analog output to Arduino Uno. The setup is fixed to the dam water whose turbidity has to be measured. The prototype model was initially developed for a miniaturized dam in a test tube, and thereby physical constraints were not addressed. However, the geotechnical features of the dam also have to be studied (Alparslan et al. 2010;Koszelnik et al. 2018). The flow of water in the dam depends on the sediment bed, density of water and volume of the reservoir. The assumed turbidity in a reservoir is illustrated in Figure 9. Due to the presence of sediment deposits at the bottom, the lower area is more turbid than at the top of the reservoir. To interpret the effect, the sensors were kept at two different heights and the voltage was measured. A significant change in the output voltage was found with changes in turbidity as shown in Figure 10.
The integration of five turbidity sensors was done in a test tube before the prototype measurement. Referring to Figure 11, the sensors read the output voltage through the serial data monitor of the Arduino board, which is then interfaced with the HC05 Bluetooth module to the mobile application display unit (Figure 12).

Corrected Proof
The prototype was further developed into a model with five sensor arrays at different positions mounted on an aluminium rod that fits a dam experimental setup in the laboratory. Irrespective of the structure of the dam, the results were similar to that of the setup made out of a test tube (Figure 13). The studies were performed on different sediment levels and dam structures. Analysis showed that the sediment bed in the dam restricts the voltage acquisition at the bottom level of the dam. Hence a tank setup was used as a dam model without many sediment deposits.
The experiment was conducted in a cylindrical tank of 2 m high and sensors placed as an array at an irregular distance. The bottom of the tank was assumed to have higher sediment deposits than the top layers of water. Hence the sensors were placed closer towards the bottom of the tank and far away at ascending water levels. The demonstration of the distributor pipeline to the reservoir setup with tank and the sensors is illustrated in Figure 14. The integration of sensors for quality measurement is thus comprised of an Arduino Uno microcontroller, sensors, array of sensors, Bluetooth module and mobile application display.

CONCLUSIONS
Guaranteeing a safe water management system and a healthy society, a prototype was designed and developed using low-cost sensors for an effective water quality analysis of a dam. While water quality is addressed as a serious concern in the current domain, many experiments and much research has been carried out around the globe. An approach to assess water quality at various depths was presented in this study. Given the implications of recent research, the study can be concluded as follows.
(1) The water quality in terms of turbidity is measured at various depths of a reservoir to comprehend the sedimentation effect and presence of dissolved matters in the lower level of the reservoir. Depending on the clearness of water the sensor voltage changes were fed to the processor for continuous online monitoring.
The sensor developed utilises a low-cost simple electric circuit that is more affordable than using complex remote sensing and other image processing algorithms. The sensor array was fixed at various depths in the dam and data were transferred serially to the processor for measurement. (2) Subsequently, the water from the reservoir was stored in public tanks before distribution to the local households. Generally, the presence of impure water through a central pipeline will affect the entire houses consuming water from the same source. Hence monitoring the water quality before distribution can help the authorities to act, consequently without affecting the local public on a large scale. Basic parameters such as pH, temperature, and conductivity are measured from the distributor line and were fed to the processor for further analysis. (3) The work focussed on developing a prototype for the integration of sensors for measuring turbidity at various depths and monitoring pH, conductivity, and temperature before distribution for domestic and irrigation.
Future research can be extended to a real-time scenario in which the sensor array is fixed to the reservoir at several meters depth and a huge diameter distribution pipeline. The effectiveness and suitability of sensors would be a challenging task, as the pressure and flow of the reservoir is tremendous. However, the complexity of the sensor development and interfacing would not be a serious problem owing to easy installation for better quality analysis.

DATA AVAILABILITY STATEMENT
All relevant data are included in the paper or its Supplementary Information.