Automatic Rainwater Quality Monitoring System Using Low-Cost Technology

: Water quality monitoring serves diverse purposes, such as assessing water safety for drinking or agriculture. However, traditional methods are often time-consuming and costly. Additionally, assessing water quality on demand is not always feasible, and parameter variations are not consistently documented. With the advent of affordable equipment capable of efficient performance with minimal resources, remote monitoring sans physical access to the environment has become viable. This has led to reduced inspection and control costs. Understanding the applications, characteristics, and limitations of these devices is crucial for maximizing their benefits. Rainwater quality remains understudied in many areas, leaving its physical, chemical, and microbiological conditions unknown. These conditions are influenced by various atmospheric factors, including both human and natural activities. This research paper develops monitoring stations employing low-cost technology to assess rainwater quality in Morelia City. A prototype was developed based on low-cost technology implementation. Additionally, basic parameters measured include pH, total dissolved solids, turbidity, and temperature, utilizing an Arduino microcontroller for data processing. Data collected from these stations are transmitted via a Wi-Fi communication module to a web platform, enabling real-time visualization of measurements both spatially and temporally. Utilizing such a device offers several advantages compared to standard methods of assessing rainwater quality. It enables continuous measurements and provides a record of how rainwater quality is affected over time by human and natural activities.


Introduction
Rainwater harvesting is becoming a popular practice in developed urban areas.It involves collecting and treating rainwater for domestic use, including drinking if properly treated.This practice has several benefits, such as flood prevention and conservation of water sources [1].One millimeter of rainfall per square meter is equivalent to one liter of water, indicating that the potential for rainwater harvesting is enormous.The use of rainwater as an alternative water source can help improve access to water for residents who lack reliable and efficient water supply, such as in the city of Morelia [2].The city's accelerated population growth towards the peripheries has created social, economic, and political issues regarding unequal access to water, the transience of service, contamination, poor infrastructure, and power dynamics over water [3].
The issues have spread to various sectors of the city, with the northern outskirts being one of the most affected areas, specifically the region known as La Aldea [4].In this locality, there are old and overly exploited wells that extract water from the intermediate flow at the depth of the water table, which is between 150 m and 160 m [5].Rainwater collected in catchment systems is often of lower quality and may not meet drinking water standards [6].
Another monitoring kit for water quality parameters was developed in New Jersey [19].This kit uses low-cost sensors and an Arduino microcontroller to measure parameters such as temperature, total dissolved solids, pH, and turbidity.In addition, 3D printing was used to integrate the circuitry into a solid structure.
A study was conducted in Brunei [20] to determine whether an Arduino-based sensor system could be used to monitor the water quality of a river.They used a simple prototype that included a microcontroller and multiple connected sensors for weekly on-site testing at different times throughout the day.However, the system was found to be reliant on human assistance and was prone to data inaccuracies.
Additionally, an automatic hydrological information system was developed in the city of Morelia, Michoacan, Mexico [21].This system consists of weather stations that use microcontrollers and low-cost sensors based on the Arduino platform to monitor meteorological variables in real time.The information collected by the stations is transmitted through the Wi-Fi network to the ThingSpeakserver, which allows users to visualize and download the data from a computer or a smartphone.
It has been observed that there is currently no device available in the market that can measure the quality of rainwater in real-time.Moreover, the professional equipment required to measure water quality parameters in the field is expensive and not affordable for most people.To address this issue, low-cost equipment was designed and developed that can measure basic parameters such as pH, total dissolved solids, turbidity, and temperature.The measurements are collected using an Arduino microcontroller manufactured by the company of the same name in Ivrea, Italy and a Wi-Fi ESP8266 communication module manufactured by Espressify Systems in Shangai, China.The collected data are then sent to a database and web platform, which allows for real-time visualization of the data in both spatial and temporal dimensions.

