Multiparametric System for Measuring Physicochemical Variables Associated to Water Quality Based on the Arduino Platform

Traditionally, the estimation of water quality is realized through laboratory analysis which is time-consuming and requires specialized installations, equipment, and personnel. Nowadays, it is possible to make real-time water monitoring through electrochemical sensors, microcontrollers, and central processing units to detect water pollutants. This work proposes a system based on the Arduino platform for monitoring parameters associated with water quality, such as oxidation-reduction potential, pH, total dissolved solids, turbidity, temperature, electrical conductivity, and dissolved oxygen. A critical criterion for the sensor selection was its cost and availability, resulting in sensors from different companies. They were integrated without much complexity, thanks to the selected platform. In addition, a proposal is made for a signal conditioning circuit for the oxidation-reduction potential electrode. A stage of filtering is added to the pH and turbidity commercial circuits to improve their performance. Remote access to the data is done through a mini-PC with WIFI connectivity and a MySQL database. All the sensors were calibrated with reference solutions or against other commercial meters. Through the proposed system, time series having a sampling period of 20 s of all parameters were recorded for more than a week-long exhibiting circadian patterns for the same water sample. Pearson correlation for the parameters was carried on. The results show that the system successfully monitored the seven physicochemical variables through low-cost sensors. It also has remote access capabilities.


I. INTRODUCTION
Water is a vital resource for terrestrial and aquatic ecosystems. Anthropogenic activities and natural phenomena produce unwanted chemical, physical and biological The associate editor coordinating the review of this manuscript and approving it for publication was Ilaria de Munari . changes, which alter the equilibrium of these ecosystems. Traditionally, chemical analysis of several biological and physicochemical parameters provides quantitative data related to water quality. In situ and real-time water quality monitoring is a complex and costly task to achieve by this approach. Because they usually require specialized laboratories and time-consuming experiments. Sensor monitoring of physicochemical parameters is an alternative for estimating the water quality and might complement the laboratory analysis of water.
References [1], [2] suggest the recommended physicochemical parameters which should be monitoring for estimating water quality because they are closely related to biological and chemical pollutants. These are the oxidation-reductionpotential (ORP), temperature, pH, electrical conductivity, dissolved oxygen, turbidity, free residual chlorine, and nitrates. Measuring nitrates and free residual chlorine with sensors is costly and requires frequent calibration [1], [2]. Therefore, they are usually not considered in most proposals to estimate water quality based on electrochemical sensors.
High values of ORP in water mean that its oxygen content is high, and degradation of pollutants is more efficient. The ORP units are mV. The temperature influences the rate of the reactions, the response of most physicochemical parameters, and the rate of biological activity. The electrical conductivity provides a measure of the ions present in water. It is related to variables as salinity. The dissolved oxygen in water is essential for most aquatic animals, and a low value might be present in waters with high algae concentrations.
Availability of cost-effective systems for remote monitoring in real-time parameters associated with water quality is possible because the market offers an ample variety of sensors, electronics boards based on microcontrollers, small-size computers with Internet capabilities. Their mass production might help administrate better this invaluable resource.
Water is an essential resource for human beings; for this reason, there is an extensive research community offering solutions for monitoring water quality parameters in realtime. For example, O'Flynn et al. were one of the pioneers of the development of a wireless sensor network for measuring water quality parameters like temperature, depth, pH, temperature, conductivity, and phosphates [3]. They reported 14 days of records for the River Lee in Cork. The Reference [1] proposed a system for measuring Turbidity, ORP, pH, Electrical Conductivity, and Temperature based on the sensors of SensoreX Corp with their respective signal conditioning circuits. Their design offers remoting sensing capabilities through an RF Xbee transceiver module sending water quality data every 5s. The central node corresponds to an ARM/Linux-based system. Reference [2] reported a prototype for real-time monitoring of water quality. This work provides the design of signal conditioning circuits for sensing water flow, temperature, electrical conductivity, pH, and ORP. They used ZigBee technology for their wireless communication. The logic level of the signal conditioning circuits proposed in this work corresponds to 3.3 V, which is not the standard level employed in most Arduino boards.
Other works related to this topic include the measurement of pH and conductivity with embedded microsensors [4]. Gopavanitha and Nagaraju have shown a water quality monitoring prototype based on a Raspberry PI with temperature, conductivity, pH, turbidity, flow, sensors, and solenoid valves connected directly to the single-board computer general purpose input/output (GPIO) [5]. They showed a print screen of the system accessed from a mobile device. Reference [6] reported a potentiostat and a Bluetooth transceiver shield and electrochemical sensors of pH, free chlorine, and temperature, all of them are attached to an Arduino board for measuring water samples.
This work proposes a system for measuring seven parameters related to water quality. The Arduino platform is suitable for developing prototypes because its hardware and software are open and free. Also, a large active community develops software and hardware for this microcontroller, making it cost-effective for several applications. Because there are just a few options for getting commercial low-cost ORP signal conditioning circuits (SCC), in this work, there is a proposal for solving this drawback. The components chosen in this work are from different companies, although some provide analog signals. Others offer digital signals, which communicate with different protocols such as the serial peripheral interface (SPI), and the inter-integrated circuit, eye-squared-C (I 2 C). It is demonstrated that the Arduino platform permits the integration of all the selected sensors without much complexity. Remote access to the data is done through a mini-PC with WIFI connectivity and a MySQL database. The organization of the document is the following: The section on material and methods includes a description of the sensors and the electrical connections of the signal conditioning circuits. This section also explains the proposal of the ORP SCC and describes the software and connectivity of the system. The results section includes the electrical characterization of the ORP SCC, the calibration results, and a time series of the system. The latter part of the document covers the conclusions, acknowledgments, and bibliography. Fig. 1 shows the block diagram of the system architecture. pH, ORP, turbidity, and total dissolved solids (TDS) sensors provide an analog output read by an analog to digital converter (ADC). A 16-bit-ADC module increases the resolution of 10 bits offered by the Arduino Mega native ADC. The temperature sensor is based on a commercial signal conditioning circuit communicated to the Arduino board through the SPI protocol. The electric conductivity (EC) and the dissolved oxygen (DO) use the I 2 C protocol to establish communication with the microcontroller unit (MCU). The user interacts with a graphical user interface (GUI) written in the programming language of C# to decide how many parameters are read by the system. A fixed sampling rate t s = 20 s is exclusively employed. The C# software incorporates the connector/NET program to provide the option to store the information in a MySQL database. It also can save the data on a cloud storage service like Dropbox.

