**1. Introduction**

Mexico has planted areas exceeding 44,000 hectares of pecan trees (*Carya illinoinensis Koch*) in arid zones [1]. Production of pecan nuts in Mexico affects the United States' nuts prices as 95% of the world production of pecan nuts comes from North America (Mexico and the United States) [2]. Other countries producing pecan nuts are Australia, Israel, and Peru [3]. California plants 350,000 ha of almonds being 77% of the world's production [4, 5]. Almond trees require between 700 and 1500 mm of water to obtain good yields [6] so they need irrigation systems. A high-yield mature almond orchard in South Australia presented evapotranspiration (ETc) of 1430 mm [7]. ETc used annually by pecan trees in Egypt was 2100 mm [8]. Water use by almond trees depends on canopy cover and evaporative demand [9].

Better irrigation water use efficiency was obtained with pressurized systems than with furrow irrigation [10]. Drip irrigation saves 30% of the water applied to almond trees when compared with surface irrigation [4, 11]. Almond farms in Australia use high-efficiency drip systems using from 12 to 15 (2 l h−1) drippers per tree [12]. Pulsing irrigation and deficit irrigation increased water productivity. Less water productivity was increased using deficit irrigation. The modeled water uptake using the HYDRUS-2D software was higher than sap flow measurements before the almond harvest [12]. Sprinkler irrigation systems in pecan trees produced greater trunk growth diameter in contrast to other irrigation systems [13]. Wet soil volume from micro-sprinklers was important for almond yield [14]. Sustained deficit irrigation applied water at a given percentage of full ETc over the entire season and provided excellent yield [15].

Automatic irrigation systems require sensors to log irrigation variables [10]. Fruit trees are sensitive to water deficit, so irrigation evaluation becomes critical. Water stress monitoring during deficit irrigation allows saving water without decreasing fruit yield [16]. For fruit trees, monitoring the control of soil moisture is important to avoid the proliferation of fungi in the roots under high levels of humidity [17]. Tensiometers measure soil water potential and are useful for timing irrigations [18]. Continuous monitoring with dendrometers is time-consuming and problematic for automated irrigation [19]. Midday stem water potential (MSWP) has thus become the current standard irrigation management tool [20].

LoRaWAN radio signals within forests can be attenuated due to diffraction and scattering effects caused by tree obstacles [21–23]. Low frequencies provide good penetration within forests and present lower losses than high-frequency bands [24]. Tropical orchards can experiment with drastic weather conditions, being air temperature the variable that affects more LoRa transmission [25–27]. Air temperature decreases the received signal strength indicator (RSSI) variable [25]. Rain and relative humidity did not affect RSSI strongly [25, 28].

Precision agriculture in fruit crops has become fundamental for optimizing yields [29]. Internet of Things (IoT) has been used in recent years for plant growth monitoring [30]. Unmanned aerial vehicles (UAV) can observe trees that cover several hectares with multi-spectral cameras [31]. Normalized difference green near-infrared index (NDGNI) obtained with spectral cameras has also proved to be sensitive to water status [32]. Multispectral imagery remote sensing can monitor crop ET and crop water use throughout the growing season [33]. The normalized difference vegetation index provides a reliable estimate for leaf chlorophyll content and LAI [34]. The B5:B7 near-infrared ratio positively correlates with the moisture status of pecan orchards [35].

In this chapter, sensors detect when the micro-splinker system is not irrigating trees properly. The proposed remote monitoring network is able to: (1) monitor soil moisture in each tree of the orchard at sunset; (2) trigger an alarm if soil moisture was not detected; and (3) warn the producer by sending a short message system (SMS) to his/her smartphone. The WSN (wireless system network) for different moisture sensors and orchard densities are reviewed.

#### **2. Walnut tree orchard**

The experiment during the 2018–2019 season was carried out in the Western walnut-tree plantation at Delicias, Chihuahua, Mexico (28°11′35″ N, −105°28′18″ W, 1190 m). The 25-year-old orchard has a density of 10 × 10 trees per hectare with an average tree height of 7 m. Four micro-sprinklers were added per tree, together with

#### **Figure 1.**

