A New Low-Cost Device Based on Thermal Infrared Sensors for Olive Tree Canopy Temperature Measurement and Water Status Monitoring

: In recent years, many olive orchards, which are a major crop in the Mediterranean basin, have been converted into intensive or super high-density hedgerow systems. This conﬁguration is more e ﬃ cient in terms of yield per hectare, but at the same time the water requirements are higher than in traditional grove arrangements. Moreover, irrigation regulations have a high environmental (through water use optimization) impact and inﬂuence on crop quality and yield. The mapping of (spatio-temporal) variability with conventional water stress assessment methods is impractical due to time and labor constraints, which often involve sta ﬀ training. To address this problem, this work presents the development of a new low-cost device based on a thermal infrared (IR) sensor for the measurement of olive tree canopy temperature and monitoring of water status. The performance of the developed device was compared to a commercial thermal camera. Furthermore, the proposed device was evaluated in a commercially managed olive orchard, where two di ﬀ erent irrigation treatments were established: a full irrigation treatment (FI) and a regulated deﬁcit irrigation (RDC), aimed at covering 100% and 50% of crop evapotranspiration (ETc), respectively. Predawn leaf water potential ( Ψ PD ) and stomatal conductance (g s ), two widely accepted indicators for crop water status, were regressed to the measured canopy temperature. The results were promising, reaching a coe ﬃ cient of determination R 2 ≥ 0.80. On the other hand, the crop water stress index (CWSI) was also calculated, resulting in a coe ﬃ cient of determination R 2 ≥ 0.79. The outcomes provided by the developed device support its suitability for fast, low-cost, and reliable estimation of an olive orchard’s water status, even suppressing the need for supervised acquisition of reference temperatures. The newly developed device can be used for water management, reducing water usage, and for overall improvements to olive orchard management.


Introduction
Water management has become a key factor in sustainable agriculture, especially in regions such as the Mediterranean, where water scarcity problems are rising [1]. Traditional olive orchard cultivation is the most widespread method [2]. This approach is based on having rain-fed trees at a density of 100-300 trees ha −1 , where irrigation is controlled through cultural practices, such as pruning, which reduces water requirements [3]. In recent years, many traditional orchards have been converted limitation is related to the atmospheric conditions, which may also affect image quality, and hence the derived measurements [31]. In addition, although zenithal images (the only ones available) are suitable for continuous crops, they are not appropriate for woody perennial vegetation with discontinuous canopies [5]. Moreover, they are too expensive and impractical for small-scale farms [28].
Some drawbacks of traditional thermal imaging techniques include the camera cost and resolution, and the time and labor needed to implement the techniques [32]. Sensor resolution must be high enough when used for remote acquisition or the precision of water stress assessment will be reduced. IR array sensors, used for proximal acquisition, can overcome these limitations, greatly reducing the cost and doubling the accuracy in temperature measurements from 1 • C to 0.5 • C, as reported by Martínez et al. [32]. The use of CWSI also enables the automation of the data acquisition as reference measurements are not needed, allowing for the installation of the sensor in vehicles or autonomous robots, which eases the mapping of the orchard. Moreover, cost saving will allow the sensors to be installed on a permanent basis, continuously monitoring the water needs in different locations of the orchard, covering its spatial variability. For this approach, the number of sensors would be determinant for a reliable estimation of the water needs of the crop. This would depend on the heterogeneity of the field characteristics, thereby it would be used with as many nodes as irrigation areas in the field, understanding an irrigation area as a zone with homogeneous water needs. According to this fact, the installation of such a sensor network would require a previous study of the field site. Moreover, it is important to highlight that the reduced cost will allow the increase of the number of nodes, which would have an advantage in ameliorating the spatial heterogeneity problem. On the other hand, as it will require specific manual measurements, this approach is intended for small farmers who cannot afford costly equipment, as described by Jason Shaw et al. [33]. In such cases, a small number of sample points can be representative of orchard status because of the reduced field dimensions or homogeneous conditions. The goal of this research is to assess the suitability of a new low-cost device based on thermal infrared sensors integrated in a device. The developed tool includes a screen, a microcontroller and its associated software, and a battery for in-field plant water status assessment. To this end, a portable prototype device has been developed and validated through an experimental case study (real-case scenario). The prototype is based on a low-cost development platform which uses an Arduino MEGA TM development board (Arduino LLC, Turin, Italy), an IR temperature sensor array, and common electronic components. The portable prototype includes a secure digital (SD) card and a screen for in-field data storage and supervision. All these features are included in the proposed device at a cost of 145 euros. This cost corresponds to the version used in this research for specific measurements, but it could be reduced if the purpose is to install it permanently, since some components (screen, trigger button) would be expendable.
In the first instance, the performance of the developed device was compared with a commercial thermal camera. Once the accuracy of the low-cost IR thermal camera was demonstrated, a field evaluation was carried out, which included the validation of the acquired canopy temperature and the calculated CWSI against two widely accepted water stress indicators, namely g s and Ψ PD . This enabled the demonstration of the capacity of the developed device for estimating plant water status from measured canopy temperature.

