Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
An Automated Greenhouse Control System Using Arduino Prototyping Platform Jonathan A. Enokela (Corresponding Author) Department of Electrical and Electronics Engineering, Federal University of Agriculture, P.M.B. 2373, Makurdi, Benue State, Nigeria Tel: +2347031867444 Email:
[email protected] Theophilus O. Othoigbe Department of Works & Logistics (Electrical), Nigeria Security and Civil Defence Corps, National Headquarters, Abuja, Federal Capital Territory, Nigeria Tel: +2348035683490 Email:
[email protected] Abstract The world climate change has brought about unpredictable weather conditions that have resulted in the global food shortage being experienced. A possible solution to this problem will likely involve households growing a reasonable percentage of the vegetables and crops they need in a greenhouse which does not require too much land space. A greenhouse will normally produce more crops per square meter when compared to open field cultivation since the microclimatic parameters that determine crop yield are continuously monitored and controlled to ensure that an optimum environment is created. The automated greenhouse control system achieves monitoring and control of a greenhouse environment by using sensors and actuators which are under the control of a microcontroller running a computer program. The system is composed of two stations: Remote monitoring station and the Actuators/Sensors Station. The controller used in the actuators/ sensors station which ensures that the microclimatic parameters stay within pre-defined values as determined and set by the user is the Arduino prototyping platform. The climatic conditions of the greenhouse and state of actuators are transmitted to the remote monitoring station via a pair of low power XBee Modulator-Demodulator (MODEM). The codes for the controller were written in the Arduino programming language, debugged, compiled, and burnt into the microcontroller using the Arduino integrated development environment (IDE). A scaled-down prototype of the system was built and tested. Automation of a greenhouse brings about efficient data acquisition and control of the microclimatic parameters. It also significantly reduces the labour involved in its maintenance thus making the system useful for rural farmers, small scale agriculturists, gardeners, and agricultural researchers. Keywords: Greenhouse, Automated Agriculture, Embedded System, Arduino 1.
Introduction
Food shortage is one of the greatest problems confronting mankind in the 21st century. Global warming and other weather elements have claimed substantial land mass that was available for crops cultivation. In order to address the problem, greenhouse practice which has been in existence for a very long time (Wikipedia, 2014) is now modernized and deployed in many parts of the world. This technology is yet to be embraced by many developing countries (Okunola, 2013). Modern greenhouse technology deploys automation in agriculture which is now common place due to the low costs of electronic components required for its implementation. A lot of efforts have been made by many researchers to automate the traditional greenhouse system. In the work by Sumit et al (2012) an embedded system closely monitors the microclimatic parameters of a greenhouse round the clock and activates actuators when safe thresholds are exceeded in order to restore optimum conditions. Their design employs a Liquid Crystal Display (LCD) which is directly interfaced to a microcontroller that ensures that the user is continuously alerted about the conditions inside the greenhouse. Clearly, a system of this type can provide information to the user about the conditions inside the greenhouse only when the user is at the physical location. A Wireless Sensor Network (WSN) with smart irrigation capability is discussed by Mahmoud and Ala’a (2013). This system monitors the microclimatic parameters around each row of crops and activates appropriate pumps for irrigation when the moisture level drops below a Australian Society for Commerce Industry & Engineering www.scie.org.au 1
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online) safe threshold. The drawback of this system lies in its inability to control the other microclimatic parameters such as temperature and humidity which play a major role in the development and yield of crops. Also, the user can only view the conditions of the greenhouse at the physical location since it employs LCD. Rahali et al (2011) developed a system that is based on the Global System for Mobile Communication (GSM) that allows a greenhouse user to monitor and control the microclimatic parameters via Short Message Service (SMS). The main pitfall of the system is that the control action is not automatic; it is initiated by the user who may not always be attentive and this could have adverse effects on the crops. Two separate web-based WSN applications were respectively developed and discussed by Qiang and Ming (2008) and Mancuso and Bustaffa (2006). These systems allow a greenhouse user to monitor the conditions over the internet. Although the internet communication platform is almost always available, it requires that the accessing device such as a Universal Serial Bus (USB) MODEM should have enough download data capability which may not always be the case in developing countries. The system that has been designed in this work consists of two stations: Sensors/Actuators station and Remote Monitoring station. The sensors/actuators station is the heart of the system and uses a microcontroller, Arduino Uno board (Banzi, 2009, and Melgar and Diez, 2012), XBee MODEMs, and a number of sensors and actuators as major components. The Arduino board is programmed with a sequence of codes called a sketch that enables it to read data from sensors that are representative of the greenhouse climatic conditions. The controller processes these data and issues commands to the actuators to restore desired optimum conditions required by the plants. The controller also reads the conditions of the actuators and transmits same along with the calculated controlled variables via the XBee MODEM. Another XBee MODEM receives this information over a defined and secure channel and sends it to the serial port. The information is then displayed on the terminal with the aid of XCTU software installed in a PC. Some advantages of the system include: (i) The Graphical User Interface (GUI) of the system is simple and easy to implement since it does not require additional coding by the user to display remote greenhouse information. The system also displays a history of five (5) records of greenhouse conditions received at intervals of 5 seconds. (ii) The wireless link between the two stations is not provided by the internet that requires data that must be purchased from providers, neither is it designed around the GSM that requires cost of air-time. Once the system is set up, information about the greenhouse condition will always be available at the desired remote location. (iii) The system monitors and controls all the microclimatic parameters of interest and can even be upgraded to control additional parameters should the need arise. The system is fully automated: once it is set up it drives itself automatically without any form of assistance from the user. 2.
Materials and Methods
2.1 System Architecture The automated greenhouse control system, whose block diagram is depicted in figure 1, is made up of two principal units: Sensors/Actuators station and Remote Monitoring station. These two units consist of sensors for light (Light dependent resistor), temperature (LM35), humidity (HIH4030) (Hobby Electronics, 2014) and moisture (VH400) (Vegetronix, 2014); fan, fogger, drippers and artificial light; Arduino microcontroller board; XBee MODEMs; XBee adapter board; and a personal computer (PC). The sensors/actuators station is the heart of the system that is responsible for regulating the greenhouse environment. The sensors acquire the environmental data. After the data have been filtered to remove noise they are made available to the Arduino board which then computes the current values of the controlled variables and compares them with the set thresholds. If any of the controlled variables is outside a safe limit the corresponding actuator is activated to restore the optimum condition. The Arduino board also reads the states of the actuators and transmits the information along with the current values of the controlled variables to the remote monitoring station via XBee radio frequency (RF) MODEM pair that operate at a frequency of 2.4 GHz. A large number of wireless linking devices exist (Javvin, 2007), however XBee has been used for this work primarily because of its suitability for low power data transmission (Gianfranco, 2009). 2.2 Hardware Design 2.2.1The Sensors/Actuators Station
Australian Society for Commerce Industry & Engineering www.scie.org.au 2
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online) The schematic diagram of the sensors/actuators station is shown in figure 2. This has an XBee MODEM mounted on a breakout board which is in turn interfaced to Arduino uno Rev 3 (The actual implementation employs an XBee shield for convenience). The signals from the sensors are filtered using R-C low pass filters (LPF) that have been built with LM324 operational amplifiers (Op-amp). The actuators are activated by signals provided by appropriate digital pins of the Arduino board according to the thresholds set by the user. Finally, the current values of the controlled variables and states of actuators are transmitted to the remote monitoring station via RF XBee MODEM by the serialprint commands in the Arduino sketch. 2.3 The Remote Monitoring Station The signal transmitted by the XBee at the sensors/actuators station is received and demodulated by the XBee in the remote monitoring station which then passes the information to the serial port and displays it in the terminal environment of XCTU software installed in a PC. This approach of creating a GUI requires no coding by the user and the information is still presented in a visually appealing format.
Temperature Sensor
Light Sensor
Humidity Sensor
Moisture Sensor
Signal Filter
Antenna
XBEE RADIO MODEM
ARDUINO BOARD
Relay Control Module
Cooling Fans
Artificial Light
Fogger
Drippers
(Sensors/Actuators Station)
PERSONAL COMPUTER
XBEE USB ADAPTER
XBEE RADIO MODEM
Figure 1. Block Diagram of Automated Greenhouse Control System (Remote Monitoring Station) 2.4 Software Design
Australian Society for Commerce Industry & Engineering www.scie.org.au 3
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online) The control strategy for the system in this work is developed for the individual parameters to be controlled as follows: (1) The temperature control requires the definition of two threshold limits: upper limit and lower limit. When the upper limit is exceeded a fan is activated to cool the greenhouse environment and when the temperature drops below the lower limit, the fan is deactivated while a heater is activated and vice-versa. (2) Humidity control is defined by a threshold set by the user. When the humidity of the greenhouse enclosure falls below this threshold, a fogging system is activated and then deactivated when optimum condition is restored. (3) The moisture control is defined by a threshold which ensures that if the soil moisture content falls below the set value drippers are activated, and then deactivated when optimum condition is restored. (4) The lighting condition is controlled by two set points: upper limit and lower limit. The upper limit determines when the light is activated while the lower limit determines when it is deactivated. This strategy is primarily used to extend day light or compensate for inadequate natural lighting according to the desire of the user. 2.5 Program Flowcharts The main flowchart for the program of the automated greenhouse control system is shown in figure 3. The flowcharts for the various subroutines are shown in figures 4, 5, 6, and 7. The program for the system was written in Arduino language which is actually a subset of the C/C++ programming language (Purdum, 2012). The program was written, debugged, compiled and burnt into the flash memory of the microcontroller on the board using Arduino IDE.
Figure 2a. Schematic of Actuators Station of the Automated Greenhouse Control System
Australian Society for Commerce Industry & Engineering www.scie.org.au 4
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
R13
R16
_
+5V
_
1
+
R10
1/4 LM324
C9
AD1/ DIO1
R24 R15
AD3/ DIO3
RESET
RST/ DIO6
RSSI/ DIO 10
D10
_
_
D13
+
+
R9 HIH-4030
1/4 LM324
C8 1/4 LM324
R23
R11
R14
+9V
Reset
D12
3.3V
D11
5V
D10
Gnd
D9
Gnd
D8
Vin
ARDUINO
D7
10
_
_
+5V
+
R8
+
VH400
1/4 LM324
SENSOR
1/4 LM324
0N/ SLEEP
DTR/ DI0 8
CTS/ DIO 7
Gnd
D5
A1
D4
A2
D3
A3
D2
A4
(Tx) D1
A5
(Rx) D0
DIO 4
R22 A B
R21 C
R20 D
R19 E
R18
C7
_
_
+5V
A0
VREF
NC
D6
R6
+
+
R7
LDR ( NORP 12 )
1/4 LM324
C6
R25
ASSOC/ DIO5
DIO 11 ARef
+5V
20
AD2/ DIO2
XBEE
DIO 12
1/4 LM324 R12
AD0/ DIO0
DIN DOUT
R17
+
LM35
Vcc
1/4 LM324
Figure 2b. Schematic of Sensors Station of the Automated Greenhouse Control System
Australian Society for Commerce Industry & Engineering www.scie.org.au 5
11
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Start
Initialization
No
Instruction received?
Yes Read sensors data
Compute current values of controlled variables from sensor data and store them
Retrieve Temperature Value Perform Temperature Operations
Retrieve Light Intensity Value Perform Light Intensity Operation Retrieve Relative Humidity Value Perform Relative Humidity Operation Retrieve Soil Moisture Content Value Perform Soil Moisture Content Operation Transmit Current Values of Controlled Variables and State of Actuators to XBee MODEM
Halt Program for 5 Seconds
Figure 3. Main program flowchart for the Automated Greenhouse Control System
Australian Society for Commerce Industry & Engineering www.scie.org.au 6
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Temperature Operation
T = Current Value of Temperature TL = Lower Limit of Temperature TU = Upper Limit of Temperature
T < TL?
Yes
No Turn OFF
Heater
Turn ON
Heater
T > TU?
Yes
No Turn Fan OFF
Turn Fan ON
Read State of Heater and Fan
End Temperature Operation
Figure 4. Flow Chart for Temperature Subroutine
LI = Current Value of Light Intensity
Light Intensity Operation
Li(L) = Lower Threshold for Light Intensity Li(U) = Upper Threshold for Light Intensity
LI < Li(L)?
No LI > Li(U)?
Yes
No Turn Light
ON
Turn Light
OFF
Read State of Light Hardware
End Light Intensity Operation
Figure 5. Flow Chart for Light Intensity Sub-routine
Australian Society for Commerce Industry & Engineering www.scie.org.au 7
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Relative Humidity Operation
RH = Current Value of Relative Humidity Rh(T) = Threshold Value for Relative Humidity
RH < Rh(T)?
Yes
No Deactivate Fogger
Activate Fogger
Read State of Fogger
End Relative Humidity Operation
Figure 6. Flow Chart for Relative Humidity Subroutine
Soil Moisture Operation
SM = Current Value of Soil Moisture Content Sm(T) = Threshold Value for Soil Moisture Content
SM < Sm(T)?
Yes
No Deactive Drippers
Activate Drippers
Read State of Drippers Hardware
End Soil Moisture Operation
Figure 7. Flow Chart for Soil Moisture Content Subroutine 3.
Results
A typical screenshot taken during program development and debugging is shown in figure 8. The top and bottom views of the system built on vero boards are shown in figures 9 and 10 respectively. The assembled system is shown in figure 11, while figure 12 shows the system mounted on a prototype greenhouse. The sensors/actuators station was set up on a bright sunny day and powered; a few seconds later the remote monitoring station started receiving and displaying information about the greenhouse conditions as shown in figure 13. The range of reliable transmission was around 40 m line-of-sight and 15 m with very thick and solid concrete walls posing as obstructions.
Australian Society for Commerce Industry & Engineering www.scie.org.au 8
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Figure 8. Typical Screenshot during Program Development
Australian Society for Commerce Industry & Engineering www.scie.org.au 9
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Figure 9. Top View of the System’s Circuit Board
Figure 10. Bottom View of the System’s Circuit Board
Australian Society for Commerce Industry & Engineering www.scie.org.au 10
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Figure 11. Assembled System with Sensors Connected
Figure 12. Prototype of Greenhouse with Automated System Mounted
Australian Society for Commerce Industry & Engineering www.scie.org.au 11
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online)
Figure 13. GUI Displaying Greenhouse Conditions
4.
Discussion
When the system was set up and tested, it was observed that the sensors/actuators station reacted well to restore optimum conditions each time any of the microclimatic parameters varied from the set thresholds. It was also observed that the communication between the two stations was reliable up to a line-of-sight distance of 40 m. This range can be improved by using XBee-Pro MODEMs or altering the network architecture. The system described in this work was constructed and mounted on a prototype greenhouse to demonstrate its workability. The control system described will be able to operate a practical greenhouse but the driver circuit may need relays that can handle the power required to drive the actuators in question. 5.
Conclusion
The automated greenhouse control system that has been successfully designed and built is this work is meant to protect seedlings in nurseries from intruders, and also grow them to maturity should the need arise using a very small area of land as opposed to open field cultivation which may require more square meters of land to produce the same amount of crops. This system produces healthier crops since pests Australian Society for Commerce Industry & Engineering www.scie.org.au 12
Australian Journal of Engineering Research ISSN: 2203-9465 (Print) ISSN: 2203-9473 (Online) are usually kept away from the greenhouse enclosure. The system’s reaction time to restoration of variations of microclimatic parameters suffers from a few seconds delay because of the program scan cycle and the electro-mechanical relays used. The system is fully automated as it does not require any form of adjustment from the user. The microclimatic parameters are also available at a remote terminal for the user to read and to monitor the performance of the greenhouse. References Wikipedia. 2014. Greenhouse. Accessed from: http://en.wikipedia.org/wiki/Greenhouse Okunola. A. I. 2013. Glasshouse Production of Vegetable and Ornamentals for Agricultural Production in Nigeria. World Science Research Journals, 1(3): 113-119. Sumit, K; Mohit; K; Aswani, K. and Praneet, G. 2012. Monitoring and Control of Greenhouse Environment. B.Eng. Project, Department of Electrical and Electronics Engineering, Bharat Institute of Technology, Meerut, India. Mahmoud, S. and Ala’a, I. 2013. Greenhouse Micro-climate Monitoring System based on Wireless sensor Network with Smart Irrigation. International Journal of Electrical, Computer, Electronics and Communication Engineering, 7(12): 1072-1077. Rahali, A; Guerbaoui, M; Ed-dahhak, A; El Afou, Y; Tannouche, A; Lachhab, A. and Bouchikhi, B. 2011. Development of Data Acquisition and Greenhouse Control System based on GSM. International Journal of Engineering, Science and Technology, 3(8): 297-306. Qiang, G. and Ming, C. 2008. Research and Design of Web-based Wireless Sensor Network Management System for Greenhouse. Proceedings of the International Conference on Computer and Electrical Engineering, Phuket, Thailand, 657-661. Mancuso, M. and Bustaffa, F. 2006. A Wireless Sensor Network for Monitoring Environmental Variables in a Tomato Greenhouse. Proceedings of International Workshop on Factory Communication Systems, Torino, Italy, IEExplore, 107-110. Banzi M. 2009. Getting Started with Arduino, O’Reilly media Inc, 2nd Edition, California. Melgar, E.R. and Diez, C.C. 2012. Arduino and Kinetic Projects: Design, Build, Blow Their Minds. California. Apress Media. p.10 Hobby Electronics. 2014. Humidity Sensor – http://www.hobbytronics.co.uk/humidity-sensor-hih4030
HIH4030
Breakout.
Vegetronix. 2014. VH400 Soil Moisture http://www.vegetronix.com/Products/VG400/
Sensor
Probe.
Accessed Accessed
from: from:
Javvin, W. 2007. Network Dictionary. Javvin Technologies Inc. Ed. Dong, J. California, USA. Gianfranco P. 2009. Battery Operated Devices and Systems: From Portable Electronics to Industrial Products, Elsevier Inc, San Diego, California, USA. Purdum J. 2012. Beginning C for Arduino: Learn C Programming for Arduino, Ed. Michelle L., Apress media, California.
Australian Society for Commerce Industry & Engineering www.scie.org.au 13