Case Study
The automatic hydrological information system (SAIH) [21], is now operational in Morelia.However, the SAIH weather stations were not in optimal conditions, so their location had to be improved (Figure 1).Moreover, the information collected by these stations was temporarily stored on the ThingSpeak website, which made it impossible to keep a historical record of the sensor data.This issue has been resolved, and now the information collected by the sensors is being stored in a database that was specifically developed for web hosting.Water quality monitoring stations were developed to monitor rainwater in Morelia spatially and in real-time.These stations were placed throughout the city, ensuring their distribution in different quadrants of Morelia, and the responsibility of their maintenance was assigned to the SAIH team.Water quality monitoring stations were developed to monitor rainwater in Morelia spatially and in real-time.These stations were placed throughout the city, ensuring their distribution in different quadrants of Morelia, and the responsibility of their maintenance was assigned to the SAIH team.
The constructed stations can be seen in Figure 2 and are located in various sectors of the city, such as the Torreon Nuevo station in the northwest, the Independencia station in the northeast, the Ciudad Universitaria (C.U.) station in the southwest, and the Lomas de las Americas Sur station in the southeast.Water quality monitoring stations were developed to monitor rainwater in Morelia spatially and in real-time.These stations were placed throughout the city, ensuring their distribution in different quadrants of Morelia, and the responsibility of their maintenance was assigned to the SAIH team.
The constructed stations can be seen in Figure 2 and are located in various sectors of the city, such as the Torreon Nuevo station in the northwest, the Independencia station in the northeast, the Ciudad Universitaria (C.U.) station in the southwest, and the Lomas de las Americas Sur station in the southeast.

Methodology
Figure 3 presents the methodology used to develop a prototype for a real-time water quality monitoring system.It also describes each stage of the process.

Methodology
Figure 3 presents the methodology used to develop a prototype for a real-time water quality monitoring system.It also describes each stage of the process.

Selection of Monitored Water Quality Parameters
When evaluating water quality, several variables must be taken into consideration.However, it is also important to consider the practicality of measuring certain variables.
A previous study [22] found that monitoring water parameters such as nitrate levels,

Selection of Monitored Water Quality Parameters
When evaluating water quality, several variables must be taken into consideration.However, it is also important to consider the practicality of measuring certain variables.
A previous study [22] found that monitoring water parameters such as nitrate levels, free chlorine concentration, and dissolved oxygen is too expensive.These variables require frequent maintenance and calibration to ensure accurate readings over time, which is not feasible for a long-term, low-cost, real-time water quality monitoring system.Therefore, in this work, an alternative approach was developed that is both cost-effective and practical.
Water quality measurements that were time-consuming and did not provide accurate results had to be excluded.Instead of measuring biological factors like fecal coliform and total coliform contamination, turbidity was measured, which is more accessible even though it is more general.Additionally, electrical conductivity (EC) was used to represent contamination by dissolved hazardous substances since EC indirectly measures total dissolved solids (TDS).Finally, the pH level was also measured, which is an indicator of the degree of alkalinity or acidity.This is a critical factor when considering the toxicity of a water sample.

Analysis of Requirements
The following are the aspects that were considered and the selected options based on the challenges encountered by [23].

I.
Power supply: The prototype will be connected to the SAIH stations and powered through the electrical network.II.
Connectivity: SAIH stations and the developed prototype connect to the internet wirelessly via Wi-Fi.III.
Visualization: SAIH stations display their information in real-time on a web page using ThingSpeak platform widgets.However, the free version only stores data for a month before deleting it.To overcome this limitation, a database was developed for this project on web hosting.IV.
Operating conditions: The water quality sensors consist of a circuit and a probe.The probes are waterproof, but the circuits are not.To protect the circuits from the elements, a housing was designed to store them, while the probes were left exposed to collect and renew rainwater.The maintenance of probes due to corrosion or sensor replacement, estimating that this could potentially increase the total cost by 5%.

Design and Development
In this section, a draft of the prototype architecture is presented, which includes the connection of microcontrollers with sensors and the programming of microcontrollers.

Calibration
Calibration is the process of using a measurement standard to establish the relationship between the value displayed by the measuring instrument and the actual value.
In this project, each sensor was calibrated and validated to ensure its proper operation.The measurements given by the developed equipment were compared with standard calibration solutions.To calibrate each sensor, the procedure shown below was followed.

1.
Clean the sensor probe with distilled water and dry it with a disposable tissue.

2.
Correctly place the sensor inside the calibration standard solution.

3.
Carry out the measurement.

4.
Record the parameter value and the voltage read by the device.

5.
Remove the probe from the calibration standard solution.
Calculate the relative error percentage using Equation (1).If it is greater than that guaranteed by the manufacturer, the sensor is calibrated.

Relative error
where EV is the experimental value measured with the sensor and AV is the accepted value of the calibration standard solution.

