High ‐ Density Wi ‐ Fi Based Sensor Network for Efficient Irrigation Management in Precision Agriculture

Featured Application: This work demonstrates the feasibility of using wireless networks with Wi ‐ Fi technology in the deployment of sensor networks for precision agriculture. Abstract: The application of deficit irrigation techniques is essential in arid or semi ‐ arid areas of the southeast of Spain, where water is a scarce and very costly resource. However, to apply these techniques, it is necessary to carry out preliminary tests on the specific crop in order to develop the models that allow the optimization of water use while achieving acceptable yields. The system proposed in this article demonstrates the feasibility of using wireless technologies available in most facilities (Wireless Fidelity) to deploy a high ‐ density network of nodes with a variety of heterogeneous sensors to collect data from the soil, plant, and atmosphere. The data are sent and stored in a cloud server for real ‐ time visualization from any mobile device and further analysis. The nodes have been developed using low ‐ cost processors and are equipped with batteries and solar panels, allowing their autonomy to be virtually unlimited, as shown by the consumption studies and tests carried out.


Introduction
In arid and semi-arid zones, such as the southeast of Spain, the agriculture yield is conditioned by limiting factors, the main one being the available irrigation water. Regulated deficit irrigation (RDI) techniques allow controlling the water applied to the crop in critical and non-critical phenological stages, determining periods where the crop can be irrigated with much less water. Therefore, these techniques have been widely used in these areas where water is a scarce resource [1][2][3]. However, the application of RDI strategies is conditioned by crop and climatic conditions. The development of irrigation models specifically designed for a crop would allow the application of RDI for water optimization purposes. In order to develop these models, it is necessary to carry out several comparative tests on different areas of the same crop, where the conditions of the applied RDI are modified. By studying the production and soil and plant water relations on trees subjected to the different treatments, it is possible to determine the most appropriate models for optimal irrigation management. In order to establish these RDI models, sensors that report on the state of the soil, plant and atmosphere are required. In addition, to achieve sufficient precision, it is important to have several repetitions of the
The soil was a silty-clay-loam texture and the bulk density ranged 1.3-1.5 g cm −3 . The irrigation water, from the Tajo-Segura Water Transfer System, has low salinity (Electrical conductivity, EC25 °C, of 1.2 dS m −1 ) and was applied with an automatic controller (Agronic 4000, Sistemes Electrònics PROGRÉS, S.A., Lérida, Spain) that performed control of irrigation, fertilization, pH regulation, pumping and filter cleaning with fault detection. The irrigation system was comprised of a double drip line per row with 12 pressurecompensated drippers (PC dripper 4.0 L h −1 , Netafim, Tel Aviv, Israel) per tree and spaced 1.0 m.
Daily agrometeorological data were recorded by a weather station at the experimental orchard owned by the Agricultural Information Network System of Murcia (SIAM-siam.imida.es). The climate of the area was classified as Mediterranean, with dry and warm summers and mild winters. During the experimental period, most rainfall events occurred between September and May, with the average annual rainfall of 327 mm. The average annual reference evapotranspiration (ET0) of 1320 mm with daily average temperatures ranged between 5.5 °C (January) and 29.5 °C (August) whereas air temperature rarely drops below 0.0 °C. Daily average relative humidity was ranged between 36.5% and 86.0%.

Irrigation Treatments
The irrigation scheduling was carried out in taking into account the evaporative demand (reference crop evapotranspiration, ET0), the corresponding crop coefficients KC [46,47] and the percentage of ground area shaded by the tree canopy (Kr). Therefore, plants irrigation requirements (ETC) were determined as ETC = ET0•KC•Kr. In our case, the irrigation was managed remotely using a Wi-Fi infrastructure to facilitate and guarantee the reliability of the treatments.
Irrigation treatments were distributed according to a randomized complete block design with three blocks per treatment. Each experimental plot consisted of three adjacent rows of four trees per row, but only the two central trees of the central row were used for experimental measurements. A total of five irrigation treatments were applied in this experiment and the annual average of water applied was 7658, 4758, 3490, 5220 and 4770 m 3 ha −1 for the control treatment (this treatment is irrigated at 115% ETC in order to obtain non-limiting soil water conditions), sustained deficit irrigation (SDI) at 80% ETC (SDI80), and another at 50% ETC (SDI50), regulated deficit irrigation at 45% ETC (RDI45) and another at 30% ETc (RDI30) only in phenological stage IV and at 100% ETc during the rest of irrigation season, respectively. Irrigation timing and frequency were varied during the irrigation seasons (February-November).

