Artículos
Received: 21 March 2024
Accepted: 15 September 2024
DOI: https://doi.org/10.19503/01211129.v33.n69.2024.17385
ABSTRACT: This study introduces an innovative water quality monitoring system capable of simultaneously measuring six essential parameters (total dissolved solids, oxidation-reduction potential, dissolved oxygen, temperature, pH, and electrical conductivity) by incorporating the Internet of Things technology. Therefore, it is an advanced tool for water resource management. Unlike conventional multiparameter sensors, which are often limited in their storage capacity and number of parameters, our device automatically stores data in Firebase, thus ensuring secure, accessible, and scalable real-time information management. Additionally, in situations of connectivity loss, the system includes an SD card to store data in an Excel file and ensure continuous logging without interruptions. This design not only eliminates the need for sample transportation and handling but also enables precise monitoring from any location. By measuring six distinct parameters, the system provides a comprehensive and customizable view of water quality, adapts to various needs and environments like industry, agriculture, or natural resource conservation. This versatility and technological robustness, supported by Firebase, make our system a key solution for efficient and real-time water monitoring.
Keywords: Internet of Things, sensors, water treatment.
RESUMEN: Este estudio introduce un innovador sistema de monitoreo de calidad de agua, capaz de medir simultáneamente seis parámetros esenciales (sólidos totales disueltos, potencial óxido-reducción, oxígeno disuelto, temperatura, pH y conductividad eléctrica), incorporando tecnología de Internet de las Cosas, ofreciendo una herramienta avanzada para la gestión de recursos hídricos. A diferencia de los sensores multiparamétricos convencionales, que suelen ser limitados en sus capacidades de almacenamiento y cantidad de parámetros, nuestro dispositivo almacena automáticamente los datos en Firebase, lo que garantiza una gestión de información segura, accesible y escalable en tiempo real. Además, en situaciones de pérdida de conectividad, el sistema incluye una tarjeta SD para almacenar los datos en formato Excel, asegurando la continuidad del registro sin interrupciones. Este diseño, no solo elimina la necesidad de transporte y manipulación de muestras, sino que también permite un monitoreo preciso desde cualquier lugar. Al medir seis parámetros distintos, el sistema proporciona una visión integral y personalizable de la calidad del agua, adaptándose a diversas necesidades y entornos, ya sea en la industria, agricultura, o conservación de recursos naturales. Esta versatilidad y robustez tecnológica, soportada por Firebase, convierte a nuestro equipo en una solución clave para un monitoreo hídrico eficiente y en tiempo real.
Palabras clave: Internet de las cosas, sensores, tratamiento.
1. INTRODUCTION
In the water quality process, it is necessary to measure certain parameters to determine which category it belongs to (wastewater, greywater, tap water, or drinking water). The measured indices help determine organic matter, inorganic matter, eutrophication, suspended and dissolved substances, oxygenation level, and physicochemical characteristics [1]. According to the official standards of each country, the concentration of these indices in water will determine its classification [2].
To carry out this process properly, an expert is required to collect the sample using a specific procedure and package it for later analysis in a laboratory. However, there are some drawbacks: weather conditions can affect sample collection; if it is wastewater, there is a possibility of contracting a viral disease or inhaling particles; the container used to store the sample can affect the measurements; and, if there is a delay in analyzing the sample, it can degrade [3].
An alternative to facilitate water quality analysis is the use of multiparametric sensors, which are electronic devices that incorporate one or more parameters and are widely used in water quality monitoring due to the easy acquisition of data [4] - [5]. Their use is quite common in on-site sampling or even in certified laboratories. Currently, it is possible to find commercial sensors and some that are still in experimental phases to validate their correct operation; for instance, commercial multiparametric sensors such as the HI98194 from Hanna Instruments and the AP-5000 from Alphaomega Electronics are available [6]. Their drawback is that they have a closed architecture, so it is not possible to add or remove parameters, and only some of them can save data, in addition to not being able to add new functionalities such as remote monitoring [7].
Likewise, there are various experimental multiparametric sensors in the literature. For example,[8] presents a discussion about real-time parameter measurement stations in rivers, with the disadvantage of not being able to use it in larger bodies of water due to cost and power supply requirements. In [9], the authors use an Arduino microcontroller with sensors connected to it to demonstrate the device's operation in various measurements, daily and weekly, ensuring it remains correctly calibrated. In [10], instrumentation of a multiparametric sensor is performed using sensors from the company DFRobot in Arduino, and the development of a user-friendly interface in LabVIEW for data presentation, processing, and storage, as well as the incorporation of an SD memory card in case of connection failures. Other developments like [11] and [12] propose the incorporation of the Internet of Things into multiparametric sensors, further facilitating the collection of information gathered by the sensors.
Given the recent advancements on the Internet of Things (IoT), several remote monitoring systems for water have been developed, as seen in [13] - [14]. Most commercial developments have reported good efficiency and improvements compared to other sensors based on older technologies [15]. However, these systems tend to be either too expensive or their architecture is too closed off for public use [16]. Consequently, using these commercial devices remains primarily limited to developed countries. Recognizing these limitations, various studies to explore inexpensive and reliable solutions based on the IoT have been conducted, leveraging existing communication infrastructure for smart applications [17] - [18].
This work proposes the instrumentation of a multiparametric sensor with IoT for water monitoring using an ESP WROOM microcontroller, DFRobot sensors for dissolved solids, temperature, pH, dissolved oxygen, conductivity, and redox potential. It is able to send data to Firebase, present it in a mobile application developed in AppInventor, and have the backup of saving the data to an SD card in case of connection failures.
2. METHODOLOGY
This work is a continuation and improvement of the one developed in [10]. The sensors used are from the company DFRobot to be integrated into an ESP WROOM board (previously, it was integrated into an Arduino UNO platform). The sensors used are SEN0165 for redox potential, SEN0169 for pH measurement, DFR0300 for conductivity, SEN0237 for dissolved oxygen, and SEN0244 for total dissolved solids. Additionally, a real-time clock module RTC SD2405 and an SD memory card DFR0229 are incorporated.
To select the microcontroller, connectivity, resources, processing power, support, documentation, compatibility with platforms and services, energy consumption, and total cost were considered and prioritized. The chosen microcontroller features wireless capability, a dual-core processor, and a wide range of peripherals.
For the storage and presentation of data, Firebase and AppInventor platforms were used. Firebase is a cloud platform owned by Google to develop web and mobile applications; one of its most interesting tools is the real-time database [19]; for a certain number of users and storage capacity, it is free. Likewise, AppInventor of MIT is a programming environment that allows for the easy and free creation of mobile applications [20].
The programming developed for the ESP WROOM is shown in Figure 1. First, the Firebase and Wi-Fi credentials are defined, and connections are verified in both cases. Then, the readings of the sensors integrated into the microcontroller are performed and sent to Firebase and the SD card simultaneously. After one minute, the sensors are read again, and the process is repeated until the program stops. The RTC module is set up as a clock between the microcontroller and the computer to ease data capture in a MicroSD memory.

