Development of a software for the control and the supervision of the climatic parameters under greenhouse

To meet the climatic needs of plants, there is a growing interest in the development of methods to automatically and continuously detect the constraints on plants, and to use water and nutrients under greenhouse crops in a rational way. The objective of this work is consecrated to the development of a software for the control and supervision of climatic parameters under greenhouses by an automatic process using LabVIEW. The system carried out makes it possible to measure the various values of the physical sizes resulting from various sensors (temperature, humidity, illumination, content of CO2, moisture of the ground,…). In order to visualize in real time, the evolution of the various climatic parameters, a graphic interface of supervision was developed by using the programming language LabVIEW. The latter makes it possible to integrate functions of control such as the modification of the instructions and the control commands to maintain the conditions adapted to the culture under greenhouse. The installation of such a strategy must take account of the economy of the water resources, nutritive elements and electric power while making it possible to the farmers to increase their productions as well in quantity and in quality.


Introduction
The sustainable agriculture in the Mediterranean environment can only be possible if the management of water, fertilizers and other inputs is controlled, while respecting the quality and quantity of natural resources (soil, water, biological diversity). This agriculture must also be profitable if it is to survive [1][2][3][4][5].
The farmer has a major objective, which is to have the maximum income per unit of agricultural area. That is why farmers have turned to protected crops, which provide them with high productivity and a very attractive selling price, given the period during which they are sold on the market. Greenhouse crops also make it possible to add value to small agricultural properties (less than one hectare) and land with high land prices by growing high value-added crops. This is the case in Morocco, where vegetable crops (tomatoes, cucumbers, zucchini, melons, etc.) grown in greenhouses are concentrated on the coast and are experiencing spectacular growth. Unfortunately, this boom does not take into account the notions of sustainable agriculture. Although horticulturists are mastering irrigation efficiency by using localized irrigation systems (drip and others), they do not know how much water to bring and when. As a result, irrigation water is poorly managed, even though the water saved could be used to expand irrigated farmland [6].
A rational management of water and fertilizers is insufficient (only partially meet crop needs) to put crops back on the road to sustainable and profitable agriculture, given the climatic factors (sudden changes in temperature, too low humidity, wind, ...).
The greenhouse culture offers the possibility to free itself from external climatic constraints (rain, wind, cold), and allows the heating of the air and roots, the control of irrigation and fertilization, the enrichment in CO2 and the control of humidity. Maintaining a temperature conducive to good plant production in winter generally does not pose any particular problems, apart from the need to reduce high humidity, usually by simultaneous heating and ventilation. On the other hand, excessive temperatures and low humidity are common in greenhouses in summer. It is then necessary to cool and humidify the air in the greenhouse and possibly combine this operation with CO2 enrichment. This is why greenhouse growers who want to remain competitive, must optimize their investment by controlling production conditions, also aiming to automatically control the climatic development factors of the plant and the water supply (drip irrigation) [7][8][9][10][11][12][13][14].
The objective of this work is to develop a software dedicated to ensure: the acquisition of climatic parameters (temperature, relative humidity, lighting and CO2 content, ...) inside and outside the greenhouse, the control of actuators (heating, fan, drip irrigation, fertigation, misting, ...) and the storage of data in files for processing by an automatic process.

Materials and methods
To develop our greenhouse climate control software, we used the LabVIEW (Laboratory Virtual Instrument Engineering Workbench) workspace, which is an instrumentation application development software based on a graphical programming language to create a program in the form of a diagram [15][16][17].
The communication between the software and the different devices installed in the greenhouse is done through a PCI-812PG acquisition card of Advantech brand which is placed in the computer [18]. This card offers the advantage of the simplicity of the entire acquisition system and, above all, high data transfer speeds to the memory, allowing real-time processing.
The acquisition card consists of: 16 analog inputs, with programmable gain, 16 digital inputs/outputs, 2 analog outputs, 3 programmable counters/timers. In order to verify the performance of our piloting software, we took advantage of the resources of the Electronics and Information Processing laboratory of the Faculty of Science of Meknes. The installation includes a single-chapel glazed greenhouse with a transparent roof and a set of sensors (temperature, humidity, lighting, CO2 content, soil moisture, etc.) installed inside and outside the greenhouse, actuators (heating, fan, drip irrigation, fertigation, ...) and electronic devices.
The synoptic schematic in Fig.1 illustrates the different elements of the experimental set-up used to carry out our experiments: Depending on the climatic needs of the plants, the greenhouse control software we have developed allows us to set two thresholds for each climatic parameter. For example, for the temperature, we have chosen a temperature of 20°C as a setpoint. For this, the heating system operates when the temperature drops below 20°C and stops when the temperature rises above 20°C. On the other hand, the ventilation system operates when the temperature rises above 25°C and stops when the temperature drops below 25°C.

