Layout Optimization for Greenhouse WSN Based on Path Loss Analysis

When wireless sensor networks (WSN) are deployed in the vegetable greenhouse with dynamic connectivity and interference environment, it is necessary to increase the node transmit power to ensure the communication quality, which leads to serious network interference. To offset the negative impact, the transmit power of other nodes must also be increased. The result is that the network becomes worse and worse, and node energy is wasted a lot. Taking into account the irregular connection range in the cucumber greenhouse WSN, we measured the transmission characteristics of wireless signals under the 2.4 Ghz operating frequency. For improving network layout in the greenhouse, a semiempirical prediction model of signal loss is then studied based on the measured data. Compared with other models, the average relative error of this semi-empirical signal loss model is only 2.3%. Finally, by combining the improved network topology algorithm and tabu search, this paper studies a greenhouse WSN layout that can reduce path loss, save energy, and ensure communication quality. Given the limitation of node-degree constraint in traditional network layout algorithms, the improved algorithm applies the forwarding constraint to balance network energy consumption and constructs asymmetric network communication links. Experimental results show that this research can realize the energy consumption optimization of WSN layout in the greenhouse.


Introduction
The Internet of Things (IoT), as a network that connects things to things and things to people, is considered the main driving force for 5G development. Wireless sensor networks (WSN) play an important role in the basis of the IoT. Sensors in various terminal devices perform real-time monitoring and collect a large amount of information. After data collection, the networks will analyze the data and serve the upper software. It can be seen that in-depth research on WSN helps to improve IoT performance in an all-round way. Greenhouse WSN can control production factors in time and space and

Related Works
Signal transmission characteristics are the foundation of building a reliable and efficient WSN. Free space loss model (FPSL) and two-ray model are usually used to predict signal loss. The FSPL model is adopted in ideal propagation conditions, and the two-ray model simplifies the transmit signal to a direct wave and a ground reflected wave. Signal transmission is affected by factors such as multipath effects, node locations, and space obstacles. The path loss for the same distance may also be different. Rappaport proposed a log-distance model. Based on the measured empirical data, the signal loss models of mango greenhouse, tomato greenhouse and jungle vegetation environment were obtained in Cama-Pinto et al. [10][11][12]. These log-distance models did not take into account the specific vegetation environment and prediction accuracy is limited. Therefore, empirical [13,14] and theoretical [15] models for the vegetation environment have been established. The empirical model depends on the specific environment, whose expression is simple and can be applied directly. The theoretical signal loss models are based on the wireless signal transmission theory, which has complex mathematical expressions. These expressions need to input many model parameters, including plant geometry, signal multi-path, and so on, and it is almost impossible to determine all the influenced factors and relevant environmental parameters.
Secondly, when the signal loss is greater than a given threshold, the packet loss will increase sharply, which disturbs network reliability and reduce the transmission quality. The above studies did not discuss how to optimize greenhouse WSN layout under the corresponding signal loss model. WSN layout is usually divided into the physical layout and logical layout. The physical layout mainly refers to the physical location of sensor nodes. Optimizing the physical layout can increase the monitoring area. The logical layout refers to the network communication topology, which aims to reduce network energy consumption.
The physical layout strategies include deterministic optimization and stochastic optimization. Many studies divide the monitoring area into triangles [16], hexagons [17] and parallelograms according to monitoring requirements, then deploy the network layouts for the reachable area to cover more targets with as few nodes as possible. For monitored areas that are difficult to reach or whose terrain is not ideal, heuristic optimization algorithm [18,19], virtual force, voronoi diagram [20], and related improved methods are used to optimize the physical location. Physical network layout is also associated with other network performance improvements. Based on the fixed communication radius, Nguyen et al. [21] combined the current network energy and data fusion requirements to determine WSN layout. Adasme [22] assumed that each node belongs to a connected subset, and utilized the subtree generation method to wake up different connected nodes at different times, which achieved partial space coverage. Wang et al. [23] dynamically controlled the logical layout by predicting link quality, thus improving the energy utilization. Also based on the fixed node physical location, ant colony optimization algorithm was applied to get the energy-saving network layout with expected energy level and path length [24], which prolongs the network lifetime. Kannagi [25][26][27] respectively utilized the minimum distance tree, game theory and clustering methods to set up network logic topology with low energy consumption, long lifetime, and high reliability.
By planning sensor locations, the network sensing area could be increased to realize effective monitoring for a given area. On this basis, the network logic layout method relies on information such as node energy to optimize the network communication topology to extend its energy consumption and lifetime. However, the signal path loss will bring down the communication quality between different nodes, thus affecting the network logic layout. If a network logic layout is optimized only at a fixed physical location, the improvement effect is limited [28]. In this paper, the signal attenuation characteristics and logical network layout are considered to determine the network physical layout, and the network performance is optimized by improving the network utilization on the basis of meeting the given coverage.