A. ORP SENSOR
ORP sensing provides meaningful information in water quality measurements. Its value is an indicator of the water disinfection efficiency in industrial and domestic processes [13]. ORP is an electrochemical parameter that is measured similarly to pH, but the electrode uses a noble metal as a measurement element [14]. ORP measurements do not require temperature compensation, and most commercial electrodes are rated to work from −2000 to 2000 mV [1], [2], [14]. In the particular case of the ORP sensors, there aren't many low-cost options in the market for buying the sensor and the signal conditioning circuit together. The latter is a requirement of the microcontroller for acquiring the sensor signal. For this reason, a proposal for an ORP signal conditioning circuit is presented.

1) ORP SIGNAL CONDITIONING CIRCUIT
Reference [1] reported the first stage of an ORP signal conditioning circuit. Cloete and co-workers made an analog circuit, which required to work in the voltage range of 0 to 3.3 V, which was a restriction imposed for the microcontroller board that they employed [2]. In this work, a different circuit is proposed to use the voltage range of the ADC of most popular models of Arduino microcontrollers as the Uno, Mega, and Nano, which read analog signals from 0 to 5 V. Fig. 2 shows the schematic diagram of the proposed ORP signal conditioning circuit. It has four stages. At first, a DC-DC converter AM1D-0505DZ chip provides dual voltage supply at −V s = −5 V and V s = 5 V, when it is powered with a single power supply of 5 V. This circuit powers the op amp's labeled as U 1 , U 2 , and U 3 , which correspond to the same type of op amp, whose part number is the LMC6041. This integrated circuit has a very high typical input resistance, greater than 10 T , and low current consumption of the order of 14 µA. U 1 is configured as a voltage follower. The signal coming from this circuit is filtered with a three-pole low-pass filter having a unity gain and a cutoff frequency of f c = 10 Hz, which is suitable for this application considering that the sampling frequency f s of the overall system is less than 1 Hz. The last stage of the circuit consists of a summing circuit with a unity gain. The output signal of the filter may vary from −2000 to 2000 mV. It requires a voltage adapter circuit to make it compatible with the voltage of the microcontroller ADC, whose working range goes from 0 to 5 V. Thus, A signal of 2.5 V provided by the voltage reference LM336-2.5 V is added to the electrode signal as a DC offset signal. The output signal of the circuit v out is in the voltage range from 0.5 V to 4.5 V. The value of ORP in volts corresponds to v out − 2.5. In the system, the software does this arithmetic operation.
In the voltage follower, the input voltage coming from the electrode is equal to the op-amp output. The three-pole lowpass filter is composed of a passive first-order unity gain low-pass filter cascaded with a second-order unity gain filter having a Sallen Key topology [15]. Its transfer function H (s) is given by where s is the complex frequency given by j f f c , at which f stands for the frequency in Hz. The filter coefficients of Eq. (1) are given by where ω c = 2π f c and the subscripts stand for the value of the component. In the circuit all the resistors are in k and all the capacitors are in nF. and Having f c = 10 Hz, the coefficients after substituting their respective component values are given by a 1 = 1.3823 s, a 2 = 0.4747 s, and b 2 = 0.6123 s −2 .
The summing circuit with a unity gain [16], with the proposed component values has an output v out given by where v in is the signal coming from the filter, which may vary from −2000 to 2000 mV, and the voltage reference LM2336-2.5 provides v ref = 2500 mV. Therefore, the circuit has an output from 500 mV to 4500 mV, assuring compatibility with the Arduino's ADC.

