Design of remote low-power irrigation control system based on ZigBee

Publisher:TranquilSoulLatest update time:2014-01-18 Source: 21icKeywords:ZigBee Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction
   
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.

a.jpg


    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.

b.jpg


    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.

c.jpg[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.

d.jpg


    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.

e.jpg


    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.

f.jpg


    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.

g.jpg

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.

h.jpg


    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.

i.jpg


    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.

j.jpg


    (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.

k.jpg


    The message format of the solenoid valve status information replied to the ZigBee coordinator is as follows.

l.jpg


    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.

Keywords:ZigBee Reference address:Design of remote low-power irrigation control system based on ZigBee

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

Design of Distributed Greenhouse Monitoring System Based on ZigBee Technology
    This paper proposes a design of a wireless distributed greenhouse monitoring system using ZigBee technology, thereby realizing automatic detection and control of greenhouse environmental parameters.   1 Composition of greenhouse monitoring system   The structure of the distributed greenhouse monitoring system b
[Microcontroller]
Design of Distributed Greenhouse Monitoring System Based on ZigBee Technology
Design of environmental monitoring system based on ZigBee technology
0 Introduction All walks of life, especially in the fields of industrial and agricultural production, environmental monitoring, etc., have put forward great demands and higher requirements for wireless digital monitoring systems. The rapid development and gradual maturity of wireless sensor networks have better met
[Microcontroller]
Design of environmental monitoring system based on ZigBee technology
Design of wireless security system based on GSM and Zigbee technology
introduction At present, urban security systems are receiving more and more attention, and customers have higher and higher requirements on the functions and performance of security systems. This paper proposes a wireless security system based on GSM and Zigbee technology. The system is character
[Security Electronics]
Design of wireless security system based on GSM and Zigbee technology
Design of home wireless gateway based on Zigbee technology
0 Introduction Gateways may be familiar to people who have used the Internet, such as routers that connect personal computers to the Internet at home or in the office. The gateway discussed here does not connect your personal computer to the Internet, but connects your home appliances, large and small, to y
[Microcontroller]
Internet of Things Connection - Wi-Fi HaLow vs. Zigbee
As the Internet of Things (IoT) continues to innovate, connected devices are handling more and more intelligent tasks. It is increasingly important for IoT developers to deploy long-range, low-power, reliable networks to monitor the growing suite of IoT devices. What is Zigbee? Zigbee was born in 1998 (revised in
[Internet of Things]
Internet of Things Connection - Wi-Fi HaLow vs. Zigbee
Design of industrial wastewater monitoring system based on ZigBee wireless sensor network
0 Preface With the rapid development of my country's industrial production capacity, the discharge of industrial wastewater is increasing day by day. After the wastewater that does not meet the discharge standards is discharged into the water body, it will cause huge pollution to the surface and groundwater. Therefo
[Microcontroller]
Design of industrial wastewater monitoring system based on ZigBee wireless sensor network
Design of automatic bus stop announcement system based on ZigBee
Aiming at the characteristics of the bus system in small and medium-sized cities and the actual operating environment, a single-chip automatic station announcement system based on ZigBee (Purple Bee Protocol) technology was designed in consideration of cost performance and practicality. The station transmitter uses
[Analog Electronics]
Design of automatic bus stop announcement system based on ZigBee
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号