Next, Figure 2 shows the flowchart for Firebase programming. Initially, it checks the time, whether it has elapsed or not; then, it verifies the connection, and if it exists, it saves the sensor readings.

Below, the programming done for the mobile application in AppInventor is shown. First, registration is required to use the application; then, it checks for communication with Firebase. If there is communication between the phone and Firebase, sensor readings are performed, and on the screen, the user can select the sensor of interest and view the result. There is an option to save the sensor records on the phone, and if the user wants to view the history, a new window opens for this purpose.
3. RESULTS
The system developed in [10] was modified because Arduino UNO does not incorporate the Internet of Things technology; instead, it was changed to an ESP WROOM. The device developed with the integrated sensors (dissolved oxygen, redox potential, temperature, hydrogen potential, total dissolved solids, and conductivity) is shown in Figure 4. To arrange the sensors in order, a 3D-printed box was made, which serves as a support for each of the signal conditioning boards.


Measurements were conducted using bottled water, tap water, and wastewater to showcase sensor versatility and accuracy. Results were compared to conventional laboratory results as shown in Table 1; they fit the ranges established by the Official Mexican Standards and confirm the sensor reliability across various water sources.

Furthermore, communication with Google Firebase is demonstrated. In this section, diverse accounts are active, including those of students and teachers. Furthermore, it encompasses the storage of both historical data and real-time data collected by the sensor.

