You are on page 1of 69

Greenhouse Monitoring

System Using GSM


Final Graduation Project (2)

2014

Greenhouse Monitoring System Using GSM

Prepared by:
Asma Ghannam and Maram Azzam

Submitted to:
Jamal Kharrousheh

Report presented in Partial Fulfillment of the Requirements


for Bachelor degree in telecommunication engineering
Project II (69590)

Departments of Telecommunication and Electrical


Engineering
Faculty of Engineering
An-Najah National University

April , 2013



. "
"


.




.
) ( .



) (
)
(.

Contents
ABSTRACT............................................................................................................... 4

CH1. INTRODUCTION................................................................................................ 5
1.1
1.2
1.3
1.4
1.5

OVERVIEW...................................................................................................... 5
BENEFITS OF GREENHOUSES AND SMART GREENHOUSE................................................6
OPERATION SYSTEM........................................................................................... 7
OPJECTIVES AND MOTIVATIONS.............................................................................7
REPORT ORGANIZATION.....................................................................................8

CH2. STANDARDS AND CONSTRAINTS.......................................................................8


2.1 CONSTRAINTS..................................................................................................... 8
2.1.1 Strengths................................................................................................ 8
2.1.2 Weaknesses............................................................................................8
2.1.3 Opportunities..........................................................................................8
2.1.4 Threats................................................................................................... 9
2.2 STANDARDS..................................................................................................... 9
2.2.1
IEEE standards...................................................................................9
2.2.2
GSM standards...................................................................................9
2.3 EARLIER COURSEWORK........................................................................................14
CH3. LITERATURE REVIEW......................................................................................16
3.1 INTRODUCTION............................................................................................... 16
3.1.1 Arduino.................................................................................................. 16
3.1.2 GSM Module............................................................................................. 18
3.1.3 Push Button Switch......................................................................................20
3.1.4 Sensors..................................................................................................... 21
3.1.5 Valve..................................................................................................... 24
3.1.6 Fan....................................................................................................... 24
3.1.7 Light..................................................................................................... 25
3.1.8 Relays.................................................................................................... 26
3.1.10 Pump................................................................................................... 26
3.1.9 Liquid Crystal Display (LCD)......................................................................27
3.2 SIMILAR GREENHOUSE AUTOMATED SYSTEM..........................................................28
3.3 PROPOSED SYSTEM..........................................................................................29
CH4. METHODOLOGY AND IMPLEMENTATION..........................................................30
4.1 INTRODUCTION............................................................................................... 31
4.2 SIGNAL DETECTION..........................................................................................32
4.2.1 Light Dependent Resistor............................................................................32
4.2.2 Humidity and Temperture Sensor..................................................................34
4.2.3 Soil Moisture sensor..................................................................................35
4.3 HARDWARE CONTROLLING.................................................................................35
4.3.1 Push Button Switch...................................................................................40
4.3.2
Interfacing LCD with Arduino............................................................41
4.4 SMS SERVICE FOR GREENHOUSE CONTROLLING.......................................................42
4.4.1
Interfacing GSM with Arduino...........................................................42
4.4.2
SIM Interface.....................................................................................42
4.5 SOFTWARE DESCRIPTION...................................................................................43
CH5. RESULTS AND DISCUSSION..............................................................................44
CH6. CONCLUSIONS AND RECOMMENDATION..........................................................57
REFERENCES.......................................................................................................... 57

List Of Figures
Y

FIGURE 1.1 PROPOSED MODEL OF GREEN HOUSE SYSTEM..........................7


FIGURE 1.2 GENERAL FLOW DIAGRAM OF SYSTEM.....................................8
FIGURE1.3 INPUT-OUTPUT OF OUR SYSTEM..............................................8
FIGURE 3.1 TMEGA 2560..................................................................17
FIGURE 3.2 ARDUINO PIN MAPPING......................................................18
FIGURE 3.3 GSM MODEL HAVE SPECIFIC INTERFACE WITH ARDUINO............20
FIGURE 3.4 SIM ELECTRICAL CHARACTERISTICS......................................21
FIGURE 3.5 PUSH BUTTON..................................................................21
FIGURE 3.6 LDR RESISTOR.................................................................22
FIGURE 3.7 LDR CIRCUIT....................................................................22
FIGURE 3.8 RHT03 SENSOR...............................................................23
FIGURE 3.9 RHT03 AND LDR SENSORS...............................................23
FIGURE 3.10 SOIL MOISTURE SENSOR...................................................24
FIGURE 2.11 VALVE...........................................................................25
FIGURE 3.12 FAN..............................................................................26
FIGURE 3.13 LIGHT...........................................................................27
FIGURE 3.14 RELAYS.........................................................................27
FIGURE 3.15 PUMP............................................................................28
FIGURE 3.16 LCD.............................................................................28
FIGURE3.17 TOP GREENHOUSE'S PROJECTS AROUND THE GLOBE................30
FIGURE 3.18 BLOCK DIAGRAM OF SYSTEM..............................................31
FIGURE 4.1 PROJECT IDEA...................................................................32
FIGURE 4.2 SYSTEM PROCESS..............................................................33
FIGURE 4.3 SENSOR CONNECTION.........................................................33
FIGURE 4.4 LDR AND ARDUINO CONNECTION.........................................34
FIGURE 4.5 LDR INTIER CIRCUIT..........................................................35
FIGURE 4.6 SENSOR INTERFACE............................................................35
FIGURE 4.7 HUMIDITY AND TEMPERTURE SENSOR INTERFACE.....................36
FIGURE 4.8 SOIL SENSOR CIRCUIT DIAGRAM...........................................36
FIGURE 4.9 DEVICE CONNECTION.........................................................37
FIGURE 4.10 OVERALL FLOW CHART FOR ARDUINO..................................38
FIGURE 4.11 FLOW CHART OF SWITCH CONTROL.....................................39
FIGURE 4.12 FLOW CHART FOR TEMPERATURE SENSOR.............................40
FIGURE 4.13 FLOW CHART FOR SOIL.....................................................41
FIGURE 4.14 FLOW CHART FOR PHOTOCELL SENSOR................................41
FIGURE 4.15 PUSH BUTTON SWITCH CIRCUIT..........................................42
FIGURE 4.16 LCD CONNECTION...........................................................43

FIGURE 4.17 LCD INTERFACE..............................................................43


FIGURE 4.18 GSM INTERFACE.............................................................44
FIGURE 4.19 SIMULATION DESIGN........................................................45

List Of Tabels
TABEL
TABEL
TABEL
TABEL
TABEL
TABLE
TABEL
TABEL
TABLE

2.1 GSM FREQUENCY BANDS.....................................................10


2.2 PROJECT SPECIFICATIONS......................................................13
2.3 RELAYS............................................................................13
2.4 ARDUINO DETAILS...............................................................13
2.5 PRELIMENTRY PARTS LIST.....................................................14
3.1 ARDUINO DETAILS...............................................................18
3.2 SIM PIN DESCRIPTION.........................................................19
3.3 SIM ELECTRICAL CHARACTERISTICS.......................................20
3.4 PIN DEFINITION.................................................................23

Abstract
The system proposed in this project is Green House which is a smart technology to
provide plants and trees the required nourishment from the sunlight and to prevent the
same from the harmful effects.

System components used are Humidity & temperature sensor, soil moisture sensor,
temperature sensor, light sensor, Transistor switches, relay nodes for automatic control,
and arduino to control greenhouse information. The system is implemented using low
power wireless components, and easy to install . To make this more efficient a GSM has
been linked with the system.
A model of greenhouse is achieved .It was possible to do control plant growth through
closely studying relationship between indoor environmental information and monitored
information on crop itself. It is made possible to collect information and control
effectively and automatically greenhouse in the site or from a remote place through
GSM modem.

Ch1. Introduction
1.1

Overview

A greenhouse is a structure with a glass or plastic roof and frequently glass or plastic
walls ; the incoming solar radiation from the sun warms plants, soil, and other things
inside the building [1]. Moreover , a greenhouse protects and a controlls environment
for raising plants indoors. As we know, most of the gar-dener uses manual system of
watering to their plant in the garden and also in the greenhouse. This system is
inefficient since when we manually do this, the possibility to get some plant can
drown.In order to overcome this problem, automatic greenhouse used .

The greenhouse automatic control system will fully automate the management of a
greenhouse using the latest pervasive systems and technology. The proposed system
controls and monitors light intensity, soil and air humidity using a Arduino and GSM
modules.
A temperature sensor, humidity sensor, soil moisture and light sensor which are
automatically controlled are used in our project . The concern with a lot of consumer
needs and demand for the agriculture products has stimulated awareness among the
farmer that increases their products in the market by implementing advance
technologies in this industry.
This project uses sensors and Global System for Mobile Communication (GSM) and
short message service (SMS) to carry out data from the green house with sensors
directly alert the farmers to their mobile phone. Therefore, this makes controlling plants
easier by directly sending alert notification messages to farmers using GSM and SMS
technology. So, this project aims to design a smart greenhouse model controlled
automatically by a keypad. Parameters like humidity, temperature and lightning will be
controlled by ARDUINO UNO microcontroller. Each of these parameters is measured
by a sensor that is set at a specific range, if this sensor signals any change in that range,
the system will take the appropriate action required, and the system sends a daily report
to the user by SMS.

Figure 1.1 Proposed Model of Green House System

Figure 1.1. denote that the main system identified the hazardous condition then GSM
modem activated and send the message to another modem which is connected to
computer system and Computer system store the log of SMS received and send and
New SMS send to first GSM and after receiving SMS, main unit can starting the
operation on green house system.

1.2

Benefits of greenhouses and smart greenhouse

Benefits of greenhouses
Greenhouses allow you to control the temperature and humidity, a manipulation that
allows you to grow vegetables year round. In these closed microcosm, you can mimic
the climate of any section of the world. You also have more control of the climate,
.leading to better crops [2]
Benefits of smart greenhouses
1. Saves money, time, and effort.
2. Provides a better environment to the plant to prevent it from damage and to
increase its productivity.
3. Some plants require a longer period of lighting than other plants; the smart
greenhouse will provide the right amount of lighting.
4. Automatically controls the amount of water needed for each plant.

1.3

Operation system

This system measures input levels by various sensors; each sensor will be calibrated to a
preprogrammed level.
Many items are measured by the sensors; each one is processed separately and then
provides a suitable output that runs one of the mechanic systems to adjust this measured
value.
The following diagram explains that if the main system detects the signal, system will
analyzed the signal and detect the problem then send SMS message to system that will
start its operation to prevent the hazards[3] .

Figure 1.2 General flow diagram of system

1.4

Opjectives and Motivations

Design a hardware unit of the prototype of the system that is monitoring and controlling
the greenhouse environment and build a small greenhouse model :

Arduin
o
&GSM
system

Temperature
Irrigation
Light
Sprinkler
System

Fan
Soil moisture
Humidity
Light sensor

Figure1.3 Input-Output of our system

1.5

Report Organization

We organised our report as follows. The second chapter mentions the standards ,
strength and weakness points. Chapter three highlights literature review .After that in
chapter four a full description will made on experimental methods taken by using
flow charts for the system procedure and approximate design simulation for the
system . Then results and analysis will be shown and discussed .Finally, conclusion
and our recommendations.

Ch2. Standards and Constraints


Constraints 2.1
2.1.1 Strengths
This project is a pioneer in Palestinian agri -business.The owners are very
experienced in the agricultural sector.

Regarding the implementation, Arduino programming is easy concept to deal with


The project finally done .

2.1.2 Weaknesses
Modeling the greenhouses could face some limitations :
a. The tools we are dealing with are very sensible , they need to
be carefull and so the project may be a bit costly.
b. Failure to supply the essential factors for optimum growth
such as light, moisture, carbon dioxide and heat in amounts
necessary for each individual crop and this problem faces
greenhouses in general .
c. Palestine still faces a problem in marketing the plants.

2.1.3 Opportunities
Greenhouses represent a means of greatly improving agricultural production .There is
increasing demand for natural medical remedies.

2.1.4 Threats
1. The possible deterioration in the political and security situation in the
Palestinian territoriesThere is competition from non-natural products.
2. There is a lack of overall planning in the Palestinian agricultural sector.

Industry Highlights:
Greenhouses are rapidly gaining momentum in Palestine. Farmers are increasingly
aware of the benets of planting under greenhouses.
Greenhouses yield more production per m than open farming. Currently there is no
local provider of suitable plastic sheets so they are imported from Israel. With
approximately 25,000 hectares of agricultural land in Palestine, there is a large
potential for this factory to satisfy the market.

Strategic Benets to Palestine:

The project will strengthen the agricultural sector in Palestine.Moreover, this will
generate 20 permanent jobs in manufacturing.

Standards

2.2

IEEE standards

2.2.1

Since greenhouse automation is a very specific and not widely recognized topic there
.are currently no IEEE standard governing greenhouse automation

2.2.2

GSM standards

GSM (Global System for Mobile communications) is an open, digital cellular


technology used for transmitting mobile voice and data services. GSM differs from
first generation wireless systems in that it uses digital technology and Time Division
Multiple Access (TDMA) transmission methods. GSM is a circuit-switched system
that divides each 200kHz channel into eight 25kHz time-slots. GSM operates in the
900MHz and 1.8GHz bands in Europe and the 1.9GHz and 850MHz bands in the US.
The 850MHz band is also used for GSM and 3GSM in Australia, Canada and many
South American countries. GSM supports data transfer speeds of up to
9.6 kbit/s, allowing the transmission of basic data services such as SMS (Short
Message Service). Another major benefit is its international roaming capability,
allowing users to access the same services when travelling abroad as at home. This
gives consumers seamless and same number connectivity in more than 210 countries.
GSM satellite roaming has also extended service access to areas where terrestrial
.coverage is not available[4]
Global System for Mobile Communications. The first European digital standard,
developed to establish cellular compatibility throughout Europe. It's success has
spread to all parts of the world and over 80 GSM networks are now operational. It
operates at 900 MHz.
Tabel 2.1 GSM frequency bands

Type
GSM850

Channels
128-251

Uplink[MHZ]
824-849

Downlink[MHZ]
869-894

GSM 900
Classical extended

0-124,955-1023
124channels
channels 49+
512-885

876-915
890-915
880-915
1710-1785

921-960
935-960
925-960
1805-1880

GSM 1800

GSM1900

512-810

1850-1910

1930-1990

GSM-R
Exclusive

955-1024
0-124
channels 69

876-915
876-880

921-960
921-925

Additionally:GSM400(also named GSM 450 or GSM 480 at 450-458/460-468 or479-486/489 -464MHZ)


-.Note: frequency ranges may vary depending on the country
Channels at the lower/upper frequency edge of the frequency .bands are typically not used[5]

GSM radio frequency spectrum


In the frequency range specified for GSM-900 System mobile radio networks, 124
frequency channels with a bandwidth of 200 KHz are available for both the uplink
and downlink direction. The uplink (mobile station to BTS) uses the frequencies
between 890 MHz and 915 MHz and the downlink (BTS to mobile station) uses the
frequencies between 935 MHz and 960 MHz. The duplex spacing, the spacing
between the uplink and downlink channel, is 45 MHz. The E-GSM band adds 50
frequency channels and the R-GSM another 20 frequency channels to the spectrum.
For the specific channel number to frequency mapping refer to the table
.on
the
next
page
In the frequency range specified for GSM-1800 System mobile radio networks, 374
frequency channels with a bandwidth of 200 KHz are available for both the uplink
and downlink direction. The uplink uses the frequencies between 1710 MHz and 1785
MHz and the downlink uses the frequencies between 1805 MHz and 1880 MHz. The
.duplex spacing is 95 MHz[6]

Multiple access techniques


In cellular and cordless terminology the three main types of multiple access used to
divide the radio frequency spectrum between the cell site radios and the mobile
:stations are
:Frequency Division Multiple Access (FDMA)
.Each call is carried on a separate frequency channel
:Time Division Multiple Access (TDMA)
Each frequency channel is further divided into a set of timeslots; each timeslot carries

.the data of a voice call


:Code Division Multiple Access (CDMA)
A spread-spectrum technology is used, in which the radio signals associated with a
call are spread across a single broad frequency spectrum (1.25 MHz). Each call in the
spectrum is differentiated from other calls in that spectrum by assigning a unique code
to each call's signal. At the receiving end (mobile station or cell site), the specific
call's signal is isolated by decoding the full received signal using the code assigned to
.that call's signal[7]

Multiplexing techniques
:The two multiplexing techniques used in cellular and cordless terminology are
Frequency Division Duplexing (FDD)
In FDD two symmetric frequency bands are used, one containing the uplink channels
.and the other the downlink channels
Time Division Duplexing (TDD)
TDD means that the uplink of the voice call is time multiplexed on the same
.frequency channel as the downlink of the voice call[8]

Coding techniques
In wireless networks, however, digital transmission cannot be used. Here, the binary
bit-stream has to be translated into an analog signal rst . The three basic methods for
this translation are

amplitude shift keying (ASK) the most simple digital modulation scheme.
The two binary values, 1 and 0, are represented by two different amplitudes.
frequency shift keying (FSK) . The simplest form of FSK, also called binary
(BFSK), assigns one frequency f1 to the binary 1 and another frequency f2 to
the binary 0
phase shift keying (PSK) uses shifts in the phase of a signal to represent data

GSM Data Rates

GSM Data Rates are Global.The standard of maximum data rate in GSM is
9.6 kbps.
GSM data rates with GPRS are in all operator cases across the globe
are between 30-40kb/s.
CDMA 1X user data rates vary from up to 90kb/s in a fragmented Korean
market where they have a mixture of proprietary solutions to 43kb/s in the US,
which has been measured by Nokia
GSM/EDGE user data rates will be 80-100kb/s with the first handsets and then
160 to 200kb/s by end of 2003
WCDMA networks are already in working trials and the terminals have passed
regulatory type approval (dual mode) in Europe and Japan
Immediacy of service will have the biggest impact on the network load and
impact costs[9].

DEVICE

ACCURACY

UNITS

RANGE UNITS

RESOLUTION

UNITS

12V Main
Supply
5V Switching
supply
RHT-22 humidity
& temperatur
sensor

volts

500mA min

5.

volts

mA min 250

2
1

%
digree

mA
1-1.5

A
40-50

standby
current

Tabel 2.2 Project specifications

Tabel 2.3 Relays

DEVICE

SWITCHING VOLTAGE

SWITCHINGCURRENT

Relays:

277VAC

10A

125VAC

12A

Tabel 2.4 Arduino details


Microcontroller

ATmega2560

Operating Voltage
Input Voltage (recommended)
Input Voltage (limits)
Digital I/O Pins
Analog Input Pins
DC Current per I/O Pin
DC Current for 3.3V Pin
Flash Memory
SRAM
EEPROM
Clock Speed

5V
7-12V
6-20V
54 (of which 15 provide PWM output)
16
40 mA
50 mA
256 KB of which 8 KB used by bootloader
8 KB
4 KB
16 MHz

Device

Tabel 2.5 Prelimentry parts list


Price
Number

Total price

Power supply

19.99$

19.99$

Arduino Mega

100$

100$

GSM modem

100$

100$

Soil moisture
sensor
Humidity &
temprature
sensor

17$

17$

18$

18$

LDR sensor
LCD

14$
15$

1
1

14$
15$

Fan

15.5$

5.5$

Valves

11$

22$

LEDs

0.3$

15

4.5$

Push button
switch
Resistances

1$

4$

0.5$

2.5$

Transistors

1$

5$

Transformer

1.5$

6$

relay

1$

5$

The outer body


of the house
Control Box

40$

40$

20$

20$

Boards

11$

11$

: The total cost is

2.3 Earlier coursework


This project mainly based on Electrical Measurements and Sensors , Electronic
circuits and Cellular Communication Systems courses . Electrical Measurements and
Sensors cource since this project depends alot on knowledge of sensors types and
their functions . Cellular Communication Systems course helps to understands the
background of GSM system that definitely used in this project . In addition , we used
the papers on internet and specialized books to understand how the system works and
other sites that talking about the plants and the suitable growth conditions.

Ch3. Literature Review

3.1

Introduction

Greenhouse Automation Solution which senses, processes and stores


temperature values. Managing temperature by comparing the measured values
with the expected ones and take action if it is necessary. The solution aims are
flexibility, maintainability and usefulness. Following terms associated with it
and infused into the system.
3.1.1 Arduino
Arduino is an open-source electronics prototyping platform based on flexible,
easy-to-use hardware and software. It's intended for artists, designers, hobbyists,
and anyone interested in creating interactive objects or environments
Arduino can sense the environment by receiving input from a variety of sensors
and can affect its surroundings by controlling lights, motors, and other actuators.
The microcontroller on the board is programmed using the c++language .Arduino
projects can be stand-alone or they can communicate with software running on a
computer (e.g. Flash, Processing, MaxMSP)[10].

Memory
The ATmega2560 has 256 KB of flash memory for storing code (of which 8 KB is
used for the boot loader), 8 KB of SRAM and 4 KB of EEPROM (which can be
read and written with the EEPROM) and that is enough of our system

Figure 3.1 TMega 2560

Power

The Arduino Mega can be powered via the USB connection or with an external
.power supply. The power source is selected automatically
External (non-USB) power can come either from an AC-to-DC adapter (wallwart) or battery. The adapter can be connected by plugging a 2.1mm centerpositive plug into the board's power jack. Leads from a battery can be inserted
.in the Gnd and Vin pin headers of the POWER connector
The board can operate on an external supply of 6 to 20 volts. If supplied with
less than 7V, however, the 5V pin may supply less than five volts and the board
may be unstable. If using more than 12V, the voltage regulator may overheat
. and damage the board. The recommended range is volts

: The power pins are as follows

Figure 3.2 Arduino Pin Mapping

VIN. The input voltage to the Arduino board when it's using an external
power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage
via the power jack, access it through this pin.

5V. This pin outputs a regulated 5V from the regulator on the board. The
board can be supplied with power either from the DC power jack (7 - 12V), the
USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage
via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We
don't advise it.

3V3. A 3.3 volt supply generated by the on-board regulator. Maximum


current draw is 50 mA.
GND. Ground pins.
IOREF. This pin on the Arduino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the
IOREF pin voltage and select the appropriate power source or enable voltage
translators on the outputs for working with the 5V or 3.3V[11].
Arduino details
Table 3.1 Arduino details

Microcontroller
ATmega2560
Operating Voltage
5V
Input Voltage (recommended)
7-12V
Input Voltage (limits)
6-20V
Digital I/O Pins
54 (of which 15 provide PWM output)
Analog Input Pins
16
DC Current per I/O Pin
40 mA
DC Current for 3.3V Pin
50 mA
Flash Memory
256 KB of which 8 KB used by boot loader
SRAM
8 KB
EEPROM
4 KB
Clock Speed
16 MHz

3.1.2 GSM Module


A GSM modem is a wireless modem that works with a GSM wireless network.

A wireless modem behaves like a dial-up modem. The main difference between
them is that a dial-up modem sends and receives data through a fixed telephone
line while a wireless modem sends and receives data through radio waves. Like
a GSM mobile phone, a GSM modem requires a SIM card from a wireless
carrier in order to operate.

Figure 3.3 GSM model have specific interface with Arduino

GSM modem is a specialized type of modem which accepts a SIM card, and
operates over a subscription to a mobile operator, just like a mobile phone. From
the mobile operator perspective, a GSM modem looks just like a mobile
phone;GSM modems can be a quick and efficient way to get started with SMS,
because a special subscription to an SMS service provider is not required.In most
parts of the world, GSM modems are a cost effective solution for receiving SMS
messages, because the sender is paying for the message delivery[12]

SIM Interface
Tabel 3.2 SIM Pin Description
# Pin
Pin name
29
SIM_DA
27
SIM_CLK
21
SIM_RST
51
SIM_VCC

Type
I/O
O
O
P

SIM serial data

SIM Pin Description


SIM card connection:

1- SIM_VCC need add three capacitor: 4.7uF, 0.1uF, 27pF.


2- SIM_RST, SIM_DATA, SIM_CLK lines also need add 27pF capacitor for each
line.
3- SIM_DATA need to Pull-up with 2K resistor to SIM_VCC.

Figure 3.4 SIM Electrical Characteristics

Power Supply Description for GSM


The power supply is one of the key issues in the designing GSM terminals. Due to
the 577us radio burst emission in GSM every 4.615ms, power supply must be able
to deliver high current peaks in a short time. During these peaks, ripples and drops
on the supply voltage must not exceed a certain limit [13].

# PIN
1,3,5,7

Tabel 3.3 SIM Electrical Characteristics


V min
V nom
V max
3.3V
3.6V
4.2V

Ripple max
50mVpp for
f<200KHz
2mVpp for
f>200kHz

When supplying the module with a battery, the total impedance (battery +
protections + PCBS) should be less than 150mOhms.

3.1.3 Push Button Switch

In our project will be used push button switch to insert the values of variable
( high temperature value, low temperature value, high relative humidity value ,low
relative humidity value ,period of light need and the time GSM send sms report)
[14].

Figure 3.5 Push button

3.1.4 Sensors
Sensor is a device which measures a physical value and converts it into a signal
which can be read by instrument.
LDR- Light Dependent Resistor
Light Dependent Resistors (LDR sensor) used to measure amount of light, LDR
are very useful in light/dark sensor circuits, felled on it and send at output
analog value to be convert to digital by ADC device. LDR device has a
resistance which varies according to the amount of light falling on its surface.
Since LDR is extremely sensitive in visible ligh range[15].

Figure 3.6 LDR resistor

Figure 3.7 LDR circuit

Humidity and Temperature Sensor RHT03


The RHT03 is a low cost humidity and temperature sensor with a single wire
digital interface. The sensor is calibrated and doesn't require extra components
so you can get right to measuring relative humidity and temperature[16].
Features:

3.3-6V Input

1-1.5mA measuring current

40-50 uA standby current

Humidity from 0-100% RH

-40 - 80 degrees C temperature range

+-2% RH accuracy

+-0.5 degrees C

Figure 3.8 RHT03 sensor

Figure 3.9 RHT03 and LDR sensors

Soil Moisture Sensor


This Moisture Sensor can be used to detect the moisture of soil or judge if there
is water around the sensor, let the plants in your garden reach out for human
help. They can be very easy to use, just insert it into the soil and then read it.
With the help of this sensor, it will be realizable to make the plant remind you :
hey, i am thirsty now, please give me some water[17].
It has the following Features :
1)module plant waterer device, so that the plants in gardens are without people
to manage
2)Adjustable sensitivity by adjusting the digital potentiometer (shown in blue)
3)Operating voltage:3.3V~5V
4)Dual output mode,analog output more accurate.
5)A fixed bolt hole for easy installation
6)Panel PCB Dimension: 30mm * 16mm
7)Soil Probe Dimension:60mm*30mm
8)With power indicator (red) and digital switching output indicator (green)
9)Having LM393 comparator chip, stable