a water moisture sensor. Once the farmer receives a smartphone message (SMS) containing the tree number where irrigation failed, he/she drives to the tree and cleans the micro-sprinkler, letting it ready for the next irrigation cycle (**Figure 1**).

Tree number per hectare characterizes orchard density, which is important to increase yield. Almond tree size and height increase with age, and in order to obtain good yield, it is necessary to prune the orchard and let the radiation pass through the canopy. The reduced yield was obtained in almond low density (LD) farms with compost application [36]. Super high-density (SHD) orchards (over 2000 trees/ ha) were studied since 2010 [37]. Kernel and almond in shell yield were 1.58 and 4.43 ton/ha, respectively [37]. The 25-year-old Western walnut-tree plantation in Delicias, Mexico, with a density of 10 × 10 trees per hectare, sprinkler irrigation, and a nitrogen application of 200 kg/ha produced 33 kg/tree [38]. Tree crowding reduces productivity due to excessive shading [39]. Tree management, including spraying and harvesting, becomes more difficult.

#### **2.1 Soil and tree water content detector**

Real-time monitoring of the whole orchard is impossible to carry out without sensors. Each tree presents a monitoring system consisting of moisture sensors, a microcontroller, and some of them a master microcontroller with a LoRa transmitter (TTGO LoRa32 OLED V2.1.6., Lilygo, China). A plastic box in each tree trunk covers a low power consumption CC2541 chip inside (**Figure 2**). The CC2541 built by Texas Instruments includes a Bluetooth Low Energy (BLE) platform, a built-in 8051 microcontroller, 256 KB of programmable memory, 8 KB of RAM, IO ports, and a 2.4-GHz RF transceiver.

#### *2.1.1 Soil moisture detectors*

Precise soil moisture measurements can be obtained with the gravimetric method, using tensiometers, neutron gauges, gamma-ray attenuation, and time-domain

**Figure 2.** *Tree controller and transmitters.*

reflectometry (TDR) [40]. Neutron probes, TDR, and gamma-ray sensors are highly accurate but extremely expensive. The neutron probe costs around \$10,000 and estimates water in a larger area than other soil moisture sensors. TDR needs a very good data logger (\$2000−3000) and each sensor cost is 100 US\$.

Traditional farming depends on farmers' skills and experience. A transition to smart farming is noticed in advanced countries. Smart farming optimizes yields after measuring environmental and crop conditions. Soil moisture measured at multiple locations requires cheap sensors. Low-cost dielectric soil moisture sensors require complex processing circuits and are dependent on soil type and temperature [41]. Five different soil moisture sensors are compared in **Table 1** [17, 42], and prices are decreasing as smart technologies take over. The Decagon EC-5 sensor measures volumetric water content (VWC) after obtaining the dielectric constant by frequency


#### **Table 1.**

*Comparison of relatively cheap soil moisture sensors.*

#### *WSN System Warns Producer When Micro-Sprinklers Fail in Fruit Trees DOI: http://dx.doi.org/10.5772/intechopen.106023*

domain technology [42]. As the sensor works above 70 MHz, its cost increases to 105 US\$, due to all the electronics involved, **Table 1**. It works accurately in soilless media and under saline soils.

Remote dielectric and capacitive soil water content sensors are becoming attractive as the Delta-T ThetaProbe is being precise but very expensive [43]. The YL-69 soil moisture sensor [17] provides a variable electric signal when water is present between the electrodes and the soil. Ion movement in wet soil is higher than in dry soil. This sensor is equipped with an LM393 potentiometer and provides a digital output depending on the soil moisture [44]. Clay and loamy soil samples will provide different YL69 output values when the soil has a different moisture content [45]. Clay and loam soil with 20% moisture will obtain sensor measurements of 90 and 70%, respectively. In clay soils, sensor readings are linear only until 13% [45].

#### *2.1.2 Cheap soil moisture measurements*

In this experiment, several moisture sensors were used to compare efficiency, energy consumption, and cost.


#### **Figure 3.**

*Moisture (a) capacitive V1.2 probe, (b) YL-69 probe, and (c) V1.2 and YL-69 probes buried in soil.*

**Figure 4.**

*Sprayed water (a) to a wetness sensor, (b) to a dry solar cell, and (c) to forming drops in solar cell.*


