Based on the traditional drip irrigation system, this system uses ZigBee ad hoc network to transmit information in the farmland, without laying communication lines in the farmland; remote data transmission uses GSM network, no additional communication equipment is required, reducing the cost of farmland irrigation and increasing the security of the system. The system uses ZigBee wireless ad hoc network microcontroller with low power consumption characteristics and is powered by two dry batteries to save energy consumption. The wireless sensor network in the farmland can collect the operating status of the irrigation system in real time and transmit it to the remote monitoring system. The staff can remotely control the irrigation in real time, which greatly saves labor, improves work efficiency and increases farmers' income.
1 Overall design of the system
The farmland planting area is large and the plots are scattered, which determines that the collection system should have the following two main characteristics: one is that the system has many control nodes; the other is that the system is a communication network with a wide coverage (the collection points are scattered). Based on the above characteristics, the system is designed as a distributed architecture, which mainly includes two modules: farmland monitoring terminal and monitoring management center. The farmland monitoring terminal is divided into ZigBee terminal and ZigBee coordinator (terminal that interacts with the host computer) due to different functions. Based on the above analysis, this system uses ZigBee technology and GSM technology to realize the transmission of system network components and data. Its system structure is shown in Figure 1.
The remote monitoring and management center sends control commands to the ZigBee coordinator in the farmland through the GSM network. After receiving the control commands, the ZigBee coordinator forwards them to the ZigBee terminal to control the irrigation system. First, the computer in the monitoring and management center sends AT commands to the GSM wireless communication device PTM100 through the RS232 interface. PTM100 sends the control commands to the farmland ZigBee coordinator in the form of short messages through the GSM network. The ZigBee coordinator sends control commands to the corresponding terminal according to the control commands sent by the monitoring and management center to control the shutoff of the solenoid valve. The Zig Bee terminal collects the state of the solenoid valve and transmits it to the ZigBee coordinator through the wireless network, and then transmits the state of the solenoid valve to the data terminal through the GSM network.
2 System hardware design
According to the requirements of the system function, the hardware circuit of the system is divided into solar charging circuit, CC2530 power supply circuit, and solenoid valve drive circuit.
2.1 Solar charging circuit
Since the ZigBee coordinator cannot sleep and has a GSM module, the power consumption of the ZigBee coordinator is relatively large, so the ZigBee coordinator must use solar panels to supply battery charging. The charging circuit is shown in Figure 2.
The solar panel is connected to J1. CN3082 is a solar charging management chip. When the input voltage is greater than the power supply low voltage detection threshold, CN3082 starts to charge the battery. In the pre-charge state and constant current charging state, the pin outputs a low level, indicating that charging is in progress. If the voltage of the battery voltage feedback input terminal FB pin is lower than 1.54 V, the charger is in the pre-charge state, and the charging current is 20% of the set constant current charging current. When the voltage of the battery voltage feedback input terminal FB pin is greater than 1.54 V and less than 2.445 V, the charger uses the constant current mode to charge the battery, and the charging current is determined by the resistor R1. When the voltage of the battery voltage feedback input terminal FB pin is greater than 2.445 V, CN3082 is in the maintenance charging state, and the maintenance charging current is determined by the input voltage VIN, R2 and R1. In the maintenance charging state, when the voltage of the battery voltage feedback input terminal FB pin drops to 1.65 V, CN3082 will start a new charging cycle and enter the pre-charge state or constant current charging state.
2.2 CC2530 power supply circuit
Since the power supply voltage of CC2530 is 2-3.6 V, and the output voltage of the rechargeable battery is 3.7 V, the CC2530 power supply circuit powered by the rechargeable battery must pass through a linear voltage regulator circuit to change its output voltage to 2-3.6 V. The circuit is shown in Figure 3. Among them, CAT6219-330 is a linear voltage regulator with a maximum output current of 500 mA and an output voltage of 3.3 V. The EN terminal is the input enable terminal, and the input is valid when the high level is high. In order to improve the transient response, add a 2.2μF bypass capacitor to the 5th pin. In order to improve the voltage suppression ratio and reduce the noise of the output voltage, connect a 0.01μF bypass capacitor to the 4th pin.
[page]
2.3 Solenoid Valve Driving Circuit
Since the driving circuit of CC2530 is very small and cannot drive the motor inside the solenoid valve to turn off the solenoid valve, a driving circuit must be added between the I/O of CC2530 and the motor to drive the motor. The circuit diagram is shown in Figure 4.
J2 is connected to the input end of the solenoid valve. L7010 is the motor drive module. Its working voltage can reach as low as 1.8 V, the continuous driving current can reach 1 A, the peak working current can reach 2 A, and it can easily control the forward and reverse rotation of the motor. VM is the motor power supply and VCC is the chip power supply.
3 System software design
3.1 System control protocol design
3.1.1 The host computer sends control messages to the subordinate
computer. When the host computer sends instructions, it is sent through mobile phone text messages, and due to the existence of spam text messages, the terminal will inevitably receive some instructions that are not related to control. Therefore, when parsing the control instructions in the text messages, some text messages will inevitably fail to parse or parse out wrong control information. Failure to parse out the control instructions will cause the program to run incorrectly and paralyze the entire system; parsing out the wrong control instructions will cause the solenoid valve to malfunction and affect the control effect. Therefore, in order to ensure the safety and robustness of the system, a corresponding protocol must be designed. In order to distinguish between control information and non-control information, there must be a flag to distinguish them. This article uses one byte to represent the message type. Each node has 4 solenoid valves, so one byte can describe the control information of one solenoid valve. In order to reduce the difficulty of terminal control and command parsing, the remaining 4 bits of this byte are used as a sign of whether each solenoid valve has control information. If each node sends a control SMS separately, it will inevitably increase the burden on the system and increase power consumption, so this system combines the control of all nodes in one SMS and sends it out. The message structure is shown below.
The message type field has a length of 1 byte. It is set to the value in Table 1 in the application. The message type field has a length of 1 byte. It is set to a value in Table 1 in the application.
The length of the control message domain is determined by the number of terminals in the specific farmland. One terminal uses one byte, where every two bits represent the control information of one solenoid valve. In the application, it should be set to the values listed in Table 2.
3.1.2 The lower computer sends data messages to the upper computer.
After the upper computer sends a control instruction to the lower computer, the lower computer will send corresponding reply information to the upper computer to tell the upper computer how the lower computer executes the sent instruction. This information includes two categories: the first category is a confirmation status reply received by the lower computer after the upper computer sends the control instruction. The message type value is shown in Table 1; the second category of message is the solenoid valve information after the lower computer executes the control instruction sent by the upper computer. The status information format of the solenoid valve is as follows.
The message type is shown in Table 1. The bytes after byte 2 represent the state of the battery valve. Each byte represents a terminal node, and the lower 4 bits represent the state of the solenoid valve. Since the ZigBee coordinator node may not receive the solenoid valve state data collected by the terminal, the 4th bit is used to indicate whether the lower 4 bits are the state of the solenoid valve, 1 for yes, and 0 for no.
[page]
3.1.3 ZigBee network communication protocol design(1) ZigBee coordinator message processing
After the ZigBee coordinator reads the content of the SMS from the SMS module through the UART interface, it saves it in the ZigBee coordinator and waits for the ZigBee terminal to wake up and send an inquiry message. If the ZigBee coordinator retains the control message after the inquiry, the ZigBee coordinator will send the saved control command in the form of broadcast. If the ZigBee coordinator does not have a control command after the terminal inquires, the ZigBee coordinator will send a no control message to the ZigBee terminal.
After sending the data, the ZigBee coordinator waits for the ZigBee terminal to reply with a confirmation message. The message format is as follows.
The message type domain value is shown in Table 1. After the coordinator receives the reply message from the ZigBee terminal, it sets all the control message bits corresponding to the node number to 0, so that the terminal node will not take corresponding actions after the next broadcast control command.
After the ZigBee coordinator sends the control message, it waits for the state of the solenoid valve of the receiving terminal. After the ZigBee coordinator receives the solenoid valve state information of all ZigBee terminals or the waiting time expires, it sends the received solenoid valve information to the upper computer. The
message processing flow of the ZigBee coordinator is shown in Figure 5.
(2) ZigBee terminal message processing
Since the ZigBee terminal is completely powered by a battery, the ZigBee terminal must sleep regularly to save energy and make the terminal work as long as possible. Therefore, after the ZigBee coordinator receives the control information, it cannot send it directly to the terminal. It must first store it. In order to obtain the control message, the ZigBee terminal must send an inquiry message to the coordinator after waking up, so that the ZigBee coordinator sends the control message.
After receiving the control command sent by the ZigBee coordinator, the ZigBee terminal sends a confirmation message to the ZigBee coordinator, so that the ZigBee coordinator changes the corresponding node state to avoid repeatedly sending control commands to the ZigBee terminal and increasing the burden on the ZigBee terminal. After
receiving the control information, the ZigBee terminal obtains the control information of this node and determines whether there is control information. If there is control information, in order to prevent the motor in the solenoid valve of the ZigBee terminal from getting stuck, the ZigBee terminal must determine whether the current control state is the same as the current state of the solenoid valve. If they are the same, no control action is taken on the solenoid valve; if they are different, the solenoid valve is controlled accordingly according to the control information. After judging the control information, in order to allow the solenoid valve to have sufficient response time to the control information, the control information of the solenoid valve is collected with a delay of 1 s and then transmitted to the ZigBee coordinator. The processing flow chart is shown in Figure 6.
The message format of the solenoid valve status information replied to the ZigBee coordinator is as follows.
The value of the message type field is shown in Table 2. The lower 4 bits of the solenoid valve status field store the status of the solenoid valve, and each bit stores the status of one solenoid valve.
3.2 Low power consumption and synchronization design
Since the ZigBee terminal node is powered by a battery, the ZigBee terminal node must sleep and wake up regularly to save energy and make the battery power supply last longer. If the ZigBee network of this system adopts a mesh structure and a tree structure, then the router node must wake up before the non-router node, which will inevitably increase the control difficulty of the system. In the worst case, the entire system
may be uncontrollable and the terminal node may be disconnected from time to time. Therefore, this system adopts a star network, and the terminal node directly exchanges information with the coordinator node.
3.2.1 ZigBee node synchronization
The error between ZigBee nodes is mainly the transmission delay and the clock error between nodes.
(1) Node clock error measurement
The ZigBee coordinator node first sends a broadcast data packet, which contains the time T1 when the coordinator node sends the next data packet. After receiving the data packet, the node starts the timer to wait for the next data sent by the ZigBee coordinator. When the ZigBee terminal node receives the next synchronization data, the time read from the timer is T2, so the clock offset error is: a=(T2-T1)/T1.
(2) Delay error
The ZigBee terminal node sends synchronization information to the ZigBee coordinator node. After receiving the synchronization information, the ZigBee coordinator replies a synchronization information to the ZigBee terminal. The time when the ZigBee terminal receives this reply information is T3. Assuming that the transmission delay is the same, which is T4, then T4=(1+a)×T3/2.
3.2.2 ZigBee terminal node sleep
When the ZigBee coordinator receives the status reply of all nodes, it broadcasts a sleep message to the ZigBee terminal. The sleep time T5 is added to the message. After receiving this time, the ZigBee terminal starts to sleep. Its sleep time is T5-T4-a×(T5-T4). After waking up, the node sends a query message to the coordinator after a delay of 1 s to obtain the control message.
Conclusion
After on-site debugging, this system can accurately control the control instructions sent by the host computer. The nodes sleep and wake up regularly, which can effectively save power. Two dry batteries can work for 6 months to two years, providing protection for the system in places without power supply such as farmland. The use of synchronization algorithms and some auxiliary measures enables the system to wake up and sleep at the same time. The probability that the ZigBee terminal node receives the control instruction data packet broadcast by the ZigBee coordinator at the same time is more than 90%, which saves more energy.
Previous article:Design and application of remote sensing and remote control navigation aid
Next article:Design of fingerprint application system with remote opening function
Recommended ReadingLatest update time:2024-11-16 15:49
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Detailed explanation and engineering practice of unmanned monitoring technology (Xie Jianbin, Li Peiqin, Yan Wei, Liu Tong, Lin Chenglong, Hong Quanyi, Zhou Hongfei, Cui Yibing)
- Introduction to Wireless Sensor Networks (Edited by Ma Sasa et al.)
- Introduction to the Internet of Things (Liu Yunhao)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- I need help with the simplest program to control 12864 with keys
- TUSB9261 -- USB3.0 to SATA interface bridge chip programming guide
- 【Video】Bluetooth Low Energy Mesh Training Video
- How to upgrade the program of msp430 microcontroller
- EEWORLD University Hall----Using buck-boost converter chips to extend the battery life of true wireless or hearing aid systems
- What does FPGA mean (how to use FPGA)
- F28335 clock + hardware parameters
- How to solve the problem of buzzing sound when converting non-isolated 220v to 3.3v inductor
- Summary of configuring 5409's McBSP as an SPI port
- EEWORLD University - Simplifying Digital Power Supply