Finally, Figure 6 shows the results obtained in the application developed in AppInventor. It is able to obtain the values that are being received in Firebase, and if required, it allows users to save a mini database of up to 5 instances with the 6 values obtained by the sensor. The rest of the data is automatically saved in the Firebase account

4. CONCLUSIONS AND DISCUSSION
This article outlines the development of a multiparametric sensor for water quality testing by integrating Internet of Things. The ESP WROOM microcontroller was chosen, data storage was facilitated through the Google Firebase platform, and data visualization was provided by a mobile application developed in App Inventor. This approach made possible the primary objective of remote monitoring, thus enabling continuous assessment of wastewater treatment processes.
Sensors were calibrated according to manufacturer specifications, and results were compared with conventional laboratory tests across various water quality parameters, adhering to the references outlined by the Official Mexican Standards. While the sensor operation had been previously demonstrated [10], the innovation lies in enabling remote monitoring without requiring a computer connection to the system and automatically saving data in the cloud. In the event of a connection failure, a backup is stored on an SD card, thus keeping parameters in an Excel file. With an open architecture, parameters can be added or removed as needed for specific measurements.
Furthermore, the versatility of the multiparametric sensor was demonstrated by analyzing diverse types of water. It was tested for quality parameter measurement at a local company, Exagromerica, situated in Rioverde, San Luis Potosí. Additionally, it was used to measure water quality parameters in San Ciro de Acosta, San Luis Potosí, and validated by an expert.
The multiparametric sensor developed in this work had a material cost of around USD $850 (this includes sensors, microcontroller, SD memory, RTC module, and 3D prints). The cost does not include the development of the mobile application or the database, as platforms still guarantee free access due to the number of users. However, it remains a viable and less expensive alternative compared to commercial developments that range in price from USD $2000 to $7000.
There are several potential enhancements to transition the multiparametric sensor from experimental to commercial development; for instance, employing a cloud-based database with a more user-friendly backend for data presentation and analysis. Additionally, improvements to the mobile application such as enhancing user authentication security, refining the interface aesthetics, and enabling storage of more than 5 instances are necessary.
6. REFERENCES
T. Maguvu, C. Bezuidenhout, R. Kritzinger, K. Thsolo, M. Plaatjie, "Combining physicochemical properties and microbine data to evaluate the water quality of South African drinking water production," Plos One, vol. 15, no. 8, pp. 1-21, 2020. https://doi.org/10.1371/journal.pone.0237335
CONAGUA. Normas Oficiales Mexicanas-Secretaría de Medio Ambiente y Recursos Naturales, pp. 1-65, 1997.
M. García, "Virus en aguas de consumo," Higiene y sanidad ambiental, vol. 6, pp. 173-189, 2006.
H. Jindal, S. Saxena, S. Kasana, "A sustainable multiparametric sensors network topology for river water quality monitoring," Wireless Networks, vol. 24, no. 8, pp. 3241-3265, 2017. https://doi.org/10.1007/s11276-017-1532-z
X. Wang, L. Sun, Y. Shi, "Research on a miniature water quality sensor chip and system with a temperature compensation function," Journal of Sensors, vol. 88, pp. 1-16, 2020. https://doi.org/10.1155/2020/8897916
AlphaOmega. Alpha Omega Electronics, 2021. https://www.alphaomega-electronics.com/es/sensores-y-sondas/2279-ap-5000-sondas-portatil-multiparametro-para-agua-dulce-salada.html
K. Saravanan, E. Anusuya, R. Kumar, L. Son, "Real-time water quality monitoring using Internet of the Things in SCADA," Environment Monitor Assessment, vol. 190, no. 556, 2018. https://doi.org/10.1007/s10661-018-6914-x
I. Yaroshenko, D. Kirsanov, M. Marjanovic, P. Lieberzeit, O. Korostynska, A. Mason, I. Frau, A. Legin, "Real-time water quality monitoring with chemical sensors," Sensors, vol. 20, pp. 1-23, 2020. https://doi.org/10.3390/s20123432
W. Hong, N. Shamsuddin, E. Abas, R. Apong, Z. Masri, H. Suhaimi, S. Godeke, M. Aqmal, "Water quality monitoring with Arduino based sensors," Environments, vol. 8, no. 6, pp. 1-15, 2021. https://doi.org/10.3990/environments8010006
L. Castillo-Nieto, I. Rosas-Hernández, R. Martínez-Montejano, M. Robles-Martínez, E. Pérez, G. González-Badillo, "Instrumentation and automation of a multiparametric sensor in water quality by using LabVIEW," Revista Internacional de Investigación en Innovación Tecnológica, vol. 10, no. 56, pp. 45-61, 2022.
I. Fonseca-Campos, L. Reyes-Ramírez, L. Guzmán-Vargas, J. Fonseca-Ruiz, J. Mendoza-Pérez, P. Rodríguez-Espinoza, "Multiparametric system for measuring physicochemical variables associated to water quality based on the Arduino platform," IEEE Access, vol. 10, pp. 69700-69713, 2022. https://doi.org/10.1109/ACCESS.2022.3187422
L. Manjakkal, S. Mitra, Y. Petillot, J. Shutler, M. Scott, M. Willander, R. Dahiya, "Connected sensors, innovative sensor development, and intelligent data analysis for online water quality monitoring," IEEE Internet of the Things, vol. 8, no. 18, pp. 13805-13824, 2021. https://doi.org/10.1109/JIOT.2021.3081772
U. Ahmed, R. Mumtaz, H. Anwar, S. Mumtaz, A. Qamar, "Water quality monitoring: from conventional to emerging technologies," Water Science Technology, vol. 20, pp. 28-45, 2020. https://doi.org/10.2166/ws.2019.144
P. Damor, K. Sharma, "IoT based water monitoring system: a review," International Journal of Advanced Research, vol. 4, pp. 1-6, 2017.
M. Banna, S. Imran, A. Francisque, H. Najjaran, R. Sadiq, M. Rodríguez, M. Hoorfar, "Online drinking water quality monitoring: review on available and emerging technologies," Critical Reviews in Environmental Science and Technology, vol. 44, pp. 1370-1421, 2014. https://doi.org/10.1080/10643389.2013.781936
S. Abba, J. Namkusong, J. Lee, M. Crespo, "Design and performance evaluation of a low-cost autonomous sensor interface for a smart IoT-based irrigation monitoring and control system," Sensors, vol. 19, e173643, 2019. https://doi.org/10.3390/s19173643
F. Jan, N. Min-Allah, D. Dustegor, "IoT based smart water quality monitoring: recent techniques, trends and challenges for domestic applications," Water, vol. 13, pp. 1-37, 2021. https://doi.org/10.3390/w13131729
M. Shahanas, P. Bagavathi, "Framework for a smart water management system in the context of smart city initiative in India," Proceedings of the Procedia Computer Science, vol. 92, pp. 583-588, 2016. https://doi.org/10.1016/j.procs.2016.07.337
D. Pérez-Jorge, M. Martínez-Murciano, "Gammification with Scratch or AppInventor in Higher Education: A Systematic Review," Future Internet, vol. 14, no. 12, 2022. https://doi.org/10.3390/fi14120374
I. Sudiarthe, I. Indrayana, W. Suasnawa, S. Asri, P. Wijaya, "Data structure comparison between MySQL relational database and Firebase database NoSQL on mobile based tourist tracking application," Journal of Physics: Conference Series, 2020. https://doi.org/10.1088/1742-6596/1569/3/032092
Notes
Author notes