Sensor Performance Evaluation
A laboratory test was performed to evaluate the low-cost IR sensor device. The accuracy of the measured temperature was compared to the data obtained with a Testo TM 875-1i infrared camera. The Testo IR camera has a resolution of 160 by 120, it is factory-calibrated following the standard ISO (International Standarization Organization) 9001:2008, and its thermal sensibility is under 50 mK at 30 • C. For the experiment, a controlled temperature chamber and a uniform flat surface (a stack of white paper) were used. White paper was selected because it is easily obtainable and it provides a uniform surface with high emissivity, and it is commonly used as an emissivity reference for thermographic inspection [34]. The uniformity of the target ensures the accuracy of the test, even when the sensor does not capture the same target's area due to differential FOVs. The chamber was used to fix the temperature of the target, along with the sensor temperature. Two different temperatures were used, namely 20 • C (ambient temperature in the laboratory) and 30 • C (fixed temperature inside the chamber). The measurements corresponding to warmed targets were performed inside the chamber to reduce the target heat dissipation. Thirty minutes of exposure was used to ensure that both the target and the sensors met the desired temperature. Moreover, an additional five minutes was added to stabilize the sensors measurements after the power was switched on. The combination of two temperatures for both the target and the sensors generated 4 different combinations for each sensor: Four images for each of the combinations were taken with the commercial camera (resulting in 76,800 pixels) and 8 images with the low-cost developed device (512 pixels). Mean and standard deviation were computed to evaluate both the estimated temperature and the pixel dispersion when measuring a uniform temperature target.

Experimental Case Study Design
The experimental case study to evaluate the sensor capabilities to estimate plant water status was carried out on 11th September, 2019, in a commercial olive orchard (Olea europaea L. cv. "Arbequina") located in Elvas, Portugal (38 • 49 33.6"N, 7 • 07 53.76"W), (Figure 1), at an elevation of around 180 m above sea level and administrated by Elaia TM (Sovena TM Group, Alges, Portugal). The experimental site is a SHD with tree spacing of 1.35 m × 3.75 m (inter and intra-row, respectively), resulting in 2116 trees/ha. The fertilization consists of a fertigation system with periodical adjustment of the nutrient content based on the chemical analysis of leaves. The weed in the experimental site was mechanically controlled. The orchard's soil has a heterogeneous composition, loan and sandy-loan areas are preponderant, but there are some clay-loan zones in the north of the crop. This irregular pattern relative to the composition of the soil has a correlation with the values of electrical conductivity (CEa). A variable amount of low and medium CEa values are observed, except for specific areas where the highest CEa values are shown. Finally, the pH determined in the soil was between 7 and 8.
The climate of the study area according to the Köppen-Geiger classification [35] is Csa (hot-summer mediterranean climate), with average annual rainfall of approximately 600 mm, concentrated from October to May and mostly distributed outside a 4-month summer drought period. During this drought period, irrigation is needed for acceptable production levels, since rainfall is not enough to cover plant water needs due to the plant density. In order to solve this, the orchard has been equipped with a drip irrigation system that supplies water during this period-from the endocarp sclerification (May) to the harvest time (September). The mentioned irrigation system was modulated to have two distinct areas (two different treatments): full irrigated (FI) plots and regulated deficit irrigated (RDC) plots (50% of the FI dosage). The irrigation scheduling consisted of a daily drip irrigation for the FI plants, calculated to cover 100% of crop evapotranspiration. On the other hand, the RDC plants were exceptionally exposed to alternating drought and irrigated periods of one week. As a result of this irrigation schedule, FI plants received approximately 480 m 3 /ha per month between May and September, while RDC plants received just 240 m 3 /ha per month. Five tree rows, oriented from north to south with a homogeneous irrigation The day of the experiment (11 th September) was a sunny day with winds that were not strong enough to be considered as a source of error for thermal measurements (8-12 Km/h). This date is situated at the end of the summer drought period typical of this climate zone, so there was no rain event close to this period.
Irrigation status was assessed using ΨPD the day of the experiment. Additionally, gs measurements were acquired simultaneously with the image capture. According to the literature [6], the maximum daily gs in olive trees can be observed around 10 AM. After this, a progressive increase in the vapor pressure deficit until afternoon occurs, and the plants respond by closing stomata, such that decreasing gs counterbalances the deficit in vapor pressure. This fact limits the ability of plants to regulate their canopy temperature. In order to evaluate this effect, measurements were acquired early in the morning (10 AM) and during midday (15 PM). The canopy temperature was measured in both FI and RDC plants with the developed low-cost device based on thermal infrared sensors. The images were taken from a lateral perspective, avoiding the effects of the soil pixels. The horizontal field of view of the camera is 60°, so the images were taken from a distance of one meter, capturing a representative image of one single tree. Four thermal images of the sunlit canopy and four of the shaded canopies of each selected tree were taken (n = 8 images/tree x 4 tree/plot x 2 plots = 64 observations). The environmental temperature during the day of the experiment reached 26 °C at 10 AM and 34 °C at 15 PM. A whole measurement cycle lasted around 45 minutes, during which the weather conditions were stable (the distance between both treatment plots was just 100 metres).

