An Automated Irrigation System for Greenhouses

Gaza Strip is a small region with limited agriculture land and water resources. Greenhouse technology allows farmers to optimize the use of this land. In this paper a computer-based control and monitoring system is designed and tested to automate drip irrigation. The model greenhouse can be used as a prototype where several sensors are connected to an acquisition and control system using a PC and a data acquisition card. The designed system can be used as a stand-alone system by lay farmers with no technical background where they can command full control through a screen command. The system is set up to handle several crops by using a user screen to adjust certain parameters on the front panel. A web server enables users to remotely monitor and control the greenhouse through VI's from any place in the world with internet access. Moreover, the system periodically generates alarms and automatically sends emails to notify users of the conditions inside greenhouse.


Introduction
Greenhouse agriculture became popular in the last three decades. Greenhouse controlled environment provides a golden place to grow crops out of season and increase the crops' s productivity [1]. Greenhouse automation is the right tool to fully monitor and control the environment and has a dramatic social and economical impact. Greenhouses are translucent glass or plastic construction for hasting crops growth [2]. They allow for more effective use of water and daylight. Proper irrigation is key to improve quality and productivity of crops grown in greenhouses [3]. The time, duration, type and amount or irrigation are essential to optimize the use of water [4,5,6,7,8].
Different irrigation systems can be used such as: hand watering, overhead sprinkling system, movable irrigation boom, flood floor, drip irrigation, capillary mat, and hydroponics [9,10]. However, the drip irrigation is the most suitable for greenhouses in term of its efficient use of the available water. The soil moisture content determines the irrigation time; therefore, continuous monitoring is necessary to decide when to exactly start the irrigation.
Gaza Strip is located at the south eastern coast of the Mediterranean Sea (at 31 25 N, 34 20 E). As shown in Figure 1, it borders Egypt in the southwest and Israel in the south, east and north. Its area size totals 360 square kilometers such that it is stretched about 41 kilometers long (North-South), and from 6 to 12 kilometers wide (East-West). It has a total population of 2 million inhabitants (about 5000 inhabitants/km 2 ) [11].
The Gaza Strip is considered as a water deficient and water-stressed middle eastern region [12]. The Gaza Strip mainly dependent on its coastal aquifer that runs along the Mediterranean from the borders of Egypt to Haifa. The availability of water resources in Palestine has been a problem and totally dependent on the annual amount of rain. The estimated water quantities drained from and supplied to the aquifer indicate negative current net effect on water availability in Gaza coastal aquifer [13].  [14] Gaza suffers from regular drought, since Gaza rainy days average around 39 days per year with an average amount of rain about 372.1 mm/y [15]. This leads to deficit in the water budget which has been leading to deterioration in the quality and quantity of groundwater (EQA). The over-pumping of the aquifer leads to sea water intrusion, as shown in Figure 2, where the red color indicates dangerous level while color green indicates the safe level [14].
The scarce water and agriculture resources and the demands to meet urban expansion, put pressure on the agriculture industry to better optimize the use of these resources. This led to using modern irrigation technology and better use of the available land. Greenhouse technology has been utilized for the last three decades but with no monitoring systems, no control, and no data records of over-pumping and/or over-applying irrigation water. Using Monitoring and Control System can save an estimated 70% of excess irrigation water [16].  [14] Lack of data records on water usage in general, and irrigation water in particular makes it hard to move forward and optimize the use of water in the irrigation process. The low efficiency of water usage in the irrigation systems can be blamed on poor management of irrigation systems and lack of reliable monitoring systems. Moreover, lack of effective tool and modern equipment for better irrigation management makes it harder to measure improvement. The absence of accurate supervisory tools, makes this problem more complicated.
This paper presents an automatic drip irrigation system with monitoring and control features using SCADA technology. The irrigation is done based on the plants' needs and the automation process is done using PIC microcontroller technology. This paper is organized as follow: section 2 talks about water irrigation, section 3 covers SCADA systems, section 4 shows the system design while section 5 presents the results, and section 6 concludes this paper.