Validation
In the validation process, the information provided by the developed prototype is guaranteed to be accurate by comparing the readings of the developed prototype with commercial equipment.

Data Visualization
The website's data visualization interface was developed using the following considerations and options were selected during its development [24].

I.
Analysis of requirements: The monitoring stations were displayed on a map with markers to visualize them and show the latest information upon interaction.II.
Architecture and technology: A hosting provider was hired for platform development.A dynamic website was developed using web technologies such as HTML, PHP, JavaScript, and CSS.MySQL 8.0.17 was used as the database manager.A free Bootstrap web template (SB Admin 2) was used as a base [25] to develop the web application and mobile-first sites with a layout that adapts to the user's screen [26].III.
Design of the logical and physical structure of the site: The main page contains the map with the monitoring stations.The site contains several sections with different functions, such as selecting consulted parameters in real-time, downloading data for a given period, and consulting data recorded on a specific time and date.Additionally, complementary pages such as Team and Contact were added.IV.
Content creation: The platform's content is primarily graphic, with more extensive text found in the Team and Contact tabs.The rest of the site contains short indications for the user or information on the indicators.V.
Graphic design: The interface features various shades of white, blue, gray, black, and green.White is used for the navigation bar, page background, and pop-up windows.Blue is used for some text, radio buttons, weather indicators, and realtime graphs.Gray is used for some text, station markers, indicator icons, and back buttons.Black is used for most text, and green is used for water quality indicators and some text.The default typography was retained from the Bootstrap template, and the sizes were adapted according to the device accessing the site.The indicator icons were obtained from the Font Awesome platform [27], which offers free icons that can be added to the website.VI.
Creation of the static pages: The static pages include the Team and Contact pages, which will not change according to the database.VII.
Creation of the dynamic pages: The dynamic page is the home page, where the station markers are displayed on the map.These markers change color based on the intensity of precipitation, and the magnitude of the indicators is updated in real-time.VIII.
Verification of the site's operation: The page's connection with the database was verified, ensuring that the most recent data was updated.The links within the site were also confirmed to redirect to the correct site.The site was tested on different browsers and devices, and the content was adjusted to fit the screen size.Finally, the site's loading time was tested.IX.
Start-up: After verifying the site's operation locally, it was published on the web domain, making it accessible to the public.

Materials
We decided to use the Arduino platform to carry out the project.Below is a description of the platform, the microcontrollers, and the sensors.

A. Arduino
The platform combines open-source software and free hardware microcontrollers to develop electronic products and projects.An Arduino board is a microcontroller that specializes in reading and requesting data from a wide range of sources to complete specific tasks that have been programmed.The coding language used in Arduino is relatively simple, and users can program the microcontroller to request data in a variety of ways, such as reporting it as a numerical value, turning on a light, moving a motor, or even sending a text message.Many people have used Arduino to build low-cost science projects, test the principles of chemistry and physics, or get started with programming and robotics [28].

B. NodeMCU
In order for the device to transmit results to the user via the internet, a board was needed to facilitate communication between the device and a platform designed for the Internet of Things.The NodeMCU development board was chosen as an open source and has an integrated ESP8266 module that allows any microcontroller to connect to its Wi-Fi network.The board features a Wi-Fi module that connects the system to the internet, digital pins, an analog one for connecting various modules and sensors, an SoC (system on a chip) processor, and 16 GPIO (general-purpose input/output) lines.It is powered by 5 V [29].

C. 3D printing
Using 3D printing technology, it is now possible to embed electronics into solid structures.The concept of 3D printing was introduced in the 1980s by Chuck Hull, a physicist and engineer, and 3D printers create three-dimensional objects by depositing material one layer at a time in an additive manufacturing process using computer-aided design (CAD) models.This method of manufacturing results in less material wastage and lower energy consumption, making it an innovative and effective technology [30].
The electronic components are embedded into a specially designed object, which includes holes and openings for connecting the circuit parts, such as sensors and wires.The circuit is printed inside the solid structure rather than being externally wired, making the final product more compact and user-friendly.

D. Sensors
A sensor is a device that receives information from a physical quantity or other disturbances in the environment and transforms it into another quantity, usually electrical, that can be quantified and manipulated.It consists of three main components: (1) the sensitive area contains the sensor system based on a given technology, (2) the processing circuitry converts the physical variable into an electrical variable, and (3) the signal output contains electronics that are connected to a control system [31].
Three basic water quality sensors were used for the project design.These sensors were purchased from a company called DFRobot established in the city of Chengdu, China, which specializes in electronics for robotics and advanced electronics projects on Arduino.