B. pH SENSOR
The pH electrodes follow a linear transfer function known as Nernst equation [6], [8], [14], [17], [18]. pH sensitivity is sensor dependent, but at 25 • C its value is around 59 mV/pH [17], [18]. Some reported values on the literature are 57 mV/pH, 59.14, and 59.18 mV/pH in the references [6], [8], [14]; respectively. Considering the sensitivity of 59 mV/pH a very strong acid with pH 0 will create a potential in the electrode of 413 mV. For a very strong base with pH 14 the voltage will correspond to −414 mV. pH measurement requires temperature compensation. Reference [2] reported an equation which corrects this effect. The compensated pH value pH c is given by where pH is the pH read value, pH 0 is the central value given by 7, T is the temperature in • C, and T 0 is the central temperature of 25 • C. Fig. 3 shows the block diagram of the pH signal conditioning circuit, which reads the signal coming from a generic pH electrode with a Bayonet Neill-Concelman (BNC) connector. The SCC is a commercial circuit from DIY MORE model PH-4502C having an analog output (PO) and works in the temperature range from −10 to 50 • C. Terminal labeled as TO provides an analog signal for temperature compensating the pH, having a soldered sensor directly in the printed board circuit (PCB) of the SCC. DO is a digital output whose threshold is modified with a potentiometer. The TO pin was left unconnected to the system because the temperature sensor didn't contact the water. v out is the terminal connected to the ADC. The addition of a three-pole low-pass filter having a cut-off frequency of 5 Hz attenuated high-frequency noise. U1 corresponds to the TLV2472 op amp.

C. TDS SENSOR
TDS provides a measure of the water salinity, and it is related to the EC of water [19]. Inorganic salts are the main contributors to TDS, and a small contribution is due to inorganic matter. Its measurement helps to identify the intrusion of seawater in groundwater. Recently, cheap SCC and sensors based on the same design for measuring TDS with microcontroller boards are available from some distributors as gravity,  keyestudio, and others. These measure up to 1000 pm. Higher values are unsafe for human consumption. Fig. 4 shows the block diagram with the electrical connections for TDS measuring with the Keyestudio module. It has an analog output A, linearly correlated to TDS ranging from 0 to 2.3 V. v out is wired to one of the ADC inputs.
Turbidity is an optical property describing how much light is scattered or absorbed for a water sample [20]. The most complex and precise turbidimeters measure light at two configurations. An infrared (IR) light source, like a light-emitting diode (LED), sends light into a water sample. One IR optical detector located in a straight line to the IR source (180 • ) measures light coming from it. The other IR detector is perpendicular to the straight-line trajectory of light (90 • ) [1], [21], [22]. The great majority of the inexpensive turbidimeters measure this parameter with the configuration of one photodetector [23]- [27].
There are low-cost commercial options if there is no need to measure turbidity with very high accuracy or when its value is less than 1000 NTU. For example, the Robot Gravity turbidity sensor and the TS-300B sensor [28]. The signal output v out is in the voltage interval of 0 − 4.5 V, which suits well with the ADC range of the Arduino Mega. Also, it incorporates a digital signal (DO) whose threshold is controlled with a potentiometer. The addition of a threepole low-pass filter having a cut-off frequency of 5 Hz attenuated high-frequency noise. U1 corresponds to the TLV2472 op amp.