Irrigation Systems
Modern drip irrigation systems is used in greenhouses in Gaza Strip where water is supplied near the root zone of the plants drip by drip; thus, making optimal use of the available water. Currently, Gaza farmers have been using drip irrigation technique through manual control. This process sometimes consumes more water and sometimes irregularity in watering causes the crops to dry. Water deficiency can slow growth rate and lead to lighter weight fruit. This problem can be solved using automatic drip irrigation system in which the irrigation will take place only when the crops need to be watered.
Valves are used to turn irrigation ON and OFF and is automated using controllers and solenoids in order to provide the right amount of water at the right time. Thus, automation reduces over watering saturated soils and avoids irrigating at the wrong time of day. This paper divides the automation process into two parts: The first involves studying the basic components of irrigation system, while the second covers the design and implementation of the control circuitry.

Definition of Irrigation
Irrigation is defined as artificially applying water to the soil. It is mainly used in dry areas, controlled environment and in periods of dry seasons in order to protect plants against frost. There are three famous types of irrigation: localized irrigation, drip irrigation and sprinkler irrigation [17].
Drip irrigation allows water to drip slowly to the roots of plants using two ways: directly onto the soil surface or directly onto the root zone by using a network of valves, pipes, tubing, and emitters; thus, minimizing the amount used of water and fertilizer.

Drip Irrigation System
The drip irrigation supplied water to root zone of the plant more frequently, often daily, and slowly to maintain moist. Drip irrigation requires about half of the water needed by sprinkler or surface irrigation [18]. Plants can be supplied and consume water more efficiently. By keeping soil moist enough, plant foliage stays dry; thus, reducing disease and insect damage.

Design of Irrigation System
The following factors play major role in designing a mechanical model as detailed in [19]: • Flow: Amount of water available per hour that can be measured as liters per hour. Liters per minute x 60 minutes/hour = liters per hour.
• Pressure: Optimal operation pressure for irrigation products between 20-40 pounds. Normal household products operate between 40-50 pounds of pressure. • Water Supply and its Quality: The type of water source and its quality will determine the necessary type of filter. • Soil Classification: Soil can be classified based on its structure such as sandy, clay, and loamy. The type of soil will dictates the design of the water dripping system and its spread. Closer emitter spacing enables water to percolate vertically at a fast rate and horizontally at slower rate and this suitable for sandy soil. While in clay soil, water spreads horizontally covering a wider distribution area; thus, emitters can be spread out further apart. In loamy soil, water percolates evenly. Therefore, short and frequent cycles are best suited for clay soil or on a hillside, while higher gap emitters enable water to spread out horizontally and fit perfectly the sandy soil.

Platform
A SCADA system is a powerful solution for monitoring and control of remote processes. Automated greenhouses can use microcontrollers or relay switches but they may require high maintenance costs with minimal upgradeability. A SCADA system can be easily developed and upgraded; therefore, logging and archiving, report generation, and alarm handling are part of most SCADA software [20,21,22,23,24]. These features can be utilized centrally in greenhouse operations. The designed system can be completely operated by lay farmers; thus, making it more attractive.
The system is implemented using LABVIEW software produced by National Instruments with VI portability features [24,25,26,27]. This software is compatible with most SCADA software where coding is implemented at the block-diagram level while the front panel forms the visual interface to monitoring and control. The main front panel of an automated greenhouse is shown in Figure 3. This front panel forms the visual link between the operator and the system.

System Design
The hardware is presented first, then followed by the software. A full description of control of temperature, humidity, and irrigation using the front panel is described.

Hardware
A prototype greenhouse is designed where it is divided into two sections: the control room and the actual greenhouse. The control room contains the main host computer and corresponding modules and other circuitry. The control room is connected electrically and logically to all sensors, motors, pumps, valves, etc. The host is loaded with the DAQ software and the field points configured accordingly. The circuitry and field points are not transparent to the operator who uses the system through a touch-screen monitor. The prototype of the actual greenhouse is seen in Figure 4.  The used components are described as follow:

