Virtual Distributed Supervision and Control for an Automated Greenhouse.

Resumen

A fin de tener una producción óptima en un invernadero, es necesario regular el micro-ambiente artificial. Mediante el control de las principales variables físicas (temperatura, humedad, ciclos de riego, etc.), así como las variables que intervienen en las tasas de crecimiento de las plantas (nutrientes, la radiación del sol, agua, etc.), calidad de la producción de la planta, el consumo de energía del agua se pueden optimizar. Por ejemplo, la temperatura y la humedad pueden ser reguladas por la apertura o el dibujo del sistema de ventilación o domos o mediante el calentamiento o la circulación del aire dentro del invernadero. Estas tareas deben ser constantemente supervisadas por un sistema de comunicación distribuida bajo supervisión. En este trabajo, se propone un sistema de comunicación serial distribuido basado en micro controladores para el seguimiento y la supervisión del proceso a través de Internet, con el fin de lograr el control on-line y el control de la operación de efecto invernadero y las condiciones ambientales, así como las principales variables (temperatura, humedad, ciclos de riego, etc.)

Palabras clave: 3D, Control, Distribuido, Interfaz de Autoría Externa, Invernadero, Java, Labview, Supervisión, Instrumentación Virtual, VRML.

Abstract

In order to have an optimal production in a Green-house, it is necessary to regulate the artificial micro-environment. By controlling the main physical variables (temperature, humidity, irrigation cycles, etc.) as well as the variables involved in the rates of plants growing (nutrients, sun radiation, water, etc.), the plant’s production quality, the energy and water consumption can be optimized. For instance, temperature and humidity can be regulated by opening or drawing the ventilation system or domes or by heating or circulating the air inside the greenhouse. These tasks should be constantly supervised by a supervised distributed communication system. In this paper, we propose a distributed serial communication system based on microcontrollers to monitoring and supervising the process via Internet, in order to achieve the on-line supervision and control of the greenhouse operation and environmental conditions as well as the main variables (temperature, humidity, irrigation cycles, etc.).

Keywords: 3D, Control, Distributing, EAI, Greenhouse, Java, Labview, Supervision, Virtual Instrumentation, VRML.

I. INTRODUCTION

Greenhouses can provide an excellent controlled environment for plants production. The greenhouse should provide uniform lighting, heating, and water with nutrients to all plants. Thus, it is important to have a system to supervise the main variables in order to control them. An optimal environment provides high quality products as well as possibility of energy and water optimization. These advantages hits mainly on: low-cost production, better control of pests, high product quality, save of water and more than one crop per year.

Furthermore, the fast evolution of the Personal Computer (PC) in the last two decades generated a revolution in virtual instrumentation for test and measurement. Virtual instrumentation offers several benefits to engineers and scientists who require increased the productivity, accuracy, and performance (National Instruments, 2005).


Virtual instrumentation


Virtual instrumentation consists of an industry-standard computer or workstation equipped with powerful application software, cost-effective hardware such as plug-in boards, and drive software, which together perform the functions of traditional instruments (National Instruments, 2005).

In this paper, we propose a design with a minimum system using the PIC16F877 microcontroller in order to set up a distributed serial communication system, and a resource network to control and supervise a greenhouse via a website. The main goal of the minimum system called Slave is the acquisition and digital conversion of analog signals, to be sent to another minimum system called Master. The Master sends these signals to the PC that achieves three main task: 1) stores the acquired data in database calculating the different control laws to be sent to the actuators, 2) keeps a Domain Name Server (DNS)[1] and 3).finally keeps the user interface. Also, the minimum systems control the actuators of the system. The main variables are digitals and analogical signals, such as speed and wind direction, solar radiation, internal and external temperature of the greenhouse, internal and external humidity, rain detector, heating actuator and sun roof opening (Fig. 1). The slave minimum systems are interconnected by a RS-485 protocol to the PC through Master-Slave architecture.

 

 

Fig. 1. Block Diagram.

 

 

We use the RS-485 Serial Communication Interface, since it allows us a multipoint communication (Table I) and others relevant characteristics. Thus, it is necessary to make a conversion from the RS232 Serial Communication Interface (shipped on PIC16F877) into the RS-485 bus protocol.