D. 16-BIT ADC
The Arduino Mega has an ADC of 10 bits. Incorporating the module ADS1115 from Adafruit, having a 16-bit ADC with a programmable gain amplifier improves the system VOLUME 10, 2022 resolution. This chip works in reference single-ended (RSE) or differential modes. Fig. 6 shows the wiring of the circuit. The way of operation selected for this application is RSE for acquiring the analog signals from the SCC's of pH, ORP, turbidity, and TDS. The chip operated at the default gain of 2/3 corresponding to a resolution of 0.1875 mV. The SDA and the SCL terminals are connected to the digital pin terminals 20 and 21 of the Arduino Mega, respectively.
The temperature may be measure with different waterproof versions of the sensors like the DS18B20 [29], thermistor [2], LM35, or an RTD sensor. We implemented the latter option with a PT100 RTD temperature sensor amplifier from Adafruit and a 3-wire PT100 sensor. Fig. 7 shows the electrical connections of the SCC circuit. Some terminals require soldering according to the number of wires of the RTD. For a three-wire sensor, the jumper labeled as 2/3 are in shortcircuit. The jumpers appearing above the component labeled as Rref of the physical circuit, labeled as 2 and 4, are in open-circuit, and the jumpers 4 and 3 are in short-circuit. The resistance between a pair of wires is around 102 or 2 . The lowest resistance pair of cables are connected to the terminals labeled as RTD+ and F+, and the last wire is attached to the terminal labeled as RTD−. F− is unconnected. The SCC communicates to the Arduino through the SPI protocol. The connectors CLK, SDO, SDI, and CS, are wire to the digital inputs 13, 12, 11, and 10 of the microcontroller board, respectively.

E. DISSOLVED OXYGEN AND ELECTRIC CONDUCTIVITY SENSORS
Dissolved oxygen provides the magnitude of the oxygen gas dissolved in water. Of course, its value is vital for living aquatic organisms. High temperature reduces the dissolved oxygen in the water. Reference [1] suggested this parameter as the one of the most important to be measured for estimating water quality. There are few sensor options for measuring this variable having the support for the Arduino platform. The company Atlas Scientific offers a DO probe with an SCC circuit. The sensor generates a voltage from 0 to 47 mV in terms of oxygen saturation.
The electrical conductivity is another parameter important for water quality [1]. The sensor consists of two electrodes separated for a fixed distance and describing a constant surface area. Both parameters determine the K constant of the sensor. In this work, the conductivity probe K 10 of Atlas Scientific with its SCC circuit is used. This measures EC in the range from 10 µS to 1 S.
Using at the same time, the DO and EC sensors of Atlas Scientific require the insertion of the EZO inline voltage isolator (BE-IVI) from the same company. Fig. 8(a) shows the electrical connections of the SCC circuit and the BE-IVI for the DO sensor, while Fig. 8(b) shows the block diagram and the electrical wiring of the EC sensor. Serial and I 2 C communication protocols are available for transferring information to the microcontroller board. The latter protocol requires external resistors of 4.7 k between the power supply at +5 V and the terminals connected to the inputs 20 and 21 of the Arduino.

F. ARDUINO PLATFORM
The Arduino platform offers several options to develop prototypes due to its large community, which provides many hardware and software solutions. In essence, the function of the microcontroller board consists of reading the signals coming from the sensors for sending them to the serial port. Fig. 9 shows the flowchart of the operation of the Arduino program. It starts by waiting for the information having the variables to be read from the serial port. Establishing them  permits the measuring of the signals of the different sensors. This task is repeated in a loop until a stop signal send by the user through the serial port is received. Sensor values are printed in the serial port at a sampling time of t s = 20 s. Another program written in C# read the signals coming from the Arduino.
A further explanation of the Arduino program is realized in Appendix.

