*Article* **Radio Wave Attenuation Measurement System Based on RSSI for Precision Agriculture: Application to Tomato Greenhouses**

**Dora Cama-Pinto 1,\* , Juan Antonio Holgado-Terriza <sup>2</sup> , Miguel Damas-Hermoso <sup>1</sup> , Francisco Gómez-Mula <sup>1</sup> and Alejandro Cama-Pinto 3,\***


**Abstract:** Precision agriculture and smart farming are concepts that are acquiring an important boom due to their relationship with the Internet of Things (IoT), especially in the search for new mechanisms and procedures that allow for sustainable and efficient agriculture to meet future demand from an increasing population. Both concepts require the deployment of sensor networks that monitor agricultural variables for the integration of spatial and temporal agricultural data. This paper presents a system that has been developed to measure the attenuation of radio waves in the 2.4 GHz free band (ISM- Industrial, Scientific and Medical) when propagating inside a tomato greenhouse based on the received signal strength indicator (RSSI), and a procedure for using the system to measure RSSI at different distances and heights. The system is based on Zolertia Re-Mote nodes with the Contiki operating system and a Raspberry Pi to record the data obtained. The receiver node records the RSSI at different locations in the greenhouse with the transmitter node and at different heights. In addition, a study of the radio wave attenuation was measured in a tomato greenhouse, and we publish the corresponding obtained dataset in order to share with the research community.

**Keywords:** wireless sensor networks; WSN; received signal strength indicator; RSSI; Internet of Things; IoT; free space pathloss; smart farming

#### **1. Introduction**

Agriculture is a fundamental pillar in a country's economy and society; therefore, increasing agricultural productivity through cutting-edge technology contributes to economic progress and the feeding of its inhabitants [1]. In this perspective, technological advancement in precision agriculture (PA) has been accelerated by the Internet of Things (IoT), wireless sensor networks (WSN), and even 5G networks [2,3], because almost all techniques used in PA have sensing technology as a common factor [4,5]. PA produces more food with limited resources such as water and soil [6–8], effectively increasing the quality and yield of crops [9], a remarkable fact considering the Food and Agriculture Organization of the United Nations (FAO) states that the human population level on a global scale will increase from eight billion inhabitants in 2025 to nine billion, six hundred million in 2050 [10].

In a PA scenario, wireless sensor networks (WSNs) serve as a local crop monitoring system that allows for making the right decisions in a controlled production system affected by climate change [11–14]. Sensor values in agricultural fields are adjusted and set according to the specific requirements of each type of plant, e.g., in an appropriate range to provide continuous information on the field conditions of the temperature, wind, light, soil moisture, nutrients, and illuminance variables [15–17].

**Citation:** Cama-Pinto, D.; Holgado-Terriza, J.A.; Damas-Hermoso, M.; Gómez-Mula, F.; Cama-Pinto, A. Radio Wave Attenuation Measurement System Based on RSSI for Precision Agriculture: Application to Tomato Greenhouses. *Inventions* **2021**, *6*, 66. https://doi.org/10.3390/ inventions6040066

Academic Editor: Konstantinos G. Arvanitis

Received: 8 September 2021 Accepted: 8 October 2021 Published: 12 October 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

On the other hand, with WSN being a distributed system, it is usually composed of small-sized embedded devices [18] called nodes or motes, which communicate wirelessly in a network. Each node has four subsystems described in Figure 1. The first detects the environment by means of its sensors that measure physical data and translate them into analogue signals that are then converted into digital signals. The second is the processing subsystem which contains the microcontroller that performs calculations on the digital data collected through the ADC. The third is the communication subsystem that is in charge of exchanging the information between the different sensor nodes by means of its transceivers [3]. Radio modules operating according to the IEEE 802.15.14 standard typically use radio frequency transceivers in the 2.4 GHz band (2400–2483.5 MHz) [19], as it is freely available worldwide and the most widely used among radio modules from manufacturers using WLAN [20–22], PAN wireless communication standards such as IEEE 802.15.1 (Bluetooth), IEEE 802.15.4 used in WSN (wireless sensor network), and IEEE 802.11 (WiFi). Finally, the fourth subsystem is the power subsystem, with a design based on energy saving, which is relevant as sensors have to operate on an extremely limited energy budget [10,23]. On the other hand, with WSN being a distributed system, it is usually composed of small-sized embedded devices [18] called nodes or motes, which communicate wirelessly in a network. Each node has four subsystems described in Figure 1. The first detects the environment by means of its sensors that measure physical data and translate them into analogue signals that are then converted into digital signals. The second is the processing subsystem which contains the microcontroller that performs calculations on the digital data collected through the ADC. The third is the communication subsystem that is in charge of exchanging the information between the different sensor nodes by means of its transceivers [3]. Radio modules operating according to the IEEE 802.15.14 standard typically use radio frequency transceivers in the 2.4 GHz band (2400–2483.5 MHz) [19], as it is freely available worldwide and the most widely used among radio modules from manufacturers using WLAN [20–22], PAN wireless communication standards such as IEEE 802.15.1 (Bluetooth), IEEE 802.15.4 used in WSN (wireless sensor network), and IEEE 802.11 (WiFi). Finally, the fourth subsystem is the power subsystem, with a design based on energy saving, which is relevant as sensors have to operate on an extremely limited energy budget [10,23].