## **2.2 Wireless system network**

A wireless system network (WSN) monitored water application to each tree within one hectare. Every tree group consists of 9 trees (**Figure 6**). One hectare is regrouped into 12-groups, being water content detectors monitored at sunset. The central tree (A) from each group holds a master microcontroller module (TTGO LoRa32 OLED V2.1.6., Lilygo, China). This master module is fixed at a height of 5 m at the end of a hydraulic PVC tube (**Figure 2**). The remaining eight trees have CC2541 slave microcontrollers (SM).

The CC2541 uses BLE (Bluetooth Low Energy) for communication taking place at sunset. Once the slave microcontroller receives the packet from the slave transmitter, it responds. If there is no data to send, an empty packet is sent, finishing the BLE connection.

The first group array (**Figure 6a**) communicates via BLE sending a value at 18:00, just at sunset. A sensor detects if water did not reach a tree, so after CC2541 acquisition and processing, it will transmit the tree number to the following tree via BLE. The sequence starts with tree G, transmitting the tree number or 0 to tree E. Tree E detects whether it was irrigated, otherwise it transmits the tree number to tree H.

*WSN System Warns Producer When Micro-Sprinklers Fail in Fruit Trees DOI: http://dx.doi.org/10.5772/intechopen.106023*

#### **Figure 5.**

*Water measurement from (a) a micro-sprinkler with an optical sensor, (b) air moisture sensor DHT 11 hanging from the tree, and (c) DHT 11 hanging from lateral hose.*

#### **Figure 6.**

*Group of 9 trees using (a) BLE transmitters and (b) lasers for the orchard WSN.*

This process continues until all the collateral trees send their information reaching the final value to the central tree. The values that will be sent to the producer's smartphone by the master microcontroller LoRa vary depending on the number of trees that were not irrigated. Trees are numbered from 1 to 108 in 1 ha, so the third group has trees numbered between 19 and 27. If G, E, and H failed due to a lateral problem, the data received by the master microcontroller will be 212,019 (**Figure 7a**). If only E and C trees were not watered, the data that will be arriving to the master is 2026 (**Figure 7a**). If all trees were watered, no data reaches the microcontroller.

Another group array topology (**Figure 6b**) substitutes the BLE signal with optical lasers. A CC2541-slave microcontroller (SM) was placed in each tree surrounding the central tree (A). The master microcontroller (MM) at tree A is the TTGO LoRa32 OLED V2.1.6. Each CC2541 reads the sensor signal, determines whether the tree was watered, and turns on the laser in case the tree soil is dry. A battery charged by a solar panel supplies the energy required to turn on the 650 nm–5 mW laser diode (D650-5I, USLASERS INC, USA). The phototransistor at the adjacent tree (10 m away) saturates after being lighted by a laser beam with a 14 mm diameter. A capacitor charges and

**Figure 7.** *Third group of 9 trees (a) using BLE lasers for WSN and (b) master microcontroller signals.*

this voltage will be read by the CC2541. The phototransistor (BPW76A, Vishay, India) was chosen as it operates under a wide temperature range using an operating voltage up to 5 V and a collector current of 0.5 mA.

As lasers do not transmit electrical signals, the CC2541 turns on the laser providing a 1.5 s pulse. The CC2541 slave microcontroller on tree E acknowledges its own water status, before checking if the capacitors were charged by lasers from trees H and G. If no charge is detected and the tree was watered, the CC2541 goes to sleep (**Figure 6b**). Tree A will hold 4 phototransistors to acknowledge the moisture status of the entire group. The master microcontroller timing signal explains its operation, being synchronized by the microcontroller clock (**Figure 7b**).

A light sensor indicates when sunset arrives, starting the operation routine. Once the MM is operating, it acquires the tree A sensor value first and waits 3 s for checking the capacitor status. It will charge through the phototransistor if tree B laser beam is on. If this is the case, it saves number 24 in a register (**Figure 7a**). The same operation takes place with tree D (number 22) 3 s later.