G. CENTRAL PROCESSING UNIT (CPU) AND GRAPHICAL USER INTERFACE (GUI)
A mini PC does the system's central processing. A MINIS FORUM mini computer model Z83-F was employed. It has a quad-core Intel Atom processor, 4 GB of RAM, an integrated Wi-Fi antenna, and SO Windows 10 Pro. The system GUI  corresponds to a Windows Form of the NET Framework written in the C# programming language using Visual Studio as an IDE. Fig. 10 shows the main window of the system GUI. The user has the option to select which variables will be measured. The operation menu establishes a continuous measurement or another that runs until the user press the stop button. There is an option for storing the data exclusively on the hard drive and another for saving it in a MySQL database. The organization of the GUI is through tabs; the main window displays the last acquired values. The rest show the plot of each measured variable and its basic statistics. Fig. 11 depicts the temporal evolution of the ORP. Fig. 12 shows the flow diagram of the GUI. It starts by giving the user the option to select the parameters to be measured, sending them to the serial port. Under a serial port interruption, the microcontroller board reads this instruction and takes the corresponding values. The Arduino board sends back the data to the serial port. The C# program consults this information to display them in the main window. A generation of the plots occurs in the corresponding window tab. The continuous reading option stores the data directly on the hard drive. Unchecking this option produces a temporal saving of data on an array. Enabling the database storage creates a connection to the database for sending queries instructing for information storing. The above process is continuous until pressing the stop button. If there is available data in the array, the user opts to save or discard it.  Fig. 13 shows the final integration of the system, and Fig. 14 shows the internal components of the electrical enclosure. An external 5 VDC power supply energizes the system. The microcontroller communicates to the mini-PC through a USB cable.

III. RESULTS AND DISCUSSION
This section presents the results of the sensor's calibration.

A. ORP SENSOR CALIBRATION
Electrical characterization of the circuit probed that the signal output of the SCC was restricted to the interval from 0.5 V to 4.5 V. The experiments consisted in injecting ten different harmonic signals into the circuit. Their amplitudes varied from 50 mVpp to 4 Vpp with a fixed frequency of 500 mHz. Fig. 15(a) shows the output signal obtained when a harmonic function of 1 Vpp was input into the SCC. The voltage reference introduced an offset of 2.5 V displacing the AC input signal vertically. A straighter waveforms comparison required the removal of the DC component of the output signal, as Fig. 15(b) shows. Fig. 15(b) shows a good agreement between the input and output waveforms. The offset had an average magnitude of 2.474 V with a standard deviation of 2 mV. There is no consensus on the most appropriate sampling period for real-time water quality monitoring. It can go from a few seconds to even minutes or hours [1], [2], [28]- [33]. In any case, the   filter of the SCC having the cut-off frequency of f c = 10 Hz reduces the amplitude of unwanted noise of 60 Hz. This stage of the circuit does not affect the amplitude, nor the phase of low-frequency signals, as Fig. 15 shows.
Three-pole low-pass filter of the SCC of ORP helps to reduce the high-frequency noise, as Fig. 16 shows. Bode plots were obtained with the Equation 1 and PSpice simulation. Experimental points confirmed the attenuation introduced by  the circuit having more agreement with the simulation than with the filter transfer function. However, in both cases, at a frequency of 20 Hz, there is an attenuation more significant than 10 dB. The slight disagreement might be due to the actual value of the components, which were different from their nominal magnitude. f c might be shifted to any other desired value by changing the values of the capacitors and the resistors of the filter.
Three-point calibration with 225, 256, and 470 mV reference solutions were made with two electrochemical electrodes and the commercial low-cost digital tester 169E ORP. All sensors presented a linear relationship between measured ORP and the calibration standards. One of the electrodes was from the company Gain Express Holdings Ltd (GE), and the other was the ORP industrial probe from Atlas Scientific TM (AS). Table 1 shows a summary of their main specifications. Fig. 17 shows the results of the three-point calibration for the sensors, where ORP cal stands for the reference solutions, the vertical axes correspond to the measured values. Fitting with a linear model explained the experimental data for all electrodes. Table 2 summarize the fitting coefficients. v ORP represents the ORP output in terms of the measured voltage v mea in Volts, r is the correlation coefficient, and RMSE is the root mean square error. Table 2 shows that the magnitude depends slightly on the electrode, but a linear relationship still stands in the GE and AS sensors. The low cost and the faster response to substance changes make the GE electrode a good choice for water monitoring.