**Figure 1.** Schematic of the four subsystems of each node. **Figure 1.** Schematic of the four subsystems of each node.

Wireless data transmission is one of the main features of IoT which enables information collection on a wide spectrum of physical parameters in agriculture thanks to its self-organization, low cost, low power consumption, wide coverage area, and deployment in complex and changing environments over areas with problematic power supply among its other characteristics [24]. This facilitates making farming practices more productive, sustainable and environmentally friendly [25–27]. Wireless data transmission is one of the main features of IoT which enables information collection on a wide spectrum of physical parameters in agriculture thanks to its selforganization, low cost, low power consumption, wide coverage area, and deployment in complex and changing environments over areas with problematic power supply among its other characteristics [24]. This facilitates making farming practices more productive, sustainable and environmentally friendly [25–27].

In this work we are interested in the development of a new measurement system that facilitates the registration of the RSSI (received signal strength indicator) of radio waves in the 2.4 GHz band that propagate in greenhouse crops for carrying out specific studies of radio wave attenuation to validate the developed system, in our case for tomato greenhouses. Other works have developed a similar RSSI measurement system design but specifically to find the positioning of nodes inside a greenhouse [28–30]. However, our measurement system is prepared especially for measuring the radio wave attenuation inside greenhouses. In this work we are interested in the development of a new measurement system that facilitates the registration of the RSSI (received signal strength indicator) of radio waves in the 2.4 GHz band that propagate in greenhouse crops for carrying out specific studies of radio wave attenuation to validate the developed system, in our case for tomato greenhouses. Other works have developed a similar RSSI measurement system design but specifically to find the positioning of nodes inside a greenhouse [28–30]. However, our measurement system is prepared especially for measuring the radio wave attenuation inside greenhouses.

Some parts of this work were presented previously in [31]. However, this work includes not only the novel RSSI measurement system, but also the procedure to be used for measuring the radio wave attenuation in greenhouses**.**  Some parts of this work were presented previously in [31]. However, this work includes not only the novel RSSI measurement system, but also the procedure to be used for measuring the radio wave attenuation in greenhouses.

In next sections, we present how the radio wave attenuation measurement system based on RSSI was developed, detailing its configuration, assembly and deployment on In next sections, we present how the radio wave attenuation measurement system based on RSSI was developed, detailing its configuration, assembly and deployment on

greenhouses. The article is divided into six sections. Section 2 describes the architecture, hardware, and software of the developed measurement and recording system. Section 3 details how the system was deployed during field tests and the steps followed to perform the measurements. Section 4 describes details of the registered dataset obtained in specific tomato greenhouses. Section 5 discusses the results obtained, and Section 6 presents the conclusions of our work.

#### **2. Radio Wave Attenuation Measurement System in a Greenhouse**

Part of the agricultural industry is based on greenhouse production systems, originally implemented in northern latitudes or geographic areas with a cold climate, so that the harvesting season would be prolonged over the year. In that sense, because the greenhouse plantations are located in well-defined indoor areas, WSNs are easier to implement than in outdoor crops in the field. The amount of transmitted data for WSNs used in agriculture is usually small, as the record of each monitored sample is taken at a considerably spaced time because its values change at a slow rate. Still, constant data transmission is necessary while minimizing the number of IoT devices deployed in the field, in order to reduce the cost of implementation and deployment of the nodes in the crop area, while ensuring the performance of the system [32]. One way to reduce the number of nodes in the WSN is to deploy them at the maximum distance from each other. However, the maximum spacing of the nodes varies in relation to the type of crop monitored [33]. Therefore, it is taken into account that crop growth can affect the propagation of electromagnetic signals, the deployment of WSN nodes and topology control [12], because the wireless signal, in addition to losing power with increasing distance between nodes, suffers from multipath fading due to reflection, diffraction and scattering when the radio signal propagates through the environment between the transmitter and receiver due to the presence of the leafy branches, leaves, and fruits of crops [9,34]. At this point, there is a clear interest of the scientific community in propagation studies and planning in the deployment of WSNs using different radio wave frequencies in different densities of food crops, and developing propagation models to establish the loss in the signal path [35–37].