Results and discussions
The essential functionalities of the piloting system carried out in this work make it possible to carry out the following functions: Management of the climate: it allows to manage in an automatic way, the climate under greenhouse by carrying out three essential operations:  Acquisition of the different climatic parameters (temperature, relative humidity, carbon dioxide, ....), which condition the production in greenhouses.  Control of the data related to these parameters.  Control of the different actuators installed in the greenhouse (fan, heating, lighting, misting, shading, ...) if necessary. Irrigation management: it allows to manage drip irrigation and fertigation (manual and automatic). Supervision: it allows the supervision, in real time, of the evolution of all the climatic parameters under greenhouse. Data storage: it allows the storage of data in files for treatment.

Adjustment of climatic parameters and actuators
The interface in figure 3 allows the user to perform several tasks:  Adjustment of the consigns of various acquired climatic parameters (temperature, humidity, lighting, CO2 content), in order to switch on or off the corresponding actuators.  Visualization of the automatic operating status of all the actuators installed inside the greenhouse (fan, lighting, etc.).  Manual control of the actuators.
 The visualization of error messages from analog sensors and digital actuators in case of misuse by the user.  The choice of the lecture step.  The choice of the registration file.  The status display activates or deactivates the registration.

Fig.3. Interface for adjusting climatic parameters and actuators.
We have the choice between two possible modes of action: an All-or-Nothing (TOR) mode with sixteen digital outputs, and a progressive mode with two analog outputs.
In our application, we work with the TOR mode where the control element (or command) can only take two positions: Turning on or turning off a device. A first threshold triggers the start-up of an equipment and a second threshold causes it to stop. The climatic parameter must therefore evolve between these two values.

Real-time acquisition of climate parameters
The interface in figure 4 allows real-time supervision of:  The evolution of all climatic parameters (temperature, humidity, lighting, CO2 content, soil moisture) inside and outside the greenhouse.  The numerical values for each climatic parameter.  The voltages of eight analog sensors that we used in our application.

Fig.4.
Interface to visualize the evolution of the climatic parameters in real-time.

Irrigation and fertigation drip management interface
The figure 5 represents the interface four of the control software allowing:  The supervision in real time of the evolution of the soil humidity, the digital value of the soil humidity (in %) and the analogical sensor voltage.  Manual control of irrigation and drip fertigation.  The choice of irrigation duration: The user has the choice of the duration of each irrigation phase from 1min to 24 hours.  Choice of frequency: The user has the choice of an irrigation frequency of 1 to 4 times a day.  Automatic Irrigation: Measurements of water in the soil are easy to make and sufficiently reliable. The automatic irrigation is managed by the developed software that compares the value of the maximum soil humidity reference value with the value sent by the soil humidity sensor at each reading step. Once the measured value exceeds the set value, the software controls automatic irrigation (Fig. 5).

Storage of the data of all climate parameters
The global management of storage files makes it possible to offer an interesting database to the user. Each saved file will contain:  The data relating to each parameter.  The name and the location of the file.  The date and time of file creation.  The duration of the registration.  The useful and practical information for the user of the created database. Figure 6 illustrates the different choices available to the user to achieve data storage in file form. The record file (with extension. lvm) can be opened with Excel, word, notepad, for processing. Fig.6. The global file management window.

Conclusion
There is a growing interest for the development of methods to automatically and continuously detect the constraints undergone by the plants and to use water and nutrients under greenhouse crops by a rational way. This interest finds its justification in the fact that computers effectively bring an improvement of the climatic conditions under greenhouses thus favoring the production of quality, with very good yields.
The software we have developed in this work brings together both the operating safety, flexibility of use, interactivity and power to command the actuators and real-time control and supervision of under greenhouse climatic parameters. The automatic management of drip irrigation and fertigation by this software permits the provide to the greenhouse crop with a uniform bring of water and nutrients throughout the season. It avoids water stress and provides water at critical times. The control and the supervision of the climate and fertilization in the greenhouse allow to reduce energy, fertilizer and water costs.
This software is flexible in that it can be reused for future acquisition systems and can even be modified to adapt it to future needs.
As perspectives to our work we envisage to control the climatic parameters inside the greenhouse while trying to develop a model governing the law of variation of these parameters. This model will be used to develop a predictive control of the greenhouse. In addition, we project to develop our software for remote control and supervision.