Physiological Measurement
Olive trees, as drought-adapted species, show an isohydric behaviour characterized by strong stomatal regulation [6]. Due to this circumstance, the reliability of the pressure chamber measurements to estimate water status decreases during the day [6]. On the other hand, during the night, the stomata of the leaves are locked (the evaporative demand is minimal), so the leaf water potential is not influenced by transpiration, giving more reliable information of the water available in the soil [6]. Because of this, the leaf water potential was measured before dawn.
The ΨPD (MPa) is the required pressure for water mobilization through the plant (measured before dawn), which mainly depends on the balance between the water that is lost by transpiration and the water that is gained by absorption [8]. This variable was measured on two healthy leaves per The day of the experiment (11th September) was a sunny day with winds that were not strong enough to be considered as a source of error for thermal measurements (8-12 Km/h). This date is situated at the end of the summer drought period typical of this climate zone, so there was no rain event close to this period.
Irrigation status was assessed using Ψ PD the day of the experiment. Additionally, g s measurements were acquired simultaneously with the image capture. According to the literature [6], the maximum daily g s in olive trees can be observed around 10 AM. After this, a progressive increase in the vapor pressure deficit until afternoon occurs, and the plants respond by closing stomata, such that decreasing g s counterbalances the deficit in vapor pressure. This fact limits the ability of plants to regulate their canopy temperature. In order to evaluate this effect, measurements were acquired early in the morning (10 AM) and during midday (15 PM). The canopy temperature was measured in both FI and RDC plants with the developed low-cost device based on thermal infrared sensors. The images were taken from a lateral perspective, avoiding the effects of the soil pixels. The horizontal field of view of the camera is 60 • , so the images were taken from a distance of one meter, capturing a representative image of one single tree. Four thermal images of the sunlit canopy and four of the shaded canopies of each selected tree were taken (n = 8 images/tree x 4 tree/plot x 2 plots = 64 observations). The environmental temperature during the day of the experiment reached 26 • C at 10 AM and 34 • C at 15 PM. A whole measurement cycle lasted around 45 minutes, during which the weather conditions were stable (the distance between both treatment plots was just 100 metres).

Physiological Measurement
Olive trees, as drought-adapted species, show an isohydric behaviour characterized by strong stomatal regulation [6]. Due to this circumstance, the reliability of the pressure chamber measurements to estimate water status decreases during the day [6]. On the other hand, during the night, the stomata of the leaves are locked (the evaporative demand is minimal), so the leaf water potential is not influenced by transpiration, giving more reliable information of the water available in the soil [6]. Because of this, the leaf water potential was measured before dawn.
The Ψ PD (MPa) is the required pressure for water mobilization through the plant (measured before dawn), which mainly depends on the balance between the water that is lost by transpiration and the water that is gained by absorption [8]. This variable was measured on two healthy leaves per tree (n = 2 leaves/tree × 4 tree/plot × 2 plots = 16 observations) with a Scholander-type pressure chamber (Solfranc Tecnologías TM ). The evening before the experiment, the leaves were covered with aluminium foil to avoid condensation on the leaf surface and enclosed in polyethylene bags to totally stop transpiration, according to the procedure of Gucci et al. [36]. Measurements within the pressure chamber were made with the leaves still enclosed in the plastic bag at 06 AM (before sunrise).
The g s (mol m −2 s −1 ) is the degree of stomatal opening, which is related to the water vapor exiting through the stomata of a leaf. Water stress induces stomatal closure, which in turn limits leaf transpiration, and hence the evaporative cooling process. This results in higher leaf and canopy temperature values [14,22]. The g s was measured on four mature sunlit leaves per tree (n = 4 leaves/tree × 4 tree/plot × 2 plots = 32 observations), on the same trees used for the predawn leaf water potential measurements, using a model SC-1 leaf porometer (Decagon Devices TM ). Measurements of stomatal conductance were taken early in the morning (10 AM) and during midday (15 PM), simultaneously to thermal image acquisition.

Crop Water Stress Index Calculation
The crop water stress index (CWSI) was developed as a normalized index to quantify stress and reduce the disturbance of the environmental parameters affecting the relationship between water stress and canopy temperature [11,15]. It has been widely used as a water status indicator [19,20]. It provides the crop stress level based on canopy-air temperature differences. The CWSI algorithm applied in the study was introduced by Jones et al. [37], which can be represented as follows: where T canopy is canopy temperature from the thermal images; T wet is the temperature of a fully transpiring leaf, or lower reference; and T dry is the temperature of a non-transpiring leaf, also considered the upper reference. Therefore, as the CWSI index (Equation (1)) is the result of normalized canopy temperature based on high and low reference temperatures, the effects of environmental conditions are minimized, and the water status is the main factor determining the index value.

Adaptative Temperature Thresholds
With the aim of simplifying the in-field CWSI assessment, adaptive thresholds of T wet and T dry based on the method proposed by Park et al. [38] were estimated. The process involved using an adaptive approximation based on the TIR histograms derived from the images. It is assumed that T wet and T dry can be taken from the coldest and the hottest part of the temperature distribution histogram of the thermal images, respectively (n = 64 pixels/imagen × 32 imagens/ measurement cycle = 2048 temperature values). The collected measurements feature normal density distributions, however there were some data represented at a reasonably low frequency that were considered outliers (i.e., non-representative canopy temperature). To avoid the influence of the outliers, T dry (Equation (2)) and T wet (Equation (3)) were calculated according the following expressions: where σ is the standard deviation. With this approach, we discarded 2.2% of the data situated at the upper and lower thresholds of the normal distribution of temperature. These data were considered Remote Sens. 2020, 12, 723 7 of 20 outliers, which could represent, for example, surfaces of the tree without transpiration capacity (branches or stems) [39].