E. pH sensor
The pH sensor uses a pair of electrodes to measure acidity levels.One electrode measures the electrical potential across a glass membrane that allows H + ions to pass through, while the other electrode measures the electrical potential across a standard reference solution of KCl, which is a measure of the ionic activity of H + .This value can be converted into a pH value by taking the negative logarithm of the concentration of H + (−log [H + ]).
The sensor responds linearly, so the equation for converting the measured voltage to pH can be derived by taking two points.The general form is shown in Equation (2), where V represents the voltage (volts), and m (units of pH/volts) and b (units of pH) are obtained by calculating the linear equation where m while calibrating the sensor with buffer solutions of pH 4, 7, and 10.
Total dissolved solids sensor The total dissolved solids (TDS) measurement indicates the number of milligrams of soluble solids that are dissolved in a liter of water.Most TDS meters display the value in mg/L (milligrams per liter).Typically, the greater the TDS value, the more soluble solids are present in the water, indicating that it is less clean.
Water mainly consists of dissolved matter, which includes minerals, salts, and anionic and cationic substances.However, it may also contain contaminants such as heavy metals and organic matter.A quick estimate of the dissolved solids content of a water sample can be obtained by measuring its electrolytic conductivity.This measurement indicates the ability of a sample to conduct electric current, which is related to the concentration of ionized substances in the water.
Electrical conductivity (EC) numerically expresses the ability of a solution to conduct an electric current.It is determined by several factors, such as the presence of ions, total concentration, mobility, valence, relative concentrations, and temperature.EC is important as it provides insight into the degree of mineralization of water.Electrolytes are substances that contain free ions and thus behave as electrical conductors.They can be acids, bases, or salts [32].
TDS sensors function by utilizing two or more probes that generate an electric current through the liquid solution in which they are submerged.The amount of current flowing between the probes is dependent on the ion concentration between them, which is also influenced by the potential difference between the probes [33].
The sensor produces a voltage output that can be translated into an EC reading.This reading can then be used to estimate the concentration of TDS in mg/L.Equation (3) demonstrates the relationship between voltage and electrical conductivity in µS/cm [34].
where CV 25 is the value of the temperature compensated voltage (V), taking as a reference a temperature of 25 • C. In a water sample, the presence of ionic species is usually insignificant in concentration.As a result, dissolved ions tend to have the same impact on conductivity readings.Therefore, EC can serve as a reliable measure of the TDS concentration in water.Typically, the TDS value is half of the electrical conductivity [35] as shown in Equation (4).
where α is the temperature coefficient of resistance, T is the recorded temperature, and T 0 is the temperature at 25 • C. The temperature coefficient can be theoretically obtained using the Nernst-Einstein and Stokes-Einstein proportionalities in the linearized approximation [36].
When EC and viscosity are applied together, they are proportionally related.This relationship can be used to reduce α to a constant of 0.02.The linear approximation maintains an error of less than 0.25 µS for a temperature range of 0 to 55 • C, which is the maximum temperature limit of the SDT sensor.Equation ( 6) can be reduced to the following.

G. Turbidity sensor
The front sensor is an optical device that consists of an LED (light emitter) and a phototransistor (light receiver).It operates based on the principle of transmittance.When light passes through a specific amount of water, the amount of light that passes through depends on the number of solids in the water.As the quantity of solids increases, the amount of light passing through the sample decreases, and the sensor measures the amount of light transmitted to determine the turbidity of the water.This measure is inversely related to nephelometric turbidity units (NTU), one of the most commonly used standards for measuring turbidity.The sensor manufacturer (DFRobot) provides Equation (7), which relates voltage to turbidity in NTU [37].y = −1120.4x 2 + 5742.3x− 4352.9 (7)

Selection of Monitored Water Quality Parameters
After conducting bibliographic research on similar works, the sensors listed in Table 1 were found on the market, where their characteristics, measurement ranges, and accuracy are also indicated.

