Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 13, No. 3, 2025 73 Design of Hydrological Information Monitoring System Based on Single-Chip Microcomputer Siju Jiang, Ying Guo * School of Electronic Information, XiJing University, Xi’an, Shaanxi, China * Corresponding author: Ying Guo Abstract: China is rich in water resources, but water pollution has intensified under industrialization. Traditional manual hydrological monitoring is inefficient and error-prone. This paper designs an intelligent monitoring system based on STM32 single-chip microcomputer, which uses turbidity, pH, and temperature sensors to monitor water quality in real time. Data is transmitted remotely via a GSM module to achieve intelligent management, reducing costs and improving efficiency. This system provides a reliable solution for water resource protection and holds significant social and practical value. Keywords: Hydrological Information Monitoring; pH Sensor; Water Turbidity Monitoring; GSM Communication. 1. Introduction China has abundant water resources, but water pollution has worsened during industrialization. Traditional manual hydrological monitoring suffers from low efficiency and large errors. This paper designs an intelligent monitoring system based on STM32 single-chip microcomputer, using multiple sensors to collect water quality indicators in real time.[1] Data is transmitted remotely through a GSM module to realize intelligent management, reducing monitoring costs and risks while improving efficiency. This provides a reliable solution for water resource protection. 2. Overall Scheme The hydrological monitoring system with STM32 single- chip microcomputer as the core integrates turbidity, pH, and water temperature sensors to monitor water parameters in real time, and displays data through an LCD1602.[2] The overall framework of the hydrological information monitoring system is designed as shown in Figure 1. Figure 1. Structure of Hydrological Information Monitoring System 3. Hardware Design 3.1. Control Module The STM32F103C8T6 single-chip microcomputer is selected, with a main frequency of 72MHz, 64KB Flash, and 20KB SRAM, meeting the requirements of high performance and low power consumption to provide a stable control core for the system.[3] 3.2. Water Turbidity Detection Module The TSW-20 sensor is adopted, and its output analog signal is converted into a digital value by the internal ADC of STM32, which is input through the PA1 port to realize turbidity data collection. The water turbidity monitoring circuit is shown in Figure 2. Figure 2. Water Turbidity Monitoring Circuit 3.3. pH Value Detection Module Signal modulation The E-201-C high-precision pH probe is used, and its output analog quantity is converted into a pH value through ADC, communicating with the single-chip microcomputer via the PA0 port, as shown in Figure 3. Figure 3. PH detection circuit 3.4. Water Temperature Detection Module The waterproof DS18B20 sensor is connected to the PB8 pin of the single-chip microcomputer via a single bus, with a detection range of -25℃ to 150℃. A 10K pull-up resistor is added to the data output port to enhance transmission stability. 74 The temperature detection circuit design is shown in Figure 4. Figure 4. Water Temperature Detection Circuit 3.5. Display Module The LCD1602 display transmits data through PB0-PB7, with PB11 and PB12 controlling the read-write mode and command/data selection respectively. A slide rheostat adjusts the contrast. The LCD1602 display module circuit is shown in Figure 5. Figure 5. Hydrological Information Monitoring System Display Circuit 3.6. Indicator Light Module Three LED lights correspond to alarms for abnormal temperature (>30℃), pH (>10), and turbidity (<30), with PA2 controlling the buzzer to trigger an alarm in case of abnormalities.[4] The indicator light circuit of the hydrological information monitoring system is shown in Figure 6. Figure 6. Hydrological Information Monitoring System Indicator Light Circuit 3.7. Prompt Tone Module The SIM800 module communicates asynchronously with the single-chip microcomputer via PA9 (TXD) and PA10 (RXD) to achieve remote data transmission.[5]The buzzer prompt tone circuit of the hydrological information monitoring system is shown in Figure 7. Figure 7. Hydrological Information Monitoring System Buzzer Sound Circuit 3.8. GSM Communication Module PA3 and PA4 control the conduction of triodes to drive pumps M1 (for turbidity abnormalities) and M2 (for pH abnormalities), realizing automatic water body adjustment.[6] The GSM data transmission circuit is shown in Figure 8. Figure 8. GSM Data Transmission Circuit 3.9. Reaction Control Module PA3/PA4 control triodes, and the pumps are activated when turbidity or pH exceeds the standard. The reaction control circuit based on motors for the hydrological information monitoring system is shown in Figure 9. Figure 9. Reaction Control Circuit 4. Software Design The system is developed based on Keil, with the following process: initialize the single-chip microcomputer and sensors, collect pH, turbidity, and temperature data in real time, display them through the LCD; trigger an alarm and start the 75 corresponding pump when parameters exceed the standard; transmit data remotely via the GSM module.[7] The software design flow chart is shown in Figure 10. Figure 10. Software Design Flow Chart 4.1. Subroutine Design of LCD1602 Display The LCD1602 display shows real-time parameters according to instructions after initialization. For temperature detection, the DS18B20 is reset, a conversion command is sent, and 16-bit data is read to parse the temperature value. For wireless communication, the GSM module is initialized and interacts with the single-chip microcomputer via UART to send text messages.[8] The LCD1602 display subroutine flow chart is shown in Figure 11. Figure 11. Flowchart of LCD1602 Display Subroutine 4.2. Temperature Detection Subroutine Design The hydrological information monitoring system detects temperature through the DS18B20[9], and the temperature detection subroutine flow is shown in Figure 12. Figure 12. Temperature Monitoring Subroutine Flow Chart 4.3. Water Turbidity Detection Subroutine Design Figure 13. Flow Chart of Water Turbidity Detection Subroutine 76 In the hydrological information monitoring system, the TSW-20 sensor is used to monitor water turbidity, and the water turbidity detection subroutine flow is shown in Figure 13. 4.4. pH Value Detection Subroutine Design The hydrological monitoring system uses the E-201-C pH probe to detect the water body pH value. The built-in ADC of the STM32 single-chip microcomputer converts the analog signal output by the probe into a digital signal.[10] The pH value detection subroutine flow is shown in Figure 14. Figure 14. PH detection subroutine flowchart 4.5. Wireless Communication Subroutine Design The remote communication subroutine for the hydrological information monitoring system design is shown in Figure 15. Figure 15. Wireless Communication Subroutine Flow Chart 4.6. Reaction Control Subroutine Design This hydrological monitoring system design uses a stepper motor to complete the design of the water area reaction control module, as shown in Figure 16. Figure 16. Flowchart of Reaction Control Subroutine 5. System Debugging 5.1. System Simulation Debugging After building the simulation environment for the hydrological information monitoring system using PROTUES software, functional testing of the monitoring system can be gradually carried out using the simulation software. (3) In the hydrological monitoring system, an alarm will be triggered when the pH value is abnormal. As shown in the following figure 19. (4) It also has an alarm function when turbidity is abnormal, as shown in the following figure 20. (5) The water temperature monitoring function of the hydrological information monitoring system is implemented through the DS18B20 sensor (6) Adjust the sensor detection value of DS18B20 as shown in Figure 22. (7) The verification of the remote hydrological information monitoring function of the hydrological information monitoring system is shown in Figure 23. 77 Figure 17. Initial operation diagram of hydrological information monitoring system Figure 18. Display Status Diagram of Hydrological Information Monitoring System Figure 19. PH value abnormal alarm status diagram of hydrological information 78 Figure 20. Effect of Water Turbidity Abnormal Alarm Figure 21. Temperature Detection Effect of Hydrological Information Figure 22. Temperature Abnormal Alarm Diagram of Hydrological Information Monitoring 79 Figure 23. Wireless Communication Effect of Hydrological Information Monitoring System 6. Conclusion With the rapid development of China's manufacturing industry, many chemical and manufacturing plants have caused serious water pollution due to 大量 (massive) 排污 (pollution discharge). After the hydrological information of rivers and lakes is polluted, if water is to be used for industrial production, more treatment costs need to be invested, causing serious waste of resources and energy. Especially for the food industry, unqualified hydrological information will directly lead to production stoppage and affect food safety. The use of sewage in agriculture will also result in crop yield reduction, quality degradation, and far-reaching impacts on soil quality. This paper designs a hydrological information monitoring system using STM32 single-chip microcomputer as the main control core, adopting a water turbidity sensor to measure water turbidity, a pH value sensor to determine water pH parameters, and DS18B20 for water temperature detection. The monitored parameters are displayed on an LCD1602 for easy observation and use by users. References [1] Chen Shuxian, He Wenbin, Zhang Tuoxiang, et al. Design and Implementation of a Smart Ecological Hydrological Information pH Value Monitoring System Model [J]. Technology and Innovation, 2022, (05): 125-129. [2] Qian Ying, Du Liang, Yan Xiang. Design of a Scalable Dual- Power Hydrological Information Monitoring System [J]. Technology Innovation and Productivity, 2022, (12): 30-33. [3] Tan Hua. Design of a Remote Wireless Multi-Parameter Hydrological Information Monitoring System Based on Labview Monitoring [J]. Network Security Technology and Application, 2022, (08): 36-38. [4] Deng Jie, Wang Shoufeng, Huang Xiaoping, et al. Design of an On-Line Hydrological Information Monitoring System Based on STM32 [J]. Electronic Production, 2023, 31(18): 7-10. [5] Ma Yinxing, Guo Laigong, Zhu Mingzhi, et al. Design of a Hydrological Information Monitoring System Based on a Microcontroller [J]. Journal of Luoyang Institute of Science and Technology (Natural Science Edition), 2022, 32(03): 53- 57. [6] Xiao Wubing, Ling Pengpeng, Sha Wen. Design of an On-Line pH Value Monitoring System for Solid-State Fermentation Cellars [J]. Sensors and Microsystems, 2021, 40(03): 109-111. [7] Wang Xiaosong, Chang Hongye, Zhi Xinze, et al. Intelligent Double-Tub Washing Machine Controlled by STM32 [J]. Hebei Agricultural Machinery, 2020, (04): 56-57. [8] Zhou H, Qiu J, Lu H L, et al. Intelligent Monitoring of Water Quality Based on Image Analytics [J]. Journal of Contaminant Hydrology, 2023, 258: 104234. [9] Kanaujia S B A. Quality Monitoring of Water Being Fed to Livestock in Haryana - A Case Study [J]. International Journal, 2022, 18(2): 115-121. [10] Liu Shuo. Design of an Intelligent Hydrological Information Monitoring System Based on Single-Chip Microcomputer [J]. Internet of Things Technology, 2021, 11(10): 3.