In the case of our developed measurement system, this allows measurements of the received signal strength level (RSSI) inside a farm, and in particular in a greenhouse at different distances and height between the transmitter and the receiver. Also, this system contributes to precision agriculture by determining the maximum communication distance between two wireless nodes, to efficiently plan the number of nodes in the WSN and their coverage area in sensor/actuator deployment within an agricultural field. There are other studies on this subject, which also employ wireless sensor networks, and use mobile devices based on Arduino boards and Xbee radio modules [38–40]. In our case, for the RSSI measurement of radio waves, we use a board that has an integrated radio module in the 2.4 GHz ISM band [41]. On the other hand, we include data logging in the system itself so that it is autonomous, and can operate 24 h for two weeks without interruption. The main benefit of the developed system is its portability, ease of installation in an agricultural environment, and sufficient autonomy time for continuous monitoring. The system is also capable of operating in the 868/915 MHz band, although no tests were carried out on this band in this study. If the working environment inside a greenhouse is difficult for the farmer because it is a closed environment, usually with higher temperature and humidity levels than outside, it is even more difficult for someone who is not involved in these tasks, such as a researcher who performs radio wave measurements for hours inside a greenhouse. In this sense, the main difference of our proposed system concerning similar solutions is its ease of implementation, verified in our field tests, and its ability to store data that can then be used to evaluate the attenuation behavior of radio waves in a crop with the possibility of generating new models from the values taken. The greater the amount of data collected, the greater the accuracy of the results obtained in the analysis, so our system can record RSSI for a full day unattended.

#### *2.1. Architecture 2.1. Architecture*

The architecture of the system is composed of two stations, the receiving station which records the RSSI of the signal sent from the transmitting station. The receiving station is composed of the Re-Mote node which is connected and powered through its USB port connected to a Raspberry Pi embedded system, and the latter to a 220 V power socket inside the greenhouse. The system is autonomous, but for monitoring purposes, it is connected sporadically to a laptop with a UTP cable to the RJ45 port of the Raspberry Pi. The transmitter station is made up of the Re-Mote node, which is powered by a rechargeable 3.7 V lithium-ion battery with a nominal capacity of 6600 mAh that gives it autonomy in its operation. These elements are housed in a PVC enclosure with an IP65 protection rating, prepared to keep out dust and water jets. The architecture of the system is composed of two stations, the receiving station which records the RSSI of the signal sent from the transmitting station. The receiving station is composed of the Re-Mote node which is connected and powered through its USB port connected to a Raspberry Pi embedded system, and the latter to a 220 V power socket inside the greenhouse. The system is autonomous, but for monitoring purposes, it is connected sporadically to a laptop with a UTP cable to the RJ45 port of the Raspberry Pi. The transmitter station is made up of the Re-Mote node, which is powered by a rechargeable 3.7 V lithium-ion battery with a nominal capacity of 6600 mAh that gives it autonomy in its operation. These elements are housed in a PVC enclosure with an IP65 protection rating, prepared to keep out dust and water jets.

Figure 2 shows schematically the arrangement of the two stations in the crop. Each station is placed on a mast supported by a 17 kg base for stability. Acrylic plates that carry the PVC boxes are attached to the masts. The PVC box at the transmitter station houses the Re-Mote node and a battery that powers it, giving it autonomy. On the receiver side, the PVC box houses the Re-Mote node intercommunicated and powered by its USB connection to the Raspberry Pi, which is the data logging unit, with its charger plugged into a 220 V socket. Figure 2 shows schematically the arrangement of the two stations in the crop. Each station is placed on a mast supported by a 17 kg base for stability. Acrylic plates that carry the PVC boxes are attached to the masts. The PVC box at the transmitter station houses the Re-Mote node and a battery that powers it, giving it autonomy. On the receiver side, the PVC box houses the Re-Mote node intercommunicated and powered by its USB connection to the Raspberry Pi, which is the data logging unit, with its charger plugged into a 220 V socket.

