“Countries around the world are increasingly recognizing that water has become a key issue for sustainable development in the 21st century. China’s water resources are already in a state of serious shortage. In addition, 90% of the country’s waste and sewage are directly discharged without treatment or the water pollution is not up to standard, and the water quality of 11% of rivers is lower than the standard for farmland water supply. Water is the lifeblood of agriculture, the controlling element of the ecological environment, and a strategic economic resource. Therefore, the use of water pumps to pump groundwater to irrigate farmland, realize the rational use of water resources, develop water-saving water supply, and improve the ecological environment is the current precise key to agriculture.
Countries around the world are increasingly recognizing that water has become a key issue for sustainable development in the 21st century. China’s water resources are already in a state of serious shortage. In addition, 90% of the country’s waste and sewage are directly discharged without treatment or the water pollution is not up to standard, and the water quality of 11% of rivers is lower than the standard for farmland water supply. Water is the lifeblood of agriculture, the controlling element of the ecological environment, and a strategic economic resource. Therefore, the use of water pumps to pump groundwater to irrigate farmland, realize the rational use of water resources, develop water-saving water supply, and improve the ecological environment is the current precise key to agriculture.
The use of water-saving and energy-saving irrigation methods is the general trend of the development of water supply technology in the world today. The intelligent water supply system has been promoted relatively quickly in foreign developed countries, the technology development is relatively mature, and the start is relatively early, especially in Israel, the United States and Canada and other countries, advanced Electronic technology, computer and control technology have been applied to agricultural water supply, greatly improving the water efficiency and productivity. With the development of my country’s economy and science and technology, the water-saving water supply system has developed rapidly, but most of them stay on the basis of single-chip control as the core technology, and there is a certain gap with foreign developed countries.
The task of farmland water supply is to deliver water from the water source to the farmland in a timely and appropriate amount to meet the needs of crop growth. Water supply from natural state to being absorbed by crops and finally forming yield can be attributed to the following three links:
(1) Lead water to the field through the water supply, transmission and distribution system;
(2) The water is then converted into soil water that can be absorbed by crops with appropriate irrigation techniques;
(3) Crop roots absorb water (including nutrients) from the soil, convert radiation energy into chemical energy through photosynthesis, and finally form dry matter (carbohydrate).
The first two links can be realized by a series of engineering technology and management measures. The goal of saving water and increasing production should be to greatly improve the efficiency of water conversion and output in the above two links. This design paper is designed for the first link. If drip irrigation, spraying, fertilization, pest control and other technologies are used rationally according to the actual conditions of crop fields, the future of my country’s agriculture will be very optimistic.
2 System working principle and hardware structure
2.1 The working principle of the system
In this paper, the single-chip microcomputer system realizes precise automatic irrigation control of farmland by collecting various information such as humidity, temperature, rainfall, pH, water evaporation (wind speed) and air temperature through multiple sensors, and outputs the signal information of A through wireless The full-duplex data transmission transceiver module is transmitted to the control center (embedded system) to determine whether to start the water pump to supply water to the farmland. At the same time, the water supply information is transmitted by GPRS communication to the remote control center through the Internet to realize remote monitoring, and through the computer Some models are used to process information and make water supply plans.
2.2 The hardware structure of the system
The system consists of two subsystems, one of which is the control center: a control host and wireless sensor network nodes. The second is the remote control system: GPRS communication module, Internet network transmission and monitoring center host. Figure 1 is a schematic diagram of the overall structure of the system, and the wireless communication modules in the figure have exactly the same structure. The control host consists of a development platform based on MiniARM embedded microcontroller and a wireless communication module. The host and wireless sensor network nodes form a star topology wireless network; the remote control system is connected to the Internet by the GPRS module Mini-WG23 (this system can be expanded to make the GPRS communication network into a star topology access) and then transmitted to the remote control center.
2.3 Wireless sensor network hardware design
The wireless sensor network model (as shown in Figure 1) is an infrastructure network different from the traditional wireless network. By arbitrarily deploying and removing a large number of sensor nodes (referred to as nodes) in the monitoring area, each node coordinates and quickly forms a communication network. Work tasks are divided under the principle of energy utilization priority to obtain monitoring area information. The self-organizing feature of the network is reflected in that the network can be adaptively reorganized when a node fails or a new node joins, so as to adjust the global detection accuracy and give full play to the resource advantages, that is, each node in the network has the function of data collection and data forwarding. Implement multi-hop routing. The composition of a wireless sensor network node is generally composed of four parts: data acquisition, data processing, data transmission and power supply. The hardware design and software design of each one-chip computer system are the same. The research and design scheme of this design is only for a single-chip system. The form of the physical signal being monitored determines the type of sensor. The processor usually chooses embedded CPU, such as 68HC16 of MOTOROLA Company, C51 series one-chip computer and so on. The data transmission unit can be composed of low-power, short-distance wireless communication modules, but considering theft and natural damage, the system chooses SA68D21DL with high power consumption and long transmission distance, farmers can place the main controller in the office or home . Figure 2 depicts the composition of a node, where the direction of the arrow indicates the direction of data flow in the node.
2.4 Wireless Communication Module Selection
For mobile or portable data acquisition and measurement and control systems, wireless data transmission is a better choice. The SA68D21DL wireless data alarm transceiver module produced by Beijing Jiemai Communication Equipment Co., Ltd. is a transceiver module that can perform full-duplex long-distance wireless communication between a microcomputer and a microcomputer, or between a microcomputer and a single-chip microcomputer. The module can also form a wireless local area network in the form of single-transmit multiple-receive or multiple-transmit single-receive at most 65535 points. Its upper computer hardware wiring circuit is shown in Figure 3.
In this system, SA68D21DL is a higher voltage device, and the voltage requirement is 6 V. In order to interface with it, AT89S51 also works under 6 V (AT89C2051 is a wide voltage device). The system is powered by +6 V power supply, which can be obtained from a tributary regulated power supply. Considering interference and system stability, it is recommended to use dry batteries for power supply.
3 main control system
In this system, the control host acts as a protocol conversion gateway between the Internet and the wireless sensor network. Its hardware adopts MiniARM embedded industrial control module of Zhiyuan Electronics Company. The MiniISA series acquisition board adopts an intelligent board structure, that is, an MCU is built in the board. The on-board MCU controls the I/O ports on the board and realizes the cache of I/O data, thereby reducing the board’s dependence on the MiniISA interface host, saving the host’s time for data processing, and ensuring the MiniISA system runs more efficiently. In addition, the onboard MCU can further process the collected data or output data. The system circuit diagram is shown in Figure 4.
3.1 MiniISA-8016A digital input relay output board
MiniISA-8016A is a relay output and isolated digital input card for MiniISA bus. The card provides 8 isolated digital inputs and provides 1 500 VDC isolation protection for digital acquisition in noisy environments; it has 8 A relay that can be used as an on/off control device or a small power switch; in addition, it has 2 isolated PWM outputs that can be customized by the user.
3.2 MiniISA-GMT05001 Human-Machine Interface Board
MiniISA-GMT05001 is a human-machine interface board based on MiniISA bus, suitable for any baseboard with MiniISA bus master circuit.
It adopts a 5.7-inch monochrome screen with a resolution of 320 × 240, supports touch screen operation, and provides six key inputs. The corresponding Display and key functions are completed by operating the MiniISA bus.
3.3 MiniISA GPRS wireless data transmission equipment MiniISA-WG23
MiniISA-WG23 is an intelligent wireless data transmission device (DTU) based on GPRS network. It has a MiniISA parallel interface, which can be easily embedded in the user’s equipment, providing transparent data transmission function, and can easily realize wireless data transmission.
4 Remote control system
The remote control system mainly designs GPRS communication system, GPRS and Internet network access system, and monitoring center host friendly interface display control system. This part of the hardware can be applied to existing Internet resources such as mobile companies and telecommunications. The software can be independently developed considering cost and professional functions. It is recommended to use existing remote software, such as “Ball Remote Control” software, Hunan Province Remote Monitoring Equipment Co., Ltd. The RC-2000 visual remote control software system.
5 Pump motor drive circuit
Considering the isolation of strong and weak electricity, the pump power supply system can be considered to be designed separately from the entire system. It can be realized by controlling the motor power supply by the relay on the system board. The circuit is shown in Figure 5.
6 System software design
The system software includes two parts: the sensor network contact system program and the host control system program.
6.1 Acquisition system program
The wireless sensor network node system program is composed of main program, data acquisition subprogram, and subprogram communicating with the host computer. The design block diagram of the main program is introduced here.
6.2 Research on Communication Protocol
The upper PC as the control center must have the functions of wake-on-LAN, data processing, and routing maintenance. C++Builder, Delphi and Microsoft’s Visual Basic are optional rapid development tools. The upper layer software function is realized by Delphi, considering the reliability of point-to-point communication, the necessary protocol specification needs to be added to the bottom layer wireless transmission of data. In the design, the valid data is packaged, and the format is: preamble, address, valid data load, and check code.
6.2.1 Serial communication format
The communication between the host computer and the module is accomplished through the asynchronous serial port. The asynchronous serial port adopts the standard serial port format, namely 1 start bit, 8 data bits and 1 stop bit, and the transmission rate is 1 200 b/s. There are two types of communication content between the host computer and the module, one is data, and the other is command.
6.2.2 Distinction between data and commands
When the host computer transmits information to the module, the function of the DTR terminal is to indicate the nature of the serial port information. If the serial port information is a command, the DTR terminal should be set to logic “0”; if the serial port information is data, the DTR terminal should be set to a logic “1”.
When the module transmits information to the upper computer, the DSR end can be used to indicate the nature of the serial port information. If the serial port information is a command, the DSR end is a logic “0”; if the serial port information is data, the DSR end is a logic “1”. When there is no data sent from the serial port of the module, the function of the DSR terminal can indicate whether the module can receive information from the host computer. When the module is ready and can receive information from the host computer, this terminal is logic “0”; when the module cannot receive data from the computer , this terminal is logic “1”.
6.2.3 Command and data transfer format
The command transmission format of SA68D21DL is:
D7H Command code H Parameter H
Among them, D7H is the feature code of the command code, that is, the prefix. The command code is one byte long and represents the nature of the command. Different command codes have different parameters. After the module receives the command, it will analyze the parameters and execute the command according to the different command codes. For some commands that need to send signaling, the module will send corresponding signaling according to the nature of the command. When SA68D21DL transmits data, no matter whether it is the data transmitted by the host computer to the module or the data transmitted by the module to the host computer, it adopts the unformatted transmission method.
Based on actual farmland projects, the plane routing protocol DD (Directed Diffusion) is used. Directed diffusion routing is a data-centric information dissemination protocol. It has a completely different implementation mechanism from the existing routing algorithms. The sensor nodes running DD use attribute-based routing. The naming mechanism is used to describe data, and data collection is done by sending INTEREST (task descriptor) to a named data to all nodes. In the process of spreading the INTEREST, the nodes within the specified range use the cache mechanism to dynamically maintain the attributes of the received data and the gradient vector pointing to the information source, and activate the sensors to collect the information matching the INTEREST. After the node performs simple preprocessing on the collected information, an optimal path to the destination node is established by using localization rules and enhanced algorithms.
6.3 Main control software programming
The system software adopts layered design, including hardware device driver layer, operating system layer, application program interface layer and application software layer. The software system structure is shown in Figure 7. The selection of the small real-time operating system μC/OS-II for the operating system is based on the following considerations: The MiniARM embedded industrial control module of Guangzhou Zhiyuan Company provides rich software resources including the genuine μC/OS-II real-time operating system, and the complete software and hardware architecture only needs to be Applications that focus on writing products. A few lines of code can realize complex functions such as TCP/IP communication, CAN-BUS field bus communication, USB communication and mass storage, which makes the design of embedded system more concise and convenient. The TCP/IP protocol is divided into four layers: link layer (ARP protocol), network layer (IP protocol, ICMP protocol), transport layer (TCP protocol, UDP protocol), application layer (HTTP protocol). The TCP/IP protocol stack of this system chooses UIP1.0.
This paper studies the intelligent wide-area farmland water supply system designed based on the embedded system. When the water shortage information of the farmland is detected, it can automatically control the relay to start the water supply pump, and realize the remote GPRS communication, and the system can be understood through the PC. It can automatically collect soil information to determine whether to start the water pump to supply water to the farmland, which is in line with the basic national conditions of my country’s rural areas.
The system is simple to operate, and it can be designed into a courtyard automatic water supply system, a greenhouse automatic water supply system, and a garden automatic water supply system, etc., so the system has good scalability and broad prospects.