Statistical Analyses
Analysis of variance (ANOVA) was used to compare the average values measured between treatments relative to plant-based variables and canopy temperatures. Error probability (EP) values below 0.01 were considered significant. The relationships between canopy temperature and CWSI index regarding the physiological measurements were evaluated through linear regression analyses. In all cases, the coefficient of determination R 2 was used to assess the quality of the statistical model.

Developed Device for Measuring Canopy Temperature and Water Status Monitoring
A new low-cost device based on a thermal infrared sensor for olive tree canopy temperature measurement and water status monitoring was developed. A block diagram of its architecture can be seen in Figure 2, with its physical implementation shown in Figure 3. The controller of the whole device is a low-cost development platform, specifically an Arduino TM MEGA 2560.
Remote Sens. 2019, 11, x FOR PEER REVIEW 7 of 20 index regarding the physiological measurements were evaluated through linear regression analyses. In all cases, the coefficient of determination R 2 was used to assess the quality of the statistical model.

Developed Device for Measuring Canopy Temperature and Water Status Monitoring
A new low-cost device based on a thermal infrared sensor for olive tree canopy temperature measurement and water status monitoring was developed. A block diagram of its architecture can be seen in Figure 2, with its physical implementation shown in Figure 3. The controller of the whole device is a low-cost development platform, specifically an Arduino TM MEGA 2560. The blocks of the developed device depicted in Figure 2 are described below.

Thermal Infrared Sensor
The chosen low-cost thermal IR sensor is embedded in the integrated circuit (IC) MLX90620 (Melexis TM ). In addition to its low cost, the choice is based on the fact that it is a fully calibrated IR temperature sensor array (16 × 4 pixels) capable of remote non-contact temperature measurements, with 16-bit precision and noise equivalent temperature difference (NETD) under 0.5 K; its operating temperature is very suitable for operating in agriculture, specifically from −40 °C to +85°C. The sensor is encapsulated in a 4-lead TO-39 (metal can package) containing two chips: the thermal IR sensor with its associated signal conditioning hardware and an electrically erasable programmable readonly memory (EEPROM) chip used for calibration data storage. The sensor is available in two different field of view (FOV) configurations: 60° and 40°; the latter was selected, since it provides optimum temperature measurements of the central canopy zone at 1 m, resulting in an approximated measurement area of 75 cm (horizontal) by 10 cm (vertical) and a pixel size of 4.7 by 1.25 cm.
The MLX90620 is an infrared sensor composed 64 thermopile units (16 by 4 array). Thermopiles are composed of several thermocouples in series. A thermocouple is a device that generates voltage when its dissimilar metals (thermocouples) are exposed to differential temperatures. The output voltage is directly proportional to the temperature differential from their junction point (related to the IR radiation of the object the sensor is pointed to) and the voltage measurement point, not to the absolute temperature. Thermocouples can be connected in series (forming thermopiles), increasing The blocks of the developed device depicted in Figure 2 are described below.

Thermal Infrared Sensor
The chosen low-cost thermal IR sensor is embedded in the integrated circuit (IC) MLX90620 (Melexis TM ). In addition to its low cost, the choice is based on the fact that it is a fully calibrated IR temperature sensor array (16 × 4 pixels) capable of remote non-contact temperature measurements, with 16-bit precision and noise equivalent temperature difference (NETD) under 0.5 K; its operating temperature is very suitable for operating in agriculture, specifically from −40 • C to +85 • C. The sensor is encapsulated in a 4-lead TO-39 (metal can package) containing two chips: the thermal IR sensor with its associated signal conditioning hardware and an electrically erasable programmable read-only memory (EEPROM) chip used for calibration data storage. The sensor is available in two different field of view (FOV) configurations: 60 • and 40 • ; the latter was selected, since it provides optimum temperature measurements of the central canopy zone at 1 m, resulting in an approximated measurement area of 75 cm (horizontal) by 10 cm (vertical) and a pixel size of 4.7 by 1.25 cm.
The system is powered by a 2s LiPo (Lithium-ion Polymer) battery connected to the device controller board (Arduino TM MEGA 2560). To supply the device components, different voltage levels were implemented: the SD card reader and the display were powered with 5 V from the regulator of the device controller board; regarding MLX90620 IC, it requires 2.6 V for operation, so a diode was connected in the interface board to drop the voltage level down from the 3.3 volts available at the power rail of the device controller.

