# Leveraging LoRaWAN Technology for Precision Agriculture in Greenhouses
## 3 Materials, Methods and Field Tests in a Greenhouse
### Optimal Design for Sensor Box  
To understand the impact and utility of the sensor box, deployment of the sensors in the greenhouse were performed in three phases. First approach known as Commercial (Sensirion sensors) approach, we deployed a few Sensirion SHT31 development kits at different locations inside the greenhouse. To protect the sensors from regular spray and water, we kept them inside a temporary open box. We have taken the strawberry boxes to mount the sensors as they are as shown in Figure 4a. These boxes have a large open face to expose sensors. The SHT31 kit has humidity and temperature sensors and shows the values on the inbuilt display. Also, it can send the data wirelessly to a smartphone using Bluetooth Low Energy (BLE). The mobile Android application is available open source to visualize the data. We customized this application to download the readings in a file for better analysis. The data logging capabilities helped us to visualize the live data, but the coin cell batteries had a limited lifetime of one week. We learned two important lessons from this initial setup. First, the sampling and sensitivity test in the greenhouse and second, the impact of regular spray and pesticides over the installed sensors. With the help of this initial setup, we got the sampling locations based on the reading gradient in the greenhouse. For the next round of installation, known as box approach, we made an enclosed rectangular box to protect the sensors from external spray. The sensors inside the box were integrated with LoRa module for sending the data to the back end. This box was mounted on the rails above the tomato plants, so that it can be moved freely with the plants' growth. The provision for air circulation inside the box was done with the opening on the front side as demonstrated by Figure 4b. Post deployment, we again wanted to check the precision of this box in capturing the environmental data. We used thermocouple strip [49] and readings from Priva [50] sensors to compare the temperature of outside and inside the box. We found that the box design still needed some more optimization, as the temperature reported by the Priva sensors was comparatively less from the one inside the box as shown in Figure 5. The temperature reading inside the box reported higher temperature, which was majorly due to the \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline Wireless Module & CMWX1 ZZABZ \\ Radio Chipset & SXSX1276 \\ Microcontroller (MCU) & STM32L072 CZ \\ Radio Frequency & 868 MHz \\ Bandwidth & 125 kHz \\ Coding rate & 4/5 \\ Spreading factor (SF) & 9 \\ Transmission power & 14 dBm \\ \hline \hline \end{tabular}
\end{table} 
Table 3: LoRaWAN module configuration. fact of limited air circulation along with two major factors (1) sunlight heating up the box and (2) the heat produced by the sensor board itself. With these results, we wanted to come up with better box design with proper air circulation. The final and third approach is known as airflow box approach. Here, the deployment of WSN in the PCH greenhouse was done using the airflow boxes which is shown in Figure 4c. These boxes are circular in shape with an opening on both top and bottom for proper airflow. The Figure 6, shows the steps from building the airflow boxes, till the final deployment in the greenhouse. It has two shells for insulation from outside sun light and opening at the top and bottom for maintaining the air circulation. The respective size for the pipe used for building these boxes were 200 \(\times\) 3.9 mm and 160 \(\times\) 3.2 mm. There are two acrylic laser cut plates for covering top and bottom, along with to hold the cross-section of the pipes. The first part of Figure 6, shows the structure of the box from the top view, followed by the placement of sensors and batteries. Thereafter, the box in its deployment stage at the greenhouse.