**Figure 2.** Wireless communication scheme of Tx and Rx stations in a tomato greenhouse. Tx station (**left**) powered by Lithium-ion 3.7 V-6600 mAh battery. Rx station (**right**) connected to a Raspberry Pi embedded computer. **Figure 2.** Wireless communication scheme of Tx and Rx stations in a tomato greenhouse. Tx station (**left**) powered by Lithium-ion 3.7 V-6600 mAh battery. Rx station (**right**) connected to a Raspberry Pi embedded computer.

#### *2.2. System Hardware 2.2. System Hardware*

The measuring and recording system consists of the following hardware compo-The measuring and recording system consists of the following hardware components:


traditionally used to monitor and supervise the environmental conditions of the crop in a greenhouse.

#### *2.3. System Software*

For the proper functioning of the system, it is necessary to develop the appropriate software infrastructure in order to minimize energy consumption. The software developed in each case is specified below.


#### **3. Deployment and Commissioning in a Tomato Greenhouse**

This section details how the system was deployed, and how the experiments were designed in a tomato greenhouse located in the province of Almeria, Autonomous Community of Andalusia-Spain. This product, in addition to its nutritional value, is in high demand in the European Community markets.

#### *3.1. Deployment of the System*

The Tx and Rx (Figure 2) nodes were placed at different distances inside the greenhouse and at different heights with the help of masts. The station was placed on a 17 kg mast base for stability (Figure 3B). Both stations were installed at the same height, and the height was varied throughout the measurements. In general, the tomato plants were aligned in a wall and equidistant from each other, separated by a space or lane where the farmers walk, as seen in Figure 3A,C.

*Inventions* **2021**, *6*, x FOR PEER REVIEW 6 of 13

**Figure 3.** (**A**) Tomato crop side profile. (**B**) Location of transmitter node inside the greenhouse. (**C**) View of greenhouse passageway. **Figure 3.** (**A**) Tomato crop side profile. (**B**) Location of transmitter node inside the greenhouse. (**C**) View of greenhouse passageway. **Figure 3.** (**A**) Tomato crop side profile. (**B**) Location of transmitter node inside the greenhouse. (**C**) View of greenhouse passageway.

#### *3.2. Conducting Experiments 3.2. Conducting Experiments 3.2. Conducting Experiments*

For the experiments, values were recorded every 10 s for 10 min at each position. The height of the nodes was the same for the Tx and Rx node at each stage of the measurement. In addition to the RSSI recording and analysis tests, monitoring functions for agricultural and environmental variables can also be performed by plugging analogue and digital sensors, e.g., humidity or temperature, into the Re-Mote. For the experiments, values were recorded every 10 s for 10 min at each position. The height of the nodes was the same for the Tx and Rx node at each stage of the measurement. In addition to the RSSI recording and analysis tests, monitoring functions for agricultural and environmental variables can also be performed by plugging analogue and digital sensors, e.g., humidity or temperature, into the Re-Mote. For the experiments, values were recorded every 10 s for 10 min at each position. The height of the nodes was the same for the Tx and Rx node at each stage of the measurement. In addition to the RSSI recording and analysis tests, monitoring functions for agricultural and environmental variables can also be performed by plugging analogue and digital sensors, e.g., humidity or temperature, into the Re-Mote.

#### *3.3. Measurement Procedure 3.3. Measurement Procedure 3.3. Measurement Procedure*