Display
In order to help and guide the user during the measurement, the developed device includes an Arduino display, specifically a 1.8 inch TFT-LCD (thin film transistor-liquid crystal display) with a resolution of 128 by 160 pixels, as well as a micro-SD slot (see Figures 2 and 3c). Both elements are The MLX90620 is an infrared sensor composed 64 thermopile units (16 by 4 array). Thermopiles are composed of several thermocouples in series. A thermocouple is a device that generates voltage when its dissimilar metals (thermocouples) are exposed to differential temperatures. The output voltage is directly proportional to the temperature differential from their junction point (related to the IR radiation of the object the sensor is pointed to) and the voltage measurement point, not to the absolute temperature. Thermocouples can be connected in series (forming thermopiles), increasing the magnitude of the voltage output, and thus reducing the error associated with measuring the small voltages they produce (in the millivolts range). The MLX90620 integrates its own circuit to amplify (a low-noise, chopper-stabilized amplifier) the sensor signal, which is then converted to digital by a fast-integrated 16-bit ADC that is also embedded in the chip. As previously described, a thermocouple's output is proportional to the temperature differential of the junction and the voltage measurement points, in this case the device package temperature that is measured by an additional sensor (also included in the chip package), a PTAT. To block wavelengths that are not relevant to the measurements, the sensor incorporates a long-wave filter in front of it.
The outputs of both IR and PTAT sensors are stored in an internal RAM and are accessible through a I 2 C (Philips TM ) inter-integrated circuit communication protocol bus. The controller and the MLX90620 are connected using the I 2 C bus through the interface board (described in the next section). The I 2 C protocol uses a two-wire bus for bidirectional communication. Each I 2 C integrated circuit has a unique identifying number (ID) and the master (in this case the device controller) communicates with each of them using its address.

Interface Board
The interface board that connects all the elements was designed using KiCad 5.1.4 as a single-sided circuit board (Figure 3b).
The system is powered by a 2s LiPo (Lithium-ion Polymer) battery connected to the device controller board (Arduino TM MEGA 2560). To supply the device components, different voltage levels were implemented: the SD card reader and the display were powered with 5 V from the regulator of the device controller board; regarding MLX90620 IC, it requires 2.6 V for operation, so a diode was connected in the interface board to drop the voltage level down from the 3.3 volts available at the power rail of the device controller.

Display
In order to help and guide the user during the measurement, the developed device includes an Arduino display, specifically a 1.8 inch TFT-LCD (thin film transistor-liquid crystal display) with a resolution of 128 by 160 pixels, as well as a micro-SD slot (see Figures 2 and 3c). Both elements are ruled by the device controller through the interface board, using a bus based on the serial peripheral interface (SPI).
During operation, the display shows procedures, tasks, and data, as well as device status. In addition, the display shows a matrix (16 by 4) representing each of the IR temperature measurements. In order to provide very intuitive information, each pixel acquires its own RGB colour value, depending on the value of its temperature. The matrix is updated each second, coinciding with the update of the sensor measurements. The measurements and interest data, such as file names, were stored in a SD card.
The availability of an integrated display avoids the use of a computer in the field or some other external device to verify the status of the device and its proper operation, also delivering real-time data.

Device Casing
The device casing was designed using Freecad 0.16 and manufactured with a 3D printer using biodegradable polylactic acid (PLA) 3D printer filament. Two different parts were designed (front and back) to provide a perfect enclosure. A section of the device and its casing can be seen in Figure 3a, as well as its back in Figure 3c. All device elements are housed inside the developed casing, except the battery, which is installed outside to avoid temperature interferences with the IR sensor that could affect the precision of the measurement, as well as to simplify its field replacement.

Device Controller Board
The device controller board (Arduino TM MEGA 2560) includes a microcontroller, which based on the written and uploaded program, performs the programmed functions. The program was developed, compiled, and uploaded to the device controller board using the Arduino TM development environment version 1.8.9. The flow chart of Figure 4 shows the basic functionalities of the program.
The process to perform an IR temperature measurement requires successive steps, as depicted in the flowchart in Figure 4. These will be described below:

1.
Initialization. During this process, all the elements of the device are initialized:

2.
Temperature registers read: The raw data of the temperature measured by the IR sensor is stored in the MLX90620 RAM. The value corresponding to every pixel and the temperature of the chip (through PTAT) are read by the device controller using the I 2 C bus.

3.
Temperature correction: The raw temperature data must be corrected to obtain canopy temperature values. This process is performed in three different steps: -Sensibility per pixel correction: The raw temperature data is operated in conjunction with the stored calibration values to standardize the sensor response and to obtain T O(i,j) , the temperature corresponding to each pixel with the following equation: where α(i,j) corresponds to the individual pixel sensitivity coefficient calculated (as described in the MLX90620 datasheet) from data stored in EEPROM, Ta is the ambient temperature correction, calculated with Equation (5), and V IR(i,j)_COMPENSATED is the parasitic free IR compensated signal, obtained with Equation (6). -Ambient temperature correction: The temperature of the sensor (ambient temperature) affects the measurements. To correct this, MLX90620 includes a PTAT sensor to adjust the IR temperature values. The equation that calculates the ambient temperature is described below: where K T1 , K T2 , and V TH are constants (fixed during the in-factory calibration) stored in the MLX90620 EEPROM (are defined by the manufacturer), and PTAT_data refers to the value measured by the in-chip temperature sensor. -Emissivity correction: The device measures the thermal radiation of a target and estimates its temperature as corresponding to a black body. The emissivity corrects the measurement considering that the object under study is not a perfect black-body emitter. The emissivity was set to 0.98, as this value has been reported to induce errors of less than 1 • C when measuring the canopy of different horticultural crops [40].
where ε is the emissivity and V IR(i,j)_TGC_COMP corresponds to the pixel thermal value after the pixel sensibility and offset compensation process, as described in MLX90620 datasheet.