Design and Development
An Arduino NANO board was utilized as a microcontroller to operate the prototype.The circuit diagram in Figure 4 displays the sensor connections to the Arduino board.A NodeMCU ESP8266 board is employed to connect the device to the internet.The Arduino NANO board transmits the data to the NodeMCU through a serial communication protocol, and the NodeMCU board transmits the data to the server database through an HTTP communication protocol.
The rainwater quality monitoring station (RQMS) has Wi-Fi connectivity and can communicate with a web server, as shown in Figure 5.
In order to protect the circuits from any weather-related damage and to preserve the water for further analysis by the sensors, housing was created using Fusion360, a free=license 3D CAD (computer-aided design) tool suitable for hobbies.The 3D model of the housing designed in isometry is demonstrated in Figure 6, while Figure 7 displays the operational prototype.An Arduino NANO board was utilized as a microcontroller to operate the prototype.The circuit diagram in Figure 4 displays the sensor connections to the Arduino board.A NodeMCU ESP8266 board is employed to connect the device to the internet.The Arduino NANO board transmits the data to the NodeMCU through a serial communication protocol, and the NodeMCU board transmits the data to the server database through an HTTP communication protocol.The rainwater quality monitoring station (RQMS) has Wi-Fi connectivity and can communicate with a web server, as shown in Figure 5.In order to protect the circuits from any weather-related damage and to preserve the water for further analysis by the sensors, housing was created using Fusion360, a free=license 3D CAD (computer-aided design) tool suitable for hobbies.The 3D model of the housing designed in isometry is demonstrated in Figure 6, while Figure 7 displays the operational prototype.In order to protect the circuits from any weather-related damage and to preserve th water for further analysis by the sensors, housing was created using Fusion360, a free=li cense 3D CAD (computer-aided design) tool suitable for hobbies.The 3D model of th housing designed in isometry is demonstrated in Figure 6, while Figure 7 displays th operational prototype.

Calibration
The pH sensor was calibrated using three buffer solutions with pH values of 4, 7, and 10, as specified in NMX-AA-008-SCFI-2016 [38].The measurement process involved cleaning the sensor probe with distilled water, drying it with a disposable handkerchief, and immersing it in the solution.After a few minutes, the measurement would stabilize, and the voltage value was recorded as soon as it stabilized (Table 2).