With the proposed system, different types of studies can be carried out to identify radio wave propagation patterns in orchards [51], mango [52], and tomato greenhouses. In these studies, we should place the receiver and transmitter node at different distances and heights. The RSSI values recorded can be taken at different stages of the crop, from planting to harvesting if it is desired to analyze the data and/or build a model relating radio wave attenuation to the growth stages of the plantation. Alternatively, the analysis or model generation can be developed from the recorded data, when the data are taken in the extreme case, i.e., near harvest time, when the canopy thickness is at its maximum. With the proposed system, different types of studies can be carried out to identify radio wave propagation patterns in orchards [51], mango [52], and tomato greenhouses. In these studies, we should place the receiver and transmitter node at different distances and heights. The RSSI values recorded can be taken at different stages of the crop, from planting to harvesting if it is desired to analyze the data and/or build a model relating radio wave attenuation to the growth stages of the plantation. Alternatively, the analysis or model generation can be developed from the recorded data, when the data are taken in the extreme case, i.e., near harvest time, when the canopy thickness is at its maximum. With the proposed system, different types of studies can be carried out to identify radio wave propagation patterns in orchards [51], mango [52], and tomato greenhouses. In these studies, we should place the receiver and transmitter node at different distances and heights. The RSSI values recorded can be taken at different stages of the crop, from planting to harvesting if it is desired to analyze the data and/or build a model relating radio wave attenuation to the growth stages of the plantation. Alternatively, the analysis or model generation can be developed from the recorded data, when the data are taken in the extreme case, i.e., near harvest time, when the canopy thickness is at its maximum.

In our case we follow the following steps to carry out a study of radio wave attenuation based on RSSI, and is summarized in Figure 4: In our case we follow the following steps to carry out a study of radio wave attenuation based on RSSI, and is summarized in Figure 4: In our case we follow the following steps to carry out a study of radio wave attenuation based on RSSI, and is summarized in Figure 4:

**Step 2:**

**Figure 4.** Steps to carry out a radio attenuation study based on RSSI inside a greenhouse. **Figure 4.** Steps to carry out a radio attenuation study based on RSSI inside a greenhouse. **Figure 4.** Steps to carry out a radio attenuation study based on RSSI inside a greenhouse.

Step 1: Initial position of the system. The position of the receiving station is fixed, as it is powered by a 220 V electrical current from a socket in the greenhouse. In any study with the system, the receiving station depicted as Rx is the reference node where the RSSI is to be measured. For instance, in Figure 5A the positions of the receiving nodes are shown in red (A1, A2, A3, A4) at one end of the greenhouse during the measurement of Step 1: Initial position of the system. The position of the receiving station is fixed, as it is powered by a 220 V electrical current from a socket in the greenhouse. In any study with the system, the receiving station depicted as Rx is the reference node where the RSSI is to be measured. For instance, in Figure 5A the positions of the receiving nodes are shown in red (A1, A2, A3, A4) at one end of the greenhouse during the measurement of Step 1: Initial position of the system. The position of the receiving station is fixed, as it is powered by a 220 V electrical current from a socket in the greenhouse. In any study with the system, the receiving station depicted as Rx is the reference node where the RSSI is to be measured. For instance, in Figure 5A the positions of the receiving nodes are shown in red (A1, A2, A3, A4) at one end of the greenhouse during the measurement of RSSI.

RSSI.

RSSI.

**Figure 5.** (**A**) The figure on the left shows a planting frame inside the greenhouse where the transmitting node (light blue) changes the distance with respect to the receiving node (red). (**B**) On the right the figure shows that the height of both nodes was maintained constant while the distance between them changed. **Figure 5.** (**A**) The figure on the left shows a planting frame inside the greenhouse where the transmitting node (light blue) changes the distance with respect to the receiving node (red). (**B**) On the right the figure shows that the height of both nodes was maintained constant while the distance between them changed.

Step 2: RSSI Measurement at a specific distance and height. In this case, the transmitting station depicted as Tx is placed at a specific position with respect to the Rx node. According to the Figure 5A, the RX node was fixed initially at the position A1 while the Tx node was placed at position B1 with a specific distance of 260 cm. This distance depends on the row of plants and the spacing between the rails in the greenhouse. In this case, there is only one row of spacing plants between them. In addition to the distance, both nodes must also be situated at the same height, as shown in Figure 5B. Step 2: RSSI Measurement at a specific distance and height. In this case, the transmitting station depicted as Tx is placed at a specific position with respect to the Rx node. According to the Figure 5A, the RX node was fixed initially at the position A1 while the Tx node was placed at position B1 with a specific distance of 260 cm. This distance depends on the row of plants and the spacing between the rails in the greenhouse. In this case, there is only one row of spacing plants between them. In addition to the distance, both nodes must also be situated at the same height, as shown in Figure 5B.

Once the distance and height are fixed for both nodes, the receiver node can perform the RSSI measurements and collect at the same time the temperature and humidity measured by transmitter node to be transmitted later to receiver node. These measurements can be performed at a customizable rate and can be stored as a data frame. Once the distance and height are fixed for both nodes, the receiver node can perform the RSSI measurements and collect at the same time the temperature and humidity measured by transmitter node to be transmitted later to receiver node. These measurements can be performed at a customizable rate and can be stored as a data frame.