4.
Display update: After all the corrections have taken place, the display is updated with the measured temperature. The temperatures are shown as a coloured matrix, with colour values reflecting the temperature associated with the corresponding pixel.

5.
File writing (in the event of the trigger button is pressed): When the trigger button is pressed, the temperature measurement (already corrected) is stored in a file and saved on the micro SD card for further processing. The name of the file is automatically generated.

Device Controller Board
The device controller board (Arduino TM MEGA 2560) includes a microcontroller, which based on the written and uploaded program, performs the programmed functions. The program was developed, compiled, and uploaded to the device controller board using the Arduino TM development environment version 1.8.9. The flow chart of Figure 4 shows the basic functionalities of the program. The process to perform an IR temperature measurement requires successive steps, as depicted in the flowchart in Figure 4. These will be described below:

Device Components and Cost
The labor required to manufacture, assemble, and test each element of the developed device, as well as housing them in the casing, is about 3 h for circuit board fabrication, 10 h for 3D printing of the device casing, and 2 h for final assembly and testing. Costs of the circuit and sensor components are shown in Table 1, with a cost of materials under 150 € for the whole device. As a comparison, the Testo TM 875-1i used for the sensor performance evaluation has an acquisition cost of around 3500 €.

Sensor Performance Evaluation
The results of the evaluation of the two sensors under the two different operation conditions are represented in Table 2. The precision of the measurements decreases as the sensor temperature increases, affecting both the commercial camera and the low-cost developed sensor. The performance of both sensors is similar in terms of both average temperature drift and dispersion of the values across the image.

Plant-Based Variables Reference Values
As described in Section 2, two different treatments were established in a commercial olive orchard: FI and RDC. In order to check the differences in water status, two physiological variables related to water stress were assessed for each treatment: g s and Ψ PD . Differences in these parameters between treatments would confirm the quality of the experimental case study design. The Ψ PD was measured by a Scholander-type pressure chamber and the g s by a leaf porometer.
Measured Ψ PD responded to the water stress from the different irrigation treatments, oscillating between 0.32 and 3.73 MPa, with the lowest values corresponding to the FI treatment (Table 3). On the other hand, g s was highest in the morning and declined continuously towards the afternoon in both irrigation treatments. However, statistical differences between irrigated treatments (related to the rate of decrease) could be found during the morning and afternoon, with reductions in g s between RDC and FI plants of around 48% at 10 AM and 57% at 15 PM. The measured water stress indicator confirmed the differences in the physiological state of the plants subjected to different irrigation treatments.

Canopy Temperature
Once the physiological variability between treatments (FI and RDC) was confirmed, the experiment continued to try to verify that this physiological variability was related to differences in canopy temperature. Therefore, simultaneously to the g s data collection by the leaf porometer, the canopy temperature was measured using the developed device. The canopy temperature averaged per treatment showed that RDC trees presented higher crown temperatures than FI trees (Table 4). Additionally, as expected, larger disparities were found in the sunlit side of the canopy at 15 PM, with differences of up to 3.24 • C. Table 4. Canopy temperature measured by the developed device on September 11, 2019 for the experimental plot. Data collected at 10 AM and 15 PM. Note: T canopy sunlit ( • C), canopy temperature of the sunlit face; T canopy shaded ( • C), canopy temperature of the shaded face; FI, full irrigated treatment; RDC, deficit irrigation treatment; 1-4 represent selected trees from each part of the plot. Average values followed by different letters are different at EP ≤ 0.01.

Treatments
Tree On the other hand, T canopy measured on the shaded side of the canopy also showed a significant response to varying irrigation levels (Table 4). However, these differences were smaller than those shown by the sunlit side. The larger disparities of this side were found at 10AM, with differences up to 1.85 • C.