Figure 3.10 Soil Moisture sensor

Table 3.4 Pin definition

3.1.5

Pin

Definition

VCC

5V

GND

GND

DO

Digital output interface (0 and 1)

AO

Analog output interface

Valve

We will use electric solenoid water valve 24v DC, orbit brand featured, the current
recommended valve is
this little unit from Orbit. There are many type of this valve (latching / nonlatching), but all type use 24v
DC. This valve has standard headphones plug (1/8in). So we just use a standard
audio jack connecting this valve to system we need.

Figure 2.11 Valve

3.1.6

Fan

To maintain plant health during warm summer months, fans and air coolers
should be used. It will be used in our project for cool climate inside the
greenhouse. So we will use the fan that use in pc computer for mini model, Fans
are available in many sizes and capacities. Typically square 120mm and this fan
cool vary good use in power supply and there many size for example (140mm) and
may we use it.
Air pressure is most important for cooling. It indicates cooling power per unit area.
If the diameter of fan is constant, than more air pressure indicate more air flow.
This fan need 12V DC voltage to run then we will use relay to provide it voltage
that need .

Ventilation in greenhouses, horticulture buildings, plant nurseries and garden


centers controls several environmental factors by diluting inside air with outside
air. Ventilation systems affect:

Air temperature
Moisture level
Moisture condensation on surfaces
Air temperature uniformity
Air speed across plants
Odor and gas concentrations
Airborne dust and disease organism levels
Combustion fumes from un-vented heaters [18].

