Design of a Precision Agriculture Leakage Seeding System Based on Wireless Sensors

In light of the agricultural development in China, more attention has been paid to the studies about precision agriculture. The environmental factors such as temperature-humidity and soil humidity are the key influencing factors on crop growth, therefore, how to rapidly and accurately acquire the environmental information of crop growth and learn about their real-time growing environment is of vital importance. The wireless sensor networks (WSN) can make real-time environmental information acquisition as well as communication and processing of network environmental data. Based on this, the RSSI range-based positioning method was optimized in this paper in order to greatly improve its precision. To be specific, in this study, the particle swarm optimization (PSO) algorithm was firstly applied in the hybrid mutation strategy to make more accurate node positioning and significantly improve the evolutionary performance by enlarging the hunting zone; besides, through the use of WSN, the influencing parameters on crop growth such as soil humidity, and temperature-humidity etc. would be monitored; finally, to realize the precise location and derive the unseeded nodes, GPS was applied for accurate positioning, and the intelligence algorithm was adopted to determine the coordinate position of unknown nodes. At last, the actual field test indicates that the designed monitoring system in this paper satisfies the requirements for precise measurement, playing a positive role in promoting the development of precision agriculture.


Introduction
As a large agricultural country, China is facing with the situations such as an increasingly fierce competition in the international market of agricultural products, declining product quality, and environmental deterioration [1][2][3]. How to reduce the consumption of resources by changing the traditional methods, and then achieve a significant increase in production efficiency and output based on limited resources, is a key issue urgently to be solved. With the emergence of precision agriculture, the use of advanced technologies in agricultural production has, to some extent, achieved the goal of high efficiency and high output of agriculture. At present, precision agriculture is widely promoted due to the increasing popularity of WSN, and its prospects and market demands in the country are extremely prominent, especially its major role in terms of promoting the intelligentization and informatization of agricultural development, [4][5][6]. The paper aims to make real-time monitoring of the growth and sowing of crops through such technologies, such as convenient networking, strong pertinence, and relatively lower costs, etc.

WSN technology and its application 2.1 WSN composition structure and system
Many wireless sensor modules together constitute the WSN system with small-size structure, convenient deployment of major modules, and the lower cost; it moves per the actual situation and acquire the information of related objects in the coordination and cooperation mode; then the processed information is sent to the test staffs [7][8][9]. In the monitoring network system, with the nodes placed at random, the data of objects should be monitored according to specific requirements, besides, the simple calculation and processing can be made accordingly. Generally, the WSN configuration can be divided into three parts: network nodes, topological structure, and transmission protocols [10][11][12].

ZigBee technology
ZigBee technology, with its outstanding ad-hoc network and self-healing capability, can work in free frequency band at a relatively lower cost [13][14][15]. Per the specific requirements, by increasing the communication distance and the network area, the signal transmission and data acquisition can be performed widely. In the wireless monitoring system, this technology is more applicable, because of its extremely prominent data security by applying the collision avoidance mechanism to the transmission process; besides, before sending the data, the channel monitoring should be completed in order to ensure the channel availability, and then the transmission could be made, so as to avoid conflicts and significantly reduce the interference [16][17][18]. At the same time, more effective encryption and security processing can be performed on key data, effectively avoiding malicious intrusion problems, and improving reliability and security.

ZigBee communication technology
In a ZigBee network, coordinate, routing, and end nodes are the most basic forms. The Z-Stack protocol stack is its key part, mainly including the various major modules. With the physical layer as the bottom layer to standardize the ZigBee communication standard, it is responsible for interacting with the outside world to realize the wireless closing and receiving; as the network is established through access to the control layer by medium, the network is the important part located between the application layer and MAC layer, as the core connection hub within the network [19][20].
In ZigBee devices, the most critical function of the security layer is to provide protocol security services to ZigBee. The application layer plays a role in providing interfaces and effectively managing the devices.

3
Zigbee network nodes positioning technology in precision agriculture When the sensing activities are measured through the agricultural WSN, the most critical is the sensor nodes positioning, because the monitoring could be effectively conducted only after the nodes determination. Thus, the location of the node needs to be clarified, so as to acquire the actual information about the environment.