B. pH SENSOR CALIBRATION
Reference solutions of pH 4, 6.86, and 9.18 were used to calibrate the pH sensor. Fig. 18 shows the electric potential read by the ADC in terms of pH. Fitting is better described    with a linear function. Table 3 shows the fitting coefficients, were v pH is the voltage of the SCC of pH.
Most calibrations for the pH sensor available after consulting tutorials on the web are carried on with the two-point calibration considering a linear relationship. This behavior  holds as well with the three-point calibration, as Fig. 18 shows.

C. TDS SENSOR CALIBRATION
The calibration of the sensor was made through two steps. The first consisted of considering a linear relationship between the measured voltage with the electrode v TDS , and the magnitude of two reference solutions of 500 ppm and 1000 ppm, given by TDS cal = 503.178 v TDS − 92.454. The second was a comparison between the calibrated values read by the sensor TDS v1 and the digital tester HMDAP1 AP-1 from AquaPro, referred to as TDS. A linear model explains the relationship between both readings, as Figure 19 shows. Table 4 shows the fitting coefficients.
Unfortunately, sensor specifications do not provide information on the relationship between voltage and TDS. Moreover, Wibowo and coworkers reported a parabolic relationship for an unspecified TDS sensor [34]. Nevertheless, by doing the calibration through two steps, we confirm a linear relationship between both variables, as Fig. 19 shows. A slight deviation of the data from the straight line is expected due to the sensor's resolution of ±10 ppm. It is worth mentioning that immersing in a reference solution of 2000 ppm produced saturation because it exceeded the sensor's range from 0-1000 ppm.

D. TURBIDITY SENSOR CALIBRATION
For doing the turbidity sensor calibration, it was prepared a few solutions with distilled water and a small amount of pine oil cleaner. NTUs of those samples were measured with a commercial Oakton T-100 Waterproof turbidimeter. Sample turbidity in terms of the output voltage of the sensor v tur was   fitted with a parabolic model having the equation turbidity = a 0 + a 1 v tur + a 2 v 2 tur as Figure 20 shows. Table 5 shows the fitting coefficients.
A parabolic fitting has also been reported in other turbidity sensors like the ones of Reference [28] but having an inverted curvature. Other aspects that must be accounted for when using the sensor are that the reading is influenced by ambient light. For this reason, it requires a protective case to block it, and the sensor cap made with high-density polyethylene is very difficult to seal, as reported in [28].

E. TEMPERATURE SENSOR CALIBRATION
Comparing the readings of a bulb thermometer with the ones of the RTD PT100 sensor was the way to calibrate the temperature sensor. Fig. 21 shows the linear model fitting both readings. Table 6 shows the coefficients of the linear least square method.   Fig. 21 shows a deviation of the experimental data from the straight-line relationship. In fact, in the application report SBAA275-June 2018 called ''A Basic Guide to RTD Measurements'' of Texas Instruments and in the MAX31865 datasheet, they expose a nonlinear behavior of the RTD resistance in terms of temperature, but in the region from 0 to 100 • C where readings are likely to be made they assume a linear relationship. The discrepancy between the model and the experimental points might be related to the length of the sensor 16 cm and the measured water volume of 19 L. On the one hand, the bulb thermometer provided a point measurement, which was not guaranteed with the other sonde. Also, water temperature gradients were likely to be present.

F. ELECTRICAL CONDUCTIVITY SENSOR CALIBRATION
Three-point calibration was carried on with reference solutions of 1.413, 12.88, and 150 mS, which were compared with the readings of the electrical conductivity sensor of Atlas Scientific. A straight line relationship fitted the experimental data with good agreement. Fig. 22 shows the behavior of both variables following the equation EC cal = a 0 + a 1 EC AS mS, where EC AS is the value read by the sensor in µS and the EC cal is the electrical conductivity of the solutions. Table 7 shows the fitting coefficients.
An additional calibration consisted of comparing the electric conductivity of a few solutions measured with the EC sensor and the commercial tester ExStik II EC500 from Extech company. Fig. 23 shows the linear fitting by the least square method of the readings of both sensors. The equation is given by EC ext = a 0 + a 1 EC AS_cal mS, where EC ext is the value of the tester and EC AS_cal is the magnitude of the sensor of Atlas Scientific after being linearly fitted with the coefficients of the Table 7. Table 8 shows the fitting coefficients of the last calibration.    Fig. 22 shows a good agreement between the AS sensor and the straight-line model. Fig. 23 does not show a perfect linear relationship. However, the slope of the model is very near to unity. The resolution of ±2% of both electrodes might cause some error.