Figure 3.12 Fan

3.1.7

Light

Being able to control the outdoor lighting in your garden, your greenhouse or your
allotment should be viewed as just as important as being able to control

temperature, ventilation and humidity. Outdoor lighting can be used to provide you
with more time in the greenhouse or it can be used to affect the growth of your
plants.

Greenhouse lighting is designed to provide good general illumination allowing


you to work in your greenhouse when it's dark outside. Also known as
supplementary lighting, greenhosue lighting can also be used to increase day
length during those parts of the year when it starts to get dark earlier - the winter
and spring months.
Grow lighting is designed specifically to help the growth of your plants and is
often used to 'force' plants to flower out of season. This makes grow lighting more
sophisticated than supplementary lighting, with the quality of light produced by
grow lights being more closely controlled than supplementary lighting in your
greenhouse [19].

Figure 3.13 Light

3.1.8

Relays

A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet
to open or close one or many sets of contacts. Because a relay is able to control an
output circuit of higher power than the input circuit.

Figure 3.14 relays

3.1.10

Pump

Greenhouse Pumps can be used to move large quantities of water from one place
to another - for example you could fill your water butt with water taken from a
well, river or stream. Where water pressure is poor or mains water is not available,
a pump can be used to take stored water, increase the pressure, and deliver the
water to your plants via a hosepipe. Greenhouse Pumps can also be used to take
water from a tank or water butt to increase the water pressure to run an Overhead
Spray Kit or a Deluxe Misting Kit[20]. The pump we use works at 12V DC.

