A Clustering Routing Algorithm for Wireless Sensor Monitoring Network in Irrigation Area

It is the basis for the implementation and scientific management decision of precision irrigation to accurately and comprehensively sense water and rainfall regime, soil moisture content and engineering conditions in irrigation areas and various environmental factors closely related to crop growth. In view of the characteristics of large monitoring range and scattered distribution of measuring points in the irrigation area, based on the analysis of the characteristics of the strip shape layout of the wireless sensor network at the water demand side of the irrigation area, and the limited battery energy and transmission distance under the condition of battery power supply, a clustering routing algorithm based on wireless sensor network for monitoring irrigation area is proposed (known simply as CRAIM algorithm). The formation of clusters, the selection of cluster heads, the routing process between clusters and the sink nodes are studied, and the CRAIM algorithm, EE-LEACH (energy-efficient LEACH) and MMH-LEACH (modified multi-hop LEACH) algorithm are simulated and compared respectively. Experimental results showed that, the new algorithm, CRAIM, has some advantages in the energy consumption of the network.


Introduction
In the irrigated areas (especially large and medium-sized irrigated areas), there are many monitoring points in the information monitoring network, various types of wired and wireless transmission links, backbone communication networks and front-end (terminal) micro-networks, and large monitoring range. For the micro grid on the water demand side (especially in the application of farmland environment), the traditional monitoring method of laying cable/wire has some problems, such as high cost of laying, vulnerable cable and low reliability, and the labor-consuming and time-costing of rearranging the network. In view of the shortcomings of wired monitoring system, in recent years, wireless sensor networks (WSN) technology has become the focus of research to solve practical application problems in the fields of irrigation area water conservancy and related precision agriculture [1][2][3][4] . The monitoring area of the micro grid on the water demand side is usually far away from the center of the water supply side of the irrigation area, so it needs to be connected to the management system through the trunk communication network. The monitoring information of these microgrids not only includes the growth status of different crops, water/fertilizer status, engineering conditions of field projects and climate environment in the farmland, but also may include independent measuring points 2 of water condition/engineering condition/soil moisture content in the water supply center far away from the irrigation area. WSN has the characteristics such as low cost, flexible wireless networking, convenient deployment and large monitoring range, which is a feasible and effective scheme for the design of micro grid at the water demand side of irrigation area. However, the WSN nodes are limited by the application environment, and battery power is limited in terms of battery power, computing power and transmission distance, which restrict the actual application of WSN network in irrigated area [3][4][5] . Nowadays, the cluster routing algorithm represented by LEACH protocol [6,7] is a routing algorithm that extends the life cycle of a WSN network. Although its process is simple, but it has some defects that affect the lifetime of the whole network when it is applied to the water-demand WSN system in the irrigation area [3,4,7] : 1) the cluster heads of LEACH are randomly elected, and the residual energy of the elected nodes is not considered; 2) One-hop communication mode is adopted between the cluster heads and the sink nodes (SN). When the distance is long, data transmission will consume more energy of the cluster heads; 3) The size of clusters is irregular. If the size of subnet formed is large, the cluster head of the subnet may be overburdened. Based on the practical application requirements of micro-grid deployment at the water demand side of irrigation areas, aiming at the characteristics of large monitoring range, large WSN scale, scattered node layout and far distance from the sink nodes SN, a clustering routing algorithm based on wireless sensor network for monitoring irrigation area (CRAIM for short) is proposed. The main contribution of this paper can be summarized as follows. 1) Aiming at the existing problems in WSN application in irrigated areas (especially large and medium-sized irrigated areas), the traditional LEACH routing algorithm is improved to provide an effective technical solution for the reliable transmission of data between nodes of WSN network in irrigated areas and the extension of network life cycle. 2) By defining the clustering line partitioning criteria, the clustering of the first round is optimized, and the residual energy of nodes and the geographical location in the cluster are comprehensively considered. The shortcomings, that the cluster head is elected in a random way without considering the deficiency of the residual energy of the selected nodes, of the traditional LEACH clustering routing algorithm is overcome.
3) By constructing the energy path graph and solving the path strategy of the least energy consumption with the optimization algorithm, the data transmission of the least energy consumption path between the cluster head and other cluster heads and between the cluster head and SN can be achieved.