Table 1. Comparison of RS-232, RS-422, and RS-485 Serial Communication Interfaces.

Specifications RS-232 RS-422 RS-485
Mode of operation Single-Ended Differential Differential
Total Number of Drivers and Receivers on One Line (One drive activate at a time for RS-485 networks). 1 Driver 1 Receiver 1 Driver 10 Receivers 32 Drivers 32 Receivers
Maximum Cable Length 50 ft. (2500 pf) 4000 ft. 4000 ft.
Maximum Data Rate (40 ft. – 4000 ft. for RS-422/RS-485) 20kB/s (by spec-can be higher) 10 Mbits/s 1 Mbits/s

II. SYSTEM OVERVIEW

In this section, it is shown the main components and devices used in our complete system. The system consists of two main parts: the PC connected to the Internet and the Master-Slave System (Fig. 2).

 

 

Fig. 2. General Structure.

 

 

The physical variables are measured by the Sensors and then sent by the Slave Module to the Master Module and then retransmitted to the PC.

The PC stores in a database the physical variables, calculates the control laws to be sent to the corresponding actuator, and then it is sent via the Master module to the corresponding Slave Module driving the actuator. In addition the PC keeps the Web server, publishing the variables with a GUI via Internet.

III. MASTER-SLAVE SYSTEM

The minimum system developed (Fig. 3}), has eight analog inputs where the signals of the sensors are conditioned and then connected to the Analog-Digital Converter Module. After the conversion the values are stored in a variable and it is ready to be sent to the Master and then to the PC. The communication between devices is through the Addressable Universal Synchronous Asynchronous Receiver Transmitter (USART)[2]. In this case the USART is configured as a full duplex asynchronous system with a baud rate in 9600 bauds.

Each Slave has an identifier composed by nine bits. In this way, the master sends the user request to the correct slave, avoiding errors between information transmission and request from the master to the slaves. The communication between master and PC is realized with eight bits since the LabVIEW only allows eight bits transmission.

When a request arrives to the corresponding slave, then a code is sent which indicates the information that the slave has to transmit. This information comes from the temperature, humidity and solar radiation sensors. Thus, the control schemes running on the PC under LabVIEW can supervise the greenhouse and control these variables.

Moreover the analog input module, the SCI (Serial Communication Interface) module (transmission- receive) and the digital outputs module (to the actuators), the minimum system has the necessary implementations to be used in our system. These implementations are: the keyboard, the display, one free port and the Master Synchronous Serial Module. The display is used to locally supervise some parameters in the same module instead of going necessarily to PC. The others shipped-on modules are not been used at this moment, but they will integrated in a future development works. The linkage of these digital devices and components must be made by some software components. We have used some commercial packages and developed all the algorithms and VIs to have an open architecture to perform easily different control and supervision schemes.

 

 

Fig. 3. Minimum System Diagram.

 

 

IV. SOFTWARE FEATURES

In order to keep some compatibility among the different devices and software components and reliability of the proposed architecture, it was chosen some commercially software as described in the following.


A. LabVIEW

LabView is a graphical programming language that uses icons instead of lines of text to create applications; furthermore, it allows achieving different forms of communication between a PC and external digital devices.

This communication can be made by a serial or a parallel port, and all of this is programmed under an easy graphic user interface. Since the master and slaves, based on the microcontroller 16F877, have two serial ports, we have chosen a LabView based on serial communication interface.

The virtual instrumentation is achieved via virtual instruments (VI). This VI, defined by LabVIEW, looks and operates as a physical instrument, such as an oscilloscope or a multi-meter. Furthermore, it can be used a VI in another VI, it is called a subVI.

In this work, each VI is used to manipulate functions for example the VI presents data on the screen or sends it to another files or PC's. (Fig. 4). For the database, the data comes from the Master and is directly saved in the server PC (see Fig. 2.) in an Excel file due to the LabView input output format requirement.

 

 

Fig. 4. Labview graphic interface.

 

 

Server PC executes LabVIEW in server configuration in order to publish in a broadcast mode th VI´s (see Fig. 4.).

Since we need to supervise and control remotely (User PC) the automated greenhouse, it is necessary to manage (PHP) a database (MySQL) and Labview.


B. Java, MySQL and PHP