Analysis of Signal Loss Model in the Greenhouse
The basic elements of WSN monitoring are network connectivity and coverage. But affected by vegetables etc., signal transmission in the greenhouse shows irregular attenuation characteristics. The WSN node layout in the greenhouse is not suitable to use the brown connected model. This paper studies a signal loss model involving vegetables, and on this basis explores a connected network layout with low path loss and balanced energy consumption.

Large-scale Path Loss Models
Scattering, diffraction, and reflection usually occur in signal transmission, which limits the communication range of networks. The large-scale path loss model can be used to predict signal loss. Common large-scale models include the FSPL model, two-ray model, and log-distance model. The FPSL model assumes that the signal is transmitted in free space without any obstacles around.
where d is the TX-RX distance and f is the operating frequency.
The two-ray model is for near-earth line-of-sight signal transmission. The path loss expression is obtained by considering the influence of the direct signal and ground reflection signal: P Tworay ¼ 40 logðdÞ À 20 logðh t Þ À 20 logðh r Þ where h t is transmitter height and h r is receiver height.
In fact, due to obstacles, terrain changes, and other factors, the same Tx-Rx distance may result in different path loss. The log-distance model is proposed: where, P(d 0 ) is the path loss at the reference distance d 0 , and g is the attenuation index related to the transmission environment. The log-distance loss model is commonly used in path prediction because it considers the signal attenuation caused by obstacles, multi-path, and so on. However, for the vegetation scattering and absorption, not only the greenhouse has large scale path loss, but also the signal attenuation caused by small-scale path loss cannot be ignored.

Small-scale Path Loss Caused by Vegetables
The empirical vegetation models characterized by simple expressions and wide application range, which are often used to predict small-scale path loss in the greenhouse. Weissberger [13] first proposed a modified exponential decay model: where d v represents the vegetation depth in meters, and f is the operating frequency in Ghz. The applicable frequency range of this model is 230MHz f 95GHz. Based on the UHF operating frequency, ITU-R model is proposed and verified [14]: where, 200MHz f 95GHz. Through the path loss experiment in a small forest, the Cost 235 model is proposed as follows [14]: The above empirical models do not include the physical wireless signal characteristics, and the given model parameters always lead to excessive attenuation for the predicted signal loss in other vegetation scenarios. To solve the problem of poor environmental adaptability of the above model, Rutherford Appleton laboratory developed a Non-Zero Gradient Model (NZG, a semi-empirical model) model [29]: R 0 and R / are the initial and final attenuation values respectively, and k is the final attenuation offset. R 0 , R / and k are usually determined by fitting measured empirical data. Therefore, the NZG model is called a semi-empirical model, which not only includes the physical characteristics of the wireless signal, but also adapts to the actual environment, and has a better prediction effect.
The total signal loss in the greenhouse is composed of the path loss caused by free space and the extra loss caused by vegetables. It can be expressed as: By studying the signal transmission loss model in vegetable greenhouse, we can get the communication quality between different nodes, which provides the basis for the physical layout and logical topology optimization of greenhouse WSN.

