Jabir et. Controlling and Monitoring Water Quality WATER QUALITY CONTROL AND MONITORING AT THE PATIH DRINKING WATER DEPOT BASED ON NODEMCU ESP32 St. Nurhayati Jabir1*. Asyraful Insan Asry2. Rahmat Hidayat3 Otomasi Sistem Permesinan. Politeknik ATI Makassar. Makassar. Indonesia E-mail address: nurhayati. djabir@atim. id1, asyraful@atim. id2, 20osp518@atim. Received: 18. March, 2024 Revised: 12. June, 2024 Accepted: 7. December 2024 ABSTRACT Manual control and monitoring of water quality remain a significant challenge for managers of drinking water depots, potentially affecting water safety and operational efficiency. To address this, an automated system was developed to fill water tanks and monitor water quality using advanced sensors and a real-time notification system. The solution integrates a Node MCU ESP32 microcontroller, a pH sensor for detecting water acidity, a TDS sensor for dissolved solids, an ultrasonic sensor for water level detection, and a Telegram bot for remote monitoring and notifications. The system activates the pump under optimal conditions pH between 6. 5 and 5. TDS below 150 ppm, and water level below 30 cm and deactivates it when conditions deviate, such as pH outside the range. TDS exceeding 150 ppm, or water level reaching 120 Notifications on pump status, pH. TDS, and water levels are sent via Telegram. Testing demonstrated reliable operation, with the system correctly activating and deactivating the pump under specified conditions, enhancing water quality management and operational effectiveness in drinking water depots. Keywords: Drinking Water Depot. HC-SR04. NodeMCU ESP32. Telegram. Total Dissolved Solids (TDS) INTRODUCTION Drinking water is a basic need for the people of Indonesia (Rahman, 2024. Wulandari & Ilyas. Drinking water sources are usually managed by Regional Drinking Water Companies (PDAM. , but some still get drinking water from wells and mountain rivers (Kapur, 2017. Aprillia & Ismiyati, 2023. Arruzzi, 2021. Wiharja, 2. Microbiologically, drinking water quality requirements must meet the provisions of the Decree of the Minister of Health of the Republic of Indonesia No. 907/MENKES/VII/2002 concerning drinking water quality requirements and supervision, which the Total Dissolved Solids (TDS) content does not exceed 1000 ppm or parts per million (Menkes, 2002a, 2002b. Permatasari. Musli et al. , 2. The lower the ppm value, the better the quality of drinking water. the number shows a value of 1, the solute detected in the water is 1 ppm . gram of solids in 1000 liters of wate. In the absence of a distinct taste, consistent mineral content and aesthetic quality are the most important determinants of drinking water taste and consumer acceptance (Info, 2023. Rasyid, 2024. Subari, 2024. Widianto, 2. Mineral content, often measured as total dissolved solids (TDS), is also an important factor in consumer preference. Water with Inspiration: Jurnal Teknologi Informasi dan Komunikasi Volume 14. Number 2. December 2024: 1 Ae 13 https://doi. org/10. 35585/inspir. P-ISSN : 2088-6705 E-ISSN : 2621-5608 high levels of dissolved solids or Total Dissolved Solids (TDS) can cause indigestion, lead to kidney damage, and cause nausea or dizziness (Novenpa & Dzulkiflih, 2. Bottled drinking water is considered more convenient, and cheaper and has been sterilized so that it can be drunk immediately without the need to reheat (Chandra, 2022. Fajriah & others. Prihatini, 2. This is what increases people's interest in consuming bottled drinking However, drinking water warehouse owners cannot directly sell bottled drinking water to consumers. Therefore, it is necessary to control and monitor the quality and quantity . of drinking water available (Kurniawan et al. , 2. Water quality monitoring is one of the first steps required in the proper development and management of water resources (Antara, 2021. Asrori, 2021. Delinom & Marganingrum, 2007. Ramadhan & Firdaus, 2. The rapid development of wireless sensor network technology brings new approaches to real-time data collection, transmission and processing (Akhriana et , 2020. Sari et al. , 2022. Solechan et al. , 2022. Usman et al. , 2023. Widodo et al. , 2. These systems allow long-term information on water quality to be obtained remotely (Hariyadi et al. , 2. This research is in line with research Huan et al. , with the title Design of water quality monitoring system for aquaculture ponds based on NB-IoT. And research Jan et al. with the title Iot based smart water quality monitoring: Recent techniques, trends and challenges for domestic applications. As well as a study Ighalo & Adeniyi . , entitled A comprehensive review of water quality monitoring and assessment in Nigeria. The problem faced by the manager of UD. PATIH is that the process of monitoring the quality and quantity . of water must be done through direct measurement at the storage To help solve the problems faced by the manager of the drinking water reservoir is to develop a tool that can monitor and control the quality and quantity . of water in the tank via Telegram application. THEORY Water is a vital necessity in our lives. Water used for daily purposes such as drinking, bathing and washing clothes and kitchen utensils must meet health requirements (Hasan, 2. Water is an essential material in the life of living things, there is no living thing in the world that does not need water. Increasingly accompanied by population growth, the need for water is also increasing so that the availability of water must always be available both in households, public places, offices or industries (Yuliaminuddin et al. , 2. The NodeMCU ESP32 is a low-power System-on-a-Chip (SoC) series with dual-mode WiFi and Bluetooth capabilities. The ESP32 uses a dual-core or single-core Tensilica Xtensa LX6 microprocessor clocked up to 240MHz (Prastyo, 2. The ESP32 comes with an integrated antenna switch. RF balun, power amplifier, low-noise receiver amplifier, filter, and power management module. The ESP32 is the successor to the ESP8266 which is very popular in IoT The ESP32 has one CPU core and faster WiFi, more GPIOs, and Bluetooth Low Energy support (AlAoAziz & Rahayu, 2. Jabir et. Controlling and Monitoring Water Quality A Telegram bot is a robot that is programmed with various commands to carry out a series of instructions given by the user (Eva, 2. This bot is just a Telegram account operated by software that has AI (Artificial Intelligenc. features (Nursalim & Irianto, 2. In making telegram bots, there are two ways, namely long polling and webhook (Administrator, 2. These two test methods use the response time parameter, which is the range of usage time required from the user performing the command/request until the user receives a reply from the telegram bot (Suharjo & others, 2. Ultrasonic sensors are sensors that work on the principle of reflected sound waves and are used to detect the presence of a particular object or object in front of it. This sensor is used to detect the water level in the tank (Solihin et al. , 2. The TDS sensor has a working principle that matches the nature of electrical conductivity (Damayanti, 2. There are two electrodes that can measure conductivity in liquids. The content of ion particles and electrolyte properties in liquids can affect the results of measurements using TDS sensors (Wirman et al. , 2. PH-4502C Sensor the pH meter sensor is an electronic device used to measure the pH . cidity or alkalinit. or base of a solution (Safiroh et al. , 2. The pH meter consists of a pH probe measurement connected to a readout measurement that measures and displays the pH value (Wirman et al. , 2. METHOD 1 Time and Place Research and design was carried out from July 2023 to August 2023 at BTN Asal Mula. Jl. Perintis Kemerdekaan 3 and the Makassar ATI Polytechnic Campus Laboratory and then testing data collection at UD. PATIH Drinking Water Depot located in Pentuanginan. Tomenawa Village. Baraka District. Enrekang Regency. South Sulawesi Province. 2 Design technique In the design process of controlling and monitoring water quality at UD. PATIH drinking water depot, a block diagram is made to see the overall system built and the relationship between these systems, as shown in Figure 1. ACC 220V Power Supplay 12V TDS Sensor Relay 5V Ultrasonic Sensor Ph Meter Sensor NodeMCU ESP32 Pump Reservoir Telegram Figure. Block diagram Inspiration: Jurnal Teknologi Informasi dan Komunikasi Volume 14. Number 2. December 2024: 1 Ae 13 https://doi. org/10. 35585/inspir. P-ISSN : 2088-6705 E-ISSN : 2621-5608 Figure 1 above, is a block diagram of controlling and monitoring water quality at UD drinking water depot. PATIH is based on NodeMCU ESP32. Where the power supply and COM relay pins are connected directly to 220VAC. Then the power supply supplies NodeMCU ESP32 as a data processing center. In general, the block diagram of the system gets input, namely the TDS sensor to detect dissolved solids in water, the ultrasonic sensor to detect water level, and the pH sensor to detect potential hydrogen or hydrogen strength in water. Then Telegram as an output which functions to display the value generated by the sensor on a cellphone or connected monitoring device, while the relay is a switch to provide 220 VAC electricity to the water Figure. Flowchart 3 Data Collection Technique This The data collection stage is the initial step in the design process, requiring the search for references from various relevant sources. The steps involved include gathering references related to the required data, conducting observations and direct interviews at UD. PATIH drinking water depot to understand the problems encountered, and consulting with the final project supervisor to obtain information and guidance on the necessary data collection. 4 Data Analysis The data analysis conducted by the author in this study involves several stages. First, all sensors were tested by comparing the measurements of the devices using percentage deviation, accuracy, and average deviation. Second, the entire device was tested using the developed Third, a trial of the complete device was conducted at the UD. PATIH Drinking Water Depot located in Pentuanginan. Tomenawa Village. Baraka District. Enrekang Regency. South Sulawesi. Jabir et. Controlling and Monitoring Water Quality RESULTS AND DISCUSSION 1 Working Principle The wiring diagram is made through the Fritzing application which allows assembling components starting from connecting the pH. TDS, and ultrasonic sensors to the input pin of the NodeMCU esp32 Microcontroller then the output pin of the Microcontroller is connected to a relay that functions as a switch on the pump, to monitor the water condition NodeMCU esp32 is connected to the Telegram via WiFi. Image description: NodeMCU ESP32 HC-SR04 ultrasonic sensor TDS sensor V1. 0 DF-ROBOT PH-4502C sensor Wifi Telegram App Relay Voltage Source 220 VAC Water Pump Figure. Wiring diagram The results of the design of controlling and monitoring water quality at UD. PATIH drinking water depot based on NodeMCU ESP32 can be seen in Figure 4. Image description: Power Supply 12 VDC pH Sensor Module Relay TDS sensor module NodeMCU ESP32 Figure. Control circuit The design results of the Prototype for controlling and monitoring water quality at UD. PATIH drinking water depot is shown in Figure 5. Inspiration: Jurnal Teknologi Informasi dan Komunikasi Volume 14. Number 2. December 2024: 1 Ae 13 https://doi. org/10. 35585/inspir. P-ISSN : 2088-6705 E-ISSN : 2621-5608 Figure. Prototype of water control and monitoring at UG. PATIH dringking water depot This study employs several components, ranging from the control circuit to the entire device, each with its specific function. The 12V power supply is used to step down and convert the voltage from 220 VAC to 12 VDC, serving as a power source for the microcontroller. The TDS (Total Dissolved Solid. sensor probe is immersed in the first tank to detect the amount of dissolved solids in the water, while the pH (Potential Hydroge. sensor probe is also immersed in the first tank to measure the water's hydrogen potential. An ultrasonic sensor is installed on the lid of the second tank to detect the water level in that tank. The readings from these three sensors are sent to the NodeMCU ESP32, which functions as a microcontroller to process the sensor signals, issue commands to the relay, and transmit sensor readings to a Telegram bot based on commands programmed in the Arduino IDE. The relay controls the flow of electricity from the power supply to the water pump, which is used to transfer water from the first tank to the second. Wifi connects the microcontroller to the Telegram bot, which serves as a platform to monitor the water quality and level in the tanks. 2 Testing the pH sensor Testing the performance of the sensor in detecting the pH of water was carried out using pH buffers 4 and 7. The pH sensor consists of pH electrodes made of special materials such as glass coated with special compounds, such as special electrolytes or reference gels (Manjakkal et al. , 2. Figure. Testing the pH sensor Jabir et. Controlling and Monitoring Water Quality Table 1, it can be seen a series of pH measurement results taken with the help of sensors on various buffer solutions, where each solution has a predetermined pH value. This shows that this sensor has a high level of accuracy in its use to measure the pH of buffer solutions. Table 1. Calibration Results of pH Sensor Readings pH Buffer . H) Sensor Reading . H) Nature Acid 4,02 Error (%) 4,02 Acid 4,06 7,03 7,03 7,04 Total Error Percentage Acid 0,48 0,43 0,43 0,57 2,86% Netral Netral Netral 3 TDS (Total Dissolved Solid. sensor testing Testing the performance of the sensor in detecting dissolved solids in water is done using several water samples. The TDS sensor is a device used to measure the total amount of dissolved solids in a solution or liquid (Erlina & others, 2. Figure. TDS sensor testing In Table 2, it can be seen that there is a difference of 9 ppm between the sensor readings displayed on the Serial Monitor and the TDS meter. This difference can be caused by several factors, such as sensor inaccuracy, calibration error, reference solution variation, or natural variability in measurement. Table 2. Sensor Reading Calibration Results TDS Meter . Sensor Reading . Total Error Percentage Error (%) 1,53 1,45 1,32 1,26 7,46 4 Ultrasonic Sensor Testing Ultrasonic sensors work on the principle of reflected ultrasonic waves to measure the distance or height of an object (Purwanto et al. , 2. First, the ultrasonic sensor will emit ultrasonic waves with a high frequency towards the object you want to measure the distance. After reaching the object, the ultrasonic waves will bounce back to the sensor (Arifin et al. , 2. Inspiration: Jurnal Teknologi Informasi dan Komunikasi Volume 14. Number 2. December 2024: 1 Ae 13 https://doi. org/10. 35585/inspir. P-ISSN : 2088-6705 E-ISSN : 2621-5608 Figure. Ultrasonic sensor testing Table 3 illustrates the highly accurate measurement results of using the ruler and sensor to measure the distance of objects in centimeters. The data results in this table show that measurements using the ruler and sensor in the calibration process are very accurate and do not produce significant errors. Table 3. Sensor Reading Calibration Results Ruler Length . Sensor Reading . Total Error Percentage Error (%) 5 Testing the Prototype This test aims to determine whether the system as a whole has worked as designed. Testing is carried out starting from testing sensor readings, pump control, and Telegram Monitoring on the Prototype. Water Level . Table 4. Testing the Prototype pH Air . H) TDS Air . 7,44 7,40 7,46 4,37 7,40 7,43 7,44 7,46 7,44 7,43 Pump State Inactive Active Active Inactive Active Active Active Inactive Active Inactive From the test results in Table 4, pH and TDS sensors are used to detect water quality in the first tank, while ultrasonic sensors are used to detect water level in the second tank. Jabir et. Controlling and Monitoring Water Quality 6 Testing at UD. PATIH dringking water depot This test aims to determine whether the system as a whole has worked as designed. Testing is carried out starting from testing sensor readings, pump control, and Telegram Monitoring. Obtained test result data as shown in Table 5. Table 5. Testing at UD. PATIH Drinking Water Depot Water Level . pH Air . H) TDS Air . Pump State 7,28 Inactive 7,34 Active 7,43 Active 7,44 Active 7,47 Inactive 7,49 Active 7,45 Active 7,47 Inactive 4,56 Inactive 7,47 Active From the test results in Table 5, it can be seen that in testing the control and monitoring of water quality at UD's drinking water depot. PATIH based on NodeMCU ESP32, the pump condition is in accordance with the working principle of this tool. However, the table shows that the pH and TDS sensor readings are unstable, so the reading values go up and down. These results show that the water quality control and monitoring system at UD drinking water depot. PATIH based on NodeMCU ESP32 is able to fill the tank and monitor water quality effectively. Figure. Monitoring view of water quality and level on Telegram Bot CONCLUSIONS AND SUGGESTIONS The results of testing on the prototype and direct testing at UD. PATIH shows that this tool successfully works according to its purpose. The tests involved various variations of water height, pH value, and TDS value. The pump is activated when the water quality meets the set criteria and is stopped if any changes are detected that could affect the water quality. Through Inspiration: Jurnal Teknologi Informasi dan Komunikasi Volume 14. Number 2. December 2024: 1 Ae 13 https://doi. org/10. 35585/inspir. P-ISSN : 2088-6705 E-ISSN : 2621-5608 this device, the manager of a drinking water depot can efficiently control and monitor the quality and quantity of water in the reservoir remotely through a Telegram application. This tool has the potential to optimize water management, ensuring that the water entering the second reservoir complies with the set standards of pH 6. 5, and TDS less than 150. addition, this technology can minimize the risk of using low-quality water and provide benefits in more effective and efficient monitoring and control. REFERENCES