Design of Intelligent Wireless Monitoring System for Water Saving Irrigation based on Fuzzy-PID Strategy

In order to solve the problems existing in the water-saving irrigation monitoring system, such as small monitoring area, complicated wiring etc., a soil information monitoring system of water-saving irrigation based on Fuzzy PID control strategy was designed. The wireless sensor node is developed with CC2530 as the core, and the real time monitoring of temperature and humidity in soil environment is completed. The system adopts ZigBee technology to realize wireless sensor network and automatic gathering of monitoring data, realizes soil temperature and humidity adjustment based on fuzzy PID control technology, and adopts embedded database management mode to realize terminal node and data management and so on. Compared to the other network monitoring technology, this system is characterized with flexible configuration, which can be widely used in the place unattended or in poor condition. The test run results have shown that this system had many advantages such as low power consumption, flexible networking, scalability, friendly interface, etc.


Introduction
With the continuous development of modern agriculture, the quality and safety of farmland irrigation is increasingly demanded, and the quality of irrigation capacity directly affects the quality of crop growth [1] [2], so the stable, efficient and low cost operation of irrigation equipment has become the main technical requirements of fine agricultural industry transformation in recent years [3]. Agricultural irrigation involves a large area, and the terrain of the control area is complex. The traditional water-saving irrigation monitoring system mainly uses wired mode [4]. The field control points and measuring points are many and scattered, the operation is tedious, the connection cable is many, the failure rate is high, is not conducive to the use and maintenance [5]. Wireless sensor network (WSN), composed of a large number of sensor nodes, is a new advanced technology for data acquisition, processing and wireless transmission [6]. It has the advantages of simple deployment, low cost, no need for on-site maintenance, and has broad application prospects in the field of environmental monitoring [7]. Some scholars have applied wireless communication technology to water-saving irrigation [8], but these technologies usually have the shortcomings of high cost, high power consumption and unsatisfactory precision, so cannot be widely applied.
Aiming at the existing problems of water-saving irrigation monitoring system, this paper adopts the intelligent sensor network ZigBee technology and embedded technology to design a farmland environment water-saving irrigation monitoring system. Its advantages are low power consumption, low cost, friendly man-machine interface, and automatic information collection and processing. The system is based on data wireless transceiver, using multi-hop routing, real-time monitoring and issuing data information and control instructions, using fuzzy PID control technology to achieve the injection speed of each valve, start and stop decisions, intelligent regulation of irrigation timing and water volume. Therefore, the control accuracy and irrigation efficiency can be improved, so as to realize intelligent monitoring of water-saving irrigation.

Requirement Analysis of Monitoring System.
In view of the characteristics of large lag and inertia in farmland soil temperature and humidity, through investigation and analysis, the application requirements of environmental monitoring system include: a) Realizing real-time collection, processing and wireless transmission of environmental temperature and humidity on-line all day. b) Applying ZigBee wireless communication mode to transmit and aggregate the uploaded data in real time. c) The upper computer carries on the information processing, provides the fault diagnosis, the over-limit alarm prompt manager, in order to carry on the decision, complete the sensor management, the environment information storage and the analysis processing and so on. In other words, according to the predetermined control strategy to form a control output, direct action in the production process.

System Overall Design.
This system is based on ZigBee tree topology sensor network, including terminal nodes, gateway nodes and monitoring center. The terminal node is composed of sensor nodes and connected to network, which task is to collect soil environment temperature and humidity data and upload them to the gateway node wirelessly. ZigBee coordinator operates the gateway node, which is responsible for receiving data information and communicating with monitoring center through serial port. The monitoring center includes a PC computer and related management software. In addition to providing graphical operation interface, data display and staff query, it can also provide out-of-gauge alarm prompt, and form control output according to pre-determined control strategy.

Fuzzy PID Control Strategy.
Because the characteristics of temperature and humidity control in farmland soil are multivariable, large inertia nonlinearity, parameter coupling, pure delay, long control and regulation time and obvious overshoot, it is impossible to establish an accurate mathematical model, and it is difficult to achieve satisfactory control accuracy by using classical control methods. Fuzzy control strategy is based on human thinking, and has the advantages of simple design and strong robustness. Therefore, this paper chooses the fuzzy control algorithm to control the environmental factors of the system, and uses software tools to design the fuzzy control system.

Realization of Fuzzy PID Control of Soil Moisture.
The fuzzy controller organizes the control decision table according to the manual control rules, and then determines the control quantity by this vote. This paper combines fuzzy control with PID control, which not only has the advantages of flexibility and adaptability of fuzzy control, but also has the characteristics of high precision of PID control.
By calculating the current system humidity error and error rate of change, using fuzzy rules for fuzzy reasoning, query the fuzzy rules table for parameter adjustment. The structure of fuzzy PID controller is shown in Fig.1.   Fig.1. Fuzzy PID humidity controller structure In this paper, the fuzzy PID controller is applied to humidity control. Its error and rate of change are used as input language variables, and the input and control variables of the controlled process are used as output language variables. Thus, the system stability can be guaranteed, the overshoot of the response process can be reduced and the oscillation phenomenon can be weakened. The fuzzy relation between the three parameters of PID controller and sum is found out, and the three parameters are adjusted according to the principle of fuzzy control to meet the different requirements of control parameters at different times, so that the controlled object has good dynamic and static performance. By summarizing the process and operator's experience, the control rule statements are obtained, and the temperature fuzzy control rule table is established. The solution is to make a fuzzy control query table as shown in Table 1, and to perform fuzzy operation by software query.
The software part uses the query table method to implement fuzzy reasoning using fuzzy rules. The specific implementation method is to store the sum fuzzy control table computed, and offline in the memory data block, and periodically interrupt the subroutine of inquiring the fuzzy control table every 30 ms. Then the fuzzy control table is querying according to the quantization value, and the quantization value is obtained. The program flow chart is shown in Fig.2