Network Layout Optimization Based on the Signal Loss in the Greenhouse
The above path loss models reflect that the communication quality of wireless nodes is affected by protected vegetables. When the received signal strength attenuates too much, the packet loss rate can reach 100%, causing connectivity failure. We divide the greenhouse WSN design into the following problems: (1) Network connectivity: the communication range is usually considered as a circle with fixed radius. In the above signal attenuation studies, we found that the sensor's transmission range is not uniform due to the scattering and absorption of plants as shown in Fig. 1. If the signal strength is lower than the threshold, it cannot be received correctly. In other words, when the power loss is lower than the threshold P rth , it is judged that two nodes can communicate: Set node v i to carry out signal transmission at maximum transmitted power p Max . If the path loss is less than P rth , the node is considered to be a neighbor node of v i . There is a communication link between any two nodes in a network, and the network is connected.
(2) Network coverage: network connectivity ensures that data transmission is feasible, but the coverage range of each wireless sensor node is limited. It is necessary to make all nodes provide enough area coverage. Let the node sensing radius be R, when the distance d between a target and a node is less than R, the coverage probability is 1, otherwise, it is 0. The target area is uniformly dispersed into multiple pixel points. The probability that a pixel pix k is covered by sensor set V is: The total covered area is C area ¼ P pix k 2l 1 Âl 2 pðV ; pixÞ.
(3) Forwarding times: wireless sensors have limited energy and are difficult to charge. If a node undertakes too many forwarding tasks, it will lead to unbalanced network energy consumption and poor robustness. In most studies, the network energy consumption is balanced by limiting the number of nodes that connect to node v i . However, compared with the node-degree constraint, the more times a node is used as a forwarding node, the more energy needs to be consumed, which could better reflect the balance of energy consumption: where, P v r 6 ¼v t 6 ¼v i r v r v t ðv i Þ represents the number that the node v i acts as a forwarding node in the shortest transmission path, and r path represents the total communication link number in the network. This index can better reflect the energy consumption pressure.
The network optimization problem in this paper can be expressed as a simple weighted undirected grepresents a set composed of selected nodes. E represents the edges between nodes communicating with each other, and W ¼ ðw ij Þ N ÂN represents the edge weight matrix. In this paper, the edge weight is obtained by calculating the path loss according to Eq. (8).
When the path loss between nodes v i and v j is less than threshold P rth , it is defined w ij ¼ 1. The objective function that simultaneously optimizes network coverage and path loss is as Eq. (12). S represents the candidate sensor location set. V is the current location selected. a, b are the weight coefficient and th represents the constraint on the number of forwarding. path ij ¼ 1 guaranteed that the communication probability between any two nodes v i , v j is 1. In addition, when the WSN logical topology contains the communication link between nodes v i and v j , e ij = 1.
Then, this paper combines the tabu search algorithm and improved logical layout algorithm to solve Eq. (12). Tabu search algorithm is a heuristic algorithm simulating the human thinking process. It searches for the global solution by marking and avoiding local optimal solutions. First, the tabu search algorithm is used to select a given number of nodes from candidate locations to improve current network coverage. And the improved logical layout algorithm obtains network communication topology depending on the selected nodes under the forwarding constraint. Determine whether the local optimal objective function value is less than the global optimal solution, and update the physical layout and logical layout.
Traditional researches usually balance the network burden with the node-degree constraint. However, this paper studies a forwarding constraint. First, calculate the path loss between each node and other nodes depending on the maximum transmit power, and get the neighbor nodes of each node. Based on the adjacency matrix, the shortest path generation algorithm is used to obtain an initially logical network layout with the minimum path loss. Calculate the number of forwards for each forwarding node in the generated logical layout. If it is greater than the threshold, delete the direct link with the maximum path loss between this node and another node whose degree is not 1. The network logical layout is then regenerated until the forward constraint is met with minimal path loss.
Algorithm: The tabu search algorithm combined with layout optimization 1: Input: The required sensor number, candidate sensor locations, and sensing radius. (1) Node location: as shown in Fig. 2, place wireless nodes evenly in the greenhouse first packet trench, and use two packet trenches as a unit to make the transmitter nod es and receiver nodes at the same horizontal height.
(2) Node height: affected by plant growth, path loss in the greenhouses not only changes with location but also has certain differences at different heights. Therefore, we tested path loss at four heights according to the plant height with the same location, which are 0.5 m, 1 m, 1.5 m, and 2 m respectively. The channel quality at different heights is then obtained. 11: while 9Lðc i Þ > L th and ConnectðHeÞ do // There is a node v i whose path times is greater than the threshold and the current network is connected.