Calibration
The pH sensor was calibrated using three buffer solutions with pH values of 4, 7, and 10, as specified in NMX-AA-008-SCFI-2016 [38].The measurement process involved cleaning the sensor probe with distilled water, drying it with a disposable handkerchief, and immersing it in the solution.After a few minutes, the measurement would stabilize, and the voltage value was recorded as soon as it stabilized (Table 2).The plotted values indicate a linear relationship between pH and voltage due to the transducer in the sensor.Therefore, a line of best fit was obtained to give the best approximation to the data set.This is represented in Figure 8, and the equation for the line is given in Equation ( 8).The plotted values indicate a linear relationship between pH and voltage due to the transducer in the sensor.Therefore, a line of best fit was obtained to give the best approximation to the data set.This is represented in Figure 8, and the equation for the line is given in Equation ( 8).pH = −5.9981V+ 22.196 (8) Equation ( 8) is valid for voltages above 1.3664 and below 3.7005.If the voltage exceeds this range, pH values will correspond to 14 and 0, respectively.
The TDS sensor operates using Equation ( 3), which explains the relationship between voltage and electrical conductivity.A standard NaCl conductivity solution with a concentration of 692 mg/L was employed to calibrate it, indicating a conductivity of 1413 µS/cm at 25 • C as stated in NMX-AA-093-SCFI-2000 [39].A temperature probe is required for the TDS sensor to calibrate the voltage.The measurement process involved cleaning the TDS and temperature probes with deionized water, drying them with a tissue, inserting them into the solution, waiting for the reading to stabilize, and then recording the voltage values.The results are shown in Table 3.
Equation ( 8) is valid for voltages above 1.3664 and below 3.7005.If the voltage exceeds this range, pH values will correspond to 14 and0, respectively.
The TDS sensor operates using Equation ( 3), which explains the relationship between voltage and electrical conductivity.A standard NaCl conductivity solution with a concentration of 692 mg/L was employed to calibrate it, indicating a conductivity of 1413 µS/cm at 25 °C as stated in NMX-AA-093-SCFI-2000 [39].A temperature probe is required for the TDS sensor to calibrate the voltage.The measurement process involved cleaning the TDS and temperature probes with deionized water, drying them with a tissue, inserting them into the solution, waiting for the reading to stabilize, and then recording the voltage values.The results are shown in Table 3.The sensor readings closely match the value of the conductivity standard solution.To calibrate the voltage of each measurement, a voltage calibration coefficient was calculated using the function "goal seek" in Microsoft Excel 2019.Subsequently, this coefficient was multiplied with the voltage reading, resulting in an affected voltage, which was used in the equation shown in Table 4.The sensor readings closely match the value of the conductivity standard solution.To calibrate the voltage of each measurement, a voltage calibration coefficient was calculated using the function "goal seek" in Microsoft Excel 2019.Subsequently, this coefficient was multiplied with the voltage reading, resulting in an affected voltage, which was used in the equation shown in Table 4.An average voltage calibration coefficient of 0.99775 was obtained.This value will be added to the programming.
The EC equation demonstrates a parabolic behavior, which is illustrated in Figure 9.
0 The EC equation demonstrates a parabolic behavior, which is illustrated in Figure 9.The manufacturer provided Equation ( 7) for calibrating the turbidity sensor.This equation establishes a relationship between voltage and turbidity and is only valid for voltages ranging from 2.5 to 4.2.The measurement range of the sensor is between zero and 3000.35NTU, as shown in Figure 10.The manufacturer provided Equation ( 7) for calibrating the turbidity sensor.This equation establishes a relationship between voltage and turbidity and is only valid for voltages ranging from 2.5 to 4.2.The measurement range of the sensor is between zero and 3000.35  The EC equation demonstrates a parabolic behavior, which is illustrated in Figure 9.The manufacturer provided Equation ( 7) for calibrating the turbidity sensor.This equation establishes a relationship between voltage and turbidity and is only valid for voltages ranging from 2.5 to 4.2.The measurement range of the sensor is between zero and 3000.35NTU, as shown in Figure 10.The turbidity was measured at 500 NTU using a formazin standard solution, which was prepared according to the NMX-AA-038-SCFI-2001 [40] guidelines.The sensor was calibrated using different dilutions of the solution, with distilled water used as the zero value.Dilutions of 5, 10, 20, and 50 NTU were prepared, and their voltages were measured by the sensor and recorded in Table 5 along with the corresponding equation.
It is necessary to find a calibration coefficient that shows the correct values of turbidity, as the voltage values obtained are higher than the voltage limit established in the equation.
For every turbidity value, an average voltage was calculated.Table 6 shows the voltage calibration coefficients that were determined using the "goal seek" function in Excel.Each coefficient is multiplied by the voltage reading to obtain an affected voltage.The average voltage calibration coefficient is 0.98763.

Validation
The Thermo Scientific Orion portable multiparameter, which had been calibrated previously, was used to compare the measurements between commercial equipment and the low-cost one.A volume of 100 mL of deionized water was used, to which different concentrations of 0.01 M H 2 SO 4 solution were added to lower its pH.The temperature was 23.4 • C, and the substances were stirred for one minute.Five paired measurements were taken for each concentration.The average data is shown in Table 7, and the relative error percentage was calculated using Equation (1).To verify the accuracy of the TDS sensor, different volumes of 0.1 M NaCl solution at a temperature of 23.94 • C were measured, which were then made up to 100 mL with deionized water.The substances were mixed for one minute using a stirrer.Five paired measurements were performed for each concentration, and the relative errors were calculated using Equation (1).The average data is shown in Table 8.For validation, the Formazan standards were measured five times each with the voltage calibration coefficient loaded in the programming code.The average data is shown in Table 9, and the relative error was calculated using Equation (1).As can be seen, the percentage error of the sensors used is within ±10% acceptable margin set by the manufacturer.

Implementation of the Interface to Visualize the Data
The database was designed with the aim of accommodating more sensors in the future.Currently, there are two categories of variables: meteorological and environmental.The meteorological variables, such as temperature, humidity, precipitation, and precipitation intensity, are already being monitored by the SAIH.On the other hand, the environmental variables consist of pH, TDS, and turbidity.
Part of the web interface that has been developed locally is displayed in Figure 11.After creating the database and web interface locally, they were migrated to web hosting.The Hostinger company was chosen as the hosting service provider due to their annual package offering 30 GB of storage and two databases for USD 24.In addition, a domain had to be purchased for real-time data consultation, which can be accessed through the following URL: http://saihumich.com(accessed on 9 August 2022).The annual cost of After creating the database and web interface locally, they were migrated to web hosting.The Hostinger company was chosen as the hosting service provider due to their annual package offering 30 GB of storage and two databases for USD 24.In addition, a domain had to be purchased for real-time data consultation, which can be accessed through the following URL: http://saihumich.com(accessed on 9 August 2022).The annual cost of the domain is USD 10.
The development of this monitoring system cost USD 542, including materials, hosting, and web domain for four stations.

