- Home >> Technical Service >> MCU
Irrigation Water Saving Control System
Design of Remote Irrigation Water Saving Control System Based on SCM
My country is a typical large agricultural country, and most of the crops are irrigated by ground irrigation. This method is less efficient, and the duration and degree of irrigation are judged based on manual experience. Traditional bottom irrigation wastes a lot of manpower and material resources, and the water resources for irrigation cannot be absorbed by crops in time. In addition, my country's water resources are relatively scarce, so water-saving irrigation technology is more suitable for the needs of development.
Water-saving irrigation technology has matured abroad, mainly because they started early and used relatively advanced electronic and computer technology. If all the irrigation systems from abroad are imported, not only the technology will be controlled by foreign countries, but also the cost will be higher. In addition, my country's natural climate and land conditions are not the same. Based on this, this paper designs a control system based on the single-chip microcomputer STC89C52, and describes the hardware circuit of the control system, mainly including power supply circuit, display circuit, data acquisition circuit and drive circuit, etc., and uses the development software Keil to design the program, mainly including monitoring program, clock program, etc. After final debugging, the control system can well achieve the expected requirements, achieve the purpose of rational irrigation of crops, and is easy to popularize.
1. Working principle and structure of remote irrigation water saving control system
The remote irrigation system is based on the single-chip microcomputer, and controls, processes and monitors other equipment at the same time. The overall structure diagram is shown in Figure 1. The overall irrigation system mainly includes the control system of the single chip microcomputer, the pipeline water transportation system, the humidity sensor and the power supply circuit, etc. According to the introduction in Figure 1, its working principle is as follows.
(1) The irrigation device is mainly composed of a water pump, a pressure gauge, a flow meter, etc. Under a certain pressure, water and fertilizer can be fused together. At this time, the impurities are first filtered out, and then the useful liquid formed enters the inside of the pipeline.
(2) The pipeline system for water transportation is mainly composed of trunk pipelines, branch pipelines, and capillary pipes. In general, the diameter of the main pipe and the straight pipe is about 37.5-100mm, and the diameter of the capillary is about 10mm. In order to better realize the smooth circulation of water inside the pipeline, different pipelines are connected with two-way or three-way valves.
(3) The function of the dripper is mainly to change the shape of the water flow into tiny water droplets, and then fully soak the soil.
(4) The humidity sensor mainly measures the humidity inside the soil, which can collect a large amount of data from the control system, and then evaluate the degree and demand of irrigation in a timely manner.
(5) The single-chip microcomputer is a key part of the irrigation system, which is mainly composed of a central processing unit, a memory, and a timer. The upper computer and the single chip computer in the irrigation system are connected by serial communication RS232, the humidity sensor realizes data transmission and conversion according to the A/D interface, the control system processes the received signal, and uses the driving circuit to realize the control of the solenoid valve system. Control and further complete the irrigation of crops.
2. Hardware circuit design of remote irrigation water saving control system
The hardware circuit of the whole system is composed of single-chip microcomputer control circuit, clock and reset circuit, man-machine dialogue circuit, data acquisition circuit, solenoid valve drive circuit and power supply module.
2.1 Single-chip circuit design
The single-chip microcomputer STC89C52 is a low-voltage, high-performance 8-bit control machine produced by ATMEL Company, which contains 8K read-only memory and 256K data memory. It has 40 pins, 32 bidirectional input ports, 2 interrupt interfaces, 3 16-bit counters and 2 serial communication interfaces, etc., and is compatible with the MCS-51 instruction system. The clock frequency is 0~24MHz, and the access terminal of the power supply is -5~+5V.
2.2 Clock and reset circuit design
The single-chip microcomputer is composed of an internal oscillator, which is a high-gain reverse amplifier. XTAL1 and XTAL2 are input and output respectively. When the system is working, if it encounters a fault or a complex state, it needs to reset the system. The automatic reset function of this microcontroller is mainly realized by charging and discharging the capacitor. The manual button reset is mainly connected with the power supply through a resistor.
2.3 Man-machine interface circuit design
The man-machine interface circuit mainly realizes the exchange of information and data between man and computer. Currently the most commonly used output and input devices include monitors and keyboards, and the lower display interface is designed to face the LED display interface circuit and keyboard circuit. In order to simplify the system, the control system uses a four-in-one digital tube. It is composed of 8-bit common anode pipeline, and it is displayed dynamically.
In order to better realize the control of the system, 4 independent keyboards are adopted, the number of keys is less and the operation speed is faster. The overall structure is simple and the cost is low.
2.4 Data Acquisition Circuit Design
In order to accurately realize the irrigation of crops, accurate sensors must be selected. The current soil moisture sensor is the FDR type. This type of sensor makes simple, safe, automatic measurements. According to the actual situation, select SWR-2 sensor.
After the sensor is collected, digital-to-analog conversion is required, so the TLC549 converter is selected accordingly. It is an 8-bit gradually approaching serial A/D chip.
When converted into data, the data needs to be stored. Due to the large amount of measured data, AT24C16 memory is selected according to requirements. It has 2048 8-bit bytes, has 16K serial memory, and operates through the bus.
2.5 Output drive circuit design
The relay is an important part of the output circuit, its function is mainly to drive and control the solenoid valve, and then complete the action of the nozzle. In addition, in order to improve the anti-interference performance of the whole system, optocoupler isolation is used between the relay and the single-chip microcomputer. This power supply system is powered by dual power supplies.
3. Software program design of remote irrigation water saving control system
Modular structure design is one of the main methods used in the software program design of the irrigation system. Its structure has corresponding module programs to complete, mainly including different signal acquisition modules, signal initialization modules, system control modules, and time-limited display modules. . The modules of the above-mentioned parts cooperate with each other to complete the irrigation of crops within a limited time. The control system has the advantages of strong versatility, high safety, and convenient debugging.
When the single-chip microcomputer STC89C52 is powered on, the first thing to do is to initialize the system program. The main content of the initialization includes the initialization of the required chip interface and the initialization of different flags and variables. After completing these, the entire system program will enter the main program. The single-chip microcomputer will convert the collected soil moisture information through a digital-to-analog converter, and then compare it with the value set in the program. After a certain comparison, the LED display will be Displays the moisture content of the soil in real time. If the obtained value is larger than the standard value, the software program will continuously collect the program and display the value, otherwise the program will proceed according to the steps, start the designed subroutine, and further limit the solenoid valve control and nozzle time until The soil moisture value is not much different from the set value. The entire system also has a time limit. If the time limit is exceeded, it will be re-initialized and the irrigation of crops will be restarted.
The clock program of the software system mainly completes the timing and timing of the single-chip microcomputer STC89C52. The interface T0 of the single-chip microcomputer can adjust the time display of the whole system and the determination of the object through programming.
The keyboard scanning program of the software is mainly aimed at testing the vibration and key state of the software during system operation. The entire scanning procedure is to scan every 50ms. In order to better prevent key conflicts during operation, the system only executes the key once.
The design of the LED display program is mainly carried out according to the common anode digital tube adopted. When the anode of the entire diode is at a high level, the digital tube will light up at this time. Therefore, parallel common anode digital tubes can clearly display the change of time. When performing dynamic system reality, the numbers in the digital tube are stored in the ROM in a certain format, and the stored content is called through the translated different numbers to further display the change of time.
When performing digital-to-analog conversion, the TLC549 converter is based on mode input, A/D conversion, and data output. The data storage is mainly AT24C16, and the data bus used at this time is I2C. Write different bytes in time according to the addressing and response content of different situations of the chip. The transmission of the bus does not affect the change of the clock line level, and the signal for data transmission will start when the idle condition is satisfied.
4. Debugging of remote irrigation water saving control system
The software program design of the control system is developed based on KeilC51. Its simulation debugging can also be completed by Keil software. The final generated object code is burned into the required STC89C52 microcontroller through the programmer JDT-2008.
After verification, the value of the sensor detection number is not much different from the actual value, which basically meets the requirements.
Summarize
With the development of the times, my country's water resources are increasingly scarce, so the selection of crop irrigation methods is particularly important. According to actual needs, this paper designs a remote water-saving irrigation system based on the single-chip microcomputer STC89C52.
Firstly, the research status of irrigation system at home and abroad is introduced, and on this basis, the structure and working principle of irrigation system are expounded. Then, the hardware of the system is designed, mainly including single-chip circuit design, clock and reset circuit design, drive circuit design, man-machine interface circuit design and data acquisition circuit design. After completing the hardware design, it is necessary to program the software. The software program design mainly includes the design of the main monitoring program, the system clock program design, the key recognition and processing program design, and the dynamic display program design. Finally, debug and verify the designed irrigation system. After testing, it is found that the whole system meets the design requirements, with low design cost, reliable operation, high safety and relatively simple operation. It not only overcomes the difficulty of designing transmission, but also provides a reference for the design of similar systems.
The above is the design and implementation of the remote irrigation and water-saving control system based on single-chip microcomputer introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.
- TOP