Table of Contents
Abstract III
ABSTRACT IV
Chapter 1 Introduction 1
1.1 Research Background 1
1.2 Research Significance 1
1.3 Current Research Status 2
Chapter 2 Overall System Design 3
2.1 Overall Framework Design 3
2.2 Functional Module Design 4
2.2.1 Chip Selection 4
2.2.2 Key Control 4
2.2.3 Water Level Detection Sensor 5
2.2.4 Soil Moisture Detection Sensor 5
Chapter 3 Overall Hardware Design 7
3.1 Minimum System Circuit Design 7
3.1.1 Reset Circuit Design 7
3.1.2 Power Supply Circuit Design 8
3.1.3 Crystal Oscillator Circuit Design 8
3.2 LCD1602 Circuit Design 8
3.3 Soil Moisture Sensor Circuit Design 9
3.4 Analog-to-Digital Converter Circuit Design 10
3.5 Relay Circuit Design 10
3.6 Buzzer and Key Circuit Design 11
Chapter 4 Overall Software Design 13
4.1 Main Interface Control Flow Design 13
4.2 LCD Display Program Flow Design 17
Chapter 5 System Testing 22
5.1 Purpose of Testing 22
5.2 Test Result Analysis 22
Conclusion 25
Acknowledgments 26
References 27
Abstract
With the continuous progress of agricultural technology in our country and the rapid development of modern agriculture, people have put forward higher requirements for agricultural production. To improve agricultural production efficiency, it is necessary to strengthen the protection of water resources and improve agricultural production efficiency by controlling and utilizing water resources. The intelligent irrigation system is a new type of irrigation equipment, which uses a microcontroller as the core processing unit, monitors soil moisture, temperature and other parameters through sensors, and transmits them to the irrigation management center for processing and control through the network. It can automatically adjust soil moisture and temperature, while meeting the growth needs of crops, saving water resources and improving water resource utilization efficiency.
This article designs an intelligent irrigation management system based on STM32, with a microcontroller as the core processing unit. A series of sensors are used to monitor parameters such as soil moisture sensors and water level detection sensors. The monitored data is transmitted to the irrigation management center for processing and control through the network, thereby achieving the function of intelligent irrigation.
Keywords: soil moisture sensor; water level detection sensor; STM32; irrigation management system;
Chapter 1 Introduction
1.1 Research Background
With the continuous development of the economy, people’s living standards are also improving, and the yield of crops planted by farmers is increasing. However, the produced crops cannot meet people’s demands. Nowadays, people pay more attention to nutrition and quality of life. Agricultural products are sold by weight, which leads to farmers needing a lot of labor to irrigate crops to meet their demands. One person clearly cannot complete this task, and many places now rely on machinery for irrigation, which reduces the need for labor. Thus, the intelligent irrigation system has emerged.[2].
The country now advocates the intelligent development of agriculture and vigorously develops agricultural production technology. Currently, China’s agricultural production mainly relies on traditional, extensive irrigation methods, such as irrigation from fields, ponds, and reservoirs. This method cannot ensure a continuous supply of soil moisture and cannot flexibly adjust according to crop growth needs, such as irrigating to cool down when temperatures are too high or irrigating to warm up when temperatures are too low, failing to meet the moisture needs of crops. Traditional irrigation methods have many drawbacks: first, high labor costs; second, the need for dedicated management; third, ineffective control.[3].
The intelligent irrigation system uses sensors to collect information on soil moisture, air temperature, etc., and transmits it to the microcontroller for processing, which then controls the irrigation equipment. This system utilizes computer technology to monitor and manage irrigation equipment in agricultural production. It can be widely applied in greenhouses, greenhouse planting, fruit tree cultivation, and other fields.
China is a major agricultural country, but the level of agricultural mechanization is relatively low. Agricultural mechanization can improve production efficiency and reduce labor intensity, promoting farmers’ income. In the development of modern agriculture, the technological progress and innovation in water-saving, fertilizer-saving, and pesticide-saving irrigation techniques are of great significance. Achieving agricultural modernization has become a common trend and main task for agricultural development in countries around the world.[4].
Based on this goal, we designed an intelligent irrigation system controlled by a microcontroller. This system mainly includes the microcontroller system and the soil moisture collection system. The system uses the STM32 microcontroller as the core control module, with soil moisture sensor YL-69 and water level detection sensor as the main detection components.
1.2 Research Significance
China is a major agricultural country, and the development of agriculture is related to the livelihood issues of the nation. Our country’s population accounts for more than thirty percent of the world’s total population, but our arable land area is only about seven percent of the world’s total arable land area. This requires a large amount of labor to cultivate the land. Therefore, to better improve our agricultural level and farmers’ income, it is very necessary to research intelligent irrigation systems.[5].
With a large population and scarce resources, and outdated traditional agricultural technology, improving agricultural production efficiency requires the introduction of technological means. Currently, the level of technological development in our country is low, and the technical means in agricultural production are not yet perfect. For example, water-saving irrigation, agricultural machinery, and fertilization methods do not meet the requirements of modern agricultural development. To address these issues, we need to research and apply these technical means to improve our agricultural production level through the intelligent irrigation management system and promote the development of modern agriculture in our country.[6].
The intelligent irrigation management system is one of the more advanced technologies in intelligent irrigation technology. This system can provide the required moisture when needed, solving the problem of irrigation water scarcity for farmers. Currently, in some regions of our country, it has not yet been popularized, mainly because many places still use traditional irrigation methods. In traditional methods, farmers can only determine the irrigation amount based on weather changes and crop growth conditions, rather than based on crop needs, which does not allow for the most reasonable and effective use of water resources.[7].
1.3 Current Research Status
In the past, farmers had to irrigate manually, and in some arid areas, there was no water available for irrigation, making it impossible for them to plant crops. Continuous rainy weather would exacerbate the situation, leading to significant losses and reduced farmers’ economic income. The intelligent irrigation system utilizes intelligent irrigation equipment to achieve automatic watering, automatic water control, and automatic soil moisture detection. Due to the high efficiency of the intelligent irrigation system, it can save water and labor resources to a certain extent. Moreover, applying the intelligent irrigation system in agricultural development can effectively improve agricultural production efficiency, save water resources, reduce production costs, increase crop yield, improve crop quality, and enhance comprehensive agricultural production capacity, thus promoting sustainable rural economic and social development.[8].
With the development and progress of modern technology, many crops have begun to use advanced technology for production. For example, the intelligent irrigation system we are going to use is a modern high-tech product that not only meets the needs of agricultural production but also can automatically irrigate based on local climate and environmental conditions, effectively improving crop yield and quality. The intelligent irrigation system is a new product in the country, so it is not yet widely popularized in many places.[9].
Chapter 2 Overall System Design
2.1 Overall Framework Design
The main purpose of designing the intelligent irrigation system is to improve farmers’ work efficiency and facilitate their irrigation tasks. The intelligent irrigation system is mainly divided into two parts: one part is the collection of soil moisture, and the other part is the control of water flow, keeping the soil moisture within an appropriate range. The intelligent irrigation system mainly includes three aspects: first, soil moisture detection; second, water flow control; third, monitoring the working status of the water pump.[10]. As shown in Figure 2-1.
The soil moisture sensor consists of YL-69 and LCD1602, which can transmit soil moisture information to the microcontroller. The microcontroller then reads the data for analysis and processing, issuing control signals to display the water pump working status on the buzzer.[11].
The water flow controller mainly includes YL-69 and LCD1602. After YL-69 transmits soil moisture information to the microcontroller, the microcontroller determines whether to execute the control signal. If executed, it will issue a control signal; if not executed, it will not issue a signal.[12].
The monitoring of the water pump working status mainly includes YL-69, LCD1602, and the relay. YL-69 is responsible for collecting soil moisture information and transmitting the data to the microcontroller, which reads…