G. DISSOLVED OXYGEN SENSOR CALIBRATION
The dissolved oxygen sensor was calibrated by comparing its readings with the Milwaukee MW600 PRO DO Meter. A fitting between both quantities follows the equation DO MW = a 0 + a 1 DO AS , where DO AS corresponds to the magnitude provided by the sensor of Atlas Scientific and DO MW is the measure of the commercial meter. Fig. 24 shows the experimental data and the linear fitting. Table 9 shows the coefficients of the model.
Cloete and colleagues avoided the measurement of dissolved oxygen due to cost, maintenance, and the requirement of frequent calibration [2]. During the performance of the experiments, a few minutes for reading stabilization was required in both sensors, and the uncertainty of the measurement shown in Fig. 24 in the AS sensor was not negligible. Nevertheless, the linear relationship in both readings shows good agreement.

H. TIME SERIES
The performance of the continuous monitoring systems might deteriorate by the loss of data, wrong readings, and stability in the sensor's readings. An experiment to test the system consisted of measuring seven physicochemical variables when the sensors were immersed in the same water sample for several days. An indoor fish tank was the recipient to place the sensors and the water. Fig. 25 shows the time series for the seven sensors; after they were calibrated with the equations shown above. The Figure shows the pH value with temperature compensation obtained through eq. (6). It is clear from the time series that all parameters follow a circadian pattern mostly influenced by temperature [35]. Even variables such as turbidity measured by optical means exhibit changes, most likely due to variations in the index of refraction. Erroneous readings in the system did not exceed 0.01% of all data.
The time series shown in Fig. 25 have a certain degree of relation. Plot correlation matrix using pandas through the built function pandas.DataFrame.corr was carried on to explore this feature more deeply. Fig. 25 shows the heatmap  of the correlation matrix using the Pearson method of the seven parameters produced through the data visualization library Seaborn of python. ORP exhibits poor correlation with most parameters, at a lesser degree with TDS and pH c , both having a negative trend also found in the ORP time series. pH c behaves similar to ORP, most likely because of its temperature compensation. TDS correlated favorably with almost all other parameters, and of course, it has a close relation with EC. The index of refraction depends on temperature; for this reason, it is not surprising the high correlation between turbidity and temperature. The latter parameter has a strong correlation with electric conductivity. DO has a high relation to Tu, EC, and Te.
An option offered by the system is the possibility of saving data in an Amazon Web Services (AWS) database. Fig. 27 shows the screen capture of the program MySQL Workbench where some records of the parameters were stored.

IV. CONCLUSION
This article shows the viability of developing a system to measure physicochemical variables associated with water quality under the Arduino platform. The parameters measured were ORP, pH, TDS, turbidity, temperature, electrical conductivity, and dissolved oxygen. A designed SCC for ORP exhibited an excellent electrical performance when it was excited with harmonic waves of different amplitudes. Data from this SCC in the frequency domain agreed with the PSpice simulation and the transfer function calculation. Two electrodes of different suppliers connected to this circuit displayed a linear relationship comparing their output signal against three reference solutions. Most sensors showed a linear response when compared with calibration solutions or other meters. However, turbidity was best fitted with a parabolic function. Time-series of all variables were recorded for a fixed water sample of more than a week-long with t s = 20 s. Most of them displayed a circadian pattern. Pearson correlation showed a high correlation among temperature, turbidity, electrical conductivity, and TDS. The microcontroller was controlled with a mini-PC with WIFI connectivity, which permitted the data storage in a database. Sensors' wrong readings were almost negligible on the time series. Overall the system exhibited a good performance with low-cost and readily available elements.

APPENDIX PSEUDOCODE FOR ARDUINO PROGRAM
A further explanation of the Arduino program is realized in the pseudocode shown below. VOLUME 10, 2022