An Intelligent IoT-Based System Design For Control
An Intelligent IoT-Based System Design For Control
fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000.
Digital Object Identifier 10.1109/ACCESS.2017.Doi Number
ABSTRACT The Kingdom of Saudi Arabia is known for its extreme climate where temperatures can exceed
50 °C, especially in summer. Improving agricultural production can only be achieved using innovative
environmentally suitable solutions and modern agricultural technologies. Using Internet of Things (IoT)
technologies in greenhouse farming allows reduction of the immediate impact of external climatic conditions.
In this paper, a highly scalable intelligent system controlling, and monitoring greenhouse temperature using
IoT technologies is introduced. The first objective of this system is to monitor the greenhouse environment
and control the internal temperature to reduce consumed energy while maintaining good conditions that
improve productivity. A Petri Nets (PN) model is used to achieve both monitoring of the greenhouse
environment and generating the suitable reference temperature which is sent later to a temperature regulation
block. The second objective is to provide an Energy-Efficient (EE) scalable system design that handles
massive amounts of IoT big data captured from sensors using a dynamic graph data model to be used for
future analysis and prediction of production, crop growth rate, energy consumption and other related issues.
The design tries to organize various possible unstructured formats of raw data, collected from different kinds
of IoT devices, unified and technology-independent fashion using the benefit of model transformations and
model-driven architecture to transform data in structured form.
INDEX TERMS Intelligent Greenhouse Agriculture, Temperature Control System, Internet of Things
(IoT), Petri Nets (PNs), Graph database, Model Transformations, Model-Driven Architecture (MDA).
I. INTRODUCTION In the desert climate where the summer lasts over half of the
Agriculture in the Kingdom of Saudi Arabia (KSA) faces year, as in Saudi Arabia. The average temperature in July is
several constraints, including extreme temperatures, water around 43 °C, and the average one in January is about 14 °C.
scarcity, sea water desalination costs, and non-fertile soil. To It is impossible to enhance the production of vegetables and
overcome this hostile environment and ensure agricultural fruits like tomatoes, Cucumbers, Sweet peppers and
self-sufficiency, multiple government agricultural programs strawberries, as the optimum temperature for their growth falls
were launched to ensure food security [1]. Indeed, agricultural in the range between 11°C to 28°C.
self-sufficiency is a sign of a country’s stability and strength From that, it can be realized that there is a necessity of
[2]. Agricultural self-sufficiency can only be achieved by providing an appropriate controlled microclimate, for various
introducing innovative environmentally suitable solutions and kinds of crops, that requires caring of four main environmental
modern agricultural technologies necessary for improving parameters, namely, temperature, humidity, CO2 level and
productivity and decreasing production costs. Greenhouse light intensity. This makes greenhouses is an appropriate
farming is interesting in the sense that it succeeds in isolating economical solution for farming because climate variables can
the yield of nature, and allowing the protection of plants be manipulated and controlled to achieve optimal growth rate
against the immediate impact of external climatic conditions of crops. Greenhouse allows producing crops, especially fruits
[3]. and vegetables production that requires cold weather to grow
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
fast in a quality manner, all year round and meet consumer The rest of this paper is organized as follows. Section II
demand for out-of-season fruit and vegetables [4]. represents a brief highlight about the related technologies to
The Internet of Things (IoT) concept allows the system, using the proposed work, including the concepts of big data, graph
electronic circuits, sensors and programming, to detect and data model, principles of model transformations and model-
control other devices remotely, creating a good interaction driven architecture (MDA). Section III, discusses in depth the
between the physical and computer world in order to improve overall architectural design of the proposed greenhouse
efficiency and accuracy while achieving financial benefits [5]. system, including its core components: temperature control &
The use of IoT in the development of smart homes has monitoring subsystem with simulation results, data conversion
received increasing interest. The studies presented focus subsystem, and greenhouse management information system.
mainly on energy management through the control of Section IV, presents the contribution summary of the proposed
electrical units [6-10]. The results are very interesting, and are greenhouse system. Finally, in the conclusion (section V), we
being used more and more in everyday life. summarize the ideas and innovations presented in this paper
The use of IoT in greenhouse agriculture contributes to its and outline some future perspectives and applications.
development [11]. Thus, the information collected from the
sensors, inside and outside of the greenhouse, can be analyzed II. RELATED TECHNOLOGIES
and stored on a central cloud data storage for archiving long
term analysis and data mining tasks, as well as stored on cloud A. IoT SENSORS
edge points for faster processing. End-users can access these A broad variety of sensors that provides a mature sensing
data from any active internet device and gain benefits of the technology for greenhouse monitoring applications is
generated knowledge regarding their greenhouse crops available in markets These sensors can be utilized for
production, energy consumption, and other related issues collecting, automatically, important information including
associated to this business [12-14]. The use of IoT in microclimate data in the greenhouse, control actions, crops
growth rate and characteristics of the crops and more related
greenhouses is receiving increasing attention and many
data. The availability of these various kinds of advanced
interesting results have been achieved [15-17].
sensing technologies in the markets makes the implementation
In this paper, based on the IoT new advances in using sensors
of the proposed IoT-based system is achievable.
equipment, we propose to build an intelligent Energy-Efficient Temperature sensors, for instance, can be used to measure,
(EE) system which monitors and controls internal greenhouse periodically the temperature inside the greenhouse. There are
temperature. The proposed system will allow increased and some common models utilized for this purpose, such as LP
improved productivity. The main study objective is not only PYRA 02 [4], E+E Elektronik EE160 [18], DHT11 [19, 20],
to build a consistent growing environment, but also to and LM35 model [21]. On the other hand, Humidity sensors
automate the whole system and make it smart to save energy can be utilized for sensing the amount of vapours in the air,
and production costs. The proposed approach focuses on such as LP PYRA 02 [4], E+E Elektronik EE160 [18], DHT11
monitoring and controlling greenhouse internal temperature, [19, 20], and HSM20G [21]. Additionally, there is another
but it can be extended to other kinds of properties, e.g. Carbon important sensing technology need to be utilized inside the
dioxide (CO2) and humidity. greenhouse for measuring the level of CO2. It is available in
The proposed system is considered as smart because it is able, markets with different models such as Vaisala GMP220 [4].
autonomously, to monitor the outside temperature and the Sensors for sensing the density of Sun rays is also another kind
energy consumption rush hours, in order to accurately of critical and sensitive technology required in the greenhouse
generate the suitable reference temperature, and ensure that visible, such as LP PYRA 02 [4], and Apogee Instruments Inc.
the greenhouse temperature reaches this reference SP110 [18].
temperature. In addition, this system can identify the angle of
the Sun rays in order to control the opening and closing of the A. ENERGY EFFICIENCY (EE)
awnings, which results in reducing the effects of high- Energy efficiency (EE) has always been a research hotspot in
temperatures. the field of Internet of Things [22, 23]. According to [22], for
All these captured parameters related to temperature and instance, an integrated structure is introduced for both wireless
energy are recorded for future analysis and prediction in a and wired parts to optimize the energy efficiency (EE)
dynamic graph data model used in designing the backend performance of the fifth generation (5G) Internet of Things
storage of the system. The proposed system design supports systems. A cellular partition zooming (CPZ) mechanism and
handling IoT data in a unified and technology-independent a precaching mechanism were utilized for the wireless part and
fashion, using a suitable strategy of model transformations, a the wired one respectively. The integration of both
principle of model-driven engineering methodology of mechanism, in the proposed comprehensive solution
software system development. The designed graph-based (structure), provided better deployment of the select-and-sleep
schema accepts multiple formats of IoT data and parameters mechanism in the introduced component of the unified control
that come from various sensor brands. center. In order to cover wider outdoor area, the single antenna
RRHs was replaced by massive MIMO array instead. As a
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
consequence, This solution was regarded economical as it or network nodes. Each part of the overall system is
used a fewer number of RRHs. Additionally, it was considered responsible for generating, storing, and manipulating various
energy-efficient as it can satisfy transmission requests using kinds of independent data. Graph representation is an
the information stored in the router directly in less distance effective and light way to express and model the distributed
[22]. Besides, IoT devices for agriculture and aquaponics that data because of its nature. In contrast to traditional relational
are based on nRF52840 microcontroller and Bluetooth 5 have database systems, the efficient performance of the graph data
been introduced and tested, in [23], for energy harvesting. It model outweighs the robustness benefits of the relational
showed nodes ability to harvest energy several times, during one. As such the performance of the relational models might
their lifetime, more than their amount of energy consumption. be cost when the number of connected data are increased via
Thus there is no maintenance needs for these nodes. JOIN operators. Thus, in the proposed work, the graph data
model is considered as a design choice to model the required
B. BIG DATA data for the proposed greenhouse smart system.
Nowadays, with rapid technology advancement in the Based on the graph theory, the graph can be navigated and
information era, data has become available and accessible traversed through different traversal techniques. In graph
everywhere as it is collected in massive quantities with database this requires adopting appropriate query language
different formats and from various sources in an unstructured to traverse graph paths and brings answers [27]. Regarding
or semi-structured way. This has led to the domain of big the Neo4j, the suggested design choice, the Cypher query
data to emerge and receive great attention from computer, language is used for querying Neo4j graph databases. Cypher
data scientists and software system architects. has a descriptive, human-readable, textual notation for
With respect to IoT applications, vast amounts of data is expressing user queries [27, 28]. Similar to other query
periodically captured and collected from a wide variety of languages, Cypher has various widely used operations,
sensor devices, which is considered one common source of namely, filters, aggregate functions, create, delete and
big data in general. These data are captured with different match. Going into the syntactical detail about Cypher is out
formats such as texts, images, documents, sounds, videos, of the scope of goals of this work.
Global Positioning System (GPS) points, routes information
and more. At the backend of the system, these various types C. SECURITY
of data must be indexed somehow, stored, and linked, before Information security is another challenge and a research
being analyzed, processed, and retrieved. hotspot in the field of Internet of Things (IoTs). With the
These operations and the other basic CRUD (create, read, recent advancement in technology, blockchain has emerged
update and delete) ones brought different challenges in the as one of the promising secure technologies for IoT
domain of big data. According to [24], traditional relation- applications [29 – 32].
based data models do not properly serve the needs of storing The work presented in [29] starts by introducing the basic
and processing terabytes or even petabytes of big data. The concept of blockchain and illustrating why a consensus
data model of big data has special characteristics that are not mechanism along with an encryption algorithm plays an
fully supported by relational data models, namely: Volume, indispensable role in a blockchain enabled IoT system
Velocity and Variety. NoSQL data model brings key benefits strengthening its overall security by design. Three main
to tackle these issues, such as efficiency, scalability, and mechanisms were included in the detailed comparison
availability when storing and processing large amounts of between their characteristics, advantages and limitations for
data. By the time, the role of NoSQL databases has emerged IoT systems in [29], namely, Proof of Work (PoW), Proof of
in solving many Big Data challenges. Stake (PoS) and Direct Acyclic Graph (DAG) based
Graph databases are found based on graph theory and can be consensus mechanisms (Tangle and Hashgraph approaches).
defined as a form of data store representation that adopts In addition to this, there are several blockchain-based
graph structures in expressing data entities, properties, frameworks introduced to store and audit access control
interrelationships and semantic queries. It has been used in policies. For instance, Sash, a secure and decentralized IoT
recent decade, as a formal technique, for modeling various blockchain-based data-sharing framework for auditing
kinds of distributed and interconnected systems that work access control policy was introduced in [29]. It is considered
with massive amounts of data, such as social networks, secured-by-design that provides two methods for granting
cloud-based systems, biological systems and more. It is access policies via two sharing schemas. The first method is
considered an example of NoSQL databases that has a strong by distribution of prefix decryption Keys, whereas the
ability to express and manage connected data and their second one is based on Access Control List (ACL) that
relationships in IoT systems [25, 26]. There are various contains a list of permissions to manage who can access a
graph database systems used in the domain of big data and data [29].
IoT applications, such as Neo4j, TITAN, and OrientDB.
One of the main characteristics of distributed systems is the
demand to distribute data storage across different locations,
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
D. PRINCIPLE OF MODEL TRANSFORMATIONS used to demonstrate the overall architectural design of the
Automatic model transformation (MT) is considered a key proposed system via a number of abstracted units
principle in advanced model-oriented software development (subsystems).
methodologies, such as Model-driven Engineering (MDA).
Models, as abstracted views of the system, are considered
primary artefacts used throughout the development lifecycle
instead of code. These models express the system from
different views and at multiple levels of abstraction to enable
the separation of concerns based on developers perspectives.
The MDA-based approaches are based on utilizing three
kinds of core models, namely, Computation Independent
Model (CIM), Platform-Independent Model (PIM), and
Platform Specific Model (PSM) [33].
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
temperature a little bit higher that the ideal one during the ensure that the whole control system is smart with a high
energy consumption rush hours to reduce the greenhouse degree of interaction with the outside world.
consumption and then to participate in reducing energy All these tools, used in the proposed system, are well-known
consumption pressure on the kingdom power grid. and have given good results each in its corresponding field.
We considered the advantages of each tool when using it in
the control system. Therefore, the proposed system
integrates all the advantages of these components:
feasibility, ease of implementation, and great flexibility.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
sending stage can still be activated for a duration chosen by More advanced controllers that require accurate mathematic
the system manager. In this case study the PN model keeps was also applied to control greenhouse systems. Model
this state activated for 3 minutes. Predictive Control was largely used in controlling greenhouse
system proprieties, we refer the reader to [45-48]. Feedback
TABLE I and feedforward control was also applied to control
TEMPERATURE CONTROL PN PLACES AND TRANSITIONS
Places Transitions greenhouse systems [49-51]. To handle unknown model
17C < Temp < 30C proprieties, some authors used adaptive control such as in [52-
P1 17 C <= Temp <= 30 C t1
change detection 55]. In the presence of system uncertainties and disturbances,
Temp < 17 or Temp > robust control is the most adapted. It was also largely used and
P2 Temp < 17 or Temp > 30 t2
30 change detection
gave interesting results [56-59].
Working status changes
P3 Standby mode t3
from Standby to ON
Depending on the budget that can be invested, for the main
Working status changes desired objective and the used model, the greenhouse manager
P4 On mode t4
from ON to Standby can choose one of the control algorithms mentioned above.
Sending ref temp = 27 C. to Energy consumption
P5 t5
stage3 during t = 3 min. rush hours detection
Sending ref temp = 24 C. to Not energy consumption
3) SIMULATION RESULTS
P6 t6 In order to show the effectiveness of the proposed approach in
stage3 during t = 3 min. rush hours detection
t7, t8, this work, a number of simulations are performed using a
P7 Intermediary state =1
t9, t10 greenhouse temperature transfer function proposed by authors
in [60].
At the end of this duration, two situations are possible. Either 1.03 × 10−4
𝐺(𝑠) =
the outside temperature is still above 30°C or below 17°C, and 𝑠2 + 0.015 𝑠 + (2.78 × 10−5 )
a new cycle of identifying daytime and sending reference
temperature is accomplished. Or the outside temperature is The greenhouse is supervised using the PN model developed
between 17°C and 30°C and then the system goes back to the in Figure 4. The regulation model, applied in stage 3 of the
standby mode. proposed system, is implemented using a PID controller
according to the model represented in Figure 5.
The reference temperature signal sent for regulation is typical
2) TEMPERATURE REGULATION for a summer day (From May to September). The reference
In this section, some of the main control algorithms used in temperature is equal to 27°C from 11:00 to 17:00 (energy
greenhouse control literature are cited. The closed loop system consumption rush hour). Apart from energy consumption rush
for the greenhouse temperature control is represented in hour, from 8:00 am to 11:00 am and 17:00 pm to 22:00 pm, a
Figure 5. reference temperature equal to 24°C is sent to the regulation
block. The greenhouse temperature simulation using the
proposed smart system is shown in Figure 6 below.
Furthermore, Figure 7 demonstrates the temperature in the
greenhouse when the On/Off controller is applied around a
temperature of 24°C.
FIGURE 5. Greenhouse closed loop temperature regulation system
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
TABLE 2 main translators are responsible for unifying the concepts and
PROPOSED PN PLACES AND TRANSITIONS
representations of input files to generate technology-
Places Transitions independent PIM elements, namely, ReadingTranslator,
Sun rays angles Sun rays < 55 or > 150 MetadataTranslator and StatusTranslator. This approach of
P1 t1
< 55 or > 150 changes detection constructing the PIM model leads to enable the reuse and
55 < Sun rays < 150 composition of required transformations from PIM to PSM
P2 55 < Sun rays < 150 t2
changes detection and from PSM to code in technology-independent fashion.
Working status changes
P3 Standby mode t3
from On to Standby
1) FROM IOT RAW DATA TO STRUCTURED IOT DATA
Working status changes GRAPH
P4 On mode t4
from Standby to ON It is assumed that suitable serialization techniques are applied
Partially open Sun rays < 75 or > 130 to various .csv files, which contains captured data from
P5 t5
awnings changes detection sensors, for restructuring some of the attributes to construct the
Completely open 75 < Sun rays < 130 PIM graph model. As such some attributes might be
P6 t6
awnings changes detection eliminated or added, and others may be replaced, split up or
P7 Intermediary place t7, t8, t9, t10 =1 merged. The resulting technology-independent PIM is defined
using generic terminologies/ concepts expressed in the
B. LAYERED DATA TRANSFORMATIONAL following metamodel (Figure 13a). A UML class diagram is
SUBSYSTEM used for representing PIM concepts at the metamodel level and
In this section, a strategy of constructing a structured backend to show how they relate to each other using generalization and
graph data model of the greenhouse management system is composition relationships.
introduced via a layered architecture, illustrated in Figure 12. It can be seen that the PIM metamodel contains general terms
It aims at translating unstructured, or even semi-structured, related to graph theory that are more readable and organized
IoT raw data into executable Neo4j cyber statements that with a balance between normalizing and denormalizing graph
create nodes and relationships in the graph database or modify elements than streamed data stored in .csv files. On the other
the existing graph. This raw data is captured from various hand, the metamodel of PSM (Figure 13b) uses a language
kinds of IoT sensors/ devices with different formats, including closed to the implementation of Neo4j query Cyphers for
actuators, as well as associated information about weather, manipulating the graph database.
geographical location and energy consumption. One of the 2) FROM STRUCTURED IOT-DATA GRAPH INTO
benefits of the proposed layered transformations of data is NEO4J CYPHER GRAPH SCHEMA
forming a unified and technology-independent PIM view that At the second phase of transformations, which is a core step
contains the collected raw data of interests without bothering aims at deriving final representation of the Neo4j graph query
with the type of devices that produces these data. This strategy schema (PSM) from the intermediate PIM graph. The
establishes a common ground of a unified representation of following First-Order Predicate Logic (FOPL) rules, Listing
PIM model that can be used by different transformations steps. 1, express the mapping between PIM elements and PSM
It is worth mentioning that this layered architecture is elements. These rules might be implemented using the
considered the detailed design of the data conversion declarative approach and languages of transformations like
component illustrated previously in Figure 2. Following the Atlas Transformation Language (ATL) and Epsilon or
MDA principle, the proposed process of data conversion is imperative one using Java at the implementation phase, which
distributed across three main layers. The first layer aims at is out of the scope of this article.
constructing a platform-independent model (PIM) from raw, The widely used Extensible Markup Language (XML) format
unstructured IoT device data. The second transformation layer is adopted to express the underlying representation of both
intends to derive the platform-specific model (PSM) from the PIM and PSM models, due to its ability to represent data in a
resulting intermediate PIM. Additionally, the final layer is hierarchal structure. The following listings (Listing 2 and 3)
generating Neo4j Cypher statements to construct the Neo4j demonstrates a snapshot of a possible representation of PIM
graph database of the greenhouse. model and its equivalent PSM model respectively.
3) GENERATING EXECUTABLE NEO4J CYPHER
C. DATA TRANSFORMATIONS & UNDERLYING STATEMENTS FROM NEO4J CYPHER GRAPH
REPRESENTATIONS
In this phase, the intermediate Neo4j Cypher graph is used as
As various formats of streamed data stored in some .csv files,
a source form of conceptual schema for generating the final
which is captured from different types of IoT devices/ sensors,
executable Neo4j Cypher queries. The granularity level of the
are used as input to the first layer. These files consist of several
model supports the design of the generator to be simpler, in
kinds of unstructured/ semi-structured critical data, such as
which many of direct one-to-one mapping rules can be applied
reading data, metadata of sensor/ device, energy consumption
to construct the final queries from this low-level PSM model.
data in voltage, geo data, weather and location data. Three
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
LISTING 1. Transformation rules from the PIM graph into PSM graph
<Query action=”create”>
<Node name=”node1” type=”ActuatorOrder“ aoId=”ao8833”>
FIGURE 12. A transformations chain of unstructured IoT data into <Property name=”actionType“ value=”CLOSE“ />
Neo4j Cypher
<Property name=”priority“ value=”1“ />
<Property name=”reqTimestamp“ value=”13:53:28PM“ />
</Node>
<Return ref=”aoId” />
</Query>
<Query action=”create”>
<Node name=”node2” type=”Actuator“ aid=”ac1002”>
<Property name=”job“ value=”partialOpen“ />
<Property name=”voltageReq“ value=”73.89V” />
<Property name=”job“ value=”partialOpen“ />
<Property name=”size“ value=”1.2k” />
</Node>
<Return ref=”aId” />
</Query>
(A)
<Query action=”create”>
(B)
<Relationship id=”r1” label=”ACTIVATES“>
FIGURE 9. Concepts of PIM & PSM graphs at the metamodel level
<Source ref=”ao8833“ />
<Target ref=”ac1002“ />
𝑡𝑟: 𝑃𝐼𝑀 → 𝑃𝑆𝑀
</Relationship >
𝑟1: 𝑉𝑒𝑟𝑡𝑒𝑥 → 𝑁𝑜𝑑𝑒 <Return ref=”id” />
∀𝑣: 𝑉𝑒𝑟𝑡𝑒𝑥, ∀𝑎: 𝐴𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒 ⋅ ((𝑣 ∈ 𝑃𝐼𝑀 ∧ 𝑎 ∈ 𝑃𝐼𝑀) </Query>
→
∃! 𝑛: 𝑁𝑜𝑑𝑒, ∃! 𝑝: 𝑃𝑟𝑜𝑝𝑒𝑟𝑡𝑦 ⋅ ((𝑛 ∈ 𝑃𝑆𝑀 ∧ 𝑝 ∈ 𝑃𝑆𝑀) ∧
(𝐶𝑟𝑒𝑎𝑡𝑒𝑁𝑜𝑑𝑒(𝑛, 𝑣) ∧ 𝐶𝑟𝑒𝑎𝑡𝑒𝑃𝑟𝑜𝑝𝑒𝑟𝑡𝑦(𝑝, 𝑎)
∧ 𝑃𝑟𝑜𝑝𝑒𝑟𝑡𝑦𝑂𝑓(𝑝, 𝑛)))
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
The output of this phase is a Cypher script file that contains all distributor (light blue nodes), and (4) Archival information
query statements for constructing the final Neo4j greenhouse about Crop Orders, Completed Actions, Actuator Orders and
graph database. The following listing (Listing 4) demonstrates crop production level (pink nodes).
an example of Cypher statements for creating two new nodes, 2) DESCRIPTION OF GRAPH ENTITIES
ActuatorOrder and Actuator and a relationship (Activates) In the proposed graph data model 15 entities are identified
between them. (Table 3). Regarding the actual monitoring data that are
stored in these entities, it is worth mentioning that there is
CREATE (node1:ActuatorOrder { aoId: 'ao8833',
various periodical information used in the proposed
actionType: 'CLOSE', priority: '1', reqTimestamp:
subsystems that are collected automatically from different
'13:53:28PM'})
RETURN node1.aoId
IoT devices and sensors installed in the smart greenhouse.
CREATE (node2:Actuator { type: 'Awning', job:
'partialOpen', voltageReq: '73.89V', size: '1.2K', aId:
'ac1002'})
RETURN node2.aId
MATCH (node1:ActuatorOrder),(node2:Actuator)
WHERE node1.aoId = 'ao8833' AND node2.aId = 'ac1002'
CREATE (node1)-[r1:ACTIVATES]->(node2)
RETURN type(r1)
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
specific kind of seeds, another simple Neo4j Cypher query is - Reducing the consumed energy by sending a
executed as: relatively higher reference temperature than usual
that needs less energy.
MATCH(node1:Seeds),(node2:CompletedActions),(node3:Sen - Reducing better energy performance when it runs
singValues) using 5G wireless communication technology and
WHERE node1.seedId = 'seeds500'
MIMO method.
RETURN (node1, node2, node3)
- Reducing pressure on the public electricity supply
LISTING 6. A Neo4j Cypher query for representing the relationship during energy consumption rush hours.
between the kind of seeds and the overall energy consumption
TABLE 3
- Reducing energy costs by consuming less energy
DESCRIPTION OF ENTITIES during the daytime rush hours, because it is well
Graph Entity Description Main Properties
A public of private company that manages any activity related regNo, activities, name, ownerId, establishDate, email
Organisation to the food production or smart farming and used the
proposed system.
Distributor Details of individual or crop distribution company disId, email, name, ownerID, regNo, type
Farm Details of a farm that may consist of some greenhouse units gpsLoc, length, width, noOfFarmers, noOfGreenHouses
GreenHouse Details of a greenhouse units including its size and gpsLoc, length, width, height, noOfBlocks, shapeType
dimensions
Block Details of a specific area within a greenhouse (each bNo, length, width, noOfRaisedBed, shapeType
greenhouse has a number of bocks)
RaisedBed Details of raised bed in each block length, rbNo, seedsType, shapeType, soilType, width
Details of seeds seedId, colour, maxHeight, maxWidth, species, stemShape, stemType,
Seeds
surfaceType
kind of devices that record measures of parameters coverage, voltageReq, mUnit, outputParameterType, readingPeriod,
Sensor (temperature, humidity, pressure, degree of lights and more) senId, type
that is used in greenhouses
Actuator Kind of devices that consumes energy to perform some aId, voltageReq, height, job, length, size, type, width
mechanical or electrical action for controlling the greenhouse.
CropOrders Maintaining information about customer or distributor orders amount, coDate, delDate, totalPrice, itemId
CropProduction Recording all details about the crop production and its prices amount, cpDate, cpId, cpType, expDate, uPrice, unitType
ActuatorOrders Maintaining information about actuator orders that are actionType, aoId, priority, reqTimeStamp
requested by the system for controlling the greenhouse.
GrowthRate Recording the change in crop growth colour, comment, dayNo, height, measurmentNo, timestamp, width
CompletedActions Maintaining archival information about all completed actions actionType, caId, voltageCon, finishingTimeStamp, result
performed by actuators
SensingValues Maintaining all details about raw data captured by a sensor voltageCon, svId, timestamp, value
(sensor readings)
known that energy costs are higher during rush
hours.
IV. CONTRIBUTION SUMMARY
a) Using PN, through its high-quality supervising e) The proposed greenhouse system design is scalable; it
properties, allows us to achieve the two first stages, can be extended to capture other kinds of properties such
system monitoring and reference temperature generation. as CO2, humidity, dust level and more associated
These properties justify the choice we made of using this parameters by attaching additional sensors (with) control
interesting and flexible tool. components.
b) The fact that awnings are completely or halfway open f) The proposed system is considered intelligent as it
during the day’s high-temperature period, decreases archives all related data for future analysis and prediction.
internal greenhouse temperature, and therefore reduces g) The system supports different brands of sensors as the
the necessary energy for temperature regulation. transformation units will unify all reading formats of the
c) The angles of the Sun rays and reference temperatures captured data to be structured and consistent with the
used in this work are only illustrative values obtained backend data model.
from discussions we had with local greenhouse owners. h) Supporting distribution of system tasks, in which the
These values can be modified to fit the specific conditions amount of processing data will be split up across the
of each greenhouse. network edge points.
d) Using an economic mode (higher reference temperature)
during the energy consumption rush hour has three V. CONCLUSION
advantages. In order to overcome the very restrictive climatic conditions
in the KSA, a highly scalable intelligent system that
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
monitors the greenhouse environment, generates the [6] W. Li, T. Logenthiran, V. Phan and W. L. Woo, "A Novel Smart Energy
reference temperature, and regulates the internal temperature Theft System (SETS) for IoT-Based Smart Home," in IEEE Internet of
Things Journal, vol. 6, no. 3, pp. 5531-5539, June 2019.
was developed. The use of a PN model allows us to monitor
[7] Bouazza, K.E.; Deabes, W. Smart Petri Nets Temperature Control
the greenhouse environment, to generate suitable reference Framework for Reducing Building Energy Consumption. Sensors 2019, 19,
temperatures, and to supervise the whole system. 2441.
A controlled awning that reduces the effects of the Sun rays [8] K. Tsai, F. Leu and I. You, "Residence Energy Control System Based
was also introduced. on Wireless Smart Socket and IoT," in IEEE Access, vol. 4, pp. 2885-2894,
The proposed system is autonomously able to: monitor the 2016.
outside temperature, monitor the energy consumption rush [9] R. J. Tom, S. Sankaranarayanan and J. J. P. C. Rodrigues, "Smart Energy
Management and Demand Reduction by Consumers and Utilities in an IoT-
Fog-Based Power Distribution System," in IEEE Internet of Things Journal,
hours, monitor the angles of the Sun rays, generate the vol. 6, no. 5, pp. 7386-7394, Oct. 2019.
suitable temperature, send this temperature as a reference [10] G. Bedi, G. K. Venayagamoorthy, R. Singh, R. R. Brooks and K. Wang,
signal for temperature regulation, guarantee that the ambient "Review of Internet of Things (IoT) in Electric Power and Energy Systems,"
greenhouse temperature reaches this reference temperature, in IEEE Internet of Things Journal, vol. 5, no. 2, pp. 847-870, April 2018.
and finally, goes into standby state in the absence of tasks to [11] Guo T, Zhong W (2015) Design and implementation of the span
accomplish. greenhouse agriculture internet of things system. In: Proceedings of the
The main innovative point of this work is to build a smart international conference on fluid power and mechatronics, Harbin, Aug
2015
system through associating different techniques; greenhouse
[12] Dan L, Xin C, Chongwei H, Liangliang JI (2015) Intelligent agriculture
monitoring and supervising through PN, temperature greenhouse environment monitoring system based on IoT technology. In:
regulation using a closed loop system and awnings control to Proceedings of the international conference on intelligent transportation, big
obtain a smart framework that reduces energy consumption data and smart city, Halong Bay, Dec 2015
and ensuring an appropriate greenhouse growing [13] Mat I, Kassim M, Harun A, Yusoff I (2016) IoT in precision agriculture
environment. This is considered very beneficial while applications using wireless moisture sensor network. In: Proceedings of the
achieving energy savings and reducing production costs, it IEEE conference on open systems (ICOS), Langkawi, Oct 2016
[14] Gomes T, Brito J, Abreu H, Gomes H, Cabral J (2015) GreenMon: an
keeps an appropriate environment for plants to grow. The
efficient wireless sensor network monitoring solution for greenhouses. In:
effectiveness of the proposed approach is demonstrated via a Proceedings of the IEEE international conference on industrial technology
number of simulations that are performed using a greenhouse (ICIT), Seville, Mar 2015
temperature transfer function. [15] M. Danita, B. Mathew, N. Shereen, N. Sharon and J. J. Paul, "IoT Based
Additionally, all captured information that is related to Automated Greenhouse Monitoring System," 2018 Second International
energy consumption, internal greenhouse temperature and Conference on Intelligent Computing and Control Systems (ICICCS),
other agricultural attributes are structured using a proper Madurai, India, 2018, pp. 1933-1937.
strategy of model transformations, then stored and archived [16] L. K. S. Tolentino et al., "Development of an IoT-based Aquaponics
Monitoring and Correction System with Temperature-Controlled
in the dynamic Neo4j graph-based database system. This is
Greenhouse," 2019 International SoC Design Conference (ISOCC), Jeju,
introduced and discussed as a scalable design of a supporting Korea (South), 2019, pp. 261-262.
management information system in the second part of this [17] D. Shinde and N. Siddiqui, "IOT Based Environment change
work. Monitoring & Controlling in Greenhouse using WSN," 2018 International
Conference on Information , Communication, Engineering and Technology
VI. REFERENCES (ICICET), Pune, 2018, pp. 1-5.
[1] Baig, M. B., & Straquadine, G. S. (2014). Sustainable agriculture and [18] Zamora-Izquierdo, M. A., Santa, J., Martínez, J. A., Martínez, V., &
rural development in the Kingdom of Saudi Arabia: implications for Skarmeta, A. F. (2019). Smart farming IoT platform based on edge and
agricultural extension and education. In Vulnerability of agriculture, water cloud computing. Biosystems engineering, 177, 4-17.
and fisheries to climate change (pp. 101-116). Springer, Dordrecht. [19] Danita, M., Mathew, B., Shereen, N., Sharon, N., & Paul, J. J. (2018,
[2] Fiaz, S., Noor, M. A., & Aldosri, F. O. (2018). Achieving food security June). IoT Based Automated Greenhouse Monitoring System. In 2018
in the Kingdom of Saudi Arabia through innovation: Potential role of Second International Conference on Intelligent Computing and Control
agricultural extension. Journal of the Saudi Society of Agricultural Systems (ICICCS) (pp. 1933-1937). IEEE.
Sciences, 17(4), 365-375. [20] Rajalakshmi, P., & Mahalakshmi, S. D. (2016, January). IOT based
[3] Keerthi, V., & Kodandaramaiah, G. N. (2015). Cloud IoT based crop-field monitoring and irrigation automation. In 2016 10th International
greenhouse monitoring system. International Journal of Engineering Conference on Intelligent Systems and Control (ISCO) (pp. 1-6). IEEE.
Research and Applications, 5(10), 35-41. [21] Keerthi, V., & Kodandaramaiah, G. N. (2015). Cloud IoT based
[4] Sánchez-Molina, J. A., Pérez, N., Rodríguez, F., Guzmán, J. L., & greenhouse monitoring system. International Journal of Engineering
López, J. C. (2015). Support system for decision making in the management Research and Applications, 5(10), 35-41.
of the greenhouse environmental based on growth model for sweet pepper. [22] Zhang, D., Zhou, Z., Mumtaz, S., Rodriguez, J., & Sato, T. (2016). One
Agricultural Systems, 139, 144-152. integrated energy efficiency proposal for 5G IoT communications. IEEE
[5] Mustafa Alper Akkaş, Radosveta Sokullu,”An IoT-based greenhouse Internet of Things Journal, 3(6), 1346-1354.
monitoring system with Micaz motes”, Procedia Computer Science, [23] Kjellby, R. A., Cenkeramaddi, L. R., Frøytlog, A., Lozano, B. B.,
Volume 113, Pages 603-608, 2017. Soumya, J., & Bhange, M. (2019, April). Long-range & Self-powered IoT
Devices for Agriculture & Aquaponics Based on Multi-hop Topology.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
In 2019 IEEE 5th World Forum on Internet of Things (WF-IoT) (pp. 545- [45] Ramdani M, Hamza A, Boughamsa M. Multiscale fuzzy model-based
549). IEEE. short term predictive control of greenhouse microclimate. In: Industrial
[24] Subahi, A. F. (2019). Edge-Based IoT Medical Record System: informatics (INDIN). IEEE 13th International Conference on. 2015; 2015.
Requirements, Recommendations and Conceptual Design. IEEE Access, 7, p. 1348–53.
94150-94159. [46] M. Guoqi, Q. Linlin, L. Xinghua and W. Gang. Modeling and
[25] M. Younas, "Research challenges of big data," Service Oriented predictive control of greenhouse temperature-humidity system based on
Computing and Applications, vol. 13, pp. 105-107, 2019. MLD and time-series. in Control conference (CCC), 2015 34th Chinese.
[26] I. Robinson, W. Jim and E. Emil, Graph databases: new opportunities 2015. IEEE. pp. 2234-2239.
for connected data, O'Reilly Media, 2015. [47] Gruber JK, Guzman JL, Rodriguez F, Bordons C, Berenguel M,
[27] E. Latronico, E. A. Lee, M. Lohstroh, C. Shaver, A. Wasicek and M. Sanchez JA. Nonlinear MPC based on a Volterra series model for
Weber, A vision of swarmlets, vol. 19(2), IEEE Internet Computing,, 2015, greenhouse temperature control using natural ventilation. Contr Eng Pract
pp. 20-28. 2011;19(4):354–66.
[28] "Cypher Query Language," neo4j Inc., 2019. [Online]. Available: [48] Haas NT, Ierapetritou M, Singh R. Advanced model predictive
https://neo4j.com/developer/cypher-query-language/. [Accessed 27 feedforward/ feedback control of a tablet press. J Pharm Innov
Decmber 2019]. 2017;12(2):110–23.
[29] Cao, B., Li, Y., Zhang, L., Zhang, L., Mumtaz, S., Zhou, Z., & Peng, [49] Sigrimis N, Arvanitis KG, Ferentinos KP, Anastasiou A. An intelligent
M. (2019). When Internet of Things meets blockchain: Challenges in noninteracting technique for climate control of greenhouses. In:
distributed consensus. IEEE Network, 33(6), 133-139. Proceedings of the 15th triennial world congress; 2002. p. 21–6.
[30] Truong, H. T. T., Almeida, M., Karame, G., & Soriente, C. (2019, July). [50] Setiawan A, Albright LD, Phelan RM. Application of pseudo-
Towards Secure and Decentralized Sharing of IoT Data. In 2019 IEEE derivative-feedback algorithm in greenhouse air temperature control.
International Conference on Blockchain (Blockchain) (pp. 176-183). IEEE. Comput Electron Agric 2000;26 (3):283–302.
[31] Islam, M. A., & Madria, S. (2019, July). A Permissioned Blockchain [51] Atia DM, El-madany HT. Analysis and design of greenhouse
Based Access Control System for IOT. In 2019 IEEE International temperature control using adaptive neuro-fuzzy inference system. J Electr
Conference on Blockchain (Blockchain) (pp. 469-476). IEEE. Syst Inf Technol 2017;4(1): 34–48.
[32] H. Smidt, M. Thornton and R. Ghorbani, "Smart application [52] M. Berenguel, L. Yebra and F. Rodríguez. Adaptive control strategies
development for IoT asset management using graph database modeling and for greenhouse temperature control. in European control conference (ECC),
high-availability web services," in the 51st Hawaii International Conference 2003. IEEE. pp. 2747-2752.
on System Sciences, Waikoloa Village, Hawaii, USA, 2018. [53] Arvanitis KG, Paraskevopoulos PN, Vernardos AA. Multirate adaptive
[33] A. F. Subahi and Y. Alotaibi, "A New Framework for Classifying temperature control of greenhouses. Comput Electron Agric
Information Systems Modelling Languages," Journal of Software (JSW), 2000;26(3):303–20.
vol. 13, no. 1, pp. 18-42, 2018. [54] Rodríguez F, Guzman JL, Berenguel M, Arahal MR. Adaptive
[34] M. Kardos and M. Drozdova, "Analytical method of CIM to PIM hierarchical control of greenhouse crop production. Int J Adapt Control
transformation in model driven architecture (MDA)," Journal of Signal Process 2008;22(2): 180–97.
Information and Organizational Sciences, vol. 34, no. 1, pp. 89-99, 2010. [55] Speetjens S, Stigter J, van Straten G. Towards an adaptive model for
[35] Alshahrani, J.; Boait, P. Reducing High Energy Demand Associated greenhouse control. Comput Electron Agric 2009; 67(1–2):1–8.
with Air-Conditioning Needs in Saudi Arabia. Energies 2019, 12, 87. [56] Willis MJ, Tham MT. Advanced process control. UK: Department of
[36] Lopez-Cruz IL, Fitz-Rodriguez E, Torres-Monsivais JC, Trejo-Zuniga Chemical and Process Engineering, University of Newcastle Upon Tyne;
EC, Ruiz- Garcias A, Ramirez-Arias A. Control strategies of greenhouse 1994.
climate for vegetables production, biosystems engineering: biofactories for [57] van Straten G, van Henten E. Optimal greenhouse cultivation control:
food production in the century XXI. Cham: Springer; 2014. p. 401–21. survey and perspectives. 2010.
[37] Behrooz F, Mariun n, Marhaban M, Mohd Radzi M, Ramli A. Review [58] Bennis N, Duplaix J, Enea G, Haloua M, Youlai H. Greenhouse climate
of control techniques for HVAC systems—nonlinearity approaches based modelling and robust control. Comput Electron Agric 2008;61(2):96–107.
on Fuzzy cognitive maps. Energies 2018;11(3):495. [59] Linker R, Gutman P, Seginer I. Robust controllers for simultaneous
[38] Dounis AI, Caraiscos C. Advanced control systems engineering for control of temperature and CO2 concentration in greenhouses. Contr Eng Pract
energy and comfort management in a building environment—a review.
1999;7(7): 851–62.
Renew Sustain Energy Rev 2009;13(6–7):1246–61.
[60] H. Oubehar,” High-Order Sliding Mode Control of Greenhouse
[39] Mirinejad H, Sadati SH, Ghasemian M, Torab H. Control techniques in
heating, ventilating and air conditioning (HVAC) systems 1. 2008. Temperature”, Indonesian Journal of Electrical Engineering and Computer
[40] Blevins T, Wojsznis WK, Nixon M. Advanced control foundation: Science 2016; 4 (3): 548-554.
tools, techniques and applications. International Society of Automation
(ISA); 2013. Ahmad F. Subahi received his B.Sc degree in
[41] Li Y, Ding Y, Li D, Miao Z. Automatic carbon dioxide enrichment Computer Science from King Abdulaziz
strategies in the greenhouse: a review. Biosyst Eng 2018;171:101–19. University (KAU), Jeddah, Saudi Arabia, in 2002;
his first M.Sc. degree in Information Technology
[42] Instruments National. PID theory explained. 2018.
form Queensland University of Technology,
http://www.ni.com/wh ite-paper/3782/en/#top. [Accessed 23 September Brisbane, Australia, in 2008; his second M.Sc.
2018]. degree in Advanced Computer Science and his PhD
[43] Irshad, M.; Ali, A. A Review on PID tuning rules for SOPTD inverse in Computer Science from University of Sheffield,
response processes. In Proceedings of the International Conference on UK, in 2010 and 2015 respectively. Since 2015, he
Intelligent Computing, Instrumentation and Control Technologies has been appointed an assistant professor in computer science in the
(ICICICT), Kannur, India, 6–7 July 2017. Computer Science department at the University Collage of Al Jamoum
(JUC), Umm Al-Qura University (UQU), Makkah, Saudi Arabia. He is the
[44] Oliveira JB, Boaventura-Cunha J, Moura Oliveira P. A feasibility study
former head of the department during 2017 and 2018, and formerly the vice
of sliding mode predictive control for greenhouses. Optim Control Appl dean of development and entrepreneurship at JUC during 2018 - 2020. He
Methods 2016;37 (4):730–48.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2020.3007955, IEEE Access
is currently the vice dean of academic affairs at JUC. His research is focused
on advanced software engineering and computer science field. Specific
research areas include model-driven engineering, domain specific
(modeling) languages, automatic code generation and programming
languages design, software systems architecture and design, database
systems, robotics and secure IoT systems engineering.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/.