Improved particle swarm optimization algorithm
In order to ensure consistency with the positioning accuracy, the paper improved the standard particle swarm algorithm by applying the hybrid mutation strategy, so that the defects of the algorithm can be effectively improved. The specific steps of algorithm are given as follows: (1) Set parameters such as population size, number of iterations, and learning factor etc.; (2) Initialize the corresponding speed and position of all particles, and then complete the calculation of fitness.
(3) Through the use of the Cauchy variogram, the variation component is disturbed, and the global, individual fitness, and optimal value correlations are clarified.
(4) The following formulas are used to update the particle velocity, position, etc., and then the assessment of individual fitness is made.
(5) Complete the later-period mutation operation. Through selecting the Gaussian variogram, the search particles are perturbed; the search is completed with the emergence of new individual appears, and then the fitness evaluation is carried out.
(6) Following the steps above, the previous individual will be replaced by the optimal individual generated thereafter.
(7) End the condition by determining whether the fitness is optimal, or whether number of search iterations meets expectations. If reach the conditions, the algorithm is ended, otherwise, repeat the above steps. The flow chart is given as:

Fitness function
The paper uses the RSSI ranging method to complete the distance measurement work; in view of the errors existed inevitably here, the positioning will be transformed to be the optimization problem of error model, that is, calculation of the minimum solution to the fitness degree; if the value is small, the better positioning results shall be achieved. So, the corresponding fitness function is given as: where, m is the number of effective beacon nodes; d i is the distance measured; (x, y) is the estimated coordinate for the unknown node; (x i , y i ) is the coordinate of the beacon node; the positioning error is taken as the key criterion for measurement of positioning accuracy. At less distance difference, it shall be more accurate.
iJOE -Vol. 14, No. 5, 2018 where, (x t , y t ) means the actual corresponding coordinate position of nodes; (x, y) is the estimated coordinate position.

Simulation test
To test the algorithm performance above, by applying the Matlab software, an experimental simulation platform based on RSSI ranging is constructed. Through the selection of the unknown node, the simulation experiment could be conducted about the positioning error, with 20% as the distance-measuring error; if 20 beacon nodes are selected, the related results are shown in Fig.2; so, compared with the standard particle swarm algorithm, this algorithm has a relatively smaller positioning error with a good compensating error effect. Therefore, it can be found that the improved algorithm possesses smaller positioning errors, more accurate results, and higher accuracy. Requirements analysis and overall design of unseeded system in precision agriculture

System requirements analysis and design requirements:
The required functions of the developed system in this paper include: 1. Acquisition of farmland environment information; 2. Processing of monitoring data; 3. Real-time online monitoring.
The design requirements include: 1. Outstanding reliability 2. Low energy consumption 3. Use of standardized protocols 4. Design of an easy-to-maintain platform 5. Advanced technology and low cost.