12:
Calculate the network topology N t 13: Ee delate =max(E ij ) (E ij 2 Nt and DegreeðjÞ 6 ¼ 1)// Select a direct path of node v i in the topology, which has the largest loss, and the degree of another node is not 1.  Fig. 3 shows the path loss data in different greenhouse locations. It can be seen that with the distance increase, RSSI (Received Signal Strength Indication) decreases gradually, but the decrease amplitude reduces with the distance increase. It will eventually decay to the receiver sensitivity. At different heights, the plant density is different, and the depth of the plant that the signal needs to cross is different. Therefore, RSSI varies with sensor heights. In Fig. 3, when the sensor height is 1 m and 0.5 m, the signal attenuation is severe due to the influence of plant occlusion and absorption. In this paper, the cucumber canopy is about 1.7 m, and it can be deduced that the fruits, stems and leaves are relatively mature at 1 m and 0.5 m. The signal loss increases with the increase of plant volume and density. Taking 1.5 m height as an example, we use the existing vegetation model in Section 3.2 to predict path loss between different Tx-Rx distance. Figs. 4 and 5 shows predicted data and measured data. Compared with the combination of the FSPL model and vegetation models, the prediction errors for the combination of the two-ray model and vegetation models are larger, and the predicted data are generally smaller. Because the two-ray model only considers the main line-of-sight propagation and ground reflection rays of the signal, and there are walls, plastic ceiling, and other structures in the greenhouse, which leads to the signal multi-path propagation.
Tabs. 2 and 3 shows the relative error loss RE abs between the predicted data and measured data, which conforms to the trend in Figs. 4 and 5. The combination of the FSPL model and COST235 model can be close to the measured data, and the average relative error loss is only 3.2%, while the average error loss of the tworay model combined with COST_235 model is 35.8%. We know that FSPL model can better predict the other  RE abs ¼ y predict À y y Â 100% (13) where, y is the measured value, and y precdict is the predicted value.
Although the combination of the FSPL model and COST 235 model performs a good prediction, it still has a significant error. From the above, the prediction effect of the FSPL model combined with other vegetation models is better than that of the two-ray model combined with other models. Therefore, based on the FSPL model, the least square method is used for fitting model parameters according to Eqs. (7) and (8). The results are as Tab. 4.
The new regression fitting model can achieve a smaller relative error loss of 2.3%. It accords with the characteristics of signal transmission and attenuation in the vegetable greenhouse.     Semi-empirical model fitting is carried out for the measured signals at the heights of 0.5 m, 1 m, 1.5 m, and 2 m, respectively. The regression parameters are shown in Tab. 5. The determination coefficient determines the correlation between the fitting equation and the measured data. The closer it is to 1, the higher the reference value of the fitting expression. The determination coefficient shown in Tab. 5 indicates that for sensors at different heights, a stable greenhouse wireless signal path loss model can be fitted in this paper.

