=Paper= {{Paper |id=Vol-2588/paper26 |storemode=property |title=Investment Feasibility of Building the Architecture of Greenhouse Automated Control System Based on the IoT and Cloud Technologies |pdfUrl=https://ceur-ws.org/Vol-2588/paper26.pdf |volume=Vol-2588 |authors=Viktor Khavalko,Sofiia Baranovska,Galyna Geliznyak |dblpUrl=https://dblp.org/rec/conf/cmigin/KhavalkoBG19 }} ==Investment Feasibility of Building the Architecture of Greenhouse Automated Control System Based on the IoT and Cloud Technologies== https://ceur-ws.org/Vol-2588/paper26.pdf
 Investment Feasibility of Building the Architecture of
Greenhouse Automated Control System Based on the IoT
              and Cloud Technologies

             Viktor Khavalko1[0000-0002-9585-3078], Sofiia Baranovska1[0000-0003-3264-9210]
                           and Galyna Geliznyak2[0000-0002-3624-0255]
         1
          Lviv Polytechnic National University, S. Bandery Str., 12, Lviv 79013, Ukraine
2
    Separated structural unit - College of telecommunications and computer technologies of Lviv
      Polytechnic National University, Volodymyra Velykogo Str., 12, Lviv, 79000, Ukraine
       viktor.m.khavalko@lpnu.ua, sofiia.p.baranovska@lpnu.ua,
                                galyna.geliznyak@gmail.com



         Abstract. The paper deals with the process of building the architecture of an
         automated control system for the greenhouse operation. The advantages and
         disadvantages of the traditional greenhouse ACS architecture, which consists of
         three major components - the greenhouse, the IoT platform and the ML model -
         are analyzed. In order to avoid the disadvantages of such ACS, it is proposed to
         use cloud technologies. The greenhouse ACS architecture has been developed
         based on cloud technology and an IoT platform that is flexible, reliable, mobile
         and versatile. The results of the operation of the greenhouse, the microclimate
         of which is controlled and maintained with the help of automatic control sys-
         tem, which is built on the basis of the developed architecture, are presented.

         Keywords: Iot Platform, Cloud Technologies, Greenhouse Agent, ML Model,
         Automated Control System Architecture, Microclimate Parameters.


1        Introduction

A large number of greenhouses are used in Ukraine and abroad to grow a wide variety
of crops. A significant difference between greenhouses and other types of protected
soil structures is the ability to create favorable conditions not only for cultivated
plants, but also for maintenance personnel and process equipment. As a result, green-
houses increase productivity and culture of production, and the seasonal nature of
agricultural work disappears. In a greenhouse, unlike small shelters, all agrotechnical
measures can be performed without compromising the integrity of the fence, and var-
ious mechanisms for plant care can be widely used.
   Ensuring the operation of a greenhouse requires optimal investment support by at-
tracting financial resources from different economic entities. At the same time, the
role of public-private as the most effective way of modern investment is important.



    Copyright © 2020 for this paper by its authors. Use permitted under Creative Commons License Attrib-
ution 4.0 International (CC BY 4.0) CMiGIN-2019: International Workshop on Conflict Management in
Global Information Networks.
   Forms of investment can be: corporatization; issue of bonds; direct capital invest-
ments; sponsorship contributions; state financial support, etc.
   It should be noted that industrial greenhouses can occupy an area of more than 50
thousand m2 (Fig. 1). In the middle of each such greenhouse is created its own cli-
mate, which depends on the type of crops grown and sensitive to that climate. In order
to effectively control the work of such complex systems [1,2], it is necessary to use
powerful automated control systems that control the work of a variety of modern
equipment, the latest technologies, methods and algorithms and generate control deci-
sions accordingly.




                              Fig. 1. Industrial greenhouse

    The greenhouse and control system are affected by the unsteady behavior of a large
number of internal and external factors: equipment failures, sensor failures, unstable
software operation, dramatic changes in climatic conditions, etc. Many of the static
and dynamic characteristics of a number of greenhouse elements and units make the
task of quality process control difficult, but to effectively control the climate of the
greenhouse, all these impacts must be taken into account, which is quite a challenge.
Therefore, projecting and implementing an ACS architecture with the operation of a
greenhouse based on artificial intelligence, the IoT and cloud technologies in such a
way that ensure the functioning of all equipment and sensors within the required lim-
its is an important and actual problem.


2      Analysis of existing solutions

Among the technological processes that take place in greenhouses, the processes of
automatic control, determination and maintenance of microclimate parameters of
greenhouses are of particular importance. All these parameters are closely linked and
affect each other [3,4], but together they determine the growth and development of
greenhouse plants. Recently, adaptive automated control systems [5-7] using neural
networks have become more widespread and used [8-10]. The use ACS of in green-
houses of mathematical apparatus of fuzzy logic makes it possible to formalize and
process large amounts of information in real time [11].However, most of such sys-
tems do not have real-time research object information because they process data-
bases from previously obtained information [8-10], which is of no importance.
   In the last decade, methods and systems of fuzzy analysis and control [4, 10],
which operating with incomplete information about control object, are high-
performance and interference resistant, have been rapidly evolving. In addition, the
development of approaches and tools for artificial intelligence also significantly in-
crease the efficiency of such systems. The work [5, 6, 9, 11] offers methods and ways
of using intelligent technologies that can significantly reduce the complexity of con-
trol systems and simplify their design and development.
   Therefore, the development of automated control systems for the operation of
greenhouses, which in the current conditions of development of industry in Ukraine
and abroad make demands of high-tech, reliability, energy efficiency, is an urgent and
important task.


3      Problem statement

To describe the process of developing a system of automatic control of the green-
house operation, which will be able to determine and maintain the optimal modes of
the required parameters throughout the period of plant growth, because most of them,
namely temperature, light, heat, humidity and fertilizers are the main factors that max-
imize yield. Functional requirements for such a system are: to maximize the volume
of harvested crops, to reduce the impact of the human factor on the process of analy-
sis and decision-making, to make the greenhouse more energy efficient, and therefore
reduce its operating costs. In the end, it will result in a significant increase in profits.
The architecture of such a system is proposed to be developed on the basis of artificial
intelligence, IoT platform and cloud technologies.


4      The structure of the ACS of greenhouse

Before going to the description of the system structure, we would focus on the
equipment that affects the creation of the greenhouse microclimate. Such equipment
will include: heaters- to regulate the thermal mode; watering pipelines; air-
conditioning system; sun screens; lighting system; etc. In addition, it should be noted
that the microclimate in the greenhouse is significantly influenced by the
macroclimate, and therefore all the smallest changes in the macroclimate should be
monitored and the control effects on the greenhouse should be made in accordance
with the current changes in the macroclimate.
   Such ACS can be both standalone devices and fully integrated systems that provide
complete control over the process of growth and ripening of the crop and for the
automated control of parameters and climate control in the greenhouse.
   The use of the system provides high accuracy of maintaining the set climate modes
separately for each greenhouse by influencing the mechanisms and equipment of the
following major technological systems and processes:

 lower air heating system;
 upper air heating system;
 soil heating system;
 substrate heating system;
 ventilation system;
 shading system;
 evaporation, cooling and humidification control system;
 drip irrigation system;
 air recirculation system.

The structure of such a complex ACS can be depicted as follows (Fig. 2):

 one or more greenhouses;
 a machine learning model that will intellectually process data in real time and
  control the operation of the entire system;
 a platform that integrates the two previous components and provides effective
  interaction between the greenhouse and the machine learning mode




                                 Fig. 2. System structure

The general approach to the process of controlling all components of a projected
greenhouse ACS can be summarized as follows (Fig. 3). The first thing to do is to get
from the sensors installed in the greenhouse all the necessary current data, i.e. param-
eters of temperature, humidity, lighting, etc., as well as weather forecast data for the
near term. Submit them to the ML model input together with the desired microclimate
in the greenhouse (for example, temperature and humidity for the next 24 hours). The
output of the ML model will give you the control steps that must be applied to all the
greenhouse equipment in order to get the desired result.
         Fig. 3. The structure of the proposed greenhouse climate control approach

The most important in this structure is the use of an IoT (Internet of Things) platform
that will enable the integration of human factors, technologies and processes to max-
imize human interaction with all kinds of sensors and equipment. That is, it will allow
the person who oversees the operation of the greenhouse to avoid most errors and
maximize the automation of manual adjustment or control of all equipment that is
responsible for maintaining the microclimate of the greenhouse, and thus reduce the
role of humans only to monitor the current parameters.
   Based on the above, the main role was focused on the development of such an IoT
platform. Its structure (Fig. 4) consists of:

 Greenhouse agent, responsible for reading sensor data and operating greenhouse
  hardware and for controlling greenhouse equipment;
 A set of APIs that would allow other system components to communicate with the
  kernel to transmit or receive data. For example, a Greenhouse agent at certain
  intervals (such as once a minute) would transfer all sensors' data of the Greenhouse
  to the Sensor API, which would normalize the data received and store it in a
  database for later use;
 Web Application (Web APP), which is intended for the person who manages the
  operation of the greenhouse, can enter the necessary parameters of the greenhouse
  microclimate and set the system settings. This web application is linked to the
  Climate Settings API, which will allow it to interact with the system kernel and the
  corresponding database;
                             Fig. 4. IoT platform structure

 Service for downloading weather forecasts from different sources, normalizing
  these data and bringing them to a specific form, suitable for further processing by
  the system. The received data will be transferred to the system using the Weather
  Forecast API;
 A software service (Planner) that will run the ML model, which inputs' are all
  necessary data (weather forecast, climate settings, current sensor data, etc.) from
  the database. The output from the ML model will be submitted to a Greenhouse
  agent who will apply the resulting control actions.

Since the planning and retrieval of weather forecast data must occur periodically,
these two processes must be started on a specific timer.
There may be a problem with server deployment when deploying the system, that is,
where the entire system and therefore the database will be stored. Among the main
difficulties are:

 availability of high-speed Internet, which is necessary for timely transmission of
  data between all components of the system;
 logging, monitoring and alerting - how under these unstable conditions to carry out
  these three processes;
 data backup - since most data have a critical impact on the functioning of the
  greenhouse and maintain a proper microclimate, the issue of data backup is ex-
  tremely acute;
 increasing the number of greenhouses - under the traditional approach, is reduced
  to the installation in each greenhouse of a separate server, which again does not
  remove the previously considered difficulties.
5      Choosing a cloud environment

Avoid all of these difficulties and problems allows the use of cloud technologies [12,
13]. Among the most popular public cloud repositories are: Google Cloud Platform,
Azure, AWS.
Considering these three cloud repositories with the perspective of using IoT, they all
offer specific IoT solutions that are 90% similar in functionality. As for the selection
criterion, here are some requirements that are related to the functional requirements of
the projected greenhouse ACS and the following wishes:

 Python support, since the ML model was created in Python, like all software de-
  velopment when creating an IoT platform (Google Cloud Platform had better ca-
  pabilities in this regard);
 the cost of using cloud services (the Google Cloud Platform was cheaper, though
  not insignificant);
 experience in cloud services.

Google Cloud Platform is a global cloud provider that supports IoT solutions. Its
Google Cloud IoT suite allows you to create and manage IoT systems of any size and
complexity. The Google Cloud IoT solution includes a number of services that can help
to build IoT networks. Google Cloud for IoT offers the following solutions (Fig. 5).




               Fig. 5. Reference diagram of Google Cloud Solutions for IoT

The central and most important element of this system is Cloud IoT Core - a fully
managed service for easy and secure two-way connection between devices and the
Cloud IoT platform, as well as managing and receiving data from different devices.
Cloud Pub / Sub is a service that processes event data and provides real-time flow
analytics. Cloud ML Engine is a service that allows to create ML models and use data
obtained from IoT devices. Goole Dataflow is a data conversion service (can work
both in real-time and in batch mode). Google's IoT solution includes a number of
other services that may be useful for building complex connected networks.
   So, after analyzing all the possibilities, it was decided to implement a greenhouse
ACS on the base of a cloud architecture that would allow the implementation of the
IoT platform.



6      Architecture of the greenhouse ACS based on cloud
       technologies and solutions

The architecture of the projected greenhouse ACS considering that the system plat-
form is transferred to the cloud will take the following form (Fig. 6). The Greenhouse
agent remains a core element that must operate on the same network as the green-
house in order to have access to all the greenhouse hardware and equipment. All other
system elements are moved to Google Cloud. The platform's entry point will be Cloud
IoT Core service, and the Greenhouse agent will communicate with it using one of the
two protocols it supports HTTP / MQTT.




                    Fig. 6. Cloud Architecture of the proposed system

All data received from a Greenhouse agent with a certain frequency by a Cloud IoT
Core is sent to Cloud Pub / Sub. From there, all the data goes to the Sensor Service,
where the datas are normalized and brought to look necessary for further processing,
and then the entry in BigQuerry (this is a serverless data warehouse for interactive
large-scale analysis of large datasets. It can be used via the web interface, the com-
mand line interface and API. Payment is for the number of terabytes of data processed
when querying), where both people and our other applications can access it. The next
element of our system's cloud architecture that uses cloud functions and transmits data
to BigQuerry is the Weather Service. This service periodically (using Cloud Sched-
uler for this purpose) receives weather data from providers, processes it and normaliz-
es it to store in the required form in BigQuerry. The Climate Settings Service is the
next item used, and it is responsible for transmitting the desired greenhouse climate
settings. This data is stored in CloudSQL Postgres. The core of the system is Planner,
which was developed using Cloud ML Engine and ML Flow. Planner inputs are the
desired greenhouse climate settings, the latest greenhouse sensor data, the most up-to-
date weather forecasts, and the result is submitted to Cloud Pub / Sub. From where
they get to Cloud IoT Core and are transmitted to the Greenhouse agent, who inter-
prets the resulting numeric data into control influences. This model plans a microcli-
mate for the next 24 hours, but redevelopment is possible due to refinement of the
data every 10 minutes. This is due to the update of the weather forecast data.
   Let's analyze how the situation with the problems described in the previous para-
graph has changed. So, the system deployment. Docker, a software used to automate
deployment and application management in container-enabled environments, has been
used to eliminate all deployment-related issues except cloud-based features. Allows
you to "place" an application with all its environment and dependencies in a container
that can be migrated to any system, and also provides a container management envi-
ronment. In addition, a Google Cloud component, namely Cloud Deployment Manag-
er, has been deployed that has the ability to form an image of the system and deploy it
to a specific location.
   Another Google Cloud component, StackDriver, which is a necessary and free ser-
vice for managing cloud computing, has been used to resolve logging, monitoring, and
alerting. It provides performance and diagnostics data (in the form of monitoring, log-
ging, tracking, error messages and alerts) for public cloud users. Stackdriver is a hybrid
cloud solution that supports both Google and AWS cloud environments. It collects all
metrics and logins centrally from all cloud components of the system, and you can also
specify user parameters to collect the required metrics and logs or alerting.
   System backup is organized using BigQuerry and CloudSQL, where puts a check-
box that enables backup at certain intervals. In addition, the BigQuerry component
enables you to stream data to Google Cloud Storage and then restore it if necessary.
   If we consider the extension of the proposed system to several greenhouses, its
structure will have the following form (Fig. 7). That is, in the case of one greenhouse,
we will have one Greenhouse agent - one platform, and in the case of several green-
houses - several Greenhouse agent - one platform. The new Greenhouse agent is con-
nected in console mode via Cloud IoT Core. That is, we see that the use of cloud
technology has allowed us to develop an architecture, the advantages of which are:
system flexibility; ease of installation; ease of setup and operation.
   As can be seen from the analysis of the shortcomings of the previous architecture
(Fig. 4) the use of cloud technologies and accordingly developed on this technology
system architecture (Fig. 6) allows to avoid all the above disadvantages and has sev-
eral advantages.
                          Fig. 7. One platform – multiple agents


7      Results of modelling of greenhouse ACS

As a result of the system functioning, all operating parameters and indicators are dis-
played as graphs. As already mentioned, the functioning of the greenhouse is set at 24
hours, but in the event of severe changes in climatic conditions or equipment parame-
ters, greenhouses can be adjusted every 10-15 minutes. That is why each graph shows
the behavior of the parameters in 24 hours. In Fig. 8 shows a screenshot of a web
application seen by a person monitoring the operation of a greenhouse, namely a
schedule for temperature control. The thick red line is the microclimate of the green-
house installed by the farmer. The blue dotted line is the current temperature in the
greenhouse that the ACS could set and support. The yellow line is the temperature
outside, according to the weather forecast.




                               Fig. 8. Temperature control

   In Fig. 9 shows a graph of humidity control. In this graph, similar to the previous
figure, the red line is the humidity parameters set by the person, who controls the
operation of the greenhouse. The blue dotted line is the current humidity in the green-
house, which is measured by sensors and which the ACS could support, and the yel-
low line is the humidity curve outside, according to the weather forecast.




                                 Fig. 9. Humidity control
Finally, the most interesting result of the operation of the greenhouse ACS is the
results of the proposed control effects from the ML model (Fig. 10). The functionality
of the application is constructed in such a way that if you click on one of the graphs
(highlight it), this graph will become more bold. In Fig. 10 shows the temperature
curve of the pipe responsible for heating the soil of the greenhouse. Each of the
graphs in Fig. The 10 curves correspond to a specific device in the greenhouse, which
can be controlled and responsible for the establishment and maintenance of the neces-
sary greenhouse microclimate.




            Fig. 10. Planned control impacts obtained from the ML model output
Because the system is complex and control many parameters, it is clear that it requires
testing and setup. The approach is quite simple - it makes assumptions how to control
the system, what parameters are important and what is not, and based on these as-
sumptions the current version of the model is created. We take a test set of data based
on some historical data and run it on our model to investigate how well it can meet the
desired greenhouse climate. The obtained results are analyzed and accordingly make
changes to the created model of the system. And the process of testing the model
continues again until we reach the desired results.


Conclusions

As a result of these developments, two greenhouse ACS architectures were designed.
The advantages and disadvantages of these architectures are analyzed, and it is argued
that the most appropriate option is an architecture created on the basis of artificial
intelligence, IoT platform and cloud technologies. The machine learning model is
used to analyze current greenhouse microclimate parameters obtained from green-
house sensors and equipment, weather data, and desired climate settings. As a result
of the machine learning model, there are control effects that are recommended to
apply to the greenhouse equipment to achieve the desired parameter settings.
   The application of the IoT platform and cloud technologies enables the creation of an
architecture that offers flexibility, ease of deployment, ease of setup and operation, as
well as monitoring, alerting and drastic changes in greenhouse operation parameters.
   The IoT platform-based greenhouse architecture and cloud-based architecture al-
lows for the rapid and efficient implementation of the process of extending the pro-
posed system to multiple greenhouses, as well as performing regular backup of data,
which is important for a large data system.


References
 1. Sethi V.P., Sumathy K., Chiwon Lee, Pal D.S.: Thermal modeling aspects of solar
    greenhouse microclimate control: A review on heating technologies. In: Solar Energy, vol.
    96, pp. 56-82 (2013).
 2. Santosh, D.T., Tiwari K.N., Vikas Kumar Singh and Raja Gopala Reddy A.: Micro
    Climate Control in Greenhouse. In: Int.J.Curr.Microbiol.App.Sci. vol. 6(3), pp. 1730-1742
    (2017).
 3. Nicolosi G., Volpe R., Messineo A.: An Innovative Adaptive Control System to Regulate
    Microclimatic Conditions in a Greenhouse. In: Energies. vol. 10, issue 5, 722 (2017).
 4. Hahn, F.: Fuzzy controller decreases tomato cracking in greenhouses. In: Comput. Elec-
    tron. Agric. vol. 77, pp.21–27 (2011).
 5. Kryvenchuk, Y., Shakhovska, N., Shvorob, I., Montenegro, S., Nechepurenko, M.: The
    smart house based system for the collection and analysis of medical data. In: CEUR, vol.
    2255, pp. 215–228 (2018)
 6. Melnykova, N., Marikutsa, U., Kryvenchuk, U.: The new approaches of heterogeneous
    data consolidation. In: 2018 IEEE 13th International Scientific and Technical Conference
    on Computer Sciences and Information Technologies (CSIT), Lviv, pp. 408–411 (2018).
 7. Bennis, N., Duplaix, J., Enéa, G., Haloua, M,, Youlal, H.: Greenhouse climate modelling
    and robust control. In: Comput. Electron. Agric. vol. 61, pp.96–107 (2008).
 8. Fourati, F. Multiple neural control of a greenhouse. In: Neurocomputing. vol. 139, pp.138–
    144 (2014).
 9. Maher, A.; Kamel, E.; Enrico, F.; Atif, I.; Abdelkader, M.: An intelligent system for the
    climate control and energy savings in agricultural greenhouses. In: Energy Effic. vol.9,
    pp.1241–1255 (2016).
10. Zhang, D.; Wu, X.; Zhang, C.: The application of fuzzy control in greenhouse environment
    control. In: Appl. Mech. Mater. 543–547, pp.1432–1435 (2014).
11. Tsmots I., Skorokhoda O., Tsymbal Yu., Tesliuk T., Khavalko V.: Neural-Like Means for
    Data Streams Encryption and Decryption in Real Time. In: IEEE Second International
    Conference on Data Stream Mining & Processing. pp.438-443 (2018).
12. Joon Yong Kim, Chun Gu Lee, Dong-Hyeok Park, Heun Dong Park, Joong-Yong Rhee:
    Building a Private Cloud-Computing System for Greenhouse Control. In: Journal of Bio-
    systems Engineering. vol. 43(4), pp. 440-444 (2018).
13. Vatari S., Bakshi A., Thakur T.: Green house by using IOT and cloud computing. In: 2016
    IEEE International Conference on Recent Trends in Electronics Information & Communi-
    cation Technology (RTEICT), pp. 246-250 (2016).