Information coming from trees E and C has to be decoded. It also contains information from trees H and G, and K and F. Laser from tree E sends 3-pulses of 1.5 s each, separated by OFF pulses of 1.5 s. The three pulses sent by the CC2541 controller are shown at the E timing signal (**Figure 7b**). Three pulses are sent, when trees G, E, and H were not watered. If only the first pulse appears (green pulse), tree G is not watered and the master microcontroller will convert it to number 21 (**Figure 7a**). The same operation takes place with tree C. After checking all the trees, the MM generates a value that is transmitted through LoRa, and the tree enters sleep mode until the next day.

#### *2.2.1 Master LoRa communication*

LoRa provides a low-cost communication system that does not require a license. TTGO LoRa32 OLED V2.1.6. modules can communicate through BLE and LoRa. The LoRa was programmed at 915 MHz, with a power transmission of 20 dBm, a spreading factor (SF) of 12 and a bandwidth of 125 kHz. The maximum packet size for a 9-tree group would be 18 bytes if all the trees were not watered at the same time.

Another TTGO LoRa32 OLED V2.1.6 module at the roof of the farmer's house works as a general receiver from the entire plantation and presents a 3 dbi 915 MHz whip antenna. In addition, a SIM Card is incorporated so that the tree number with water shortage could be transferred to the farmer's smartphone by SMS.

#### *WSN System Warns Producer When Micro-Sprinklers Fail in Fruit Trees DOI: http://dx.doi.org/10.5772/intechopen.106023*

Transmission between the 12 central tree modules within a hectare and the end TTGO LoRa32 OLED V2.1.6 module at the orchard house was synchronized to avoid crossover between SMS messages. The time delay for this transmission takes 13 s. The 3 central trees further away transmitted their data 1–2-min after sunset. LoRa from the following 3 groups transmitted data 3–4 min after sunset and so on.

#### **2.3 Optical remote sensing measurements**

In situ soil moisture monitoring of crop water stress is time-consuming, and assumes uniform plant density and transpiration rate [46]. Vis–NIR (400–1100 nm) can provide measurements of soil moisture [47]. Hydration, hygroscopic, and free water are present in the soil, being the free water inside soil pores. Spectral absorption peaks for hygroscopic and free water occur at 1900 nm but cannot be measured with a cheap VIS–NIR spectrometer. Vis–NIR optical soil moisture measurements require large local calibration data sets limiting their use [48]. Remote sensing detects vegetation stress in trees [49, 50], but satellites provide low-resolution images with a limited field of view. Nano-satellites increase spatial resolution and image timing [50]. NDVI (Normalized Difference Vegetation Index) [51] and crop water stress index [49, 52] have been correlated against canopy temperature and tree stress. NDVI provides useful information on canopy structure and drought stress [53].

#### *2.3.1 UAV selection and flight programming*

A six-wing DJI S900 (DJI Co., Ltd. Shenzhen, China) with a load capacity of 5 kg was selected to take tree images (**Figure 8a**). Time of flight at midday took 18 min and was done at a height of 30 m at a speed of 4 km h−1. Multi-rotor drones used to study pistachio, almond and walnut plantations collect RGB, and multi spectral images [54]. The hexacopter was equipped with a Parrot Sequoia multispectral camera (SenseFly, Inc., Switzerland). The Parrot equipment presents 2 sensors: a

**Figure 8.** *Hexacopter (a) flying over tree and (b) parrot camera.*

**Figure 9.** *Image taken by the hexacopter (a) in RGB and (b) showing trees with sprinklers removed.*

multispectral camera and a light sensor to monitor sunlight intensity. The multispectral sensor has four (1.2 megapixels) monochrome cameras: green, red, red edge, near-infrared, and 16 MP RGB [55]. Their RGB and multispectral spatial resolution were of 1.2 cm/px and 3.8 cm/x, respectively [56]. The hexacopter took aerial images of the plantation on the day when some micro-sprinklers were removed as well as 4 and 7 days after (**Figure 9a**). Aerial images were taken every 2 s, having an overlap of 80%. Some trees had all their 4 micro-sprinklers removed (red cross), meanwhile those trees with a blue cross had only one sprinkler removed (**Figure 9b**). The experiment was repeated 3 times. After the UAV returned, images were exported for processing with Pix4D software (Pix4D v.3.1., Switzerland).