WSN System Model and Network of Water Demand Side in Irrigation Area
Water-demand monitoring area in irrigation area: Water-demand area along and around irrigation canal. Assume that is a rectangular area with length L and width W, showing strip shape, and the area size is L×W, where L is several times of W. The measuring points are all fixed sensor nodes, evenly distributed in the monitoring area. They are connected to the main communication network of the irrigation area through the adjacent sink node SN, or connected to other SNs through the adjacent SN. SN supplies power to the solar panels (energy is not limited) and has no effect on the life of the system. WSN system is composed of N sensor nodes, each node has wireless transceiver function at the same time, and has the same energy supply and computing function, and has a unique identification number ID. Nodes can perceive their own remaining energy. When the energy of a node is lower than the maximum energy that is actually available to the node for receiving and sending data, the node cannot receive and send data. The node can estimate the distance between the starting node and itself based on the received signal strength, and adjust the transmitting power according to the length of the communication distance. Irrigation area WSN system designed in this paper is a hierarchical network, clustering strategy networking based on hierarchical topology control. WSN can be divided into M clusters, each cluster consists of a cluster head node and the members of cluster nodes, while it can dynamically form M subnets, each subnet cluster head can directly hop and pass (one-hop), or turn to multistage between subnets hop way of communication and transport network with SN. The cluster head is responsible for managing the nodes in the cluster, collecting and fusing the information in the cluster, directly or by hopping between clusters, then sending it to SN. All nodes in WSN have the possibility of becoming cluster heads. The algorithm selects cluster heads periodically by cyclic competition, so that the energy load of the whole network is evenly distributed to each sensor node, so as to prolong the lifetime of the whole network.

CRAIM Algorithm Design
The WSN clustering routing algorithm CRAIM, which is applied to the monitoring of irrigation areas, mainly includes three modules: clustering, cluster data fusion processing and routing communication between cluster head and sink node. The CRAIM design is shown in Figure 1. The main calculation steps of the CRAIM algorithm are as follows: Step 1: The network is initially partitioned according to the optimal number of cluster groups. On the basis of the initial partition, the factor energy-distance ( -) of node in the WSN network is defined to elect cluster heads, and the cluster groups are divided and the size of cluster groups is determined according to the set cluster line.
Step 2: The cluster head factor was defined, and the cluster head factor reflecting the node energy and the distance within the cluster was used as the calculation formula. The cluster head in the first round (the initial period) was selected, and the cluster was divided according to the defined cluster line division criterion to ensure that the cluster size was proportional to the distance between the cluster head and SN, then the first round of clustering is completed.
Step 3: The cluster head collects the data in the cluster. Each node in the cluster sends data to the cluster head within the allocated time, and the node that does not transmit the data will sleep automatically. The cluster head fuses and de-redundancies the data received from all nodes in the cluster, then jumps and sends it to SN node.
Step 4: The cluster head was networked with SN nodes, and the energy path diagram was constructed, while the least energy consumption path between cluster heads and other cluster heads, and between cluster heads and SN was obtained by Floyed algorithm [8] . If the energy consumption generated by this path is less than that generated by the cluster head's direct communication with the sink node, then the cluster head communicates with SN through multiple hops; otherwise, the cluster head communicates with SN directly (in one hop).
Step 5: Determine whether the data collection process of the WSN system ended or not. If the collection continues, the next round (cycle) of routing execution process will be entered.

Algorithm Simulation Experiment and Analysis
The simulation experiment of the algorithm was carried out under the environment of "Windows10 + Matlab2018", and the main parameters are listed in Table 1. Based on the topology control network of the new CRAMM algorithm proposed in this paper, the energy-efficient EE-LEACH algorithm [9] and the improved MMH-LEACH (modified multi-hop LEACH) algorithm [10] , the simulation results are shown in Figure 2. The horizontal axis represents the number of periods, i.e. number of rounds, and the vertical axis represents the total energy consumption of the WSN network running the three algorithms, unit: Joule.  By introducing cluster head factor, the new algorithm CRAIM selects cluster heads optimally by integrating node energy and intra-cluster distance. Cluster is used to realize that cluster size is proportional to the distance between cluster head and sink node SN. In addition, the shortest path algorithm Floyed algorithm is used to ensure the lowest communication energy consumption between cluster head and SN. It can be seen from Figure 2 that the energy consumption of the new CRAIM algorithm is better than the other two algorithms on the whole. After 1200 cycles, the network

Conclusion
To meet the practical needs of WSN monitoring application at the water demand side of irrigation area, a wireless sensor network networking solution suitable for water and rain condition, engineering condition, soil moisture content and farmland information collection at the water demand side was designed, including cluster head election, cluster group division and improved design of routing communication between cluster head and sink node SN. A new clustering routing algorithm (CRAIM new algorithm) for wireless sensor network is proposed for monitoring in irrigated areas. Simulation results show that, compared with EE-LEACH algorithm and MMH-LEACH algorithm, the new CRAIM algorithm can effectively save network energy consumption. This study can provide guidance for solving the limited battery energy, transmission distance and network life of WSN nodes at the water-demand side of the irrigation area.