WSN Infrastructure
The experimental plot already provided a basic Wi-Fi installation and data connection network, as it was included in the network infrastructure of the Technical University of Cartagena. Figure 1 depicts the general scheme of the devices, networks and services deployed in this work for the collection and monitoring of data, as well as for the remote management of the devices. On the laboratory terrace of the farm building (spot a), a device that integrates a 19 dBi 120-degree sector antenna and router board (mANTBox 19 s, MikroTik, Riga, Latvia) was installed. This router, powered by power over ethernet standard (PoE), was connected to the university network available at the laboratory. A virtual private network (VPN) server was configured in this router to facilitate network maintenance and access to equipment such as the datalogger and the fertigation controller. In addition, the router also implements the connection via 5 GHz Wi-Fi (802.11 ac) with a second router with integrated 16 dBi drum antenna (SXT Lite5 ac, MikroTik, Riga, Latvia), located at spot b. The following devices are located at this spot (b): (i) A large weighing lysimeter (2.5 × 2.5 × 1.7 m) with forced suction at the bottom, installed in the middle of a 0.4 ha almond orchard with trees spaced at 5 × 6 m. The soil tank was laid on a platform equipped with load cells (model FX2, Sensocar, Spain) which supplied the total weight of the lysimeter. A 15-year old almond tree (P. dulcis (Mill) D. A. Webb cv. Marta) was used as a lysimeter tree for evapotranspiration determination (ETc). The accuracy of the whole weighing system was estimated to be ± 500 g. The tree was drip irrigated by four laterals with six 4 L h −1 pressure compensating drippers. Irrigation management consisted of restoring water losses due to evapotranspiration and drainage from the previous day; (ii) A data-logger (CR1000, Campbell Scientific, Inc., Logan, UT, USA) used to collect data every 15 min from the sensors installed in the lysimeter: weight and drainage measurement, soil sensors for matric potential (MPS−6 Decagon Devices) and volumetric water content (VWC) (Enviroscan Sentek technologies, Stepney SA 5069 Australia), tree sensors for stress water index determination using dendrometers and thermo-radiometers. A climatic station with ET0 and vapor pressure deficit (VPD) was also installed; (iii) an Ethernet switch to connect the access points of the wireless links; (iv) a router (BaseBox 2, MikroTik, Riga, Latvia) and a dual polarity, 120°, 2.4 GHz 15 dB, sector antenna (AM2G15-120, Ubiquiti, New York, USA) which provides 2.4 GHz Wi-Fi wireless coverage (802.11n) to the sensor nodes; (v) a 60 degrees 2 × 2 MIMO 10 dbi sector antenna with wireless on-board (SXT 2, MikroTik, Riga, Latvia) to establish an 802.11 wireless link to the irrigation controller, located at spot c. The fertigation control device (Agronic 4000) was connected to a serial Wi-Fi converter (USR-WIFI232-610, Jinan USR IOT Technology Limited, Shandong, China) through its RS-232 serial port to enable its wireless connection to the access point of spot b for the remote management of the fertigation programmer from any computer connected to the VPN of our installation. Thanks to this infrastructure, the sensor nodes of the almond plot send the data to a server hosted in the cloud, which provides all the necessary services for its visualization from any personal computer or mobile device. This application allows real-time visualization, logging and querying of historical data, and alarm reporting among other features.