Figure 3.15 pump

3.1.9

Liquid Crystal Display (LCD)

In our project will be used LCD (type Basic 16x2 Character LCD a liquid crystal
display (LCD) is a thin,
flat display device made up of any number of color or monochrome pixels arrayed
in front of a light

source or reflector. Each pixel consists of a column of liquid crystal molecules


suspended between
two transparent electrodes, and two polarizing filters, the axes of polarity of
which are perpendicular to
each other. Without the liquid crystals between them, light passing through one
would be blocked by
the other.
The liquid crystal twists the polarization of light entering one filter to allow it to
pass through the
other. They have a standard ASCII set of characters and mathematical symbols.
For an 8-bit data bus,
the display requires a +5V supply plus 11 I/O lines. For a 4-bit data bus it only
requires the supply lines
plus seven extra lines. When the LCD display is not enabled, data lines are tri-state
and they do not
interfere with the operation of the microcontroller [21].

Figure 3.16 LCD

The LCD also requires 3 control lines from the microcontroller:


1. Enable (E) :
This line allows access to the display through R/W and RS lines. When this line .Is
low, the
LCD is disabled and ignores signals from R/W and RS. When (E) line is High, the
LCD checks the state of
the two control lines and responds accordingly.
2. Read/Write (R/W):
This line determines the direction of data between the LCD and microcontroller.

When it is low, data is written to the LCD. When it is high, data is read from the
LCD .Writing data to the
LCD is done in several steps:
o Set R/W bit to low
o Set RS bit to logic 0 or 1 (instruction or character)
o Set data to data lines (if it is writing)
o Set E line to high
o Set E line to low

3.2

Similar Greenhouse Automated System

Through our search at a similar system work at the same way of our system, we
are found only one company in the Middle East Al-khaizaran project has
. automatic irrigation systems that were installed by this company

After several researchs about projects related to greenhouse , we found a


specialized company in Israel called Top Greenhouses Ltd. It is one of the
leading companies providing a wide range of turn-key agricultural projects and
.solutions for growers, retail chains and investors around the globe
The Company embraces a forward-thing approach to agriculture: it must be
economical, environmentally-friendly and efficient, while shortening the
distance from the greenhouse to the grocer. As a result, Top Greenhouses invests
a great deal of thought and planning into each project to ensure it delivers the
.maximum yield - both agriculturally and economically
Employing an experienced staff of professionals with a variety of specialties in
cultivation and agricultural technologies, Top Greenhouses works closely with
growers to assess their needs and objectives, to evaluate site climate conditions
and crop growth requirements. Each project is then tailored to the customer?s
.specifications, budgeted and implemented
Maintaining the high quality of its projects, the company produces its own steel
products for the construction of greenhouses, using the most advanced
technologies in the world. A subsidiary of Elyahu Zalman and Sons Ltd. Group,
specialists in the design and production steel pipes and profiles for more than 50
years, Top Greenhouses benefits from a continuous supply of high-quality raw
material and the professional, in-house preparation of standard and customized
.assembly parts, which are prefabricated and easily assembled on site
Top Greenhouses closely supervises its projects from the feasibility study
through delivery, providing professional counseling and guidance to the client at

every stage along the way. Project delivery is a significant milestone, but Top
Greenhouses continues its involvement through the first growing cycle, to
.ensure the continued success of the project
Experienced in establishing profitable projects in a wide range of environmental
conditions, Top Greenhouses is eager to share its expertise with clients globally,
including in developing countries, those with severe water shortages and places
.where healthy food sources are needed most [22]
This company offers a map showing the distribution of projects related to
: GreenHouse the around the world

Figure3.17 Top Greenhouse's projects around the globe

3.3

proposed system

In our system, will be solve this problems by make a system controlled more than one
parameter not only irrigation, and in our system the farmer get report about the condition
in the greenhouse by receiving text message at his mobile.
The system below measures the values of temperature, humidity, light, and soil
moistures in the greenhouse by sensors and sends the data that was measured to the
Arduino. The Arduino processes the data and controls the fan, irrigation, sprinkler and
light to maintain suitable conditions in the greenhouse .

Figure 3.18 Block diagram of system

The Arduino controls the device by case:


1- If the values of temperature and humidity is greater than optimum, it opens the fan
to decrease the temperature and humidity in the greenhouse, When the values of
temperature and humidity is less than optimum, it opens the sprinkler to increase the
temperature and humidity in the greenhouse until a suitable value is reached.
2- If the value of soil moisture is less than optimum, the value will open irrigation
and when it is greater, irrigation will be closed.

3-if value of light is less than the optimum, the lamp turns on and closes after the
period is finished (period is the time needed by the plain each day ) and when the
value is grater the lamp will be turned off.
4-The GSM model sends an SMS to the user about the value that system measures.

Ch4. Methodology and Implementation

4.1

Introduction

Implementation encompasses all the processes involved in getting new software or


hardware operating properly in its environment, including installation, running,
testing and making necessary changes. As such, implementation is the action that
must follow any preliminary thinking in order for something to actually happen. The
project worked in divided into three sub parts , signal detection , hardware controlling
and SMS Service for Green House Controlling .
The main part that evaluated to develop control and automatic greenhouse control
system is a microcontroller called arduino. The following block diagram describe the
idea of system :

Figure 4.1 Project idea

The system above consists of three input (temperature, humidity and LDR sensor) and
three output (fan, water pump and Lamp). PIC controller as a main brain for this
system because it control the overall system in a greenhouse. Temperature sensor used
to detect the temperature in a greenhouse. When the temperature sensor detect the
high temperature, microcontroller will send the signal to the fan to stable the

greenhouse condition. Then, when LDR sensor detect no light, microcontroller will be
send the signal to the lamp and lamp will be on automatically. Water pump is used to
supply water to the sprinkler and make sure the sprinkler watered the plants in a
greenhouse.
As we see in figure 4.1 , the arduino controls circuit that will be connected to the soil
sensor, humidity sensor, and temperature sensor .the Arduino uno receives the value
from sensor and analyses and then compares it with the threshold value stored in the
Arduino memory , based on this value the Arduino takes the appropriate procedures ,
and also controls the output device based on these values, the Arduino sends the
report by the GSM model to the farmer's phone.

Figure 4.2 System process

4.2

Signal detection

As soon as the change of temperature or humidity absence of air for instance has been
detected, GSM modem sends SMS on a number provided in the GSM code. Through
this section user can manage Greenhouse Hardware or manage the SMS service.
To make this real various sensors used to measure and detect the signals .Figure
below describes the Sensors Methodology used :

Figure 4.3 sensor connection

Following sensors associated and infused into the system :


4.2.1

Light Dependent Resistor

LDR device has a resistance which varies according to the amount of light falling on its
surface. Since LDR is extremely sensitive in visible light range.
Now in our system this sensor measure value of light in the Greenhouse to take a value
and send it to the ADC port at the Arduino to compared this value with the threshold and
decide which device must be run and send 5V to the relay that was connect with the
Lamp.

Figure 4.4 LDR and Arduino connection

In this paragraph a functional description of LDR is shown


1- The LDR and a normal resistor are connecting in series across a voltage, as shown in
figure below. The resistances Depending on which is tied to the 5V and which to 0V, and
the voltage node between them known sensor node, it will be rise or fall depending on
amount of light. If the LDR tied directly with the 5V, the sensor node will increased the
voltage with increasing light.
2- The LDR's can reach 10 k ohms in the dark time, and about 100 ohms in the full light
3- In our system uses a 10 k fixed resistor which is tied to +5V. Hence the value of the
voltage in this case decreases with increase in the amount light intensity.

Figure 4.5 LDR Intier circuit

4- The sensor node voltage is make a comparison with the threshold voltages of different
levels to the light intensity corresponding to the standard four conditions- Optimum,
dim, dark and night.
5- The equation that describes the relationship between the resistance RL and the light
intensity Lux of a typical LDR is:
RL = 500 / Lux k [23]
6- When the LDR is connected to 5V through to 10K resistor, the output voltage of the
LDR is:
Vo = 5*RL / (RL+10). [23]
In figure below , we made a simulation of LDR connection with arduino using a tool
called Fritzing software :

Figure 4.6 sensor Interface

4.2.2

Humidity and Temperture Sensor

The RHT03 sensor works from 3.3v to 6v, pin1 is connected to 5v on


Arduino. The sensor pin 2 goes to the Arduino pin 5, with a 1Kohm pull-up resistor as
:shown in Figure 4.7

Again we make aconnection between Humidity and Temprature sensor using Fritzing

Figure 4.7 Humidity and Temperture Sensor Interface

4.2.3

Soil Moisture sensor

This sensor measure the humidity in the soil , the sensor use two probes that pass current
through the soil, and measure the resistance of soil to get the moisture level. More water
makes the soil conduct electricity more easily (less resistance), while dry soil conducts
electricity poorly (more resistance).

Figure 4.8 Soil sensor circuit diagram

The circuit designed uses a 5V supply, two resistances 100, two copper leads as the
sensor probes, 2N222N transistor. The sensor has three pins, the first pin is an output
pin, second pin is a ground pin, and third pin to input.
So we must connect the first pin with analog Arduinopin , and the third pin with 5 volt.
When the output between 0-1.9v dry soil, when the output between 1.9-3.5v humid soil
and when the output greater than 3.5v over humidity(24).

4.3

Hardware controlling

Hardwares are used to control environmental condition and provide optimal condition
to the plain which are kept in Green House.

Figure 4.9 Device connection

Figure4.9show the connection of the device with relay and connection relay with port.
The relay will be used in our project as driver ,so the input port of relay connect with the
Arduino that send +5 volt or 0 ,and the Vcc pin in relay connect with power supply that
provide the voltage that need to run the device . Also, the output pin of a relay connects
with the output device as Fan, Valve, and Lamp.
Data pins for temperature,humidity, light and soil moisture sensors will be connected
with analog pins in Arduino where relays will be connected to the digital pins in
arduino. The Arduino convert the analog data to digital data by using analog digital
converter embedded with Arduino.

Figure 4.10 Overall flow chart for Arduino

Figure 4.10 show the flow chart how system program work, in the beginning system
receive analog data was measured by the sensor. the system convert the analog data to
digital data by using analog digital converter in Arduino ,then apply function of control
switch to chose the value of variable, then apply all function of system after finish check
display the value of parameter in the LCD and check it is me to send report for user.
Now , Figure 4.11 shows the flow chart of the control switch function ,this function use
to enter the value of high temperature ,low temperature, high relative humidity ,low
relative humidity ,time of SMS report and the period of light , when press the control
switch the Variable change and when press the increase switch the variable value
increase , and when press the decrease switch the variable value decrease.

Figure 4.11 Flow chart of switch control

Figure4.12 shows a flow chart, the program read the value of temperature if the value is
greater than maximum temperature value, the microcontroller active the pin was
connected with fan to decrease the temperature. and when the value is less than
minimum temperature microcontroller active the pin connect with valve of sprinkler to
increase the temperature .when the temperature value set between minimum and
maximum temperature value ,the microcontroller deactivate the pins connect with fan
and valve.
when the humidity value is greater than maximum threshold, the microcontroller active
the pin connect with fan to decrease humidity and when the value is less than minimum
humidity value active the pin connect with valve of sprinkler to increase the humidity,
when the humidity value is between low humidity value and high humidity value the
microcontroller deactivate the pins connect with fan and valve
Note: we control the humidity when the temperature in optimum range.

Figure 4.12 Flow chart for temperature sensor

Figure 4.13 show the flow chart for the soil function sensor, program read the value of
soil monitor sensor ,if the value of voltage out less than 1.9v active the pin that
connect with valve of irrigation and when the value of voltage out greater than 1.9 v
deactivate the pin that connect with valve of irrigation.

Figure 4.13 Flow chart for soil

Flow chart below describes the function of light sensor :

Figure 4.14 Flow chart for photocell sensor

The main hardwares used listed below :


4.3.1

Push Button Switch

Figure 4.15 push button switch circuit

Push button switch used in this project to make a system more reliable and flexible by
using it to enter the input data of the system . In our simulation we are explain how we
using this switches, first one to change the parameter , second one to increase the value
of each parameter , and third switch to decrease these value.
Push button switch connect with GND and resister that connect with 5volt , so when the
switch was pressed the pin will be connect with GND and sent input voltage for Arduino
equal zero.

4.3.2

Interfacing LCD with Arduino

Figure 4.16 LCD connection

LCD use to display the value of condition in the green house ,the LCD include register
select (Rs) pin, read/write (r/w) pin, enable (EN) pin, 8 pins for data and we are using 4
data pin connect with Ardiuo port , and 3pins for power.
The RS pin and EN pin connect with Arduino port , the R/W pin connect with ground
,Vdd pin and led+ connect with 5 volt ,Vss pin and Vee connect with ground .
In figure below we make asimulation of LCD interfacing with arduino usin VBB()

Figure 4.17 LCD interface

4.4

SMS service for Greenhouse controlling

Here for controlling Hardware through SMS Service, we have to use GSM module.
4.4.1

Interfacing GSM with Arduino

The Arduino platform designed as an easy to use and implement device for embedded
applications.
By connecting the Tx/Rx serial pins of the GSM device with the Rx/Tx serial pins of the
Arduino, will be able to communicate messages between pla3tforms with as little as 4
pins (Tx/Rx/5V/GND).
This will create a GSM text message server that can receive up to 140 bytes of control
data that allows the microcontroller to decide what to do with each text message (25).

Figure 4.18 GSM Interface

4.4.2
SIM Interface
The SIM interface is compatible with the ISO 7816-3 IC card standard required by the
GSM11.11 Phase 2+ standard. The module also supports Release 99 of the SIM Toolki
recommendation and supports a Fixed Dialling Number directory (25).

4.5

Software Description

A simple software is designed by PROTUS (ISIS 7 Professional) to process the Light


and Temperature , monitoring and controlling the green house. The software includes
the various measurements of the sensors, analog to digital converters, send the values
from sensor to arduino. Then continue to display the value in application at LCD.
Components used in simulation:
1.
2.
3.
4.
5.

Arduino.
LM35 and LDR sensors.
Motor istead of fan
LED represents a lamp.
LCD.

Figure 4.19 Simulation design

Ch5. Results and Discussion


The result we obtained is the hardware model of greenhouse monitoring system :

The arduino code :

#include <SerialGSM.h>
#include <SoftwareSerial.h>
SerialGSM cell(2,3);
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
char inchar;
int cr=0;
char phoneNumber[] =" 0598560775" ;
LiquidCrystal lcd(33, 30, 29, 26, 25,22);

const int buttonpin1 = 46;


const int buttonpin2=47;
const int buttonpin3=48;
//const int buttonpin4=49;
int g=0, v,f, count, val1, htemp=25, ltemp=23, hhum=70, lhum=20, val2,
val3, val4, count11=0;
float temp=0,hum=0,light=0,soil=0;
float photo=A1;
int sprinkler=A3;
int lamp=A4;
int fan33=A2;
int irr=A5;
float soilmois=A0;
#include " DHT.h" // RHT03 sensor library
#define DHTPIN 4 // RHT03 sensor is connected to digital pin 2
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE);
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
dht.begin();
lcd.print(" Smart greenhouse" );
pinMode(buttonpin1,INPUT);
pinMode(buttonpin2,INPUT);
pinMode(buttonpin3,INPUT);
pinMode(sprinkler,OUTPUT);
pinMode(fan33,OUTPUT);
pinMode(lamp,OUTPUT);