Relationship Between Canopy Temperature and Plant-Based Variable Reference Values
The relationship between T canopy (measured in the sunlit face of the canopy, Table 4) and the two plant-based variables (Ψ PD and g s , Table 3) is shown in Figure 5. Here, Ψ PD exhibited a strong coefficient of determination (R 2 ) to canopy temperature: 0.96 at 10 AM and 0.90 at 15 PM. On the other hand, g s showed a solid correlation to canopy temperature at 15 PM (R 2 = 0.80), with the best results obtained with the data collected at 10 AM (R 2 = 0.94). It must be noted that in the case of Ψ PD , it was assessed before dawn (a unique measurement for the entire day), while the g s was measured simultaneously to canopy temperature. The correlation of g s with the measured temperature in the shaded face of the canopy was weaker: R 2 = 0.81 at 10 AM and R 2 = 0.71 at 15 PM. The Ψ PD showed lower correlations: R 2 = 0.71 at 10 AM and R 2 = 0.62 at 15 PM. In view of these results, the measured temperature from the sunlit face of the canopy was selected for CWSI determination.
CWSI values derived from canopy temperatures (measured in the sunlit side) for each irrigation treatment against Ψ PD and g s are plotted in Figure 6. Significant linear regression coefficients can be obtained from all the relationships. The fit of the relationships between Ψ PD and g s with CWSI were similar, with coefficients of determination close to 0.90. The relationship between g s and CWSI was slightly lower, especially at 15 PM, with a coefficient of determination of 0.80. However, a strong correlation was found at 10 AM with R 2 = 0.94. On the other hand, the Ψ PD was the physiological variable that exhibited the tightest linear relationship with CWSI, with a coefficient of determination (R 2 ) of 0.96 at 10 AM and 0.90 at 15 PM. During the first afternoon hours (15 PM), lower correlations were obtained between g s and both canopy temperature and CWSI index. results obtained with the data collected at 10 AM (R 2 = 0.94). It must be noted that in the case of ΨPD, it was assessed before dawn (a unique measurement for the entire day), while the gs was measured simultaneously to canopy temperature. The correlation of gs with the measured temperature in the shaded face of the canopy was weaker: R 2 = 0.81 at 10 AM and R 2 = 0.71 at 15 PM. The ΨPD showed lower correlations: R 2 = 0.71 at 10 AM and R 2 = 0.62 at 15 PM. In view of these results, the measured temperature from the sunlit face of the canopy was selected for CWSI determination. CWSI values derived from canopy temperatures (measured in the sunlit side) for each irrigation treatment against ΨPD and gs are plotted in Figure 6. Significant linear regression coefficients can be obtained from all the relationships. The fit of the relationships between ΨPD and gs with CWSI were similar, with coefficients of determination close to 0.90. The relationship between gs and CWSI was slightly lower, especially at 15 PM, with a coefficient of determination of 0.80. However, a strong correlation was found at 10 AM with R 2 = 0.94. On the other hand, the ΨPD was the physiological   A dispersion in the values represented by the standard error bars can be observed in Figures 5  and 6. This was caused by the variance in the 4 images x 64 pixel/image = 256 values captured per sampling point (olive tree), corresponding to a standard deviation of 2.16 for the ones obtained at 10 AM and 2.51 for 15 PM. This variability could be associated with differences in leaf health, orientation, or age, among other possibilities. As shown in the correlations between thermal acquired data and physiological status, the area of the tree (and its corresponding mean) that was measured using the developed device is representative of plant water stress estimation.

