Keywords

1 Introduction

Nowadays the water-energy-food nexus embraces the Sustainable Development Goals (SDGs) of the United Nations to satisfy the constant food production [1].

The economic viability of agricultural crops produced in protected environments, such as greenhouses, is highly dependent on the associated energy and environmental costs.

With this purpose, the monitoring of these variables, as well as the definition of solutions aim at minimizing production costs, which is fundamental for the survival and competitiveness of these companies.

In this context, a new model for collecting physical variables, using a network of sensors and rapid processing of this data, allowing the manager of these greenhouses to make quick decisions to increase the overall efficiency of these production systems is presented below.

1.1 Objectives and Case Study Features

The main objective of this work was initially to analyze the energy consumption of a case study, a 150 m2 plant production greenhouse with aquaponic technology, located at Campus 2 of the Polytechnic of Leiria, Portugal, and to develop technological solutions to improve the energy efficiency and the overall sustainability of this activity.

Thus, the present study aimed to design an energy production system by photovoltaic technology, based on a self-consumption scenario or an isolated grid scenario in accordance with current legislation in Portugal. Moreover, the study also aimed to develop an IoT-based monitoring system, using the installation of sensors and program design, so that it is possible to obtain information on key parameters in real-time, which is fundamental in decision-making in case of detection of critical conditions associated with the nutrient solution and/or climatic conditions of the greenhouse of the case study (see Fig. 1), which has some main components.

Fig. 1.
figure 1

Main components in the aquaponic greenhouse.

The greenhouse features two lateral non-automatic windows for passive ventilation and a precarious indoor shading system, denoting a great room for improvement to adequately deal with summer overheating and winter low temperatures that can delay the growth of fruits and pods. Another aspect will be to introduce systems that detect the state of maturation of the plants and automatic harvesting of fruits and pods, in this intensive production process. But this will be the subject of research and implementation soon.

1.2 Sustainable Production of Edible Plants

Some more exclusive food crops, for certain restaurants or food stores, can use small-scale greenhouses, where the typology of technology developed and presented below will be an option for sustainability and decarbonization of the economy. In this context the edible flowers like dahlia and rose can be used as a source of phenolic compounds with bioactive potential and can be incorporated in human diet [2].

The production of edible flowers in photovoltaic greenhouses can be a sustainable possibility. Not only the productions’ methods can be optimized (ex. the microclimate created can reduce pests), but it also makes possible to generate electricity (as was demonstrated in a tomatoes’ experimental greenhouse covered with flexible photovoltaic panels) [3,4,5]. The search for different sources of nutrients (e.g. flowers) to be incorporated in human diet combined with best sustainable production practices, using advanced technologies, can provide huge opportunities to improve, not only the productivity, but also the final product quality.

2 Technologies and Developed Model

2.1 Details of This Technologies

For the control and monitoring of an aquaponic/hydroponic greenhouse [6, 7], the objective is to obtain a system in which key parameters such as air and water temperature, relative air humidity, pH and electrical conductivity of the nutrient solution can be observed remotely, either through of a Web page or through a mobile application. It is also intended to be possible to control these parameters to desired values, by using appropriate actuators. These technologies use sensors to obtain parameter values; there are several types of sensors that can be used successfully. The values ​that are read from these sensors will be sent to a microcontroller. Eventually, this device processes the data and controls the greenhouse using a control unit. The control unit, i.e., a set of actuators that guarantee the control of the parameters, act when, for example, the temperature is outside the defined limits, by activating a fan or other mechanism in order to lower the temperature in the greenhouse.

The microcontroller has the final objective of sending the values​ of the parameters, so that they can be monitored through a Web page or a mobile application. The type of monitoring and control differs for different existing systems, and normally through monitoring, it is possible to change the limits defined for this data remotely and in real time. By controlling the parameters, the use of the devices allows enhances the efficiency, since it is not necessary, they are on more time than essential. Figure 2 illustrates what has just been presented [8].

Fig. 2.
figure 2

Greenhouse and associated data control parameters of physical variables.

2.2 Features of Developed Model

Applying the technology presented in Fig. 2, a model was designed for the case study herein presented, consisting in two main areas (see Fig. 3): 1) Monitoring and visualization system of the key physical variables of the greenhouse; 2) Local production of electricity by photovoltaic technology by two production regimes in accordance with national legislation [9].

Fig. 3.
figure 3

Model developed in the case study with the power source energy production, telemetry, IoT sensor network, remote monitoring, visualization, and control capabilities.

3 Methodology, Prototype and Results

Considering the components of the model developed for the case study depicted in Fig. 3, this paragraph describes the steps in the design of an electric energy production system, using photovoltaic technology, under two operating scenarios:

  1. 1)

    Self-consumption.

  2. 2)

    Isolated grid.

A monitoring and a visualization system will, also, be presented with the objective of monitoring parameters related to the plant growth process in the greenhouse and providing its remote viewing via the Internet or mobile application.

3.1 General Consumptions

Following an energy audit methodology in accordance with the Portuguese law nº 68-A/2015, which regulates energy efficiency matters and results from the transposition of Directive nº 2012/27/EU of the European Parliament, it was installed one energy analyser equipment in the electric panel of the greenhouse to collect consumption data, during a period of 2-weeks in February 2020, to carry out an analysis consumption of the installation in this season of the year.

After this, a load diagram was created (see Fig. 4) to observe the differences between the consumption of previously existing data as well as the profile of the periods of minimum and maximum consumption, which reached a value of 1.8 kWeletric. This maximum consumption is essential for the design the local electricity production by solar power plant presented in Fig. 3.

Fig. 4.
figure 4

Load diagram of 2-week sample in 2020 February.

3.2 Monitoring and Visualization System