Subsequently, both stations are moved to the right (for instance, A2 and B2 in Figure 5) maintaining the same height and distance between them. New RSSI measurements were performed by Rx node at a constant rate, generating a new data frame. The process (node movement and measurement) was reiterated until the locations A4 and B4 were reached. The repeated measurements at the same distance and height in different positions guarantee that the measurement of RSII values take into account the fluctuations Subsequently, both stations are moved to the right (for instance, A2 and B2 in Figure 5) maintaining the same height and distance between them. New RSSI measurements were performed by Rx node at a constant rate, generating a new data frame. The process (node movement and measurement) was reiterated until the locations A4 and B4 were reached. The repeated measurements at the same distance and height in different positions guarantee that the measurement of RSII values take into account the fluctuations that occurred by the presence of the leafy branches, leaves, and fruits of crops.

that occurred by the presence of the leafy branches, leaves, and fruits of crops. A data collection of all these measurements at different positions (A1, A2, A3, A4) is A data collection of all these measurements at different positions (A1, A2, A3, A4) is then stored in the Raspberry PI of the Rx node.

then stored in the Raspberry PI of the Rx node. Step 3: RSSI Measurements: changing the distance. In this case, the two stations are moved away from each other, changing the distance between them. For instance, in Figure 5B we can see that after the RSSI measurement in position B, we can move the Tx station to position C 440 cm away, which corresponds to the distance between two rows of plants between the transmitting and receiving station. The Tx station was placed at positions C1, C2, C3, C4, and the RSSI was measured and recorded with the Rx station at positions A1, A2, A3, A4 respectively. On the other hand, we can see in Figure 5B that the height was Step 3: RSSI Measurements: changing the distance. In this case, the two stations are moved away from each other, changing the distance between them. For instance, in Figure 5B we can see that after the RSSI measurement in position B, we can move the Tx station to position C 440 cm away, which corresponds to the distance between two rows of plants between the transmitting and receiving station. The Tx station was placed at positions C1, C2, C3, C4, and the RSSI was measured and recorded with the Rx station at positions A1, A2, A3, A4 respectively. On the other hand, we can see in Figure 5B that the height was the same during the RSSI measurements.

the same during the RSSI measurements. Step 4: RSSI Measurements: changing the height. In this case the two stations changed their heights to a new value at the same time, and then the measurement procedure at different distances was repeated again. After the Tx station reaches the opposite end of the greenhouse, the procedure is repeated by changing the height of both nodes to a new Step 4: RSSI Measurements: changing the height. In this case the two stations changed their heights to a new value at the same time, and then the measurement procedure at different distances was repeated again. After the Tx station reaches the opposite end of the greenhouse, the procedure is repeated by changing the height of both nodes to a new height, e.g., 50 cm above the ground. The steps are then repeated starting from step 1.

height, e.g., 50 cm above the ground. The steps are then repeated starting from step 1.

#### **4. Radio Wave Attenuation Dataset in Tomato Greenhouse 4. Radio Wave Attenuation Dataset in Tomato Greenhouse**

In order to validate the measurement system as well as the measurement procedure, a study was performed of radio wave attenuation based on RSSI in tomato greenhouses, specifically in a greenhouse at the Cañada de San Urbano in Almeria (Spain). It is an intensive farming area at the south of Spain, with many greenhouses providing fruit and vegetables to Europe. Figure 6A shows the location on a map of Spain, and Figure 6B shows a satellite image of the greenhouse in Almeria. In order to validate the measurement system as well as the measurement procedure, a study was performed of radio wave attenuation based on RSSI in tomato greenhouses, specifically in a greenhouse at the Cañada de San Urbano in Almeria (Spain). It is an intensive farming area at the south of Spain, with many greenhouses providing fruit and vegetables to Europe. Figure 6A shows the location on a map of Spain, and Figure 6B shows a satellite image of the greenhouse in Almeria.

*Inventions* **2021**, *6*, x FOR PEER REVIEW 8 of 13

**Figure 6.** Location of the greenhouse in the Cañada de San Urbano in the province of Almeria. (**A**) On the map of Spain. (**B**) Satellite Image. **Figure 6.** Location of the greenhouse in the Cañada de San Urbano in the province of Almeria. (**A**) On the map of Spain. (**B**) Satellite Image.