Conclusions
The developed monitoring system provides continuous and reliable remote measurements of rainwater quality at a significantly reduced cost, eliminating the need for expensive analytical equipment and on-site analysis.
Constant monitoring of rainwater quality can allow us to understand the physicochemical composition of rainwater and establish a correlation between rainwater and anthropogenic and natural emissions.It can also help us determine the impact of atmospheric pollutants on rainfall patterns.
Continuous monitoring of rainwater quality is essential for environmental authorities to provide real-time data, as well as protect and monitor pollution sources.
It is important to note that there may be measurement errors with low-cost devices due to various factors.However, these errors can be minimized through proper equipment maintenance and periodic sensor calibration.
Having a system with open-source hardware has the advantage of allowing the replacement of parts with other similar hardware without requiring contact with the product developers.Likewise, open-source software provides the flexibility to expand or reduce the monitored variables as needed.

Figure 1 .
Figure 1.Location of the low-cost SAIH weather stations.

Figure 1 .
Figure 1.Location of the low-cost SAIH weather stations.

Figure 2 .
Figure 2. Location of the rainwater quality monitoring stations (RQMS) in the city of Morelia.

Figure 2 .
Figure 2. Location of the rainwater quality monitoring stations (RQMS) in the city of Morelia.

Figure 3 .
Figure 3. Proposed methodology for the development of the prototype.

Figure 3 .
Figure 3. Proposed methodology for the development of the prototype.

Figure 4 .
Figure 4. Connection diagram of the rainwater quality monitoring prototype (own elaboration).

Figure 4 .
Figure 4. Connection diagram of the rainwater quality monitoring prototype (own elaboration).

Figure 5 .
Figure 5. Architecture of the rainwater quality monitoring prototype (own elaboration).

Figure 6 .
Figure 6.Three-dimensional model integrating the circuits and rainwater quality sensors.

Figure 5 .
Figure 5. Architecture of the rainwater quality monitoring prototype (own elaboration).

Figure 5 .
Figure 5. Architecture of the rainwater quality monitoring prototype (own elaboration).

Figure 6 .
Figure 6.Three-dimensional model integrating the circuits and rainwater quality sensors.

Figure 6 .
Figure 6.Three-dimensional model integrating the circuits and rainwater quality sensors.

Figure 7 .
Figure 7. Three-dimensional model integrating the circuits of the rainwater quality sensors.

Figure 7 .
Figure 7. Three-dimensional model integrating the circuits of the rainwater quality sensors.

Figure 8 .
Figure 8. Relationship between voltage and pH.

Figure 8 .
Figure 8. Relationship between voltage and pH.

Water 2024 , 19 Figure 11 .
Figure 11.Web interface that was developed locally, the main page shows the spatially located monitoring stations and the recorded values of temperature, humidity, precipitation and precipitation intensity on the left side, and on the right side there is a color scale for the different precipitation intensities.

Figure 11 .
Figure 11.Web interface that was developed locally, the main page shows the spatially located monitoring stations and the recorded values of temperature, humidity, precipitation and precipitation intensity on the left side, and on the right side there is a color scale for the different precipitation intensities.

Table 1 .
Specifications of water quality sensors selected for the prototype design.

Table 2 .
Voltage values related to pH.

Table 2 .
Voltage values related to pH.

Table 3 .
Electrical conductivity values measured with the 1413 µS/cm standard.

Table 3 .
Electrical conductivity values measured with the 1413 µS/cm standard.

Table 4 .
Voltage calibration coefficient for the TDS sensor.
NTU, as shown in Figure10.

Table 5 .
Voltage and turbidity relationship.

Table 6 .
Voltage calibration coefficient for the turbidity sensor.

Table 7 .
Comparison of pH measurements.

Table 8 .
Comparison of electrical conductivity measurements.

Table 9 .
Turbidity comparison between the formazin standard and the low-cost sensor.