IPTEK The Journal of Technology and Science, 35. , 2024 . /pISSN:2088-2033, 0853-4. DOI: 10. 12962/j20882033. Received 1 June, 2024. Revised 5 June, 2024. Accepted 11 June, 2024 ORIGINAL RESEARCH Assessing Water Quality in Nigerian Villages: An IoT-Based Monitoring of Three Rivers Martins Osifeko* | Olamide Oduwole | Rasheedat Kafar Department of Computer Engineering. Olabisi Onabanjo University, . Nigeria Correspondence *Email: martins@oouagoiwoye. Present Address Department of Computer Engineering. Olabisi Onabanjo University. Nigeria Abstract Ensuring safe and clean water is crucial for public health, especially in regions with limited access to reliable water quality testing. This study focuses on assessing water quality in three Nigerian villages using an IoT-based system. Traditional water quality monitoring methods are often expensive, time-consuming, and require specialized personnel and laboratory facilities. To overcome these challenges, we propose a low-cost, real-time water quality monitoring system utilizing the ESP32 microcontroller equipped with sensors for temperature, pH, dissolved oxygen, and Our system collects and transmits data for continuous monitoring and The deployment in Nigerian villages along three rivers reveals that while pH levels are within safe limits, turbidity levels in two rivers exceed acceptable drinking water standards, highlighting the presence of particulate contamination. The systemAos real-time capabilities and cost-effectiveness demonstrate its potential for broader application in resource-constrained areas. This study underscores the importance of IoT technologies in enhancing water quality monitoring and contributes to achieving the Sustainable Development Goals related to clean water and sanitation. KEYWORDS: Water quality monitoring. IoT. ESP32. Nigerian rivers, real-time data, pH sensor, turbidity sensor, sustainable development goals. INTRODUCTION Water, a fundamental element for human survival and multifaceted applications including agriculture and industry, faces a constant threat to its quality due to a myriad of environmental and anthropogenic factors such as sewage discharge, agricultural runoff, and industrial effluents . The imperative of safeguarding water quality from degradation cannot be overstated, given its pivotal role in human consumption and diverse utility . Martins ET AL. To achieve this, water quality systems have been developed and deployed to monitor, assess, and manage the condition of water resources . These systems are built upon the collection and analysis of water samples to detect the presence and levels of various contaminants, encompassing bacteria, chemicals, and other pollutants . The insights gleaned from water quality monitoring are essential in assessing the ecological health of aquatic systems and determining the suitability of water for various uses, such as drinking, recreation, and agriculture . Effective water quality systems are key to the sustainable management of water resources, an essential element for human well-being, the health of aquatic ecosystems, and the broader environment. They serve as the eyes and ears in identifying pollution sources and guiding interventions to prevent or mitigate contamination . These systems comprise diverse elements, including monitoring stations, laboratory analysis, data management, and communication with stakeholders. Their design and implementation are contingent on factors such as the nature of the water body under scrutiny, the types of contaminants in question, and the regulatory frameworks in place . Traditional water quality testing is expensive due to the need for specialized equipment, skilled personnel, and laboratory facilities, thus becoming a barrier in resource-constrained regions. Furthermore, laboratory-based water quality testing is timeconsuming, with results often taking days or even weeks to become available. This delay can hinder the timely response to contamination events or changes in water quality. Many existing systems cannot also provide real-time data, preventing immediate responses to emergencies or contamination events . To address these challenges, there is a growing shift towards IoT-based water quality monitoring systems, which offer the advantages of real-time data, cost-effectiveness, scalability, and remote accessibility. These systems are becoming increasingly important in improving water quality assessments and enhancing the management of water resources . However, these IoT systems are costly, complex, and sometimes difficult to maintain. Thus, to address these problems, this work proposes an Internet of Things (IoT) based water quality monitoring system utilizing a low-cost ESP32 microcontroller . The proposed system is equipped with sensors measuring critical water quality parameters like temperature, pH, dissolved oxygen, and conductivity. The proposed system is cost-effective and further facilitates seamless data transmission for analysis and storage. This work aligns with Target 6 of the Sustainable Development Goals, "Clean Water and Sanitation," which strives to enhance water quality globally by reducing pollution, eliminating hazardous discharges, and significantly increasing recycling and safe PREVIOUS RESEARCHES Water is the most basic need for humans and a source of livelihood for humans. Lack of human awareness to maintain water quality, causing water to become polluted, by both industrial and household waste, impacts human health and material loss. Thus, it is important to create technology that can monitor water pollution automatically and quickly. Amuthakkannan and Al Yaqoubi . explore the use of Internet of Things (IoT) technology for real-time water quality monitoring using a remotecontrolled (RC) boat equipped with sensors and GPS. The RC boat is designed with pH, temperature, and turbidity sensors, and a GPS module with a built-in SIM card, which transmits data to a server for monitoring via a mobile application. Testing was conducted at three locations, revealing that the water quality in a natural creek did not meet World Health Organization (WHO) standards and was highly contaminated. This IoT-based monitoring approach offers a smart solution for detecting and addressing water pollution, providing more accurate and timely data compared to traditional methods. Murti, et al. aim to create an Internet of Things (IoT) system to monitor water quality by measuring parameters such as pH and turbidity. The system employs an ATmega328P-AU controller, pH and turbidity sensors. LPWAN LoRa for data transmission, and the Antares cloud service for data storage, accessible via an Android application. The system demonstrated high accuracy, with a 99. 73% accuracy rate for the pH sensor and 99. 41% for the turbidity sensor. Additionally, it took an average of 2. 6 seconds to transmit results to the cloud service. Kumar, et al. introduce an innovative wireless system for real-time water quality monitoring using the Arduino (ESP. The system collects data from various pond locations with three sensors measuring turbidity. TDS, and pH. aquatic boat equipped with the system allows comprehensive sampling from the center and edges of ponds. The collected data is uploaded to the cloud for real-time analysis via the AquaSpecs app. The systemAos effectiveness was demonstrated through deployment in four ponds in Chhattisgarh: Birkona Pond. Budha Pond. Dagania Pond, and Kushalpur Pond. Results showed Martins ET AL. Birkona Pond had the best water quality, with average pH. TDS, and turbidity values of 6. 23, 196. 75, and 8. 83, respectively. Budha Pond was highly polluted, with average values of 13. 30, 544. 18, and 34. The proposed system outperformed recent water quality monitoring systems in accuracy and reliability, with minimal sensor errors compared to traditional methods, making it highly suitable for effective water quality management. Manocha, et al. introduce a Digital Twin Inspired Hybrid System (DTHS) for real-time water quality assessment. This system uses sequential parametric values collected in real time to provide a more accurate and dynamic evaluation of water quality. The effectiveness of the DTHS is demonstrated using observational data from a monitoring station in Chaheru, located in the Phagwara district of Punjab. India. The experimental results show that the proposed system significantly improves water quality determination, computational efficiency, and stability. The DTHS achieved high prediction accuracy . 14%), sensitivity . 74%), specificity . 47%), and f-measure . 37%), proving its ability to accurately assess water quality. Additionally, the system reduces computational delays and enhances reliability and stability, making it a robust and timely solution for water quality predictions. METHOD Several stages are involved in the design and implementation of our proposed monitoring system. First, we research the hardware and software components required to construct the system. Second, we create a system design that meets the projectAos Third, we implement the design by connecting the hardware components and writing the required software code. Finally, we test the system to ensure that it meets the performance metrics. The IoT-based water monitoring system is designed to constantly monitor water quality. The system is made up of various sensors, such as temperature, pH, and turbidity sensors which collect information about the quality of water. The system is suitable for monitoring water quality in lakes, rivers, and other bodies of water, as well as in water distribution systems. Without a PC system, keyboard commands, or a monitor, our designed water monitoring system is created to be user-friendly and An ESP32 microcontroller serves as the systemAos main controller, which enables this. As soon as the C language code is uploaded to the microcontroller, the system starts operating automatically. To measure important water parameters like pH level, turbidity . , and temperature, the system uses three sensors. These factors are sufficient to assess the water quality under observation. To better understand the design of our water monitoring system, we designed a block diagram, a circuit layout, and a conceptual drawing of the system chassis stand. The circuit layout shows the connections between the microcontroller and the sensors, whereas the block diagram depicts the operational parts of the system. Hardware Requirements The IoT-based water monitoring system has the following hardware components. Esp 32. BMS (Battery Management Syste. Bulk Converter. Lithium Battery. PH Sensor. Turbidity Sensor. Temperature Sensor, and LCD 16 controller *2. The following subsection describes each of the hardware components: ESP32 The ESP32 controller is a low-cost, low-power microcontroller with built-in Bluetooth and Wi-Fi capabilities that can be used for a wide range of Internet of Things applications. Microcontroller (ESP. Peripherals The Microcontroller (ESP. peripherals include 18 Analog-to-Digital Converter (ADC) channels, 3 SPI interfaces, 3 UART interfaces, 2 I2C interfaces, 16 PWM output channels, 2 Digital-to-Analog Converters (DAC), 2 I2S interfaces, 10 Capacitive sensing GPIOs. The multiplexing ability of the ESP32 chip enables the assignment of static pins for the ADC and DAC functions while allowing freedom in selecting which pins are designated for UART. I2C. SPI. PWM, and other functions that can be Martins ET AL. assigned in the code. As seen in Figure 1 which shows the example of the ESP32 DEVKIT V1 DOIT board with 36 pins while the software allows for the definition of pin properties, some pins are pre-assigned by default. Figure 1 . shows which pins are ideal for input and output functions as well as the pins that call for caution during use. While yellow-highlighted pins can also be used, care must be taken because they could display unexpected behavior, especially during boot. Green-highlighted pins are considered safe to use. On the other hand, red-highlighted pins should not be used as inputs or outputs. FIGURE 1 Esp32 devkit Sensors The sensors used in the system include temperature sensors, pH sensors, turbidity sensors, and flow sensors. pH Sensor: pH sensors are electrochemical devices used to gauge a solutionAos acidity or alkalinity. Applications for pH sensors include environmental monitoring, testing the quality of drinking water, and the pharmaceutical and food industries. pH sensors use hydrogen ions (H ) to assess a solutionAos activity 2 . This activity is monitored using an electrode that is sensitive to variations in hydrogen ion concentration. The electrode is composed of a reference electrode and a pH-sensitive glass electrode. The pH-sensitive glass electrode reacts with the hydrogen ions in the solution when the electrode is immersed in a solution to create an electrical potential. Afterward, this potential is measured using a voltmeter that has been calibrated to convert it to pH units . FIGURE 2 pH sensor Turbidity Sensor: The TS-300B turbidity sensor, is a tool used to quantify the quantity of suspended particles in a liquid. The TS300B turbidity sensor measures the amount of suspended particles in a liquid by using the principle of scattered light 3 . Martins ET AL. photo-diode detects the scattered light from the sensorAos light beam that is fired into the liquid. Calculating the liquidAos turbidity involves using the amount of scattered light, which is inversely proportional to the amount of suspended particles in the liquid. FIGURE 3 Turbidity Sensor Temperature Sensor (DS18B. : The DS18B20 temperature sensor has a measurement range of -55AC to 125AC, with an accuracy of A0. 5AC over the range of -10AC to 85AC. It also has a resolution of up to 12 bits, which means that it can measure temperature with a precision of up to 0. 0625AC. The sensor is designed to be highly stable and accurate over a wide range of temperatures and environmental conditions. LCD I2C Module (PCF8574T): For the majority of microcontroller families, the PCF8574T is a silicon CMOS circuit that provides general-purpose remote I/O expansion. It has an I2C bus, a two-line bidirectional bus interface that makes it simple to communicate with other components on the circuit board 4 . The PCF8574T is a highly adaptable and compatible microcontroller that features an 8-bit quasi-bidirectional port and an I2C-bus interface. It is an energy-efficient solution for battery-powered devices due to its low current consumption, which draws no more than 10 A when in standby mode. Furthermore, the PCF8574T has latched outputs with high current drive capability that enable direct LED driving without the use of additional circuitry. Additionally, it has an open-drain interrupt output that can be connected to the microcontrollerAos interrupt logic. This feature enables the remote I/O to notify the microcontroller of incoming data on its ports without using the I2C bus for communication. FIGURE 4 LCD I2C Module (PCF8574T) System Architecture This section describes the architecture of the proposed system. Figure 5 shows the system block diagram. Martins ET AL. FIGURE 5 System block diagram As shown in Figure 4 , the system consists of various sensors and an ESP32 controller. The sensors collect data about the water quality and quantity, which is transmitted to the ESP32 controller. The ESP32 controller processes the data and transmits it. Circuit Layout Figure 6 shows the circuit layout of the IoT-based water monitoring system. FIGURE 6 Circuit diagram RESULT AND DISCUSSION To evaluate the system, the pH and turbidity sensors were calibrated using standard solutions to ensure the readings obtained were precise and dependable. Once the sensors are calibrated, the water samples are tested and the pH and turbidity readings are recorded in Table 1 . The pH readings provide information about the waterAos acidity or alkalinity, whereas the turbidity readings indicate the number of particles present in the water. These readings determined the drinkability and safety of the water. The assessment of the water samplesAo quality is based on the guidelines established by the World Health Organization (WHO) for drinking water quality. The pH and turbidity readings obtained were then compared to the WHO guidelines to determine the water samplesAo quality. Based on our results, the pH readings of the water samples ranged from 6. 8 to 7. 4, indicating that the water was within the acceptable range for drinking according to the WHO guidelines. However, the turbidity readings varied significantly. Martins ET AL. with water samples collected from River Akinode and River Osungboye having turbidity levels above the acceptable limit for drinking water. Our findings suggest that the IoT-based water quality monitoring system was effective in detecting variations in water quality. The systemAos ability to measure pH and turbidity levels accurately and reliably demonstrates its potential to improve water quality monitoring in various settings. TABLE 1 pH and Turbidity Readings for 4 Samples Sample Source Osungboye River Akinode River Opara River Borehole (Ibogu. pH Value Turbidity Value Turbidity LCD Readout Dirty Dirty Clear Very Clean FIGURE 7 Turbidity values across 4 water sources FIGURE 8 pH values across 4 water sources Temperature Value (AC) Martins ET AL. FIGURE 9 Temperature values across 4 water sources FIGURE 10 The proposed IoT monitoring device FIGURE 11 An IoT monitoring device with a test container CONCLUSION This study designed and implemented an IoT-based water quality monitoring system using an ESP32 pH sensor and turbidity Our findings demonstrate the potential of IoT technology in improving water quality monitoring and providing a costeffective and efficient solution for detecting changes in water quality in real-time. The testing results showed that the pH level of the water samples was within the acceptable range for drinking according to the WHO guidelines. However, some of the Martins ET AL. water samples had high levels of turbidity, which is not considered safe for drinking. These results highlight the importance of monitoring both pH and turbidity levels in ensuring safe drinking water. Based on our findings, we recommend works that improve the accuracy and reliability of the IoT-based water quality monitoring system, additional sensors can be incorporated, such as conductivity sensors. Another suggested research is to incorporate an alert system that notifies the water agencies once the quality purifying threshold of the water has changed. Our study highlights the potential of IoT technology in improving water quality monitoring and ensuring access to safe and clean drinking water. The implementation of an IoT-based water quality monitoring system can provide real-time data on changes in water quality, enabling swift action to be taken to mitigate any potential risks to public health. We recommend the adoption of this technology in various settings, particularly in remote or hard-to-reach areas, to ensure that safe drinking water is accessible to all. CREDIT Conceptualization. References. Writing - final draft preparation, and Supervision: Martins Osifeko. Method. Writing - first draft preparation: Olamide Oduwole, research, design. Writing - review and editing: Rasheedat Kafar. References