Layout Simulation of Greenhouse WSN Based on Path Loss
We simulate 6 sensor nodes with a sensing radius of 3 m in the greenhouse for accurate sensing. By calculating, the maximum coverage that can be achieved is 0.92. In this section, the signal transmission at 1.5 m is taken as an example to analyze the performance of our optimization algorithm for WSN layout. According to Section 5.1, the path loss between sensors at 1.5 m height is: P Loss ¼ À27:56 þ 20 logðdði; jÞÞ þ 20 logðf Þ þ 0:32d v ði; jÞ þ 12:8ð1 À expðÀ ð8:2 À 0:32Þd v ði; jÞ 12:8 ÞÞ (14) When the path loss is greater than 80 dB, the corresponding nodes are considered to be disconnected. In addition, d is the distance between v i , v j . d v is the vegetable depth that the signal crosses: Taking the path loss between nodes as the edge weight in Eq. (12), we utilize the tabu search algorithm and improved topology method to get the WSN layout at 1.5 m. Fig. 10b shows the physical distribution of wireless sensor nodes in the greenhouse, and Fig. 9b shows the corresponding logical layout. In order to verify the studied algorithm performance, this paper first compares it with the network topology algorithm without the forwarding constraint and the maximal coverage hybrid search algorithm (MCHSA) in Panag et al. [19]. The comparison indexes include average node-degree, average path hops and so on. For each node's energy consumption pressure, this paper uses the standard deviation between the shortest path number experienced by each node and the mean value of the shortest path to measure: As shown in Tab. 6, three algorithms can obtain the greenhouse network layouts with good effective coverage, same average node-degree and same average hop number. The standard deviation of our algorithm is small, indicating that the energy consumption balance is improved, which provides a good foundation for subsequent network life extension. Fig. 5 shows the optimized network layout of three algorithms. In Fig. 5b, with node 3 as the forwarding node, the paths with minimum signal loss are: Node 2 $ Node 3 $ Node 6, Node 5 $ Node 3 $ Node 6, four times in total. In order to reduce the forwarding times of node 3, this algorithm obtains the asymmetric shortest communication paths: Node 6 ! Node 3 $ Node 2, Node 6 ! Node 3 $ Node 5, Node 2 ! Node 1 $ Node 6, Node 5 ! Node 4 $ Node 6, which reduces the energy consumption of node 3. The Fig. 5c shows that after MCHSA determines the node locations, the network layout obtained by the improved algorithm also optimizes the node forwarding times. However, since the path loss is not considered in the physical layout, the path loss and average path energy consumption is worse.
The WSN lifetime is related to many factors such as routing protocol and the MAC protocol. In order to further verify our algorithm effectiveness, we set a node as the sink node and the other nodes as the common nodes. Then we test the energy consumption of the three algorithms.
In Figs. 6a and 6b, the residual energy and standard deviation are compared. Our algorithm has the maximum residual energy and the minimum residual energy standard deviation. The algorithms without the forwarding constraint has a large standard deviation, although the residual energy trend is similar to that of our algorithm. MCHSA algorithm has smaller residual energy standard deviation, but less residual energy. With the increase of rounds, our algorithm has more obvious advantages than the other two algorithms. Fig. 7 shows the residual energy of each node at the 20th round. The algorithm in this paper makes the residual energy between nodes more balanced and improves the average residual energy by consuming more energy of some nodes. Fig. 8 shows the death round of the first node in three algorithms. Compared with the other two algorithms, our algorithm can effectively prolong the node death time and reduce the energy consumption depending on the forwarding constraint and physical location optimization.
In addition, we verify our algorithm performance when the sensor height is 0.5 m, 1 m, 1.5 m, and 2.0 m respectively. The physical layout can cover an area as large as possible and forms a connected logical layout that can communicate between any two nodes. According to Section 5.1, when the height is lower, the signal path loss is greater due to the higher density of fruits and leaves. In Tab. 7, when the height is 0.5 m and 1 m, the average node-degree and local path average hops are relatively more. Our algorithm can get a layout scheme of WSN suitable for the greenhouses according to the actual application demand.

Conclusion
In order to promote the practical application of WSN, this study discusses the extra signal loss caused by vegetables in the greenhouse. The path loss under different Tx-Rx distances is measured, and it is found that there is a relative error between the measured path loss and data predicted by vegetation models. A semiempirical model established in this paper can more express the signal path loss in the greenhouse accurately. Based on this model, we improved the greenhouse WSN layout, which includes the physical and logical layout. Compared with the existing network layout algorithm, this paper replaces the nodedegree constraint with the forwarding constraint and realizes the better greenhouse WSN construction by combining the tabu search algorithm and improved topology method.
Our further work mainly includes applying the research to practical application and measuring actual energy consumption about the optimized greenhouse WSN. In addition, considering the monitoring needs, different receivers and transmitters may have different height requirements, so we plan to develop research on the signal path loss characteristics and layout optimization in a three-dimensional environment.

Conflicts of Interest:
The authors declare no conflict of interest.