System Hardware Design.
Sensor node is the basic unit of water-saving irrigation monitoring system, which completes the functions of environmental temperature and humidity data acquisition, processing, wireless communication and so on. Under the application background of Water-saving Irrigation Soil Environmental monitoring, sensor node design focuses on low cost, low power consumption, stability, reliability and other factors. Wireless transceiver module includes CC2530 and related peripheral circuits, communication between gateway node and monitoring computer, application of microprocessor's P3.0 port (serial data receiver), P3.1 port (serial data transmitter), and level conversion chip MAX232, RS232 communication interface to achieve the TTL level output by microprocessor into PC. RS232 level, using 5V power supply, requires fewer peripheral components, and comply with EIA/TIA232 communication standards, transmission rate up to 220 kbps. The hardware block diagram of the terminal node is shown in Fig.3.

Fig.3. Terminal node hardware block diagram
Gateway node function is to complete data correction, fusion, and send to the monitoring center, but also to obtain instructions, after processing, sent to the control equipment. CC2530 can meet the storage and communication requirements of water-saving irrigation temperature and humidity monitoring system. Therefore, the composition and design of gateway nodes and sensor nodes are similar.

Hardware Design of Sensor Measuring Circuit.
Sensors are used to perceive soil moisture information and obtain information in the monitoring area. When selecting sensors, the energy consumption, measurement range and accuracy, cost and volume are mainly taken into account. TDR-3A soil temperature and humidity sensor is used in this paper. The output of the sensor can be directly connected with the P0 port of CC2530, and the ADC of CC2430 is used to realize data conversion. The technical parameters are shown in Table 2. The software architecture of the system consists of data acquisition software and data receiver software, including transmitter and receiver program, and initialization program. Sensor nodes are mainly responsible for collecting sensor data and transmitting these data to the central control node, while receiving data from the central control node and operating on the basis of these data. In the node software design, the device initialization, network configuration and network start-up of the network management layer are accomplished by calling the API function provided by ZigBee protocol stack, thus realizing the self-organizing network of wireless sensor nodes distributed in multiple greenhouses. In order to further reduce the node power consumption, a flexible and dynamic configuration of timing data acquisition, timing sleep and wake-up is designed. The flow chart of terminal node main program and interrupt service subroutine is shown in Fig. 4 and Fig. 5 respectively. Monitoring center management system is responsible for sending acquisition commands, receiving acquisition data, while publishing data on the server to meet the client's browsing. Its main tasks are: monitoring all flowmeters synchronously, realizing on-line monitoring functions such as over-standard alarm; collecting data and checking cyclic redundancy (CRC) to ensure data reliability; using wireless transmission mode, data real-time transmission to the monitoring center; monitoring data and time information can be automatically stored to the database server; realizing real-time data transmission; Time curve display, historical curve query, data report printing and real-time display according to the needs of sub-items, historical query according to time; when the data collected by a node is abnormal, record and alarm, in order to eliminate hidden dangers. Based on LabWindows/CVI software, this paper records and analyzes the collected data, and completes the comparison of similar signals, the display of historical and spatial data of different nodes. The main program flow chart of the monitoring center is shown in Fig. 6. Because of completing a number of detection and control, combined with the latest wireless ZigBee ad hoc network technology design to complete the system, and then carried out experimental testing. Considering the cost of the experiment, 5 points are randomly arranged according to the requirement, the buried depth is about 18 cm, and the numbers are set to be *1~*5. The data are collected by 5 temperature and humidity sensors in real time and sent to the PC of the monitoring center to display the collected parameters directly.

Experimental Results and Analysis.
The test results show that the temperature and humidity sensing node can pass through obstacles such as field instruments and equipment within the range of 13m, and can realize data acquisition, transmission and list display. The ability of wrong correction of the network is good and the data accuracy is high. Once the detection parameters exceed the limit, the computer response time is generally less than 3 seconds, display the address and exceed the limit parameter value, and alarm prompt. The two nodes (*1 and *2) monitor data at several time points as shown in Table 3. As shown in Table 3, the measured data are all located near the optimum value. By actual measurement and calculation, it can be concluded that temperature measurement error is less than ±0.5℃, and relative humidity measurement error is within 4%. The curves of temperature and humidity are shown in Fig. 7 and Fig. 8 respectively.

Conclusions
Aiming at the shortcomings of the existing monitoring system of temperature and humidity in farmland soil, a real-time monitoring system of farmland soil water-saving irrigation based on ZigBeeCC2530 and fuzzy PID control strategy is proposed. The manager can monitor and control the environmental temperature and humidity parameters in a specific area in real time. The management system of soil temperature and humidity environmental parameters based on embedded data database can effectively manage all kinds of sensor nodes and a large number of environmental data. It can realize fast self-organizing network of sensor nodes and real-time collection, transmission and display of various greenhouse environmental factors. The experimental results show that the system can monitor and control the temperature and humidity parameters of farmland soil in real time, and verify the practicability and efficiency of the system.