In this case, the RSSI measurements were obtained by the receiver node at different distances (260, 440, 620, 800, 980, 1160, 1340, 1520, 1700, 1880, 2060, 2240, and 2420 cm) with different heights (30, 50, 70, 90, 100, 150, and 200 cm). Initially, the receiver node placed at 5 cm from transmitter node reported an RSSI value of −24 dBm (best signal strength); this was the RSSI reference value used to determine the radio wave attenuation when the receiver was moved away from the transmitter node. In this case, the RSSI measurements were obtained by the receiver node at different distances (260, 440, 620, 800, 980, 1160, 1340, 1520, 1700, 1880, 2060, 2240, and 2420 cm) with different heights (30, 50, 70, 90, 100, 150, and 200 cm). Initially, the receiver node placed at 5 cm from transmitter node reported an RSSI value of −24 dBm (best signal strength); this was the RSSI reference value used to determine the radio wave attenuation when the receiver was moved away from the transmitter node.

A recording of all measurements was saved on a dataset. The RSSI measurements at a specific position (for example A1) corresponding to a data frame were taken every 10 s and stored in CSV format inside the SD memory of the Raspberry Pi. The data frames of different positions at the same distance and height are stored in the same file. Each data frame included values of the RSSI in dBm, the ambient temperature and humidity, and the timestamp including date and time. The file names indicate first the height of the node antennas, then the distance be-A recording of all measurements was saved on a dataset. The RSSI measurements at a specific position (for example A1) corresponding to a data frame were taken every 10 s and stored in CSV format inside the SD memory of the Raspberry Pi. The data frames of different positions at the same distance and height are stored in the same file. Each data frame included values of the RSSI in dBm, the ambient temperature and humidity, and the timestamp including date and time.

tween the nodes. For example, the file "50–1880 csv" includes the record of the measurements with the antennas of the nodes at 50 cm and a distance of 1880 cm between them. In each file there are 4 segments corresponding to the change of positions of the nodes Tx and Rx, e.g., A1 with B1, A2 with B2, A3 with B3, and A4 with B4, as shown in Figure 5. This dataset can be found at the following link [53]. Table 1 is an example detailing the organization of the values. The first column indicates the sample number, then the temperature value in degrees Celsius, the relative humidity, the RSSI in dBm, the date, and the time the sample was collected. The file names indicate first the height of the node antennas, then the distance between the nodes. For example, the file "50–1880 csv" includes the record of the measurements with the antennas of the nodes at 50 cm and a distance of 1880 cm between them. In each file there are 4 segments corresponding to the change of positions of the nodes Tx and Rx, e.g., A1 with B1, A2 with B2, A3 with B3, and A4 with B4, as shown in Figure 5. This dataset can be found at the following link [53]. Table 1 is an example detailing the organization of the values. The first column indicates the sample number, then the temperature value in degrees Celsius, the relative humidity, the RSSI in dBm, the date, and the time the sample was collected.

**Table 1***.* Steps to carry out a radio attenuation study based on RSSI inside a greenhouse*.*  **Table 1.** Steps to carry out a radio attenuation study based on RSSI inside a greenhouse.



**Table 1.** *Cont.*

In our measurement, the power-saving module "power-mgmt.h" was used on the Zolertia Re-Mote nodes, which caused the battery to go from 3.7 V (Tx node) to 2.8 V in about 60 h of use, as measurements were taken every 10 s. Below 2.8 V, it is advisable not to make measurements because the values recorded by the sensors may contain spurious errors.

#### **5. Discussion**

From the measurements carried out at different distances and heights, we can analyze the average value of the RSSI measurements and study how the radio wave signals at 2400 MHz attenuate as they pass through the rows of tomato plants (Figure 7). In Figure 7A, we observe that at 50 cm above the ground the maximum distance between the communication of the two Tx and Rx nodes is 2420 cm, and the minimum distance of coverage between them (1340 cm) is reached when the nodes are placed 150 cm above the ground. The values were recorded at the receiver node until they approached −100 dBm, because the receiver sensitivity is −97 dBm. However, for the purpose of wireless link stability, it is suggested to have a margin between the power detected by the receiver and the receiver sensitivity equal to or greater than 10 dB [54]. On the other hand, our system based on Re-Mote nodes is more compact than other, larger systems with a non-integrated transceiver, and the developed system has a unit price of approximately 130 euros, much lower than other options on the market.