pinMode(irr,OUTPUT);
Serial.println(" Starting SM5100B Communication..." );
cell.begin(9600);
waitTil(" +SIND: 4" );
Serial.println(" Module ready" );
delay(2000);
lcd.print(" " );
}

void loop()
{
float hum = dht.readHumidity();
float temp =dht.readTemperature();
lcd.setCursor(0,0);
lcd.print (" Temp=" ) ;
lcd.print (temp);
lcd.setCursor(7, 0);
lcd.print (" Hum=" ) ;
lcd.print (hum) ;
light=analogRead(photo);
delay(50);
light=light/200;
soil=analogRead(soilmois);
soil=soil/200;
val2 = digitalRead(buttonpin1);
Serial.println(soil);
Serial.println(light);
if (val2 == HIGH) {

count11=count11+1;
count11=count11%5;
}
if(count11==0){
lcd.setCursor(0, 1);
lcd.print(" " );
}
else {
(htemp,ltemp,hhum,lhum)=controll();
{ test(temp,hum,light,soil);
delay (50);
}
}
///control function
///////////////////////////////////////////////////////////////////
int controll(){
if( count11 ==1) {
Serial.print(" high temp" );
lcd.setCursor(2, 1);
lcd.print(" htemp" ) ;
if(digitalRead(buttonpin2)==HIGH ) {
htemp=htemp-1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(htemp) ;
delay(50);
Serial.println(htemp);

}
if(digitalRead(buttonpin3)==HIGH) {
htemp=htemp+1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(htemp) ;
Serial.println(htemp);
delay(50);
}
}
if (count11==2) {
Serial.print(" low temp" );
lcd.setCursor(2, 1);
lcd.print(" ltemp" ) ;
if(digitalRead(buttonpin2)==HIGH ) {
ltemp=ltemp-1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(ltemp) ;
Serial.println(ltemp);
delay(50); }
if(digitalRead(buttonpin3)==HIGH) {
ltemp=ltemp+1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);

lcd.print(ltemp) ;
Serial.println(ltemp);
delay(50); }
if( count11 ==3)//humdity control {
Serial.print(" high hum" );
lcd.setCursor(2, 1);
lcd.print(" hhum" ) ;
if(digitalRead(buttonpin2)==HIGH ) {
hhum=hhum-1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(hhum) ;
delay(50);
Serial.println(hhum); }
if(digitalRead(buttonpin3)==HIGH) {
hhum=hhum+1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(hhum) ; }
}
if (count11==4) {
Serial.print(" low hum" );
lcd.setCursor(2, 1);
lcd.print(" lhum" ) ;
if(digitalRead(buttonpin2)==HIGH ) {
lhum=lhum-1;

lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(lhum) ;
Serial.println(lhum);
delay(50); }
if(digitalRead(buttonpin3)==HIGH) {
lhum=lhum+1;
lcd.setCursor(8, 1);
lcd.print(" " );
lcd.setCursor(8, 1);
lcd.print(lhum) ;
Serial.println(lhum);
delay(50); }
}
return (htemp,ltemp,hhum,lhum);
}
void test(int temp,int hum,int light,int soil) {
Serial.println(temp);
Serial.println(htemp);
Serial.println(hum);
Serial.println(ltemp);
Serial.println(light);
if(temp<ltemp) {
Serial.println(" sprinkler temp high" );
delay(50); v=1;
waring(temp,ltemp);//hot>>>>>>>>>>>>>>>>>>>>>>>>>>>
}

else {
Serial.println(" sprinkler temp low" );
delay(50);
v=-1; }
if(temp>htemp ) {
Serial.println(" fan temp high" );
delay(50);
f=1; //digitalWrite(fan33,HIGH);
waring(temp,htemp);////>>>>>>>>>>>>>>>>>>>>>>>>
}
else {
Serial.println(" fan temp low" );
delay(50);
f=-1; }
if(ltemp<=temp && temp<=htemp) {
Serial.println(temp);
Serial.println(htemp);
Serial.println(ltemp);
(f,v)= humidity(hum); }
delay(200);
if(f>0 ) {
Serial.println(" fan temp high" );
delay(50);
digitalWrite(fan33,HIGH); }
else {
Serial.println(" fan temp low" );
delay(50);
digitalWrite(fan33,LOW);///>>>>>>>>>>>>>>>>>>>>>>

}
if(v>0) {
Serial.println(" sprinkler temp high" );
delay(50);
digitalWrite(sprinkler, HIGH); }
else {
Serial.println(" sprinkler temp low" );
delay(50);
digitalWrite(sprinkler, LOW); }
{
if(light<2.5) {
lcd.setCursor(12, 1);
lcd.print(" night" ) ;
delay(100);
Serial.println(" night" );
digitalWrite(lamp, HIGH); //cool>>>>>>>>>>>>>>>>>>>>>>>>
delay(50); }
else {
Serial.println(" day" );
lcd.setCursor(12, 1);
lcd.print(" day.." ) ;
delay(100);
digitalWrite(lamp,
LOW);//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
delay(50); }
}
Serial.println(" soil" );
Serial.println(soil);
if(soil<1.5) {

g=1;
Serial.println(" irrigation on" );
digitalWrite(irr, HIGH);
delay(50);
}
if(soil>2.5) {
digitalWrite(irr, LOW);
Serial.println(" irrigation off" );
g=2;//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
delay(50); }
if(soil<=4.5 &&soil>=1.5) {
if(g==1) {
Serial.println(" irrigation on" );
digitalWrite(irr, HIGH);}
if(g==2){
Serial.println(" irrigation off" );
digitalWrite(irr, LOW);
}} }
////////////////////////////////
int humidity(int hum) {
Serial.println(hum);
Serial.println(hhum);
delay(100);
if(hum<lhum) {
Serial.println(" sprinkler hum high" );
delay(50);
v=2;
waring(hum/5,lhum/5);//hot>>>>>>>>>>>>>>>>>>>>>>>>>>>

}
else {
Serial.println(" sprinkler hum low" );
delay(50);
v=-2;
waring(hum/5,hhum/5); }
if(hum>hhum) {
Serial.println(" fan hum high" );
delay(50);
f=2; }
else {
Serial.println(" fan hum low" );
delay(50);
f=-2; }
return (f,v); }
void waring(float x,float y){
float k;
k=x-y;
if(k<0){
k=-k; }
if (k>5) {
if(cr==0){
lcd.setCursor(0, 1);
lcd.print(" wait sendin sms" );
delay(5000);
SM5100B_SMS(temp,hum,light,soil);
delay(35000);
lcd.setCursor(0, 1);

lcd.print(" " );
cr=30000;
Serial.println(" send" );}
cr=cr-1;
}}
void SM5100B_SMS(double temp,double hum,double light,double soil) {
cell.println(" AT" );
delay(200);
cell.println(" AT+CMGF=1" );// set SMS mode to text
Serial.println(" AT+CMGF=1" );
delay(200);
cell.print(" AT+CMGS=" ); // now send message...
Serial.println(" AT+CMGS=" );
cell.write((byte)34);// ASCII equivalent of "
cell.print(phoneNumber);
cell.write((byte)34); // ASCII equivalent of "
cell.println();
delay(200);
cell.print(" temp :" );
cell.print(temp);
Serial.print(" temp :" );
cell.println();
cell.print(" hum: " );
cell.print(hum);
Serial.print(" hum :" );
cell.println();
cell.print(" light :" );
cell.print(light);

Serial.print(" light :" );


cell.println();
cell.print(" soil :" );
cell.print(soil);
Serial.print(" soil :" );
cell.println(); // our message to send
cell.write((byte)26); // ASCII equivalent of Ctrl-Z
cell.println();
delay(15000);
}
String getMessage() {
String s=" " ;
while(1) {
if(cell.available()>0) {
s = s+(char)cell.read();
if (s.length()>1 && s[s.length()-2]=='\r' && s[s.length()-1]=='\n') { //if
last 2 chars are \r\n
if (s==" \r\n" || s==" \r\n" ) { // skip these, move on
s=" " ;
}
else { // we have a message!
Serial.println(s.substring(0,s.length()-2));
return s.substring(0,s.length()-2);
}}}}}
void waitTil(String s) {
String message;
while (1) {
message = getMessage();
if (message == s){

delay(100); // cause we're probably about to send another command


return;
}}}