Agronomic Sensors
To allow for real-time monitoring, several sensors were connected to wireless nodes (see Table 1):  A total of four sensors per replicate (twelve in total) deployed as follows: two volumetric soil water content sensors (10HS, Decagon devices, Inc., Pullman, USA) and two matric potential of soil water sensors (MPS-6, Decagon devices, Inc., Pullman, WA, USA), installed at 23 cm from each dripper and 25 and 45 cm depth located under the canopy and along the tree drip lines.  A total of two linear variable displacement transducer sensors (LVDT, Model DF ± 2.5 mm, Solartron Metrology, Bognor Regis, UK) per replicate (six in total) were installed on the main tree branch for measuring micrometric branch diameter variations.  A total of two infrared radiometer sensors (IR120, Campbell Scientific Inc., USA) per treatment were mounted on wooden poles and installed at 0.5-1.0 m over the trees canopy for monitoring canopy temperature.  A total of four climatic sensors (VP4, Decagon devices, Inc., Pullman, WA USA) were installed to record air temperature, relative humidity and vapor pressure deficit.

Sensor Nodes
From the hardware/software point of view, there are two types of nodes: type A and type B, with different subtypes according to the sensors connected to them. The electronics of nodes A and B are housed inside a 120 × 120 × 90 mm IP65 box (G279C, Gainta AEK GmbH-Electrical Enclosures, Frankfurt, Germany). The power supply system consists of a 3.7 V, 3000 mAh Li-ion rechargeable battery, charged by an 80 × 80 mm solar panel (5 V, 0.8 W). Figure 2 shows pictures of both types of node installed in the field.  Table 2 shows the 25 nodes installed in the plot (see Figure 1), detailing, for each of them, the type it belongs to, the replicate, the irrigation treatment it is monitoring and the sensors connected to it. The hardware of the type A node (see Figure 3) is based on a wireless datalogger designed by our research group for PA applications (MEWiN MainBoard) [20]. For the signal conditioning from the sensors, an interface board (SensorBoard A) has been designed, connected to the first one by means of expansion connectors. An ESP8266 microcontroller (Esspressif Systems Co. LTD., Shanghai, China) with WiFi communication capability is also plugged to the SensorBoard A. The SensorBoard A consists of four DC/DC voltage converters (12, 10, 5 and −5 V), required to supply the sensors and to guarantee the operation of the different interfaces on the board: one for SDI12 sensors, another for radial dendrometers and one for analogue sensors (0-3 V). Finally, the board includes a circuit for the management of the rechargeable battery that supplies the power to the node.
The type B Node is similar to type A, but it is based on the use of a Wipy 3.0 (Pycom©, London, UK) (see Figure 4). The SensorBoard B includes four DC/DC voltage converters (12, 10, −3.3 and −2.5 V), required to supply the sensors and to guarantee the operation of the different interfaces on the board: one for SDI12 sensors, another for thermal radiometers and one for analogue sensors (0-3 V). Finally, the board includes a circuit for the management of the rechargeable battery that supplies the power to the node.
The software of the nodes was developed using the MicroPython programming language and a variety of open source libraries for Wi-Fi connectivity and sensor reading, among others. For some tasks, such as data acquisition from SDI-12 sensors, specific algorithms were developed.

Time Synchronization
One of the requirements established by the agronomists for this study was that all the nodes should take the sensor measurements at the same time every 15 min so that they could be compared. Therefore, a synchronization algorithm was implemented: Once a day, the nodes connected to a time server (NTP) and update their real-time clock (RTC), which is very inaccurate (it has a daily drift of approximately 50 s). This inaccuracy, together with the drift of the internal timer in deep sleep mode (about 0.3%), generated a time drift that resulted in desynchronized measurements between nodes. To solve this problem, a time correction algorithm was developed. This algorithm determined the time the system requires to perform the measuring and data sending processes, working out the remaining time needed to be in deep sleep mode before waking up at the exact minute defined by the sampling period. In this deployment, measurements were performed every 15 min (minute 0, 15, 30 and 45 of each hour) and measurements were sent every 30 min (minute 0 and 30 of each hour).