Since Java is a virtual machine platform-independent, we use it to import the data, to publish the web site and to set up the interaction communication between user PC and Server PC via free External Authoring Interface (EAI) libraries.

MySQL is a compact database server ideal for small applications. In addition to supporting standard SQL[3] (ANSI), it compiles on a number of platforms and has different operating systems multithreading abilities on UNIX servers , providing a great performance. This software is used to import information from an Excel file to a database admitted by PHP software. PHP can access most any SQL or ODBC database. It can both read and write information in the database.


C. VRML and EAI

With EAI an application may interact with a Virtual Reality Modeling Language (VRML) scene graph through use of the interface defined in part of ISO/IEC 14772. This interface is a protocol for manipulating the VRML scene graph instead of directly part of the scene graph itself.

This specification is aimed at providing a language neutral representation of all actions that can be performed by an external application across this interface. The EAI forms this interface by giving access to the top-level named nodes in the system to the external environment. Top level named nodes are those nodes at the outermost layer of name scope which have an associated identifier (DEF) name. The interface mimics the access of the Script node with a reference to the named node. To facilitate the sending of events to the external environment, a new mechanism is made available. To receive notification when an event is sent to an eventOut, the external environment registers interest in it. This mechanism is similar in concept to the processEvents functionality in ISO/IEC 14772-1, but differs due to the asynchronous nature of the external environment.

VRML is used jointly with EAI libraries to a 3D representation, and since the variables data is sampled each five seconds by LabVIEW, the greenhouse scene graph is on-line supervised.

V. WEBSITE

The website (Fig. 5.) shows the scene graph for the crop plantation and the greenhouse, the different access to read the physical variables databases, and the LabView virtual instruments to supervise the different modules.

 

 

Fig. 5. Virtual Automated Greenhouse.

 

 

VI. CONCLUSION

Based on the PIC 16F877 microcontroller, we have presented a virtual distributed serial communication system to supervise and control the external and internal variables in an automated greenhouse. The serial communication protocol used is RS485, since it allows us a multipoint communication and others relevant characteristics (number of receivers and cable length). Also some communication failure test has been carried out in order to check the robustness performance. Some control laws schemes and alarms are implemented in LabVIEW in order to achieve some user specifications. Finally, the complete system can be supervised and controlled via a Web Site.



[a] Profesor Investigador de la Universidad Autónoma del Estado de Hidalgo.

[1] LabVIEW Basics II Course Manual, National Instrument, September 2000, Edition, Texas, USA.

[2] LabVIEW User Manual, National Instrument, April 2003, Edition, Texas, USA.

[3] Serodio Carlos, Boaventura Cunha, J., Morais Raul, Couto Carlos, Monteiro Joao, A networked platform for agricultural management system, 2001, Computers and Electronics in Agricultural.

[4] Fuertes, J.M., Herrera, J., Arboleda, J.P., Heit, F., Casas, C., Company, J. Communication system for a distributed intelligent controller, 1999, Microprocessors and Microsystems.

[5] ipsuwan, Y., Chow Mo-Yuen. Control Methodologies in networked control system, 2003, Control Engineering Practice.

[6] Gieling, Th.H., Van Meurs, W. Th., Jansen, J. A computer network with SCADA and case tools for on-line process control in greenhouses, 1996, Pergamon.

[7] Boaventura Cunha, J., Moura Oliveira, J.P. Optimal management of greenhouses environments, EFITA 2003 Conference.

[8] VRML 2.0 sourcebook, Second Edition, Andrea L. Ames, David R. Nadeau, John L. Moreland, John Wiley \& Sons, Inc., ISBN:0-471-16507-7, 1997.

[9] Java 2 Manual de Usuario y tutorial, 2a edicion, Agustion Froute Quintas, Alfaomega Ra-Ma, ISBN:970-15-0550-8 2000.

[10] Java Con Programación orientada a objetos y aplicaciones en la WWW, Paul S. Wang, Kent State University, International Thomson Editores, ISBN:968-7529-98-9, 2000.

[11] http://www.web3d.org, Web3D Consortium - VRML97 and Related Specifications. Temas VRML97 Functional specification and VRML97 External Authoring Interface (EAI) and Historical - VRML 1.0 Specification.