Overall design of unseeded system
The large-scaled developed system is intertwined; the nodes are installed in the network by using the terminal nodes of various sensors for transmitting the monitoring data to the coordinator node in real time. In the lower computer of the node positioning system, the coordinator node is particularly prominent, because the application of the coordinator node can enable the data acquired by the terminal to communicate with the control centre. Therefore, the coordinator node works to construct the network, send the read command to the terminal periodically, and carry out the data transmission; besides, after receiving these data, the host computer should make effective integrated processing. The system structure diagram is shown as follows (Fig.3  The hardware of ZigBee network unseeded monitoring system mainly consists of sensor nodes, communication and monitoring module etc. Sensor terminal node design. In the unseeded system, the terminal node, as the basic unit, can be divided into two major parts: firstly, in terms of functionality, it's used for data acquisition, data transmission, and voltage conversion; secondly, it works as the ZigBee module with the analog-to-digital interchangeability and data processing. For the microprocessors, the CC2530 microprocessor chip is used, and the TDR-3 sensor is used to collect soil, moisture, and other data. But, the humidity, temperature, and other data are collected by the SHT15 model sensor. Table 4 shows the unseeded detector, and Fig.5 depicts the automatic seeding effect at 25%-35% humidity.  (1) Temperature and humidity sensor The system adopts the SHT15 sensor to measure humidity and temperature. CMOS and wireless sensor technology are integrated in this sensor containing lots of sensor modules. Because of the integration of many sensor elements onto one chip, the sen-sor module has the advantages such as high speed, high accuracy, and portability. The following (Fig.6) is the internal composition chart: (2) TDR-3 soil humidity sensor Such sensor is easy to operate; it has the good stability and reliability in terms pf data detection with the specific principle: with the dielectric constant of soil affected by the moisture, monitoring shall be carried out. The sensor has four interfaces, and the three types of power supply modes in total, namely solar battery, parasite power, and external power supply. The technical parameters are shown as follows (table 1): Design of coordinator node. In the ZigBee WSN, being adopted to send and receive software, set parameters, and manage information, the coordinator node is regarded as the key connecting node, and also the key to realize the connection between the monitoring centre of the host computer and the terminal node. It can connect the terminal node by combining with the ZigBee network and transmit the data to the control centre with the RS232 bus. Design of power management circuit. The power management can provide protection for the power-saving equipment. The power module of coordinator node supplies power to the CC2530 chip continuously, facilitating the chip dormancy and data collection. However, the terminal node, without requiring the continuous power supply, mainly includes the two methods: continuous external power supply and power supply, but with the premise that the actual farmland conditions are considered.

System software design
In terms of the design and implementation of system software, the Z-Stack protocol stack function should be taken into consideration; the software design specifically involves three major parts, namely, the procedures for operating the terminal node module, the software program design of the key coordinator node integrally connected to the network system, and the software programming for monitoring program commands. For the design of node software program, it specifically refers to the information transmission of host computer, signals acquisition and transmission, network networking methods, etc.  Fig. 7. The main software system diagram Z-Stack Protocol stack networking. The Z-Stack protocol stack has three related networking modes, where the tree networking mode is selected by the system. In this networking mode, the terminal node is located at the leaf position, generally used for real-time collection of data such as humidity, temperature, etc., and transmitting the obtained results to the coordinated information existing in the network; the coordinating node is used to receive the above information, make real-time response, and feed the information back to the intermediate node. When carrying out the identification work for the nodes, it is necessary to use a consistent ID as the basis, then followed by the data transmission operation. In this mode, it not only guarantees the data security, but also reduces the probability of errors in the data transmission process.
Software design of coordinator node. The networking of coordinator node includes two parts: network access construction of nodes, and system initialization. The related process flow is shown in Fig.8. Software design of terminal node. With various sensor modules for collecting environmental parameters integrated in the terminal node module, the module plays a key role in collecting the living environment data of crops. For related hardware, and processors, etc., the terminal node needs to carry out parameter initialization and combine the primitives to scan the channels, thereby constructing a platform for smooth information flow. Besides, the sensor should be used to obtain the variables such as soil moisture, temperature, and humidity required to be measured in real time, and to make conversion; then in combination with the wireless communication method, the result is transmitted to the coordinator node, and also the command from the coordinator node is received.
Unseeded monitoring interface design of host computer. In the unseeded system, the Visual Studio 2010, a relatively widely-applied programming software, has been selected. The unseeded monitoring interface includes two types: data query and main interface, corresponding to the functions of serial communication and database access respectively. In addition, the sensor controls existing in the system interface can number the terminal monitoring nodes; by clicking one certain device, the corresponding monitoring data shall be displayed on the interface, while by clicking the data query button, the historical data shall be displayed. The related data can be retrieved from the back-end database to facilitate the analysis of the plants growing environment and make evaluations. Fig.9 shows the display interface of upper computer: System testing For the developed system of this paper, after the system software and hardware selection and system design, the related testing was also carried out in terms of the system performance. Based on the results, this system conforms to the design expectations in the operational reliability, the timeliness of hardware and software integration, and the power consumption etc.
The environmental data collected by using the artificial and R&D systems is shown in the following histograms.
By comparing and analysing the monitoring data, it can be found that the compared with the manual operation, the developed system has the 0.4°C maximum temperature error and 1.4% humidity error, while the relative humidity error of soil reaches up to 1.9%; these error rates above are all within the margin of error at a higher accuracy. What's more, the easy-to-operate developed system can save the manual workload, and then by applying the improved positioning algorithm, the real-time monitoring can be made for sensor location, significantly reducing the difficulty in manual positioning; especially for the large-area farmland, the working hours will be significantly reduced, or in the relatively poor environment, the end nodes failure can be detected and solved in time.

Conclusion
In this paper, the RSSI range-based positioning method was optimized in order to greatly improve its precision. besides, the particle swarm optimization (PSO) algorithm was applied in the hybrid mutation strategy to make more accurate node positioning and significantly improve the evolutionary performance by enlarging the hunting zone. Through the use of WSN, the influencing parameters on crop growth such as soil humidity, and temperature-humidity etc. would be monitored; to realize the precise location and derive the unseeded nodes, GPS was applied for accurate positioning, and the intelligence algorithm was adopted to determine the coordinate position of unknown nodes. At last, by comparing our developed algorithm with manual method, the environmental testing was conducted; it is found in the test that the system error rate is smaller within the allowable error range, saving time and labour etc.; besides, the more reliable measured quantity is obtained, providing basis for actual production.