Monitoring and visualization system consisted in the use of telemetry processes, IoT sensor network, monitoring and remote visualization in the control of the equipment inherent to these methods of managing these variables. So, the board ESP32-DevKitC is a small-sized ESP32-based development board produced. Most of the I/O pins are led out to the pin headers on both sides for easy interfacing. Developers can connect these pins to peripherals/sensors as needed. Standard headers also make development easy and convenient when using a breadboard.

This module ESP32-SOLO-1 is a powerful, generic Wi-Fi + Bluetooth + Bluetooth LE MCU module that targets a wide variety of applications, ranging from low-power sensor networks to the most demanding tasks, such as voice encoding, music streaming and MP3 decoding. It has a supply voltage of 3.3/5V DC. Through this microcontroller, data from the installed sensors is acquired and this information is processed in such a way that errors are minimized.

The Raspberry Pi 4 Microcomputer or Small Single Board Computer (SBC) is like a computer built on a single circuit board, with microprocessor(s), memory, input/output (I/O) and other features required of a fully functional computer. It has a supply voltage of 5V DC and its purpose is to develop the graphical interface.

Sensor values, Table 1, are sent to the Raspberry Pi via the MQTT (Message Queue Telemetry Transport) protocol. MQTT is a communication protocol with low bandwidth and hardware requirements. The broker is installed on the Raspberry Pi, which consists of using the publish/subscribe paradigm to exchange messages. The broker is responsible for receiving and sending messages from publishers to subscribers [10].

Table 1. Components used in the project - prototype designed.

For this, a MQTT routine/function was created that connects the ESP32 to the Raspberry Pi, as can be seen in Fig. 5. When the MQTT connection is lost, there is a routine that reconnects. The same happens with Wi-Fi.

Fig. 5.
figure 5

MQTT Function [11].

The sensor data/values are sent at the end of each function; see the type of format (Fig. 6).

Fig. 6.
figure 6

Some details of the program for sending data of environment temperature, humidity, water temperature, TDS, pH and EC - electroconductivity through the MQTT protocol.

The block diagram of Fig. 7 presents the processes developed for monitoring and visualization. The ESP32 NodeMCU receives the parameter data from the sensors, where the data is processed and sent via Wi-fi to the Raspberry Pi microcomputer. The data is saved to have a history of the parameters. Data can also be viewed remotely via a computer dashboard or mobile application on a smartphone.

Fig. 7.
figure 7

Block diagram of the monitoring and visualization system

A graphical interface was developed using Node-RED [12], allowing connection with other devices. This interface consists of a dashboard, a Blynk mobile application [13] and a MariaDB database [14]. Node-RED is a flows-based development tool for connecting between devices as part of the Internet of Things - IOT.

To visualize the values of the sensor readings, a panel was created with the monitoring of each sensor. For this it was necessary to develop a flow for each sensor. The graphical interface on the smartphone can be customized the way one want to visualize the values of the devices. It can be visualized through a graph, a text box or a pressure gauge; being this, a simple graphical interface of configuration and very flexible.

To store the values of the sensor readings, a database was created using the MariaDB software. It is a database that was developed by the creators of MySQL and was created from MySQL.

To program the ESP32 NodeMCU, the Arduino software, the Arduino IDE [15] was used. The acquisition of sensor data is done through the software and the same is for sending the data to the Raspberry Pi. To carry out these processes, libraries such as WiFi, DHT, OneWire and DFRobot_PH were used. The DHT11 sensor has the objective of acquiring the ambient and relative temperature data. In order the reading of the environment temperature values to be the most correct, an arithmetic average was calculated from the five readings received from the sensor.

3.3 Electricity Local Production of Self-consumption Regime

In this article, only an explanation of the local energy production component in the self-production regime will be presented. The result of the software - PVsyst V.6.81 simulation shows that the photovoltaic system has an energy production of 5.530 kWh/year, with a performance index of 83.16%.

The solar fraction of the system is 30.21%, that is, close to 30% of the energy that powers the greenhouse comes from the photovoltaic system, with the rest being purchased from the grid.

Through the graph of Fig. 8 it is possible to observe the useful energy produced by the system over the months, the system losses from the inverter and the losses of the photovoltaic group.

Fig. 8.
figure 8

Useful energy produced by the system in a self-consumption scenario.

With this scenario of electricity production, it is possible to reduce the purchase of energy from the national grid and the surplus energy produced by the panels can be injected and sold to the national grid. The investment for the photovoltaic system will be around 7.000 EUR for around 16m2 of photovoltaic panels. Since through this self-consumption system it is not possible to have a very high energy production by this technology (30%), the loads of the stoves are loads that are in continuous operation.

4 Conclusion and Future Perspectives

It should be noted that practically all the equipment is in continuous operation in the greenhouse and in the scenario of energy production by self-consumption the investment is less than 8.000€ and it is possible to reduce the electric energy bill and sell the excess energy produced to the electricity grid, in accordance with the legislation. The scenario in an isolated network presents high costs and applied to this case study did not show great benefits.

The possibility for the greenhouse manager to have functionalities on his/her mobile phone to access data on key physical variables, allowing a real-time evaluation of the activity status is a guarantee of better efficiency and sustainability. The chosen equipment has good characteristics of useful life, reliability of operation, being the prototype installed in a professional level.

In the future, the air-cooling system should be improved, as well as the automation of opening/closing windows, and this process should be controlled and monitored according to the environmental conditions under study.

Also, as a future development, continuous and remote monitoring of energy consumption should be carried out and complementary sensors could be installed to increase the parameters collection. The prototype herein developed could be tested in greenhouses with other types of production technologies, to assess the performance under different conditions regarding its optimization and eventually large scale production.