Tank capacity GP2D12 Infrared Sensor
The GP2D12, shown in Figure 5, is a distance measuring sensor with integrated signal processing and analog voltage output proportional to the measured distance from 4-80 cm. The sensor is resistant to ambient lighting, angle of reflection, and color of detected object [28]. It is used to measure the water level in tank so it can be determined if the tank is empty or full. If it is empty, a pump will be automatically turn on and fills the tank.

Temperature Sensor LM35
The LM35, shown in Figure 6, is a sensor that is used to measure temperature with an electrical output proportional to the temperature, C o . The LM35 does not require any external calibration and maintains an accuracy of +/-0.4 C o at room temperature and +/-0.8 C o over a range of 0 C o to +100 C o . The output voltage varies linearly with temperature. [29]. This sensor is utilized to measure the temperature of the greenhouse. The health of crop is dependent on suitable temperature; thus, high/low temperature leads a fan/heater to operate respectively to reach the desired value.

Humidity Sensor
The humidity sensor, shown in Figure 7, measures humidity of the greenhouse. Based on humidity level, high/low reading activates a fan to reach the desired value [30,31].

Valves
The valve, shown in Figure 8, needs 220V AC source to work. The valve will open to let water passes through it for irrigation purposes upon receiving a signal from computer. After the signal is turned off, the valve will close and water stops flowing [32].

Pumps
The used pump, shown in Figure 9, works at 12V DC. It pumps water from the tank if the water level is above a certain level. The tank is used to irrigate the plants in the greenhouse [33].

Moisture Scale
It is the device that measures the average moisture in the soil. It consists of a source of constant voltage connected in series with a constant resistance and a variable resistance which is the soil as illustrated in Figure 10. The variable resistance is conducted with the soil's resistance through Noresta poles. The electrical conduction in soil positively varies with the quantity of water in soil. The value of the soil resistance varies from 250MΩ for high moisture soil to 3GΩ for low moisture soil. We apply a 10 V voltage to the circuit, as the soil is being watered, the voltage value across the variable resistance varies. There is a direct relation between voltage and amount of water [34].

NI 6024E Data Acquisition Card (6024E DAQ)
The 6024E card contains 16 analog input channels, two analog output channels, a 68-pin connector and eight digital I/O lines. For time-related functions, the board utilizes NI DAQ-STC timing controller. The NI DAQ-STC uses control analog input, analog output, and general-purpose counter/timer functions. The functions utilize a total of seven 24-bit and three 16-bit counters and a maximum timing resolution of 50 ns. This board has Real-Time System Integration (RTSI) bus [35].

Analog Signals
Four analog signals are available in this design from: moisture scale, humidity sensor, level sensor, and temperature sensor. Table 1 shows pins and channels for analog signal entry of the DAQ.  Analog signals should go though stages like prefiltering, amplifying, sampling and quantizing in order to deal with computer.

Digital Signals
Eight digital signals are available for operating the pump, valves, and fan, as shown in Table 2.
The maximum voltage of the computer is 5 V which cannot run the output devices. As a result, a driver circuit is necessary. The pump and fan work at 12 VDC. As shown in Figure 11, the input is the signal which came from the computer so the relay can close the circuit of pump or/and fan. A valve is used for the water tank to irrigate the plants and works at 220 VAC.

Software
Processes that occur inside the greenhouse such as irrigation and the other factors that affect agriculture such as temperature, humidity, and light are considered here. We build our project "greenhouse1", shared variable and the VI's packages in project libraries. Each control process is in its own library as shown in Figure 12.
Upon opening the project, you should choose the crop in order to select the control process that belongs to that crop that you choose as insulated as Figure 13. After that you should choose the process as shown in Figure 14.