Ch6. Conclusions and Recommendation


This project offers a design of fully automated greenhouse management system. From
the experiment it could be seen that it is fulfilling all requirements related greenhouse
monitoring. The automatic greenhouse sensor design could help in increasing the
productivity of plants.
As it has been mentioned earlier, we are not only providing automatic control over the
devices like light, motor pump but also we have a mechanism to alert farmers
regarding the parameter changes in the greenhouse so that early precaution steps can
be taken. Thus this construction, productivity of cropping can be continuously
increased so it can handle famine problem around the world. Thus we can say that the
greenhouse monitoring system using GSM is far better than the same system using the
different technologies.
Future Work
The system could be developed by different ways such as sending emails when an
alarm happens , or using different devices such as PLCs , in addition to measure the
conditions that have been mentioned , other conditions may be included like shade
and fire detection .
During the hot summer day , the bright sun may cause the temperature inside the
greenhouse rises to an extreme heat. With the arduino , the authorized user can open
up the vents to allow the fresh air enter the greenhouse by simply calling the arduino
unit. Or we could use Air Conditioner if it is possible.

References
[1] PRAKASH .H.P ATIL, CHAITALI BORSE, SNEHAL GAIKWAD , SHILPA PATIL,
2013, G REENHOUSE MONITORING SYSTEM USING GSM, INTERNATIONAL
JOURNAL OF SCIENTIFIC & ENGINEERING RESEARCH, VOLUME 4, ISSUE 6,
ISSN 2229-5518.4
[2] ADVANTAGES & DISADVANTAGES OF GREENHOUSE . RETRIEVED FROM
THE EHOW ONLINE WEBSITE : HTTP://WWW. EHOW. COM

