Design and Deployment of A Practical IoT Based Monitoring System For Protected Cultivations
Design and Deployment of A Practical IoT Based Monitoring System For Protected Cultivations
Computer Communications
journal homepage: www.elsevier.com/locate/comcom
1. Introduction ventilation, and the balance between plant transpiration and soil evap-
otranspiration. This factor contributes directly to problems such as root
Plant growing methods under artificially controlled conditions are and leaf diseases, plant stress, quality loss, among others in which the
becoming popular areas of technological development and innova- root and stem system may not be able to supply adequate water to the
tion [1]. The protected agriculture provides favorable weather condi- plant leaves. Concerning CO2 , the right doses have a positive effect on
tions to enhance the production levels of food through the full or partial both photosynthetic and water use efficiency. The additive effects could
control of the microclimate. To achieve this, large-scale commercial result in improved crop yields. Finally, light is another requirement
greenhouse structures and the application of advanced irrigation tech- for plant growth that influences the photosynthesis process, which
nologies are now commonly used to provide suitable environmental occurs only when light is absorbed by chlorophyll located mainly in
conditions with minimum labor. Among other advantages, it allows the the plant leaves. With excess direct light, the temperature increases,
development of crops outside of their natural cycle and in a shorter the transpiration of the plant increases, and therefore, the demand for
time, obtaining superior performance, better quality and greater control irrigation increases.
against pests and diseases. However, maintaining a suitable growing Over the last years, the proliferation of the Internet of Things (IoT)
environment within greenhouses can be complicated. There is a full has brought an extensive scientific literature. There are several archi-
combination of factors that influence plant growth, among the main mi- tectures, frameworks, or conceptual models for IoT systems proposed
croclimate parameters that have an important impact on plant growth by organizations, the academic community, and the business sector.
are for example temperature, relative humidity, the concentration of However, there is no single standard reference architecture for IoT
carbon dioxide (CO2 ), and light [2–4]. During the growing period of as it encompasses a variety of technologies [5–11]. Fig. 1 presents a
the crop, temperature is the variable that most influences the growth comparative of IoT patterns models existing in the current state-of-the-
of plants with a direct impact on their physiological processes. It also art. Particularly, the incorporation of IoT technologies for sustainable
affects the hormonal mechanisms involved in the flowering and fruiting agriculture has attracted significant attention [12,13]. More recently,
of plants. Another highly important factor for crop success is humidity. proof-of-concept studies of IoT solutions has become a research topic
The relative humidity is the amount of water vapor present in the of growing interest in the literature. Some of these related works are
air that is the result of condensation on the cover, vapor losses from discussed next.
∗ Corresponding author.
E-mail address: [email protected] (J.M. Luna-Rivera).
https://doi.org/10.1016/j.comcom.2022.01.009
Received 31 March 2021; Received in revised form 7 December 2021; Accepted 12 January 2022
Available online 20 January 2022
0140-3664/© 2022 Elsevier B.V. All rights reserved.
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Yang et al. [14], implemented a three-layer IoT monitoring system of the WSN measurements for air temperature, relative humidity and
for indoor plant cultivation. Various sensors were deployed to collect leaf temperature. The distributed layout consisted of 5 Zolertia Z1
environmental data including temperature, humidity, luminosity, CO2 , wireless sensor nodes placed at the center, north, south, east and west
among others. In the data sensing layer, the IoT devices are able to of a half-hectare greenhouse. Obtained data from the wireless nodes
connect to the cloud service layer via a Wi-Fi network, and the collected were analyzed to represent the spatial variation of the greenhouse
data from sensors are shown through a user interaction layer consisting conditions. A cloud-based IoT Platform for enhancing the greenhouse
of an Android or web interface. In [15], the authors performed research microclimate has been presented in [22] by using a set of sensors con-
on developing a scalable network architecture for the application of nected to an Arduino Mega that forwards the collected data to a Wi-Fi
IoT technologies in agriculture. This study outlines the IoT challenges module (ESP8266). The end-user accesses the real-time data through a
and constraints for the agri-food sector with an overview of potential user interface provided by the commercial ThingSpeak cloud platform.
solutions involved in designing large-scale pilots. Khoa et al. [16], pro- The system is validated on a cucumber greenhouse. Another end-to-
posed a real-time monitoring watering management system for smart end IoT prototype has been introduced recently in [23] for greenhouse
agriculture. The focus was laid on the construction of a low-cost sensor monitoring. It deploys a WSN using LoRaWAN to transmit data over
network structure using a LoRa-based wireless communication system. long distances where the collected data are forwarded to the Things
The IoT system was validated in real farms in Vietnam during one- network. At the backend, it uses the MQTT protocol for implementing
week data acquisition campaign. Aafreen et al. [17] introduced a GSM a customized dashboard for data analysis and visualization.
based telemetric IoT system for measuring CO2 levels, light intensity More recently, the advancement on technologies such as cloud-
and humidity. This proposed system used the Blynk IoT platform to computing, big data, machine learning, unmanned aerial vehicle, etc.,
integrate the data sent by the sensors to the cloud, which includes a is clearly expanding the possibilities of IoT for smart agriculture. For
web application to the end-user. In addition, the same interface has instance, the authors in [24] discussed some relevant IoT agriculture
the possibility of activating different actuators inside the greenhouse research trends such as network architectures and layers, applications,
for control tasks such as soil irrigation, etc. In [18], the authors security, and the integration of cloud-computing, big data and analytics
presented a scalable network architecture for precision agriculture and technologies. Moreover, Misra et al. [25] presented an overview of
farming in rural areas. This IoT solution combines the existing wireless the impact of IoT, big data, and artificial intelligence technologies in
sensor network (WSN) concept with the WiLD Network to cover longer building future agri-food systems. These discussions are mainly focused
ranges. A cross-layer based MAC and routing solution was introduced around the sensor nodes, data processing, and the implementation
to reduce the network latency and improve throughput. The network challenges to monitor agricultural and food processes. On the other
architecture performance was evaluated and analyzed for both simula- hand, there are also works related to the prediction of the behavior of
tion and testbed scenarios. Geng et al. [19], proposed a four-layer IoT different climatic variables using information collected through mon-
system architecture for mobile greenhouse environment monitoring. As itoring systems such as sensor networks and meteorological stations.
compared to the traditional coverage problem in WSN, the authors used In [26], Chen et al. presented an IoT system for monitoring different
a mobile acquisition strategy with a Raspberry Pi serving as the data environmental variables in a greenhouse. The system monitors the
server and an Arduino as the master chip for the mobile system. All four light, air temperature and humidity, soil temperature, humidity, and
layers of the architecture were deployed on the mobile system, reducing CO2 concentration levels. These data are sent to the Internet using
the physical distances and data collection costs. To test the system, a NB-IoT network technology. In addition, the node-sensor has an Edge-
monitoring experiment was carried out in a real greenhouse over a computing model to generate alerts when the values of the climatic
week where data were collected every 30 s. Vu et al. [20], focused variables are outside the optimal ranges. A prediction model based on
on developing an automatic irrigation system for greenhouses. The ARIMA is also presented that forecasts the different variables in short
designed system used LoRa technology to overcome the shortcomings periods. It highlights that such a model improves its performance as
of transmission range in existing wireless sensor nodes, as those using the number of previous samples grows. Finally, a graphical interface
ZigBee communications. The system’s architecture implementation in- allows the user to view the different monitored parameters. This system
cluded End nodes to measure temperature, humidity, and soil moisture; was implemented in a greenhouse dedicated to the cultivation of straw-
a concentrator to forward the data sent by the end-nodes to a Web berries. A remote climate monitoring system for smart greenhouses is
Server via WiFi; and a Web Interface to integrate the functionalities of presented in [27] by Mellit et al. This system is capable of monitoring
remote monitoring and control. Konstantinos et al. [21] implemented environmental variables such as air temperature, air humidity, soil
a distributed monitoring system using a WSN in a commercial green- moisture, light intensity, and CO2 levels, as well as capturing images of
house. This system aimed at investigating the reliability and accuracy crops through a camera. The information is sent to the Firebase cloud
52
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Table 1
Analysis of some selected research works in the literature for protected agriculture.
Communication Machine Studies Purpose Limitations
technologies learning
Wi-Fi, Bluetooth, No [4,18,19,21, Greenhouse monitoring system based on existing wireless Coverage, lack of modularity and scalability, need additional
Zigbee 38,39], LAN technologies network devices, high power consumption.
[40,41],
4G, 3G, GPRS, No [17,42–45] Greenhouse monitoring system based on existing cellular Lack of modularity, cost, interoperability, autonomy,
GSM, technologies complexity
Hybrid Yes [12,15,17,22, Greenhouse monitoring system based on a combination of Lack of modularity, cost, interoperability, scalability,
27,29,34,46, existing wireless technologies and computing paradigms autonomy, complexity
47] (edge, fog, cloud)
LoRa, Sigfox, No [7,16,20,23, Greenhouse monitoring based on LPWAN technologies Lack of modularity, interoperability, need additional network
NB-IoT 28,48,49] equipment (LoRa)
LoRa, Sigfox, Yes [26,27,30,46, Greenhouse monitoring system based on LPWAN technologies Lack of modularity, interoperability, need skilled labor, need
NB-IoT 50] and computing paradigms (edge, fog, cloud) additional network equipment (LoRa)
platform through an ESP8266 WiFi module for storage and visualiza- • It proposes a practical and scalable IoT system applied to monitor
tion. In addition, a mobile application is developed using React-Native and control the microclimate factors in protected cultivations.
tools. The system can classify possible diseases in crops using a deep The IoT structure consists of a four-layered architecture which
convolutional neural network and send SMS alerts to a mobile phone includes a perception layer for gathering information of the green-
through a GSM module. In [28] an intelligent IoT-based energy sys- house, a network layer to make internet connections possible,
tem for controlling and monitoring greenhouse temperature has been a middleware layer to enable software and cloud services, and
designed. This system ensures that the greenhouse temperature reaches the application layer to deliver application-specific services to the
the desired references. Although the temperatures and energy consump-
user.
tion are recorded, it does not perform any prediction algorithm. Other
• It introduces a sensing coverage strategy based on the packing
strategies based on machine learning can also be found in [29–34]. For
density theory. This strategy would enable farmers to monitor
a more exhaustive review of related research studies in this domain,
crops remotely and facilitate productivity gains by increasing the
the reader is referred to the following surveys in [5–10,24,35–37] and
their references lists. Finally, Table 1 summarizes the state-of-the-art level of technology progressively. The IoT devices are directly
features and limitations of various relevant works within the field of connected to an LPWAN base station, using a star topology that
protected agriculture related to the current study. ensures immediate access to connected sensors, a long transmis-
Despite the recent advancements in IoT technologies, the implemen- sion range, low energy consumption, and low-cost deployment.
tation of IoT-based solutions in protected agriculture are still in their • It integrates a data-driven artificial neural network (ANN) pre-
early stages of development with many existing challenges limiting dictive method capable of forecasting a temperature trend with
their adoption. One of the main problems is, of course, to combat 24-h in advance. To the best of the authors’ knowledge, no
the weather conditions variability within the greenhouses due to the prediction technique in the literature provides a 24-h forecast for
strong impact on their productivity. It becomes then necessary to greenhouses. This model was successfully applied in a Mexican
place efficiently several measurement points within the fields to obtain tomato greenhouse, yielding temperature predictions within an
better information on the behavior of the environmental conditions error of 1 ◦ C using a few past inputs of the same temperature
inside a greenhouse. In addition, future agriculture will use advanced signal. This model demonstrates the potential of the proposed
technologies such as robotics, information and communication technol- IoT monitoring system to assist farmers with the operations and
ogy, artificial intelligence, etc. However, these new technologies are
strategic decision-making needed to optimize crop productivity
evolving very fast that they have become a challenging task to farmers
and resource-use efficiency.
or users who have a lot to learn. The amount of money that comes along
with such developments are not cheap. Moreover, tools for analysis The remainder of this paper is structured as follows. Section 2
and interpretation of data may further be required which is an added introduces the architecture of the proposed IoT monitoring system for
cost. Although, there is a need for using smart agriculture technologies smart agriculture. Section 3 describes the IoT system’s components
and despite all their benefits, they are still too expensive, complex and design and implementation. Section 4 validates experimentally the
lacking clarity about the point when the farmers’ investments pay off.
proposed IoT monitoring system by deploying this scheme in a tomato
Therefore, this work aims to increase knowledge and understanding of
greenhouse in Mexico. After deployment, experimental results verify
this current undergoing technological transformation in the agriculture
the effectiveness of the monitoring and forecasting climate conditions
sector.
of the greenhouse. Finally, Section 5 includes the conclusions of this
This paper presents the design and deployment of an IoT-based
monitoring system for protected cultivations using a scalable, mod- work.
ular, and low-cost system architecture. This architecture enables the
integration of an efficient coverage sensing strategy and a flexible 2. System architecture
structure to adopt the emerging computing paradigms (cloud, edge,
and fog computing). The system focuses on monitoring the microcli-
Fig. 2 shows the proposed multi-layer reference architecture for
mate conditions and disease risk factors in greenhouses. We built our
the IoT-based greenhouse monitoring system. This design contains four
customized IoT device and used the Sigfox network to forward the
data to the internet. The proposed middleware layer structure ensures layers, namely, the perception, network, processing (middleware), and
cloud interoperability by using a microservice-based architecture. We application layers. We highlight that this architecture design aims to
have designed and implemented our cloud IoT platform with a Web offer a compromise between the level of agility in the processes and
application for analysis and data visualization. The validation of the cost. That means the architecture allows monitoring a single variable
system was conducted during a trial of 6 months at a commercial-size or a complete process at a proportional cost. This structure will benefit
tomato greenhouse in Mexico. The main contributions of this paper can the farmers with low-tech or medium-tech greenhouses by increasing
be summarized as follows: the level of technology progressively.
53
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
2.1. Perception layer This property will be of particular benefit if there is a need to do some
data processing locally. Nevertheless, we require upgrading at least
In general, the optimal conditions of plant growth will depend one of the IoT devices to an edge computing device within the sensor
upon the needs and requirements of each kind of plant. Therefore, coverage network to bring the processing power. But this last topic lies
an environmental monitoring system is a key to maximizing crop outside of the objective of this work, and we leave it for future work.
production effectively and sustainably. The perception layer represents Finally, we remark that our primary focus is to evaluate the func-
the sensors and connected devices that enable remote climate monitor- tionality and effectiveness of the proposed IoT system architecture as
ing. Typically, the microclimatic parameters that determine crop yield an indispensable tool to support the operations and strategic decision-
must be continuously monitored and controlled to ensure that an op- making for the emerging concept of smart agriculture. Therefore, a
timum environment is created. However, climatic heterogeneity inside complete analysis and understanding of all environmental factors af-
a greenhouse can cause significant differences in terms of quantitative fecting plant growth are beyond the scope of this work.
and qualitative characteristics of the plants, productivity, as well as the
development of several diseases. 2.2. Network layer
For our perception layer, we introduce a flexible, cost-effective, and
scalable sensor coverage strategy. Without loss of generality, we con- The communication technologies play an important role for a suc-
sider the problem of deploying a set of sensors with the same sensing cessful deployment of IoT systems. There are several standards for
range 𝑟 in a two-dimensional (2D) rectangular space of length 𝐴 and transmitting data between sensors and IoT platforms. They can be clas-
width 𝐵. The particular problem of finding the least number of circles, sified as short range wireless networks (e.g. Zigbee, Bluetooth, Z-Wave,
assuming that a circle represents the coverage area of each IoT device, WiFi, etc.) or long-range wireless networks (GPRS, 3G, 4G, and 5G).
is a classical NP-Hard problem that arises in many different fields. Short-range networks are very restrictive in offering a global coverage,
Fortunately, an exact solution to this problem is not required due to its whereas conventional long-range network solutions are expensive and
practical relevance. Instead of dealing with this not-obvious solution, with high power requirements. In consequence, IoT applications have
we use the circle packing theory to maximize the total coverage area driven the emergence of a new type of wireless technology called low
of the greenhouse while minimizing the number of IoT devices [51]. power wide area network (LPWAN) [52]. These new wireless commu-
The packing efficiency can be expressed as nication networks are better suited to machine-to-machine (M2M) and
𝑛𝜋𝑟2 IoT devices needs, where LoRaWAN, Sigfox and NB-IoT are among the
𝑃 (𝑟, 𝑆) = (1)
𝑆 leading LPWAN technologies for IoT deployments. Depending on the
where 𝑛 is the number of non-overlapping equal circles and 𝑆 the area use case, each business activity places different requirements on the
of the rectangle. This problem can be extended to cover a 3D space type of IoT connectivity specifications, such as coverage, throughput,
using sphere packing. packet size, power consumption, cost, etc.
Fig. 2 represents the design view of the physical components in the For the low-medium tech greenhouse application problem, it is
perception layer (leftmost side). It contains the hardware devices of critical to build connections that enable mainly the use of low-cost
the proposed IoT system as deployed in the greenhouse. Some envi- hardware, long-distance coverage, low-power consumption, and scal-
ronmental factors affecting plant growth are commonly temperature, ability. With these premises, the connectivity to the IoT devices of the
relative humidity, CO2 , light, and water. For the case study, the IoT proposed greenhouse monitoring system is implemented over a Sigfox
device includes only the temperature and relative humidity sensors network. Once the data is collected in the IoT device, it uses the LPWAN
which are connected over SPI interface and digital input, respectively, module to send data to the internet using the Sigfox network. The data
of an Arduino microcontroller. After that, our own LPWAN module that communication follows the sigfox protocol, where each device has a
can be mounted on top of the Arduino board enables the IoT device unique ID for routing and signing the messages. Table 2 summarizes the
to send data over the internet to an IoT platform using the Sigfox technical details of the sigfox communication protocol. This network
network infrastructure. All possible IoT devices that the network may infrastructure comprises base stations (gateways) that provide coverage
require for covering a specific area would be built in the same way. and a core network in charge of processing the messages and sending
However, it is also relevant to mention that the proposed IoT devices them through callbacks to the customer system. The reader is suggested
can communicate with each other and gather and share real-time data. to consult the available literature about Sigfox technology for a more
54
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Table 2
Overview of the Sigfox network technology.
Feature Sigfox
Standardization Private
Frequency Unlicensed (ISM)
Range 3–10 km urban/ 30–50 km rural
Modulation UNB/GFSK/BPSK
Channel bandwidth 100 Hz
Data transfer rate 100–600 bps
Payload 12 bytes (UL)/8 bytes (DL)
Regulated messages/day 140 (UL), 4 (DL)
Power efficiency Very high
Interference immunity Very High
Localization Yes (RSSI)
55
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 4. Hardware for the prototypes of the IoT devices. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)
• MCU programmable via JTAG interface If the temperature obtained from (3) is negative, then the following
• Sigfox compatible radio chipset polynomial approximation is used
• Arduino UNO compatible
𝑇𝑐 = −242.02 + 2.22𝑅𝑅𝑇 𝐷 + 2.58 × 10−3 𝑅2𝑅𝑇 𝐷
• Programmable Push Button
• Four general-purpose input/output (GPIO) − 4.82 × 10−6 𝑅3𝑅𝑇 𝐷 − 2.81 × 10−8 𝑅4𝑅𝑇 𝐷 +
• 1.9 V–3.3 V operating voltage 1.52 × 10−10 𝑅5𝑅𝑇 𝐷 . (4)
• Very low current consumption in Standby Mode (4.5 μA)
To get a good precision with the PT1000 sensor, we used the
As mentioned previously, the IoT device includes two sensors to Adafruit RTD sensor amplifier MAX31865 to read the low resistances.
monitor the temperature and humidity in the air of the greenhouse. The following modifications are required to connect the three-wire
These are the temperature sensor PT1000 and the humidity sensor PT1000 to the MAX31865:
DHT21. Despite DTH21 having an integrated temperature sensor, we
have opted to use the PT1000 to ensure a faster response time and • Solder closed the jumpers labeled 2/3 Wire
more accuracy. Generally, the choice of sensors for the IoT system • Cut the thin trace in between the jumper labeled 2 4 (just above
will require a given specification involving a tradeoff between cost and Rref resistance) and the jumper on the right side
• Solder closed the jumpers label 3 with the terminal block on the
precision. Next, we describe the two implemented sensors.
left side.
Temperature sensor
Fig. 5 shows the MAX31865 module with the required modifica-
The precision three-wire PT1000 sensor, shown in Fig. 4, is a plat-
tions. In this way, it is now possible to connect the wires with the
inum resistance temperature detector (RTD) that modifies its resistance
same color of the three-wire PT1000 sensor in the terminal on the right,
value as the temperature varies. The transfer function of the PT1000 is
and the wire of different color is connected to the terminal on the left.
given by [53]
The corresponding wiring diagram to connect the PT1000 temperature
{
𝑃1 (𝑇𝑐 )𝑅𝑟𝑒𝑓 for 𝑇𝑐 ≥ 0 ◦ C sensor to the MAX31865 module, and then to Arduino UNO, is shown
𝑅𝑅𝑇 𝐷 (𝑇𝑐 ) = (2) in Fig. 6(a).
𝑃2 (𝑇𝑐 )𝑅𝑟𝑒𝑓 otherwise
Humidity sensor
where 𝑃1 (𝑇𝑐 ) = 1+𝛼1 𝑇𝑐 +𝛼2 𝑇𝑐2 and 𝑃2 (𝑇𝑐 ) = 1+𝛼1 𝑇𝑐 +𝛼2 𝑇𝑐2 +𝛼3 (𝑇𝑐 −100).
Finally, sensor DHT21 is used with a digital interface to measure
In (2), 𝑅𝑅𝑇 𝐷 is the resistance value of the sensor, 𝑅𝑟𝑒𝑓 the reference
humidity. It incorporates a capacitive sensor to measure the percentage
value of the resistance at 0 ◦ C, which for the case of PT1000 is 1000
of relative humidity in the air, and a microcontroller for converting
Ω, 𝑇𝑐 the temperature variable, 𝛼1 = 3.9083 × 10−3 , 𝛼2 = −5.775 × 10−7
analog to digital values. It has a measuring range for humidity from 0
and 𝛼3 = −4.183 × 10−12 . There are various methods for calculating the
to 100% with a relative humidity accuracy of +∕−3% and a resolution
temperature through the resistance of the RTD detector. In this case,
of 0.1%. The physical appearance of the DHT21 can also be seen in
we use the direct method of solving the quadratic equation in (2), for Fig. 4 which includes a protective case. This sensor uses a single-bus
𝑇𝑐 ≥ 0 ◦ C, which results in communication (1-Wire), and for each measurement transmission, the
√
𝑅 sensor sends a data frame of 40 bits (5 bytes) consisting of 16 bits to the
−𝛼1 + 𝛼12 − 4𝛼2 (1 − 𝑅𝑅𝑇 𝐷 ) relative humidity value, 16 bits to the temperature value, and 8 parity
𝑟𝑒𝑓
𝑇𝑐 = . (3) bits. The DHT21 sensor is powered up with a voltage of 3.3 V to 5 V,
2𝛼2
56
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
3.3. Prediction
57
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 6. (a) PT1000 temperature sensor wiring diagram, (b) LPWAN module interfacing with DHT21 sensor.
Fig. 7. Mean and standard deviation of the temperature error measurements at various distances.
58
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
59
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 11. Web application for the proposed IoT monitoring system: (a) Architecture and (b) sitemap.
denormalized at the end of the ANN to compare them with the unscaled Table 3
simulated data. Error variations in terms of the number of inputs (𝑁) and the number of neurons (𝑀)
in the hidden layers of the ANN.
We started the evaluation by setting up a grid search of the hyper-
M 1 2 4 8 12
parameter values (𝑁, 𝑀) and for each combination, trained the model,
and scored the performance results. Table 3 shows the error variations N MAE RMSE MAE RMSE MAE RMSE MAE RMSE MAE RMSE
results when performing a grid search for the finite sets of values 𝑀 1 1.13 1.54 1.05 1.54 1 1.52 0.97 1.5 1.05 1.52
2 1.05 1.38 1 1.38 0.98 1.35 0.91 1.3 0.9 1.3
∈ {1, 2, 4, 8, 12} and 𝑁 ∈ {1, 2, 4, 6, 8, 10, 12, 14}. We observe that the
4 0.84 1.30 0.82 1.3 0.81 1.28 0.78 1.26 0.78 1.27
lowest error is achieved with the pair of hyperparameters (𝑁 = 8, 𝑀 = 6 0.81 1.24 0.8 1.22 0.79 1.22 0.75 1.16 0.75 1.16
8) in the ANN. It can also be seen in Table 3 that the RMSE results were 8 0.77 1.17 0.75 1.16 0.74 1.16 0.72 1.15 0.74 1.17
higher than MAE due mainly to the noisy samples. 10 0.78 1.18 0.78 1.17 0.76 1.16 0.72 1.16 0.72 1.16
12 0.77 1.18 0.77 1.17 0.76 1.17 0.74 1.16 0.74 1.16
14 0.81 1.21 0.81 1.2 0.78 1.19 0.77 1.2 0.8 1.24
4.3. Prediction results using real measurements
Let us now validate the predictive performance and accuracy of days, see the samples in Fig. 14. In the same manner as before, we
the ANN’s model using the real-time measurements generated by the split the dataset with the real measurements into training and test
implemented IoT-based monitoring system. A total of 29,232 samples sets using a 75:25 ratio, and selected the optimal ANN architecture
were collected from the IoT sensor device during a period of 203 based on the previous results with the simulated dataset, i.e. the ANN
60
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 13. Case study: IoT device located inside the greenhouse.
structure implemented had 3-layers, 𝑁 = 8 variables in the input layer, 20 epochs for 𝜆 = 0.015. Notice how quickly the model is adapted to
𝑀 = 8 neurons in the hidden layer, and one node in the output the temperature prediction problem.
layer. Thus, the ANN learned the optimal weights and biases from The prediction accuracy evaluations for the implemented IoT-based
the normalized time-series input data received from the temperature greenhouse monitoring system are listed in Table 4. These results show
sensor. Our prediction model was used for one day-ahead temperature
higher accuracy when the testing dataset was 51 days, the maximum
forecasting whose inputs corresponds to the samples collected at the
number of samples available for testing (25% of the total 203 days).
same time during the last 8 days. As a strategy, we tested different
Notice that predicting the temperature with real measurements had a
input selection approaches to enhance the reliability and accuracy of
slightly lower accuracy than using simulated samples. For example, the
the prediction model based on a small number of observation samples.
Taking the temperature samples during consecutive days, at the same MAE rises from 0.72 (simulated) to 0.98 (real). However, this effect
time, allowed us to reduce the variance of the input samples for the may be caused by the sudden changes of the real-valued temperature
prediction model. For example, the temperature forecast for next day at samples. This variability was partially yielded by the climate-control
11:00 h will require to input the samples collected from the greenhouse system, which operated manually and in a non-systematic way. Fi-
at 11:00 h in the last eight days. Tuning the learning rate helped to nally, the consistency achieved by the prediction results is illustrated
improve the training efficiency. We used learning rate decay from 0.8 in Fig. 17. Here, the predicted values are compared to the actual
to 0.01. The behavior of the loss function can be seen in Fig. 16 over temperature measured by the IoT system during a period of one week.
61
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 14. Temperature (red line) and Humidity (blue line) measurements. (For interpretation of the references to color in this figure legend, the reader is referred to the web
version of this article.)
which provided an efficient trade-off between costs and accuracy (max-
imum tolerated errors). For our case study, it is shown that 94% spatial
coverage can be achieved with only 5 IoT devices for a greenhouse of
two hectares.
We have also investigated how the IoT system can be further
developed to integrate the emerging concepts of smart agriculture.
In particular, we implemented a data-driven prediction modeling for
the microclimate in the greenhouse using an artificial neural network.
These results showed that the ANN model can be successfully used for
making a temperature forecast over a 24-h period with a simple three-
layer ANN of 8 neurons in the hidden layer. It was able to model the
future values of the internal greenhouse temperature (with MAE values
less than 1 ◦ C) simply from the past 8 inputs of the same temperature
time-series. Compared to other similar solutions in the literature, the
proposed IoT framework is more flexible, and it includes the main
features to optimize productivity and sustainability. Further studies
will be focused on performing experimental validations for the spatial
monitoring strategy proposed in this work using the packing efficiency,
which provides an effective and practical trade-off for maximizing the
coverage area with the minimum number of sensors. Another relevant
future research direction is the implementation and evaluation of spe-
cific operations and/or strategic decision-making using the proposed
Fig. 15. Simulated and real data for the temperature in the greenhouse during a period IoT system’s architecture.
of 24 h.
62
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
Fig. 16. Variation of the loss function with a number of iterations (epochs).
References [10] Yogeswaranathan Kalyani, Rem Collier, A systematic survey on the role of cloud,
fog, and edge computing combination in smart agriculture, Sensors 21 (17)
[1] Genhua Niu, Joseph Masabni, Plant production in controlled environments, Hor- (2021) 5922, http://dx.doi.org/10.3390/s21175922.
ticulturae (MDPI) 4 (2018) 28, http://dx.doi.org/10.3390/horticulturae4040028. [11] O. Araujo Sara, Ricardo S. Peres, Jose Barata, Fernando Lidon, Jose C. Ra-
[2] D.T. Santosh, K.N. Tiwari, Vikas Kumar Singh, A. Raja Gopala Reddy, Micro malho, Characterising the agriculture 4.0 landscape—Emerging trends, challenges
climate control in greenhouse, Int. J. Curr. Microbiol. Appl. Sci. 6 (3) (2017) and opportunities, Agronomy 11 (4) (2021) 667, http://dx.doi.org/10.3390/
1730–1742, http://dx.doi.org/10.20546/ijcmas.2017.603.199. agronomy11040667.
[3] E.M. Khah, H.C. Passam, Flowering, fruit set and development of the fruit and
[12] Salinee Santiteerakul, Apichat Sopadang, Korrakot Yaibuathet Tippayawong,
seed of sweet pepper (Capsicum annuum L.) cultivated under conditions of high
Krisana Tamvimol, The role of smart technology in sustainable agriculture: A
ambient temperatures, J. Hortic. Sci. 67 (1992) 251–258, http://dx.doi.org/10.
case study of wangree plant factory, Sustainability (MDPI) 12 (4640) (2020)
1080/00221589.1992.11516245.
http://dx.doi.org/10.3390/su12114640.
[4] R.K. Kodali, S.C. Rajanarayanan, L. Boppana, Iot based weather monitoring
and notification system for greenhouses, in: 11th International Conference on [13] Y. Liu, X. Ma, L. Shu, G.P. Hancke, A.M. Abu-Mahfouz, From industry 4.0 to
Advanced Computing (ICoAC), Chennai, India, 2019, pp. 342–345, http://dx. agriculture 4.0: Current status, enabling technologies, and research challenges,
doi.org/10.1109/ICoAC48765.2019.246864. IEEE Trans. Ind. Inf. (2020) http://dx.doi.org/10.1109/TII.2020.3003910.
[5] Xiaojie Shi, Xingshuang An, Qingxue Zhao, Huimin Liu, Lianming Xia, Xia Sun, [14] Jun Yang, Mengchen Liu, Jiayi Lu, Yiming Miao, M. Anwar Hossain, Mo-
Yemin Guo, State-of-the-art internet of things in protected agriculture, Sensors hammed F. Alhamid, Botanical internet of things: Toward smart indoor farming
19 (8) (2019) 1833, http://dx.doi.org/10.3390/s19081833. by connecting people, plant, data and clouds, Mob. Netw. Appl. 23 (2018)
[6] V.P. Kour, S. Arora, Recent developments of the internet of things in agriculture: 188–202, http://dx.doi.org/10.1007/s11036-017-0930-x.
A survey, IEEE Access 8 (2020) 129924–129957, http://dx.doi.org/10.1109/ [15] Christopher Brewster, Ioanna Roussaki, Nikos Kalatzis, Kevin Doolin, Keith Ellis,
ACCESS.2020.3009298. IoT In agriculture: Designing a europe-wide large-scale pilot, IEEE Commun. Mag.
[7] Gaia Codeluppi, Antonio Cilfone, Luca Davoli, Gianluigi Ferrari, LoRaFarM: A
55 (9) (2017) 26–33, http://dx.doi.org/10.1109/MCOM.2017.1600528.
LoRaWAN-Based smart farming modular IoT architecture, Sensors 20 (7) (2020)
[16] Tran Anh Khoa, Mai Minh Man, Tan-Y. Nguyen, VanDung Nguyen,
2028, http://dx.doi.org/10.3390/s20072028.
[8] R.K. Singh, R. Berkvens, M. Weyn, Agrifusion: An architecture for IoT and Nguyen Hoang Nam, Smart agriculture using IoT multi-sensors: A novel watering
emerging technologies based on a precision agriculture survey, IEEE Access 9 management system, J. Sens. Actuator Netw. (MDPI) 8 (2019) 45, http://dx.doi.
(2021) 136253–136283, http://dx.doi.org/10.1109/ACCESS.2021.3116814. org/10.3390/jsan8030045.
[9] S.I. Hassan, M.M. Alam, U. Illahi, M.A. Al Ghamdi, S.H. Almotiri, M.M. Su’ud, [17] R. Aafreen, S.Y. Neyaz, R. Shamim, M.S. Beg, An IoT based system for telemetry
A systematic review on monitoring and advanced control strategies in smart and control of greenhouse environment, in: 2019 International Conference on
agriculture, IEEE Access 9 (2021) 32517–32548, http://dx.doi.org/10.1109/ Electrical, Electronics and Computer Engineering (UPCON), ALIGARH, India,
ACCESS.2021.3057865. 2019, pp. 1–6, http://dx.doi.org/10.1109/UPCON47278.2019.8980258.
63
C.A. Hernández-Morales, J.M. Luna-Rivera and R. Perez-Jimenez Computer Communications 186 (2022) 51–64
[18] N. Ahmed, D. De, I. Hussain, Internet of things (IoT) for smart precision [38] A. Vishwakarma, A. Sahu, N. Sheikh, P. Payasi, S.K. Rajput, L. Srivastava, IOT
agriculture and farming in rural areas, IEEE Internet Things J. 5 (6) (2018) Based greenhouse monitoring and controlling system, in: 2020 IEEE Students
4890–4899, http://dx.doi.org/10.1109/JIOT.2018.2879579. Conference on Engineering & Systems (SCES), 2020, pp. 1–6, http://dx.doi.org/
[19] X. Geng, et al., A mobile greenhouse environment monitoring system based on 10.1109/SCES50439.2020.9236693.
the internet of things, IEEE Access 7 (2019) 135832–135844, http://dx.doi.org/ [39] S.R. Prathibha, A. Hongal, M.P. Jyothi, IOT Based monitoring system in smart
10.1109/ACCESS.2019.2941521. agriculture, in: 2017 International Conference on Recent Advances in Electronics
[20] V.A. Vu, D.C. Trinh, T.C. Truvant, T.D. Bui, Design of automatic irrigation system and Communication Technology (ICRAECT), 2017, http://dx.doi.org/10.1109/
for greenhouse based on LoRa technology, in: Proc. International Conference on icraect.2017.52.
Advanced Technologies for Communications (ATC), 2018, http://dx.doi.org/10. [40] H. Andrianto, A. Suhardi Faizal, Development of smart greenhouse system
1109/ATC.2018.8587487. for hydroponic agriculture, in: 2020 International Conference on Information
[21] Konstantinos P. Ferentinos, Nikolaos Katsoulas, Antonis Tzounis, Thomas Technology Systems and Innovation (ICITSI), 2020, http://dx.doi.org/10.1109/
Bartzanas, Constantinos Kittas, Wireless sensor networks for greenhouse climate icitsi50517.2020.9264.
and plant condition assessment, Biosyst. Eng. 153 (2017) 70–81, http://dx.doi. [41] A. Sagheer, M. Mohammed, K. Riad, M. Alhajhoj, A cloud-based IoT platform
org/10.1016/j.biosystemseng.2016.11.005. for precision control of soilless greenhouse cultivation, Sensors 21 (2021) 223,
[22] Ala Sagheer, Maged Mohammed, Khaled Riad, Mohammed Alhajhoj, A cloud- http://dx.doi.org/10.3390/s21010223.
based IoT platform for precision control of soilless greenhouse cultivation, [42] Abhishek Kumar, Vikrant Singh, Saurabh Kumar, Shiva Pujan Jaiswal,
Sensors 21 (2021) 223, http://dx.doi.org/10.3390/s21010223. Vikas Singh Bhadoria, IoT Enabled system to monitor and control greenhouse,
[23] Ritesh Kumar Singh, Michiel Aernouts, Mats De Meyer, MaartenWeyn And Mater. Today: Proc. (ISSN: 2214-7853) (2020) http://dx.doi.org/10.1016/j.
rafael berkvens, leveraging LoRaWAN technology for precision agriculture in matpr.2020.11.040.
greenhouses, Sensors 21 (2021) 223, http://dx.doi.org/10.3390/s21010223. [43] R. Aafreen, S.Y. Neyaz, R. Shamim, M.S. Beg, An IoT based system for telemetry
[24] M.S. Farooq, S. Riaz, A. Abid, K. Abid, M.A. Naeem, A survey on the role of IoT and control of greenhouse environment, in: 2019 International Conference on
in agriculture for the implementation of smart farming, IEEE Access 7 (2019) Electrical, Electronics and Computer Engineering (UPCON), 2019, http://dx.doi.
156237–156271, http://dx.doi.org/10.1109/ACCESS.2019.2949703. org/10.1109/upcon47278.2019.89802.
[25] N.N. Misra, Y. Dixit, A. Al-Mallahi, M.S. Bhullar, R. Upadhyay, A. Martynenko, [44] Yong Wu, Li Li, Minzan Li, Man Zhang, Hong Sun, Nikolaos Sygrimis, Wangfeng
IoT, Big data and artificial intelligence in agriculture and food industry, IEEE Lai, Remote-control system for greenhouse based on open source hardware, IFAC-
Internet Things J. (2020) http://dx.doi.org/10.1109/JIOT.2020.2998584. PapersOnLine (ISSN: 2405-8963) 52 (30) (2019) 178–183, http://dx.doi.org/10.
[26] X. Chen, X. Wang, H. Shen, Design of greenhouse environment monitoring 1016/j.ifacol.2019.12.518.
system based on NB-IoT and edge computing, in: 2021 IEEE 5th Advanced [45] A. Sofwan, S. Sumardi, A.I. Ahmada, I. Ibrahim, K. Budiraharjo, K. Karno, Smart
Information Technology, Electronic and Automation Control Conference (IAEAC), greetthings: Smart greenhouse based on internet of things for environmental engi-
2021, http://dx.doi.org/10.1109/iaeac50856.2021.93906. neering, in: 2020 International Conference on Smart Technology and Applications
[27] A. Mellit, M. Benghanem, O. Herrak, A. Messalaoui, Design of a novel remote (ICoSTA), 2020, http://dx.doi.org/10.1109/icosta48221.2020.1570.
monitoring system for smart greenhouses using the internet of things and deep [46] F. Li, Y. Weng, H. Chen, P. Zhuang, Intelligent greenhouse system based
convolutional neural networks, Energies 14 (2021) 5045, http://dx.doi.org/10. on remote sensing images and machine learning promotes the efficiency of
3390/en14165045. agricultural economic growth, Environ. Technol. Innov. 24 (2021) 101758,
[28] A.F. Subahi, K.E. Bouazza, An intelligent IoT-based system design for controlling http://dx.doi.org/10.1016/j.eti.2021.101758.
and monitoring greenhouse temperature, IEEE Access 8 (2020) 125488–125500, [47] N.P. Li, Y.M. Xiao, L. Shen, Z.Y. Xu, B.T. Li, C.X. Yin, Smart agriculture with
http://dx.doi.org/10.1109/ACCESS.2020.3007955. an automated IoT-based greenhouse system for local communities, Adv. Internet
[29] G. Verma, P. Mittal, S. Farheen, Real time weather prediction system using Things 9 (2019) 15–31, http://dx.doi.org/10.4236/ait.2019.92002.
IOT and machine learning, in: 2020 6th International Conference on Signal [48] F. Pitu, N.C. Gaitan, Surveillance of SigFox technology integrated with envi-
Processing and Communication (ICSC), Noida, India, 2020, pp. 322–324, http: ronmental monitoring, in: 2020 International Conference on Development and
//dx.doi.org/10.1109/ICSC48311.2020.9182766. Application Systems (DAS), 2020, http://dx.doi.org/10.1109/das49615.2020.
[30] U. Shafi, et al., A multi-modal approach for crop health mapping using 9108957.
low altitude remote sensing, internet of things (IoT) and machine learning, [49] J. Dai, M. Sugano, Low-cost sensor network for collecting real-time data for
IEEE Access 8 (2020) 112708–112724, http://dx.doi.org/10.1109/ACCESS.2020. agriculture by combining energy harvesting and LPWA technology, in: 2019 IEEE
3002948. Global Humanitarian Technology Conference (GHTC), 2019, http://dx.doi.org/
[31] A. Ali, H.S. Hassanein, Wireless sensor network and deep learning for 10.1109/ghtc46095.2019.903311.
prediction greenhouse environments, in: 2019 International Conference on Smart [50] U.J.L. Dos Santos, G. Pessin, C.A. da Costa, R. da Rosa Righi, AgriPrediction: A
Applications, Communications and Networking (SmartNets), Sharm El Sheik, Proactive internet of things model to anticipate problems and improve production
Egypt, 2019, pp. 1–5, http://dx.doi.org/10.1109/SmartNets48225.2019. in agricultural crops, Comput. Electron. Agric. (2018) http://dx.doi.org/10.1016/
9069766. j.compag.2018.10.010.
[32] I. Ullah, M. Fayaz, N. Naveed, D. Kim, ANN Based learning to Kalman filter [51] P.G. Szabo, M.C. Markot, T. Csendes, E. Specht, L.G. Casado, I. Garcia, New
algorithm for indoor environment prediction in smart greenhouse, IEEE Access approaches to circle packing in a square: with program codes, in: Optimization
8 (2020) 159371–159388, http://dx.doi.org/10.1109/ACCESS.2020.3016277. and its Applications, Vol. 6, Springer, New York, NY, USA, 2007.
[33] Dae-Hyun Junga, Hyoung Seok Kima, Changho Jhina, Hak-Jin Kimb, Soo Hyun [52] U. Raza, P. Kulkarni, M. Sooriyabandara, Low Power Wide Area networks: An
Parka, Time-serial analysis of deep neural network models for prediction of overview, IEEE Commun. Surv. Tutor. 19 (2) (2017) 855–873, http://dx.doi.org/
climatic conditions inside a greenhouse, Comput. Electron. Agric. 173 (2020) 10.1109/COMST.2017.2652320.
1–11, http://dx.doi.org/10.1016/j.compag.2020.105402. [53] RTD Interfacing and linearization using an ADuC8xx MicroConverter, 2014,
[34] G. Codeluppi, A. Cilfone, L. Davoli, G. Ferrari, AI At the edge: a smart Available online: https://www.analog.com/media/en/technical-documentation/
gateway for greenhouse air temperature forecasting, in: 2020 IEEE International application-notes/AN709_0.pdf [Accessed: 7-Jan-2021] www.analog.com.
Workshop on Metrology for Agriculture and Forestry (MetroAgriFor), Trento, [54] Christopher M. Bishop, Pattern Recognition and Machine Learning, Springer, New
2020, pp. 348–353, http://dx.doi.org/10.1109/MetroAgriFor50201.2020. York, USA, 2006.
9277553. [55] Richard O. Duda, Peter E. Hart, David G. Stork, Pattern Classification, John Wiley
[35] M. Ayaz, M. Ammad-Uddin, Z. Sharif, A. Mansour, E.M. Aggoune, Internet-of- & Songs, New York, USA, 2003.
things (IoT)-based smart agriculture: Toward making the fields talk, IEEE Access [56] Shamshiri Redmond, Jones James, Thorp Kelly, Ahmad Desa, Che Man Hasfalina,
7 (2019) 129551–129583, http://dx.doi.org/10.1109/ACCESS.2019.2932609. Sima Taheri, Review of optimum temperature, humidity, and vapour pressure
[36] O. Friha, M.A. Ferrag, L. Shu, L. Maglaras, X. Wang, Internet of things for the deficit for microclimate evaluation and control in greenhouse cultivation of
future of smart agriculture: A comprehensive survey of emerging technologies, tomato: A review, Int. Agrophys. 32 (2018) 287–302, http://dx.doi.org/10.1515/
IEEE/CAA J. Autom. Sin. 8 (4) (2021) 718–752, http://dx.doi.org/10.1109/JAS. intag-2017-0005.
2021.1003925. [57] G. Li, L. Tang, X. Zhang, J. Dong, M. Xiao, Factors affecting greenhouse
[37] Y. Mekonnen, S. Namuduri, L. Burton, A. Sarwat, S. Bhansali, Review—Machine microclimate and its regulating techniques: A review, IOP Conf. Ser.: Earth
learning techniques in wireless sensor network based precision agriculture, J. Environ. Sci. 167 (2018) 012019, http://dx.doi.org/10.1088/1755-1315/167/1/
Electrochem. Soc. 167 (3) (2020). 012019.
64