Temperature and HUMIDITY SYSTEM
The ideal ranges of temperature and humidity can be set through the front panel for any crops. The current value of temperature and humidity, are read through sensors, and are displayed. Based on these conditions, action is taken such as: e.g. if the temperature falls below a set value, then a heater is switched on. The designed system is an ON-OFF system but can easily be extended to a PID control system. The limit ranges can be preset or controlled using the front panel. The range can be changed by setting the end-point through the front panel itself. The LEDs represents the status of equipment control when the values exceed the acceptable range.
A fan is placed on the wall of the greenhouse or we can use a water pump to reduce the temperature of the greenhouse. A heater is used when the temperature is increased. The operator can also start or stop devices manually.
Foggers and dehumidifiers are equipment used to control electronically the humidity level within the greenhouse. The data can be archived for use later on.

Irrigation System
Automatic Irrigation is an essential tool for accurate soil moisture control in greenhouses. It provides simple means of accurately sensing the soil moisture levels and releasing the required amounts of water [28,29,30]. The removal of human error in estimating and adjusting available soil moisture levels enables the farmer to maximize net profits. First the level of water in tank will be measured using IR level sensor. If the water level is low then the EMPTY led will be turned on which give an order to the pump to switch on and fill the tank. If the tank level is high then the FULL led will be turned on. The moisture in the soil is measured using "moisture scale" and compared with the acceptable range. According to this test, the moisture considered to be LOW or HIGH. If the moisture scores LOW and the tank water is FULL, then a signal applied to the valve to open and release the water to irrigate the soil.

Stored Data
If you click on the button "previous data", a SubVI will be opened, as shown in Figure 15. SubVI contains a table of the stored data and the date and time of events. The user can convert this table to report to print or to change it to HTML to be used in webpage setting, as an example show in Figure 16.

Remote Panels
Users can gain access to the VI's to monitor and control them remotely from LabVIEW environment or from a web browser without any programming. The two access methods will be explained in the following subsections.

Using LabVIEW Program
To gain access to a remote panel from within LabVIEW, select Operate >> Connect to Remote Panel from the menu. This will open a dialog where you can enter your connection parameters, and connect to the server, as shown in Figure 17.
Once you are connected, the remote panel client window, as shown in Figure 18, will appear and you will be able to take control and use the VI.   At any time during this process, the host computer can take control of the application away from any of the remote clients. Figure 20 shows a remote front panel screen with a message when the server regained control. At that point, the client will be able to just monitor the situation until the server release control to the client.

Using Web Browser
Using a web browser in the client computer, the user enters the address of the remote panel. The, Right click on the panel and request control of VI, as shown in Figure 20. If access is authorized, control of the VI is granted, just as if running it from LabVIEW. The client can release control, from the panel's pop-up menu via the Remote Panel.
Client >> Release Control of VI option. Note that only one remote panel can be activated at any given time. Control of the VI front panel (the real VI's front panel) can be re-established, from the pop-up menu of the VI, by selecting the Regain Control option. The server can also lock out other panels from gaining control by choosing the Remote Panel Server >> Lock Control option.

email Notifications
In this system, the SMTP server of the Islamic University of Gaza was utilized. The e-mails are sent to IUG webmail account. In Figure 21, the temperature goes to a high value so the user get an email indicating that.

Conclusion
A greenhouse was designed to achieve optimal irrigation and growth factors. In this paper, a computerbased control and monitoring system was designed and tested to automate drip irrigation. The model greenhouse was used as a prototype and used several sensors and was connected to an acquisition and control system using a PC and a data acquisition. The designed system also controlled humidity, temperature, and irrigation. The developed system can be used as a stand-alone control and monitoring system for novice farmers with no technical background.
The system can be programed to work with any crop by simply adjusting certain parameters on the front panel of a user screen. The fully automated greenhouse had a control room for monitoring and governing. A web server was placed in the control module of the greenhouse and it can be controlled remotely from any place in the world. Moreover, the system periodically generates alarms and automatically sends emails to notify users of the conditions inside greenhouse.
Future work may involve implementing the system on real life environment and using emails and SMS for monitoring and control, using image processing technology and using PLC technology.