[3] SUMIT A. KHANDELWAL ET AL, 2012, A UTOMATED GREEN HOUSE


MANAGEMENT USING GMS MODEM, (IJCSIT) I NTERNATIONAL JOURNAL OF
C OMPUTER SCIENCE AND INFORMATION TECHNOLOGIES , VOL. 3 (1) ,
3099 3102.

GSM TUTORIAL. RETRIEVED FROM THE WEBSITE: [4 ]


.HTTP://ECEE.COLORADO .EDU/~ECEN4242/GSM /INDEX.HTM
[5] JOCHEN H. SCHILLER . (2003) .MOBILE COMMUNICATIONS .2ND
EDITION . ADDISON-WESLEY . 492 PAGES
[6] GSM CHARACTERISTICS . RETRIEVED FROM THE GSM SERVER O NLINE
WEBSITE : HTTP :// GSMSERVER .COM /ARTICLES / GSM _CHARACT .PHP
[7] GSM CHARACTERISTICS . RETRIEVED FROM THE GSM SERVER O NLINE
WEBSITE : HTTP :// GSMSERVER .COM /ARTICLES / GSM _CHARACT .PHP
[8] GSM CHARACTERISTICS . RETRIEVED FROM THE GSM SERVER O NLINE
WEBSITE : HTTP :// GSMSERVER .COM /ARTICLES / GSM _CHARACT .PHP
[9] DATA RATES IN GSM. R ETRIEVED FROM SCRIBD THE ONLINE WEBSITE :
HTTP :// SCRIBD .COM /DOC /22846633/D ATA -R ATES -IN-GSM