Results and Discussion
After the functional validation, in view of the importance of achieving the maximum autonomy, the current consumption of each of the node types was measured in the field. The measurements were performed with a data acquisition card (USB-6008, National Instruments Corp., Austin, TX, USA) that measured the voltage drop at a 1 Ohm shunt resistor placed in series with the battery that powered the node. The analog input of the card was configured in differential mode in the range of ±1 V and the acquisition was carried out in continuous mode at 1 kHz obtaining the averages every 0.25 s. In this mode, the card has a 12-bit resolution (equivalent to 0.48 mA) and an absolute precision at 25 °C of 1.53 mV (1.53 mA in current).
For both type A and type B nodes, consumption tests were performed for the three possible operating modes, (i) the node connects to synchronize the date and time, collects data from the sensors and sends them to the server (this is the most energy-demanding operating mode and is therefore programmed to occur only every 24 h), (ii) the node collects data and sends them to the server (occurs every 30 min) and (iii) the node collects data and stores them in the memory card waiting for the next connection to the server (occurs in the middle of the period between sending events, i.e., 15 min later).

Consumption of Type A Nodes
Node type A had a standby consumption of 1.1 mA. Figure 5 shows the current required in each of the states through which the node passes in operating mode (i). The measured current and the duration of each of these states are shown in Table 3. With these values, taking into account the standby current, the total consumption of the mode has been calculated with Equation (1). The function of each state is indicated in its description (Table 3). In state 2 (task signaling), the node displays information about the task it is executing by means of a lighting sequence of four LEDs. This information helps the user to perform maintenance and commissioning tasks in the field.  (2) and (3) show similar calculations for the other two modes of operation of the node: modes (ii) and (iii). Note that mode (i) occurs once a day, i.e., every 86,400 s (24•60•60) and modes ii and iii every 30 min, i.e., every 1800 s (30 × 60).
Once the total consumption current of each of the operating modes has been determined, taking into account the standby current and the capacity of the battery installed in the nodes, it is possible to calculate (Equation (4)) the autonomy (in days) provided that the battery is not charged by any means.

Consumption of Type B Nodes
The same measurements and calculations made for node A were carried out for type B node. These calculations are shown in Figures 8-10, Tables 6-8, and Equations (5)- (7). In this case, node B had a standby current of 1.5 mA.
The autonomy of node B, provided that the battery is not charged by any means, is depicted in Equation (8).

Sensor Data Validation
In order to demonstrate the usefulness and viability of the deployed network of nodes, data registered over a significant period of time from an agronomic and sensor network reliability point of view are shown below. Figure 11 shows the evolution of the VWC at both 25 and 45 cm depth, measured by 10HS sensors (node 04). Irrigation was scheduled every two or three days at 11 a.m. and it took 2 h. VWC values ranged between 0.413 and 0.336 m 3 m −3 during the test period.
The maximum values were reached during the irrigation events. After the irrigation events, VWC values fell due to infiltration and they stabilized at values close to 0.358 m 3 m −3 . The information registered by MPS-6 sensors ( Figure 12) was complementary to that obtained by 10HS sensors (Figure 11). In each irrigation event and depth, the value increased until it was close to −7 kPa, being considered this as field capacity [48]. The falls of MPS-6 sensors were steeper than those registered by 10HS sensors. Both types of sensors detected the irrigation events between 1 and 2 h after irrigation events started in both depths. During the test period, evaporative demand increased strongly, going from a reference crop evapotranspiration of 2.5 to 4.0 mm d −1 at the end of the study period, which accelerated the falls of the VWC and soil matric potential values, as well as it showed a greater drop in values. The values showed both types of sensors at saturation level were similar to those reported by [49] on similar texture soil. Additionally, the nodes automatically and continuously monitored plant water status with LVDT sensors. Figure 13 shows trunk diameter fluctuations (TDF) where the daily cycle of shrinkage for RDI30 for three consecutive days can be observed. The maximum trunk diameter (MXTD) was reached at the beginning of the day and the minimum trunk diameter (MNTD) was recorded during the afternoon. From data obtained from TDF, two indices were calculated to establish plant water status. The daily trunk shrinkage values, calculated as the difference between MXDT and MNTD on the same day, were 271, 411 and 292 μm for three consecutive days, respectively. The trunk growth rate values were calculated as the difference between MXTD of two consecutive days. In general, they were close to 0 μm throughout the period considered. The trend and values obtained were in agreement with those reported by [50,51].