**Figure 7.** (**A**) Signal power levels in dBm between the transmitter (Tx) and receiver (Rx) nodes at different heights and distances between them. (**B**) Path loss or attenuation measured in dB of the radio wave between the Tx and Rx node inside the tomato greenhouse at 50 cm and 150 cm above the ground [41]. **Figure 7.** (**A**) Signal power levels in dBm between the transmitter (Tx) and receiver (Rx) nodes at different heights and distances between them. (**B**) Path loss or attenuation measured in dB of the radio wave between the Tx and Rx node inside the tomato greenhouse at 50 cm and 150 cm above the ground [41].

Figure 7B shows the radio wave attenuation curves between the Tx and Rx nodes at 50 and 150 cm from the ground. For example, the average RSSI value at 260 cm distance between the two nodes and 150 cm from the ground is −58.22 dBm (See Figure 7A). Thus, the path attenuation is obtained with the following calculation: EIRP + Path\_attenuation + Gain\_RX= −58.22 dBm. Figure 7B shows the radio wave attenuation curves between the Tx and Rx nodes at 50 and 150 cm from the ground. For example, the average RSSI value at 260 cm distance between the two nodes and 150 cm from the ground is −58.22 dBm (See Figure 7A). Thus, the path attenuation is obtained with the following calculation: EIRP + Path\_attenuation + Gain\_RX= −58.22 dBm.

Therefore, Therefore,

$$\text{Path\\_attenuation} = -58.22 \text{ dBm} + 29 \text{ dBm} - 5 \text{ dBm} \tag{1}$$

$$\text{Path\\_attenuation} = -34.22 \text{ dB} \tag{2}$$

#### The attenuation produced during the path of the radio wave between the Tx and Rx node is −34.22 dB at a height of 150 cm above the ground (Figure 7B). The two curves **6. Conclusions and Future Work**

shown in Figure 7B are important because they summarize the highest and lowest attenuation due to the presence of vegetation, and therefore the highest and lowest coverage when the nodes were arranged at 50 cm and 150 cm above the ground, respectively. The results obtained serve to improve the wireless coverage planning of radio waves operating in the 2.4 GHz frequency band inside a greenhouse in order to determine the best location and height of the Tx and Rx nodes with respect to the ground in a one-hop communication between them, as well as to minimize their number in the deployment.

**6. Conclusions and Future Work**  The results obtained serve to improve the wireless coverage planning of radio waves operating in the 2.4 GHz frequency band inside a greenhouse in order to determine the best location and height of the Tx and Rx nodes with respect to the ground in a one-hop communication between them, as well as to minimize their number in the deployment. The collected measurements establish that the maximum one-hop distance between Tx and Rx within a tomato greenhouse is recorded when the antenna is located 50 cm above the ground, while the lowest coverage occurs when the antenna nodes are 150 cm above the ground. Furthermore, during the field-testing stage, our system proved to be efficient, and it is planned that in the future it will be used to determine attenuation curves

from the measurement and recording of RSSI in other greenhouses of different crops in the 868/915 and 2400 MHz bands. A dataset of the radio wave attenuation can be registered in tomato greenhouse and can be found at the following link [52]. Likewise, for ease of deployment and use by actors in agricultural production, the authors are planning to design an integrated hardware and software solution based on our system.

**Author Contributions:** Conceptualization, M.D.-H., J.A.H.-T., F.G.-M., D.C.-P. and A.C.-P. data curation, D.C.-P. and J.A.H.-T. formal analysis, D.C.-P., M.D.-H., J.A.H.-T., F.G.-M. and A.C.-P. funding acquisition, D.C.-P. and A.C.-P. investigation, D.C.-P., M.D.-H., J.A.H.-T., F.G.-M. and A.C.-P. methodology, D.C.-P., M.D.-H., J.A.H.-T. and A.C.-P. project administration, D.C.-P., M.D.-H. and A.C.-P. resources, D.C.-P. software, D.C.-P. and A.C.-P. supervision, M.D.-H. and F.G.-M. validation, M.D.-H. and A.C.-P. writing—original draft, D.C.-P. and A.C.-P. writing—review and editing, D.C.-P. and A.C.-P. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received fund by the Ibero-American Postgraduate University Association (AUIP).

**Data Availability Statement:** http://data.mendeley.com/datasets/nhk3gs7gmm/1 (accessed on 8 September 2021).

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

#### **References**