[10] R ETRIEVED FROM THE ONLINE WEBSITE :HTTP://ARDUINO. CC/


[11] ARDUINO MEGA.RETRIEVED FROM THE ONLINE WEBSITE
HTTP :// ARDUINO . CC/EN/M AIN /ARDUINO B OARD MEGA

[12] WHAT IS A GSM MODEM .RETRIEVED FROM THE WEBSITE :


HTTP :// WWW . NOWSMS .COM .

[13] DR. LONGMONT .(2008). GSM/GPRS M ODULE . LINKSPRITE


TECHNOLGIES , CO 80503, 13
[14] MINI PUSH BUTTON SWITCH. R ETRIEVED FROM ROBOT STOP
WEBSITE : HTTP :// WWW .ROBOTSHOP .COM /CA /EN
[15] V. RYAN . LIGHT DEPENDENT RESISTORS.( 2002 - 04) , FROM
HTTP :// WWW . TECHNOLOGYSTUDENT .COM /ELEC 1/ LDR1. HTM

[16] HUMIDITY AND TEMPERATURE SENSOR . RETRIEVED FROM THE ONLINE


WEBSITE : HTTPS :// WWW .SPARKFUN . COM

[17] GROVE - MOISTURE SENSOR .RETRIEVED FROM


HTTPS :// WWW . SEEEDSTUDIO .COM /WIKI/G ROVE _-_M OISTURE _S ENSOR

[18]COOLING & VENTILATION BUYER'S GUIDE .RETRIEVED FROM THE


DESIGN OF F ARMTEK GROWERS SUPPLY ONLINE WEBSITE:
HTTPS :// WWW.GROWERSSUPPLY .COM /FARM/ SUPPLIES/ HOME
[19] GREENHOUSE LIGHTING . R ETRIEVED FROM THE TWO WESTS &
ELLIOT ONLINE WEBSITE : HTTP ://WWW.TWOWESTS. CO. UK

[20]GARDEN PUMPS. R ETRIEVED FROM THE TWO WESTS & ELLIOT


ONLINE WEBSITE : HTTP ://WWW.TWOWESTS. CO. UK
[21] KU. PRACHI & V.B HALERAO . GSM BASED SECURITY SYSTEM
FOR EXAMINATION PAPER.
INTERNATIONALJOURNALFORENGINEERINGAPPLICATIONSAND
TECHNOLOGY,( 62-65) ,4
[22] TOP GREENHOUSES LTD. RETRIEVED FROM THE ONLINE WEBSITE :
HTTP :// WWW . TOP .PRO

[23] HOW_DO _YOU_MEASURE _LIGHT_INTENCITY ?.R ETRIEVED FROM


HTTP :// WIKI. ANSWERS .COM

[24] MOISTURE SENSOR (SKU:SEN0114). R ETRIEVED FROM


HTTP :// WWW . DFROBOT .COM /WIKI/ INDEX .PHP ?
TITLE =MOISTURE _S ENSOR_(SKU:SEN0114)

[25] GSM TECHNICAL SPECIFICATION .(1995). GSM 11.11.V.


5.0.0 ,P.1-91

Appendix

Appendix A: ARDUINO UNO ATMEGA328P

Appendix B: GSM MODEM

Appendix C: Humidity and Temperature Sensor RHT03

Appendix D :. The arduino full codes for the system

You might also like