Discussion
The first step towards the validation of the proposed low-cost IR sensor device was to compare its precision with a commercially available thermal camera. The relationship between canopy temperature and water status has been widely studied, even with low cost devices [25]. In this study, the accuracy of the sensor was evaluated against a commercially available thermal camera, resulting in comparable precision (in both measured temperature drift and pixel value dispersion) under different operational temperatures. A decrease in measurement precision was observed when the sensor operated at higher temperature (even when a correction is performed). Nevertheless, the commercial camera exhibited a similar effect; future works must be conducted to evaluate the influence of this effect for plant water status assessment.
The laboratory results showed than an error up to 2 • C depending on operation conditions must be expected. To determine when this bias affects the utility of the sensor, an in-field experiment in an olive orchard was performed to evaluate the sensor capability of identifying different plant water statuses. The clear response of Ψ PD to the different irrigation treatments showed the different physiological states of the plants. On the other hand, g s showed a decreasing trend throughout the day in all measured plants, which could be due to the isohydric behaviour of the olive [6], but the rate of decrease was significantly higher in RDC plants. Comparable results were reported by Moriana et al. [41], who concluded that the capacity of stomata to regulate transpiration is lost when soil water is severely depleted. In addition, Torres-Ruiz et al. [42] found a total absence of leaf water potential (Ψ) regulation by stomatal closure when this variable was as low as 4.8 MPa. Both gs and Ψ PD are two reliable indicators of water stress, which are widely accepted by the scientific community [22,43,44], so the differences between both treatments (represented in Table 2) confirm a clear response to varying irrigation levels.
On the other hand, T canopy also showed a response to different irrigation treatments. As expected, the trees exposed to a water deficit showed the higher crown temperature and larger disparities were found in the sunlit face of the canopy at 15PM. This effect is caused by stomata closure in stressed trees, resulting in an increase in canopy temperature. This effect was partially inhibited in FI plants due to their delayed stomata closure, which resulted in a better transpiration capacity [44]. The canopy temperatures measured on the shaded side of the orchard also showed significant differences between treatments (Table 3). Nevertheless, the differences between the average values of the treatments were smaller when compared to the sunlit side. This fact was due to the lower exposure to sunlight of the shaded face, resulting in less heating of the leaves, and thus reduced differences between treatments, even when differences exist in terms of stomatal conductance (g s ) [11].
Once the variability in water status of the plants was ensured (as demonstrated by the reference measurement values showed in Table 3), the next step was to investigate whether this different water status had a relation with the low-cost IR sensor device measurements. For this, both CWSI and T canopy were regressed against each water stress indicator (g s and Ψ PD ). The correlation of g s with the measured temperature in the shaded face of the canopy was weaker. For this reason, to establish the CWSI, the measured temperature in the sunlit face of the canopy (since it showed greater sensitivity [11]) was selected. Both CWSI and T canopy showed a lower correlation with g s at 15PM than at 10AM. This fact was also noticed by Ben-Gal et al. [45] and was attributed to the variation in environmental conditions during data collection and the isohydric behaviour of olive orchards [45]. The combination of both facts attenuates the relation between measured g s and obtained irrigation status indicators (T canopy and CWSI). Isohydric behaviour is characterized by a cycle of g s fluctuating during the day, independently of the water status of the tree. This means that the differences in g s were attenuated by the decrease in the g s of FI plants due to their isohydric behaviour. If the variations in the environmental conditions (incoming short-wave radiation, air temperature, relative humidity, wind speed, vapor pressure deficit) at 15 PM compared with 10 AM are added, a lesser degree of correlation between g s and the temperature reached by the canopy was expected. On the other hand, Sepulcre-Cantó et al. [31] found that temperature obtained from airborne thermal imagery earlier in the morning was less affected by background effects than that measured at noon. Nevertheless, in the experimental case study, the thermal images were acquired from a lateral view, avoiding the soil temperature interference.
The crop water stress index (CWSI) was developed as a normalized index to quantify stress and overcome the effects of other environmental parameters affecting the relationship between stress and plant temperature [11,15], so differences were expected in the accuracy of the estimation of water stress by this parameter compared with using T canopy alone. In this experimental case study, no relevant differences were found in the precision of CWSI in comparison with T canopy . This fact was due to the measurements being collected in a short period of time, during which the environmental conditions did not show large variations. It is likely that lower correlations with canopy temperature would be shown by analysing multi-day datasets, since by using the CWSI, the influence of environmental conditions is removed [31]. This suggests that the canopy temperature may be a reliable indicator if the goal is simply comparing between the water status of plants within a given plot at a given time. Nevertheless, if a comparison over time to regulate irrigation is required, the use of the CWSI index will probably be preferable to the canopy temperature. Unfortunately, the data collected for this study cannot assess this hypothesis. Future work is aimed at evaluating the developed device performance under varying environmental conditions and cultivars to define the best indicator of water stress under variable conditions. The envisaged manufacture costs enable a large margin with the establishment of a very competitive sale price compared with other devices used for water status monitoring. The pieces of equipment used in this research study (pressure chamber and leaf porometer) have final costs of around 1500 euros each. Regarding the cost of the developed device (145 euros) (see Table 1), it is more than an order of magnitude less. On the other hand, if compared with other commercially available devices with similar features, it is still cheaper. For example, the FLIR TM thermal camera TG165 has a final cost of around 350 euros, which is more than double the expense of the developed device. Furthermore, automated industrial manufacturing would significantly reduce costs. It is true that this device has better features than the proposed device (it has a resolution of 80 × 60 pixels). However, this could be considered as a strength of the proposed device, since even assuming the worst features enables detection of water stress with similar efficacy.
In summary, the new low-cost device based on the thermal infrared sensor presented in this paper would improve the current state-of-the-art in olive tree canopy temperature measurement and water status monitoring from different points of view. On the one hand, it has an excellent accuracy-cost ratio. Additionally, it is easier and quicker to use than the traditional methodology. In addition, it runs in a non-destructive way and can be operated by non-expert personnel. The reduced cost also enables its integration into a sensor network for permanent monitoring, where the price per device is a key factor to determine the number of nodes, and in turn, the precision of the collected data. Moreover, this approach would further reduce costs, since some components (screen, trigger button) would be expendable. On the other hand, its installation on vehicles or even in autonomous robots would enable the monitoring and mapping of large crop areas with minimal effort.

Conclusions
In this work, a new low-cost device based on thermal infrared sensors was presented to measure, in a non-destructive way, the olive tree canopy temperature and to monitor its water status. Sensor performance was evaluated against a commercially available thermal camera with a cost of around 20 times higher, showing comparable accuracy. The device was also tested in-field, measuring the canopy temperature and crop water stress index (CWSI) (calculated from the IR measurements), which showed high correlation indices when compared to two standardized water stress assessment methods: predawn leaf water potential (Ψ PD ) and stomatal conductance (g s ). Although the results were promising, further work is needed to expand the experimental setup to different environmental conditions and plant water statuses. Nevertheless, the aim of this research was to develop a low-cost alternative for plant water status estimation based on thermal IR measurements. Water stress estimation by canopy temperature has been widely studied and accepted [11][12][13][14]17,19,20], although it still has some limitations.
The low-cost of the developed device, along with its ease of use (it does not need to be operated by expert personnel), labour cost savings, and high precision, paves the way for the implementation of an olive orchard water status appraisal system as an alternative to more costly current technologies, and consequently, to increased efficiency and production. These numerous advantages could create new paths in sustainable oliviculture, enabling the deployment of solutions for automatic and continuous evaluation of water needs for more precise and efficient irrigation. Future works will include the evaluation of the suitability of the developed device for the monitoring of different vegetal species in addition to the olive tree, as well as its accuracy under different environmental conditions, in the context of precision agriculture. Moreover, the reduced cost of the sensor itself enables its integration into wireless sensor networks or robotic devices. Continuous monitoring of plant water status will lead to water use optimization during the growing season, reducing environmental impacts in the current context of climate change and water scarcity.