Reliability of the Nodes
In general terms, the performance of the nodes was satisfactory. Obviously, the installation required periodic maintenance tasks, such as cleaning the solar panels, and eventual interventions due to occasional failures in the hardware of the nodes.
The evolution of the battery voltage of the nodes is a useful indicator of the "health" of the node. As an example, Figure 14 shows the evolution of the battery voltage of one of the nodes (node 25) in typical conditions. As can be seen, the battery management algorithm starts the charge when the voltage falls below the lower threshold (3.95 V) and stops when the upper threshold is reached (4.1 V). In this way, it works within the optimum voltage range for the battery and reduces the charge cycles, extending its useful life. During the charge there are different voltage peaks corresponding to the daylight hours (the solar panel supplies charge) and the hours of darkness during the night (there is no photovoltaic generation and the battery discharges due to the node consumption).
The "discrepancy" that appears between days 82 and 87 (22 and 27 March 2020) corresponds to days when solar radiation was lower due to the existence of cloudiness (see Figure 15).

Typical Node Failures
Among the common problems detected during the operation of the deployment, the most frequent were those that led to the exhaustion or destruction of the battery. The usual reasons were (i) overheating due to the high temperatures reached inside the box in summer, (ii) dirt or ageing of the solar panels and (iii) natural ageing of the batteries as they reached the end of their lifespan. Figure 16 presents the evolution of the battery voltage of node 23. As can be seen, between 7 and 27 March there was a prolonged discharge due to the ageing of the panel, which stopped charging (this was later verified in a field intervention). Once the solar panel was replaced on the 27th, the node started charging again. It is worth noting that from this graph it is possible to extract very interesting information: due to the failure of the panel, the node showed an autonomy of approximately 20 days, which validates the theoretical calculations indicated in the section of consumption and autonomy estimation of the nodes.  Figures 17 and 18 depict failures in two other nodes due to dirt on the solar panels (mainly dust and bird droppings). In the case of node 5 ( Figure 17), it can be seen that since 15 March, there were successive loads that did not reach the upper threshold. From 21 March, the panel did not supply the required current to increase the battery charge, whose voltage started a downward trend until 25 March, the day on which the panel was cleaned, and the node recovered. In the case of node 4 ( Figure 18), the node never managed to reach the upper threshold because the panel current was not sufficient, so on 24 March, the voltage fell below the minimum operating voltage and the node stopped transmitting.

Conclusions
The results described in this work demonstrate the viability of using new or existing Wi-Fi infrastructures for the collection of agronomic data with low-cost nodes in deployments for taking measurements over long periods of time. Although some authors argue that Wi-Fi is not the most suitable technology for WSN in PA, the application of techniques to reduce consumption and the use of energy harvesting methods (solar panels) allows for virtually unlimited node operating autonomy. Consequently, this work demonstrates that, properly managing the energy demand, WSN deployment using Wi-Fi is feasible and even advantageous in installations where Wi-Fi coverage is already available or a major investment in the communications infrastructure is not desired. In addition, the use of Wi-Fi is particularly convenient when using multi-node deployments on the same plot (high density), e.g., in research trials where it is necessary to replicate measurements in several locations to minimize variability, and also to perform them with different parameters to evaluate the performance of irrigation strategies on a given crop.
In addition, time synchronization techniques have been implemented to ensure time alignment of the data measured by the sensors. This facilitates its subsequent analysis for the realization of agronomic studies that relate the different irrigation treatments with the state of the plant and the crop yield.
Likewise, the experimental installation described in this work has demonstrated the reliability of the nodes, sensors and communications infrastructure used. The experimental results have shown that, although wireless networks require less installation and maintenance tasks than wired ones, they do need programmed servicing interventions and occasional troubleshooting.
Next steps would involve the integration of nodes with other communication technologies such as LoRa to carry out studies to compare the advantages and disadvantages of each technology.