Você está na página 1de 77

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

1. INTRODUCTION
We live in a world where everything can be controlled and operated automatically,
but there are still a few important sectors in our country where automation has not
been adopted or not been put to a full-fledged use, perhaps because of several
reasons one such reason is cost. One such field is that of agriculture. Agriculture has
been one of the primary occupations of man since early civilizations and even today
manual interventions in farming are inevitable. Greenhouses form an important part
of the agriculture and horticulture sectors in our country as they can be used to grow
plants under controlled climatic conditions for optimum produce. Automating a
greenhouse envisages monitoring and controlling of the climatic parameters which
directly or indirectly govern the plant growth and hence their produce. Automation is
process control of industrial machinery and processes, thereby replacing human
operators.
Motivation:
A number of factors which motivated this project are complexity involved in
monitoring climatic parameters like humidity, soil moisture, illumination, soil pH,
temperature, etc which directly or indirectly govern the plan Growth, investment in
the automation process are high, as todays greenhouse control systems are designed
for only one parameter monitoring (as per GKVK research center); to control more
than one parameter simultaneously there will be a need to buy more than one system,
high maintenance and need for skilled technical labor. The modern proposed systems
use the mobile technology as the communication schemes and wireless data
acquisition systems, providing global access to the information about ones farms.
But it suffers from various limitations like design complexity, inconvenient repairing
and high price. Also the reliability of the system is relatively low, and when there are

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


malfunctions in local devices, all local and tele data will be lost and hence the whole
system collapses. More over farmers in India do not work under such sophisticated
environment and find no necessity of such an advanced system, and cannot afford the
same. Keeping these issues in view, a microcontroller based monitoring and control
system is designed to find implementation in the near future that will help Indian
farmers.
General:
The system is an embedded system which will closely monitor and control the
microclimatic parameters of a greenhouse on a regular basis round the clock for
cultivation of crops or specific plant species which could maximize their production
over the whole crop growth season and to eliminate the difficulties involved in the
system by reducing human intervention to the best possible extent. The system
comprises of sensors, microcontroller and actuators. When any of the above
mentioned climatic parameters cross a safety threshold which has to be maintained to
protect the crops, the sensors sense the change and the microcontroller reads this
from the data at its input ports after being converted to a digital form by the ADC.
The microcontroller then performs the needed actions by employing relays until the
strayed-out parameter has been brought back to its optimum level. Since a
microcontroller is used as the heart of the system, it makes the set-up low-cost and
effective nevertheless. As the system also employs an LCD display for continuously
alerting the user about the condition inside the greenhouse, the entire set-up becomes
user friendly. Thus, this system eliminates the drawbacks of the existing set-ups
mentioned in the previous section and is designed as an easy to maintain, flexible and
low cost solution.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Basic Theory:
The two major life-processes occurring in plants are photosynthesis and transpiration.

Photosynthesis is the conversion of light energy into chemical energy by living


organisms. The raw materials are carbon dioxide and water; the energy source is
sunlight; and the end- products are oxygen and (energy rich) carbohydrates, for
example sucrose, glucose and starch. This process is arguably the most important
biochemical pathway, since nearly all life on Earth either directly or indirectly
depends on it. A commonly used but slightly simplified equation for photosynthesis
is:
6 CO2(g) + 12 H2O(l) + photons C6H12O6(aq.) + 6 O2(g) + 6 H2O(l)
Carbon dioxide + water + light energy glucose + oxygen + water
Light energy obtained from the sun is very essential for photosynthesis. The
photons present in light are responsible for triggering the light-reaction in plants.
Plants need an optimum amount of exposure to light in a day. This optimum
period is called its photo- period. The plant sensitivity curve for photosynthesis
has its peak at the red side of the spectrum. This indicates that providing plants
with the wavelengths best suited to photosynthesis is most efficient with the use of
artificial light. Tests show a mean deviation from the average sensitivity curve of
less than 5% for a wide variety of plants. The curve shows that the maximum
sensitivity for photosynthesis lies in the far red at approximately 675 nm. The
plant sensitivity curve disputes two common misconceptions. The first is that an
"ideal" plant growing lamp duplicates the spectral energy distribution of the sun.
Sunlight has a continual spectrum, radiating energy in wavelengths that contribute
less to photosynthesis, and are therefore "wasted" on the plant. For this reason,

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


many lamps are more efficient than sunlight for plants.

Transpiration is the evaporation of water from the aerial parts of plants


especially leaves but also stems flowers and roots Transpiration also cools plants
and enables mass flow of mineral nutrients and water from roots to shoots. Mass
flow is caused by the decrease in hydrostatic (water) pressure in the upper parts of
the plants due to the diffusion of water out of stomata into the atmosphere. Water
is absorbed at the roots by osmosis, and anydissolved mineral nutrients travel with
it through the xylem.The rate of transpiration is directly related to the degree of
stomatal opening, and to the evaporative demand of the atmosphere surrounding the
leaf. The amount of water lost by a plant depends on its size, along with the
surrounding light intensity, temperature, humidity, and wind speed (all of which
influence evaporative demand). Soil water supply and soil temperature can
influence stomatal openingThe moisture content in the soil is a very crucial factor
in the process of transpiration as the absorption of mineral salts from the soil
through the process of osmosis is directly dependent on the moisture content in the
soil. The greenhouse works best when the temperature is not too hot and not too
cold. Though it sounds simple in the spring and autumn we can easily have a
wide range of temperatures from the cold in the middle of the night to the
excessive heat of the day when the sun is shining. During the day the rays from
the sun penetrate the greenhouse and warm up and light up the surroundings. Light
escapes through the glass walls but the heat in form of infra-red radiations gets
trapped inside the green house leading to an incubating effect and the temperature
inside gradually increases. This increased temperature leads to an increase in the
rate of transpiration which is harmful to the plants.
Humidity is the measure of the quantity of water vapor in the air. In the greenhouse
humidity is important because the air humidity affects the rate at which plants

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


transpire. By transpiration plants are drawing water along with nutrients from roots
to leaves where the water then evaporates from leaf pores into the air. As water
evaporates the plants are cooled down. For best growing conditions the preferred
humidity levels of the plants in the greenhouse and then control the amount of
moisture in the atmosphere to suit them. Humidity may be increased by various
techniques using humidifiers and may be reduced by ventilation. In the greenhouse
the humidity level is very important as a very humid atmosphere may be harmful to
some plants because the rate of transpiration and evaporation is reduced in very
humid conditions. Many tropical plants from native humid climates require high
levels of humidity for a healthy growth and will not survive in a dry atmosphere.
If the air is too dry and the humidity level is low than plants will transpire more
rapidly, often losing a great amount of moisture. In this case, plants that are not
adapted to cope with low humidity levels will wilt unless you will offer them
additional water to the roots. Dry climate pants have specific anatomical feature that
reduce the transpiration rate in drought conditions. The humidity levels in your
greenhouse depend to the temperature as warm air is capable to hold more moisture
than cold air before it becomes saturated. Relative humidity is a measure of the
amount of water vapor in the air expressed as a percentage of saturation points at the
same temperature. A humid atmosphere is defined as having a relative humidity of
about 75 per cent, while a dry atmosphere has a relative humidity of about 35 per
cent. For measuring humidity in the greenhouse can use wet and dry bulb
thermometers in conjunction with hygrometric tables. An easier way is to use
hygrometers which have a dial that gives readings for both the temperature and the
humidity. Most greenhouse plants will develop well during the growing season in a
medium with humidity between 40 and 75 per cent. If the humidity levels are above
80 per cent then diseases like grey mould and mildew may become a problem.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

2. LITERATURE SURVEY
A greenhouse is a building in which plants are grown. These structures range in size
from small sheds to very large buildings. A miniature greenhouse is known as
a frame. A greenhouse is a structure with different types of covering materials, such
as a glass or plastic roof and frequently glass or plastic walls; it heats up because
incoming visible solar radiation (for which the glass is transparent) from the sun is
absorbed by plants, soil, and other things inside the building. Air warmed by the heat
from hot interior surfaces is retained in the building by the roof and wall. In addition,
the warmed structures and plants inside the greenhouse re-radiate some of their
thermal energy in the infrared spectrum, to which glass is partly opaque, so some of
this energy is also trapped inside the glasshouse. However, this latter process is a
minor player compared with the former convective process. Thus, the primary
heating mechanism of a greenhouse is convection.
This can be demonstrated by opening a small window near the roof of a greenhouse:
the

temperature

drops

considerably.

This

principle

is

the

basis

of

the autovent automatic cooling system. Thus, the glass used for a greenhouse works
as a barrier to air flow, and its effect is to trap energy within the greenhouse. The air
that is warmed near the ground is prevented from rising indefinitely and flowing
away. Although heat loss due to thermal conduction through the glass and other
building materials occurs, net energy increases (and therefore temperature) inside the
greenhouse. Greenhouses can be divided into glass greenhouses and plastic
greenhouses. Plastics mostly used are PE film and multiwall sheet in PC or PMMA.
Commercial glass greenhouses are often high-tech production facilities for

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

vegetables or flowers. Greenhouses protect crops from too much heat or cold and
help to keep out pests. Light and temperature control allows greenhouses to turn
inarable land into arable land, thereby improving food production in marginal
environments. Because greenhouses allow certain crops to be grown throughout the
year, greenhouses are increasingly important in the food supply of high latitude
countries. One of the largest greenhouse complexes in the world is in Almeria, Spain,
where greenhouses cover almost 50,000 acres (200 km2). It is sometimes called
the sea of plastics. Greenhouses are often used for growing flowers, vegetables,
fruits, and tobacco plants. Bumblebees are the pollinators of choice for most
greenhouse pollination, although other types of bees have been used, as well as
artificial pollination.
Hydroponics can be used in greenhouses, as well, to make the most use of the
interior space. Besides tobacco, many vegetables and flowers are grown in
greenhouses in late winter and early spring, and then transplanted outside as the
weather warms. Started plants are usually available for gardeners in farmers'
markets at transplanting time. Special greenhouse varieties of certain crops, such as
tomatoes, are generally used for commercial production. he closed environment of a
greenhouse

has

its

own

unique

requirements,

compared

with

outdoor

production. Pests and diseases, and extremes of heat and humidity, have to be
controlled, and irrigation is necessary to provide water. Significant inputs of heat and
light may be required, particularly with winter production of warm-weather
vegetables.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

History
The idea of growing plants in environmentally controlled areas has existed
since Roman times. The Roman emperor Tiberius ate a cucumber-like vegetable
daily. The Roman gardeners used artificial methods similar to the greenhouse system
of growing to have it available for his table every day of the year. Cucumbers were
planted in wheeled carts which were put in the sun daily, then taken inside to keep
them warm at night. The cucumbers were stored under frames or in cucumber houses
glazed with either oiled cloth known as specularia or with sheets of selenite
(a.k.a. lapis specularis), according to the description by Pliny the Elder.
Giant Greenhouses in the Netherlands
The first modern greenhouses were built in Italy in the 13th century to house the
exotic plants that explorers brought back from the tropics. They were originally
called giardini botanici (botanical gardens). The concept of greenhouses soon spread
to the Netherlandsand then England, along with the plants. Some of these early
attempts required enormous amounts of work to close up at night or to winterize.
There were serious problems with providing adequate and balanced heat in these
early greenhouses. Today, the Netherlands has many of the largest greenhouses in the
world, some of them so vast that they are able to produce millions of vegetables
every year. The French botanist Charles Lucien Bonaparte is often credited with
building the first practical modern greenhouse in Leiden, Holland to grow medicinal
tropical plants. Originally only on the estates of the rich, the growth of the science
of botany caused greenhouses to spread to the universities. The French called their
first greenhouse sorangeries, since they were used to protect orange trees from
freezing. As pineapples became popular, pineries, or pineapple pits, were built.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Experimentation with the design of greenhouses continued during the 17th century in
Europe, as technology produced better glass and construction techniques improved.
The greenhouse at the Palace of Versailles was an example of their size and
elaborateness; it was more than 500 feet (150 m) long, 42 feet (13 m) wide, and 45
feet (14 m) high. n the 19th century, the largest greenhouses were built. The
conservatory at Kew Gardens in England is a prime example of the Victorian. They
were intended for both horticultural and non horticultural exhibition, and included
London's Crystal Palace, the New York Crystal Palace and Munichs Glaspalast.
Joseph Paxton, who had experimented with glass and iron in the creation of large
greenhouses as the head gardener at Chatsworth, in Derbyshire, working for
the Duke of Devonshire, designed and built the first, London's Crystal Palace.
A major architectural achievement in monumental greenhouse building were
the Royal Greenhouses of Laeken (18741895) for King Leopold II of Belgium.In
Japan, the first greenhouse was built in 1880 by Samuel Cocking, a British merchant
who exported herbs.In the 20th century, the geodesic dome was added to the many
types of greenhouses. A notable example is the Eden Project, in Cornwall.
Greenhouse structures adapted in the 1960s when wider sheets of polyethylene film
became widely available. Hoop houses were made by several companies and were
also frequently made by the growers themselves. Constructed of aluminium
extrusions, special galvanized steel tubing, or even just lengths of steel or PVC water
pipe, construction costs were greatly reduced. This meant many more greenhouses on
smaller farms and garden centers. Polyethylene film durability increased greatly
when more effective inhibitors were developed and added in the 1970s. These UV
inhibitors extended the usable life of the film from one or two years up to 3 and
eventually 4 or more years. Gutter-connected greenhouses became more prevalent in

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


the 1980s and 1990s. These greenhouses have two or more bays connected by a
common wall, or row of support posts.

Heating inputs were reduced as the ratio of floor area to roof area was increased
substantially. Gutter-connected greenhouses are now commonly used both in
production and in situations where plants are grown and sold to the public, as well.
Gutter-connected greenhouses are commonly covered with a double layer of
polyethylene film with air blown between to provide increased heating efficiencies,
or structured polycarbonate materials. These are the

techniques used in the green

house in the past.


As the technology becomes more and more advanced the green house controlling and
monitoring techniques has been forced to improve as a result the glass greenhouses
are filled with equipment such as screening installations, heating, cooling, lighting,
and may be automatically controlled by a computer. So an era of manually
controlling the parameters such as temperature and light by openings in the glasses,
the wind shields and controlling the moisture by spraying water in inadequate
amount came in to an end. The influence of technology in the agro industry paved
the way for magnificent changes in production and decreasing the workman ship.
The automatic controlling system is further exposed to improvisations and as a result
the idea of monitoring and automatic controlling of green house parameters
had been evolved. This type of automatic controlling and green house parameters had
been further subjected to the improvisations and finally the equipment came into
reality.
The proposed system is an embedded system which will closely monitor and
control the microclimatic parameters of a greenhouse on a regular basis

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


round the clock for cultivation of crops or specific plant species which could
maximize their production over the whole crop growth season and to eliminate the
difficulties involved in the system by reducing human intervention to the best
possible extent. When any of the above mentioned climatic parameters cross a
safety threshold which has

to

be

maintained

to

protect

the

crops,

the

sensors sense the change and the microcontroller reads this from the data at
its input ports. Since a microcontroller is used as the heart of the system, it makes
the set-up low-cost and effective nevertheless. As the system also employs an LCD
display for continuously alerting the user about the condition inside the greenhouse,
the entire set-up becomes user friendly.
As a part of an analysis it is found that in the older systems we had used an more
complex system for the monitoring and controlling of green house parameters
because in the older systems there used an ADC and an micro controller which in
turn increases the complexity and decreases the compatibility ,so here in the project
an IC AT MEGA 8/168/328 is used which comprises of ADC converter and
microcontroller. In this project we are using different types of sensors which is most
advanced compatible and efficient form of sensors from the previous models that we
had observed. A humidity and temperature integrated form of sensor called
temperature and humidity sensor: HMTC A, where in the previous models they are
separate sensors which increases the complexity. The light sensor used here is
L.D.R. and a separate circuit for analysis is of the moisture content in the soil.
A G.S.M. module has been used which will provide the information of the present
condition of the greenhouse parameters to the owners through mobile text messages,
it will also message if an equipment starts to work with the variation of any required
green house parameters.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

3. CIRCUIT ANALYSIS

Figure.1.Block Diagram
The sensor modules system consists of various sensors, namely soil moisture,
humidity, temperature and light. These sensors sense various parameterstemperature, humidity, soil moisture and light intensity and are then sent to the
microcontroller w h i c h is the heart of the proposed embedded system. It
constantly monitors the
verifies

them

with

digitized parameters of the various sensors and

the predefined threshold values and checks if any

corrective action is to be taken for the condition at that instant of time. In case
such a situation arises, it activates the AC devices to perform a controlled

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


operation.
The AC devices such as motors, coolers, pumps are the AC devices which perform
the controlling operation. For the purpose of demonstration LEDs are used. A

complete working system can be realized by simply replacing these simulation


devices by the actual devices after making it to pass through suitable relays. A
Liquid crystal display is used to indicate the present status of parameters and the
respective AC devises. The GSM modem used in the circuit for informing the user
about the current status of the green house parameters through text messages.

Figure.2.Circuit Diagram
Working
The supply used for the circuit is 12V AC supply which is then passed through a full
wave rectifier and a 7805 regulator which provide a constant 5V. The various sensor
modules assembled in the circuit will sense the climate parameter variations and
passes it to microcontroller where many major operations will took place. The micro
controller will process the signals send by the sensors according to the program

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


designed. Here when the temperature sensor senses an abnormal range (eg. below
20C or above 35C) it will activates the air condition there by controlling the
temperature in a surrounding at the desired range automatically.
It will also send a text messages to the user through GSM modem connected to the
micro controller. Similarly the humidity is also sensed and the message will be send
when the value reaches an abnormal value (eg. 75%). In the case of moisture sensor
when the sensor senses a dry condition it will sends the signal to the water pump.
Here the sensing range could be adjusted easily by adjusting the potentiometer.
Similar is the case of light sensor, here the sensor used is LDR where the range could
be adjusted by adjusting the potentiometer. Here the electrical devices like air
conditioner, water pump, artificial lights are indicated with LEDs which could be
connected to real one after making it to pass through suitable relays. Here for the
purpose of demonstration one such relay switch has been provided. The provision for
changing the range of sensing values has been provided at each sensing part.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

4. COMPONENT DESCRIPTION
Temperature and Humidity sensor

Figure.3.HMTC1A
The HMTC1A or humidity monitor temperature control from single analyzing sensor
is a combination of HIH400 and LM 35 humidity and temperature sensors
respectively. By using this sensor we continuously monitor the variations in
temperature and humidity in surroundings. The pin number two is for humidity
where as pin 4 is for temperatures while the pin number one and three is VCC and
ground respectively.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Temperature
Features:

Calibrated directly in Celsius (Centigrade)

Linear + 10.0 mV/C scale factor

0.5C accuracy guaranteed (at +25C)

Rated for full 55 to +150C range

Suitable for remote applications

Low cost due to wafer-level trimming

Operates from 4 to 30 volts

Less than 60 A current drain

Low self-heating, 0.08C in still air

Nonlinearity only 14C typical

Functional description:
o

The sensor has a sensitivity of 10mV / C.


The circuitry measures temperatures with a resolution of up to 0.5 degree Celsius.
The output voltage is converted to temperature by a simple conversion factor. The
general equation used to convert output voltage to temperature is:
o
o
Temperature ( C) = (Vout * 100 ) / 5 C
o
So if Vout is 5V, then, Temperature = 100 C
The output voltage varies linearly with temperature.
Humidity
Relative humidity is a measure, in percentage, of the vapor in the air compared to the
total amount of vapor that could be held in the air at a given temperature.
Features :

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Linear voltage output vs. %RH

Laser trimmed interchangeability

Low power design

High accuracy

Fast response time

Stable, low drift performance

Chemically resistant

The RH sensor is a laser trimmed, thermo set polymer capacitive sensing


element with on-chip integrated signal conditioning. The sensing element's
multilayer construction provides excellent resistance to most application
hazards such as wetting, dust, dirt, oils and common environmental
chemicals.

Functional description

The sensor develops a linear voltage vs. RH output that is ratio metric to the
supply voltage. That is, when the supply voltage varies, the sensor output voltage
follows in the same proportion. It can operate over a 4-5.8 supply voltage range. At
5V supply voltage, and room temperature, the output voltage ranges from 0.8 to
3.9V as the humidity varies from 0% to 100% (non condensing).
The humidity sensor functions with a resolution of up to 0.5% of relative
humidity (RH).
With a typical current draw of only 200 A, the HIH-4000 Series is ideally suited for
low drain, battery operated systems.
The change in the RH of the surroundings causes an equivalent change in the voltage
output. The output is an analog voltage proportional to the supply voltage.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Consequently, converting it to relative humidity (RH) requires that both the supply
and sensor output voltages be taken into account according to the formula:
RH = ((Vout / Vsupply) 0.16) /0.0062, typical at 25C.

Soil Moisture Sensor

Figure.4. Moisture Sensor


The conductivity of soil depends upon the amount of moisture present in it. It
increases with increase in the water content of the soil. The voltage output is taken at
the transmitter which is connected to a variable resistance. This variable resistance
is used to adjust the sensitivity of the sensor. The two copper leads act as the sensor
probes. They are immersed into the specimen soil whose moisture content is under test.
The IC used for the purpose of inverting is a special one 74AC14 which can act as a
crystal oscillator. Since the Charge flowing through the soil is an AC the chance of
rusting of components is less. The diode used for converting it to DC which is passed

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


through filter part. The capacitor provided at feedback will rectifies the signal and thus
the full current flow will be established. The potentiometer provided is for controlling
the voltage drop there by the conductivity of the soil can be choosed. The soil is
examined under three conditions:

Case.1: Dry condition- The probes are placed in the soil under dry conditions
and are inserted up to a fair depth of the soil. As there is no conduction path between
the two copper leads the sensor circuit remains open. The voltage output in this case
ranges from 0 to 0.5V.
Case.2: Optimum condition- When water is added to the soil, it percolates
through the successive layers of it and spreads across the layers of soil due to
capillary force. This water increases the moisture content of the soil. This leads to an
increase in its conductivity which forms a conductive path between the two sensor
probes leading to a close path for the current flowing from the supply to the transistor
through the sensor probes. The voltage output of the circuit in the optimum case
ranges from 1.9 to 3.4V approximately.
Case.3: Excess water condition- With the increase in water content beyond the
optimum level, the conductivity of the soil increases drastically and a steady
conduction path is established between the two sensor leads and the voltage output
from the sensor increases no further beyond a certain limit. The maximum possible
value for it is not more than 4.2V.
Liquid crystal display
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

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


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. Many microcontroller devices
use 'smart LCD' displays to output visual information.
LCD displays designed around Hitachi's LCD HD44780 module, are inexpensive,
easy to use, and it is even possible to produce a readout using the 8x80 pixels of the
display. 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. Data can be placed at any location on the LCD. For
162 LCD, the address locations are:
First line

80

81

Second line

C0

C1

82
C2

83

84

C3

C4

85
C5

86
C6

through

8F

through CF

Table.1.Address locations for a 2x16 line LCD


SIGNALS TO THE 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.
3) Register Select (RS)

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


With the help of this line, the LCD interprets the type of data on data lines. When it is
low, an instruction is being written to the LCD. When it is high, a character is being
written to the LCD.

Pin description
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).

Figure.5. Pin diagram of 2x16 line LCD

Table.2. Pin description of the LCD

IC Voltage Regulators:
7805 is a three terminal positive voltage regulator designed with built in internal
current limiting, thermal shutdown and safe area compensation for maximum

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


flexibility and safety. With adequate heat sinking provided, 7805 can deliver up to
1.5A output current.7805 can be used as fixed voltage regulator in a wide range of
applications where local voltage regulation is preferred for elimination of noise and
distribution problems associated with single-point regulation. 7805 can also be used
(by adding external components) to obtain adjustable output voltages and currents.

It is not necessary to bypass the output, although this does improve transient
response. Input bypassing is needed only if the regulator is located far from the filter
capacitor.
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain
the circuitry for reference source, comparator amplifier, control device, and overload
protection all in a single IC. IC units provide regulation of either a fixed positive
voltage, a fixed negative voltage, or an adjustably set voltage. The regulator can be
selected for operation with load currents from hundreds of milli amperes to tens of
amperes, corresponding to power ratings from milli watts to tens of watts. The fixed
voltage regulator has an unregulated dc input voltage, Vi, applied to one input
terminal, a regulated output dc voltage, Vo, from a second terminal, with the third
terminal connected to ground.

Figuer.6.Diagrm of 7805 IC

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Figure 7 shows the basic connection of a three-terminal voltage regulator IC to a
load. The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to
one input terminal, a regulated output dc voltage, Vo, from a second terminal, with
the third terminal connected to ground.

For a selected regulator, IC device the third voltage range over which the input
voltage can vary to maintain a regulated output voltage over a range of load current.
The specifications also list the amount of output voltage change resulting from a
change in load current (load regulation) or in input voltage (line regulation).

Figure.7.Circuit of 7805
Performance:
The series 78 regulators provide fixed regulated voltages from 5 to 24 V. An
unregulated input voltage Vi is filtered by capacitor and connected to the ICs IN
terminal. The ICs OUT terminal provides a regulated + 12V which is filtered by
capacitor (mostly for any high-frequency noise).The third IC terminal is connected to
ground (GND). While the input voltage may vary over some permissible voltage
range, and the output load may vary over some acceptable range, the output voltage
remains constant within specified voltage variation limits. The specifications also list
the amount of output voltage change resulting from a change in load current (load
regulation) or in input voltage (line regulation). The series 78 regulators provide
fixed regulated voltages from 5 to 24 V. The third IC terminal is connected to ground

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


(GND). While the input voltage may vary over some permissible voltage range, and
the output load may vary over some acceptable range, the output voltage remains
constant within specified voltage variation limits. Although the internal construction
of the IC is somewhat different from that described for discrete voltage regulator
circuits, the external operation is much the same.
Centre-Tap Full-Wave Rectifier:
In such a rectifier, the ac input is applied through a transformer, the anodes of the two
diodes D1 and D2 (having similar characteristics) are connected to the opposite ends
of the centre tapped secondary winding and two cathodes are connected to each other
and are connected also through the load resistance RL and back to the centre of the
transformer, as shown.

Figure.8. Centre-tap-full-wave-rectifier
When the top of the transformer secondary winding is positive, say during the first
half-cycle of the supply, the anode of diode D1 is positive w.r.t. cathode, and anode
of diode D2 is negative w.r.t. cathode. Thus only diode D1 conducts, being forward
biased and current flows from cathode to anode of diode D1 through load resistance

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


RL and top half the transformer secondary making cathode end of load resistance RL
positive. During the second half-cycle of the input voltage the polarity is reversed,
making the bottom of the secondary winding positive w.r.t. centre tap and thus diode
D2 is forward biased and diode D1 is reverse biased. Consequently during this halfcycle of the input only the diode D2 conducts and current flows through the load
resistance RL and bottom of the transformer secondary making the cathode end of
the load resistance RL positive. Thus the direction of flow of current through the load
resistance RL remains the same during both halves of the input/supply voltage. Thus
the circuit showed acts as a full-wave rectifier.

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. It was invented by Joseph Henry in 1835.
Because a relay is able to control an output circuit of higher power than the input
circuit, it can be considered to be, in a broad sense, a form of an electrical amplifier.

Fig. 9. Sugar cube relay


Despite the speed of technological developments, some products prove so popular
that their key parameters and design features remain virtually unchanged for years. One

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


such product is the sugar cube relay, shown in the figure above, which has proved
useful to many designers who needed to switch up to 10A, whilst using relatively little
PCB area. Since relays are switches, the terminology applied to switches is also
applied to relays. A relay will switch one or more poles, each of whose contacts can
be thrown by energizing the coil in one of three ways:

1. Normally - open (NO) contacts connect the circuit when the relay is activate d; the
circuit is disconnected when the relay is inactive. It is also called a FORM A contact
or make contact.
2. Normally - closed (NC) contacts disconnect the circuit when the relay is activated;
the circuit is connected when relay is inactive. It is also called form B contact or
break contact
3. Change-over or double-throw contacts control two circuits; one

normally open

contact and one normally closed contact with a common terminal. The following
types of relays are commonly encountered:

Fig. 10. Different types of Relays

SPST - Single Pole Single Throw: These have two terminals which can be connected

or disconnected. Including two for the coil, such a relay has four terminals in total. It is

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


ambiguous whether the pole is normally open or normally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the ambiguity.

SPDT - Single Pole Double Throw: A common terminal connects to either of two

others. Including two for the coil, such a relay has five terminals in total.

DPST - Double Pole Single Throw: These have two pairs of terminals. Equivalent to

two SPST switches or relays actuated by a single coil. Including two for the coil, such a
relay has six terminals in total. It is ambiguous whether the poles are normally open,
normally closed, or one of each.

DPDT - Double Pole Double Throw: These have two rows of change-over terminals.

Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has
eight terminals, including the coil.

QPDT - Quadruple Pole Double Throw: Often referred to as Quad Pole Double

Throw, or 4PDT. These have four rows of change-over terminals. Equivalent to four
SPDT switches or relays actuated by a single coil, or two DPDT relays. In total,
fourteen terminals including the coil.The Relay interfacing circuitry used in the
application is:

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Fig. 11. Relay circuitry

Crystal Oscillator

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Fig. 12. Crystal Oscillator

A miniature 4 MHz quartz crystal enclosed in a hermetically sealed HC-49/US


package, used as the resonator in a crystal oscillator. A crystal oscillator is an
electronic oscillator circuit that uses the mechanical resonance of a vibrating crystal
of piezoelectric material to create an electrical signal with a very precise frequency.
This frequency is commonly used to keep track of time (as in quartz wristwatches),
to provide a stable clock signal for digital integrated circuits, and to stabilize
frequencies for radio transmitters and receivers. The most common type of
piezoelectric resonator used is the quartz crystal, so oscillator circuits designed
around them became known as "crystal oscillators."
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens
of megahertz. More than two billion (2109) crystals are manufactured annually. Most
are used for consumer devices such as wristwatches, clocks, radios, computers, and
cell phones. Quartz crystals are also found inside test and measurement equipment,
such as counters, signal generators, and oscilloscopes.
Operation
A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a
regularly ordered, repeating pattern extending in all three spatial dimensions. Almost
any object made of an elastic material could be used like a crystal, with appropriate
transducers, since all objects have natural resonant frequencies of vibration. For
example, steel is very elastic and has a high speed of sound. It was often used in
mechanical filters before quartz. The resonant frequency depends on size, shape,
elasticity, and the speed of sound in the material. High-frequency crystals are
typically cut in the shape of a simple, rectangular plate. Low-frequency crystals, such
as those used in digital watches, are typically cut in the shape of a tuning fork. For

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


applications not needing very precise timing, a low-cost ceramic resonator is often
used in place of a quartz crystal.
When a crystal of quartz is properly cut and mounted, it can be made to distort in an
electric field by applying a voltage to an electrode near or on the crystal. This
property is known as piezoelectricity. When the field is removed, the quartz will
generate an electric field as it returns to its previous shape, and this can generate a
voltage. The result is that a quartz crystal behaves like a circuit composed of an
inductor, capacitor and resistor, with a precise resonant frequency.
Quartz has the further advantage that its elastic constants and its size change in such
a way that the frequency dependence on temperature can be very low. The specific
characteristics will depend on the mode of vibration and the angle at which the
quartz is cut (relative to its crystallographic axes). Therefore, the resonant frequency
of the plate, which depends on its size, will not change much, either. This means that
a quartz clock, filter or oscillator will remain accurate.

Light sensor
Light Dependent Resistor (LDR) also known as photoconductor or photocell, is a
device which has a resistance which varies according to the amount of light falling
on its surface. Since LDR is extremely sensitive in visible light range, it is well
suited for the proposed application.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Figure.13. LDR
Features of the light sensor:
The Light Dependent Resistor (LDR) is made using the semiconductor Cadmium
Sulphide (CdS).
The light falling on the brown zigzag lines on the sensor causes the resistance of
the device to fall. This is known as a negative co-efficient. There are some LDRs that
work in the opposite way i.e. their resistance increases with light (called positive
coefficient).
The resistance of the LDR decreases as the intensity of the light falling on it
increases. Incident photons drive electrons from the valence band into the conduction
band.

Figure.14. Structure of a LDR


Functional description
An LDR and a normal resistor are wired in series across a voltage, as shown in the
circuit below. Depending on which is tied to the 5V and which to 0V, the voltage at
the point between them, call it the sensor node, will either rise or fall with increasing

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


light. If the LDR is the component tied directly to the 5V, the sensor node will
increase in voltage with increasing light
The LDR's resistance can reach 10 k ohms in dark conditions and about 100 ohms
in full brightness.
The circuit used for sensing light in our system uses a 10 k fixed resistor which is
tied to +5V. Hence the voltage value in this case decreases with increase in light
intensity.
The sensor node voltage is compared with the threshold voltages for different levels
of light intensity corresponding to the four conditions- Optimum, dim, dark and
night.
The relationship between the resistance RL and light intensity Lux for a typical
LDR is: RL = 500 / Lux k
With the LDR connected to 5V through a 10K resistor, the output voltage of the
LDR is : Vo = 5*RL / (RL+10)
In order to increase the sensitivity of the sensor the value of the fixed resistor in
series with the sensor must be reduced.

Microcontroller ATMEGA 8/168/328


Features
High Performance, Low Power Atmel AVR 8-Bit Microcontroller
Advanced RISC Architecture
131 Powerful Instructions Most Single Clock Cycle Execution
32 8 General Purpose Working Registers
Fully Static Operation
Up to 20 MIPS Throughput at 20 MHz
On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


4/8/16 Kbytes of In-System Self-programmable Flash program memory
256/512/512 Bytes EEPROM
512/1K/1K Bytes Internal SRAM
Write/Erase cyles: 10,000 Flash/100,000 EEPROM
Data retention: 20 years at 85C/100 years at 25C
Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
Programming Lock for Software Security
Peripheral Features
Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
Real Time Counter with Separate Oscillator
Six PWM Channels
8-channel 10-bit ADC in TQFP and QFN/MLF package
6-channel 10-bit ADC in PDIP Package
Programmable Serial USART
Master/Slave SPI Serial Interface
Byte-oriented 2-wire Serial Interface (Philips I2C compatible)
Programmable Watchdog Timer with Separate On-chip Oscillator
On-chip Analog Comparator
Interrupt and Wake-up on Pin Change
Special Microcontroller Features
DebugWIRE On-Chip Debug System
Power-on Reset and Programmable Brown-out Detection

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Internal Calibrated Oscillator
External and Internal Interrupt Sources
Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Standby
I/O and Packages
23 Programmable I/O Lines
28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF
Operating Voltage:
1.8V - 5.5V for ATmega48V/88V/168V
2.7V - 5.5V for ATmega48/88/168
Temperature Range:
-40C to 85C
Speed Grade:
ATmega48V/88V/168V: 0 - 4 MHz @ 1.8V - 5.5V, 0 - 10 MHz @ 2.7V - 5.5V
ATmega48/88/168: 0 - 10 MHz @ 2.7V - 5.5V, 0 - 20 MHz @ 4.5V - 5.5V
Low Power Consumption
Active Mode: 250 A at 1 MHz, 1.8V 15
Power-down Mode:0.1A at 1.8V

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Fig. 15. Pin Diagram

Pin Descriptions
1. VCC: Digital supply voltage.
2. GND: Ground.
3. Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2: Port B is an 8-bit bi-directional
I/O port with internal pull-up resistors (selected for each bit). The Port B output
buffers have symmetrical drive characteristics with both high sink and source
capability. As inputs, Port B pins that are externally pulled low will source current if
the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not running.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Depending on the clock selection fuse settings, PB6 can be used as input to the
inverting Oscillator amplifier and input to the internal clock operating circuit.
Depending on the clock selection fuse settings, PB7 can be used as output from the
inverting Oscillator amplifier. If the Internal Calibrated RC Oscillator is used as chip
clock source, PB7..6 is used as TOSC2..1 input for the Asynchronous
Timer/Counter2 if elaborated in Alternate the AS2 bit in ASSR is set.
4. Port C (PC5:0): Port C is a 7-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The PC5..0 output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port C pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
5. PC6/RESET: If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin.
Note that the electrical characteristics of PC6 differ from those of the other pins of
Port C. If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low
level on this pin for longer than the minimum pulse length will generate a Reset,
even if the clock is not running. The minimum pulse length is given in Shorter pulses
are not guaranteed to generate a Reset.
6. Port D (PD7:0): Port D is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port D pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition becomes active, even if the clock is
not running.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


7. AVCC: AVCC is the supply voltage pin for the A/D Converter, PC3:0, and
ADC7:6. It should be externally connected to VCC, even if the ADC is not used. If
the ADC is used, it should be connected to VCC through a low-pass filter. Note that
PC6..4 use digital supply voltage, VCC.
8. AREF: AREF is the analog reference pin for the A/D Converter.
9. ADC7:6 (TQFP and QFN/MLF Package Only)In the TQFP and QFN/MLF
package, ADC7:6 serve as analog inputs to the A/D converter. These pins are
powered from the analog supply and serve as 10-bit ADC channels.
Overview
The ATmega48/88/168 is a low-power CMOS 8-bit microcontroller based on the
AVR enhanced RISC architecture. By executing powerful instructions in a single
clock cycle, the ATmega48/88/168 achieves throughputs approaching 1 MIPS per
MHz allowing the system designed to optimize power consumption versus
processing speed. The AVR core combines a rich instruction set with 32 general
purpose working registers. All the 32 registers are directly connected to the
Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in
one single instruction executed in one clock cycle. The resulting architecture is more
code efficient while achieving throughputs up to ten times faster than conventional
CISC microcontrollers. The ATmega48/88/168 provides the following features:
4K/8K/16K bytes of In-System Programmable Flash with Read-While-Write
capabilities, 256/512/512 bytes EEPROM, 512/1K/1K bytes SRAM, 23 general
purpose I/O lines, 32 general purpose working registers, three flexible
Timer/Counters with compare modes, internal and external interrupts, a serial
programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a
programmable Watchdog Timer with internal Oscillator, and five software selectable
power saving modes. The Idle mode stops the CPU while allowing the SRAM,
Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to
continue functioning. The Power-down mode saves the register contents but freezes
the Oscillator, disabling all other chip functions until the next interrupt or hardware
reset.

Fig.16.Block Diagram of ATMEGA

In Power-save mode, the asynchronous timer continues to run, allowing the user to

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


maintain a timer base while the rest of the device is sleeping. The ADC Noise
Reduction mode stops the CPU and all I/O modules except asynchronous timer and
ADC, to minimize switching noise during ADC conversions. In Standby mode, the
crystal/resonator Oscillator is running while the rest of the device is sleeping. This
allows very fast start-up combined with low power consumption. The device is
manufactured using Atmels high density non-volatile memory technology. The Onchip ISP Flash allows the program memory to be reprogrammed In-System through
an SPI serial interface, by a conventional non-volatile memory programmer, or by an
On-chip Boot program running on the AVR core. The Boot program can use any
interface to download the application program in the Application Flash memory.
Software in the Boot Flash section will continue to run while the Application Flash
section is updated, providing true Read-While-Write operation. By combining an 8bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the
Atmel ATmega48/88/168 is a powerful microcontroller that provides a highly
flexible and cost effective solution to many embedded control applications. The
ATmega48/88/168 AVR is supported with a full suite of program and system
development

tools

including:

Compilers,

Macro Assemblers,

Program

Debugger/Simulators, In-Circuit Emulators, and Evaluation kits.


AVR CPU Core Overview
This section discusses the AVR core architecture in general. The main function of the
CPU core is to ensure correct program execution. The CPU must therefore be able to
access memories, perform calculations, control peripherals, and handle interrupts.

Architectural Overview

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


In order to maximize performance and parallelism, the AVR uses Harvard
architecture with separate memories and buses for program and data. Instructions
in the program memory are executed with a single level pipelining. While one
instruction is being executed, the next instruction is pre-fetched from the program
memory.

Fig.17.Architecture
This concept enables instructions to be executed in every clock cycle. The program
memory is In-System Reprogrammable Flash memory. The fast-access Register File
contains 32 8-bit general purpose working registers with a single clock cycle
access time. This allows single-cycle Arithmetic Logic Unit (ALU) operation. In a
typical ALU operation, two operands are output from the Register File, the operation
is executed, and the result is stored back in the Register File in one clock cycle.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Six of the 32 registers can be used as three 16-bit indirect address register pointers
for Data Space addressing enabling efficient address calculations. One of the these
address pointers can also be used as an address pointer for look up tables in Flash
program memory. These added function registers are the 16-bit X-register, Y-register,
and Z-register, described later in this section. The ALU supports arithmetic and logic
operations between registers or between a constant and a register. Single register
operations can also be executed in the ALU. After an arithmetic operation, the Status
Register is updated to reflect information about the result of the operation. Program
flow is provided by conditional and unconditional jump and call instructions, able to
directly address the whole address space. Most AVR instructions have a single 16-bit
word format. Every program memory address contains a 16-bit or 32-bit instruction.
Program Flash memory space is divided in two sections, the Boot Program section
and the Application Program section. Both sections have dedicated Lock bits for
write and read/write protection. The SPM instruction that writes into the Application
Flash memory section must reside in the Boot Program section. During interrupts
and subroutine calls, the return address Program Counter (PC) is stored on the Stack.
The Stack is effectively allocated in the general data SRAM, and consequently the
Stack size is only limited by the total SRAM size and the usage of the SRAM. All
user programs must initialize the SP in the Reset routine (before subroutines or
interrupts are executed). The Stack Pointer (SP) is read/write accessible in the I/O
space. The data SRAM can easily be accessed through the five different addressing
modes supported in the AVR architecture. The memory spaces in the AVR
architecture are all linear and regular memory maps. A flexible interrupt module has
its control registers in the I/O space with an additional Global Interrupt Enable bit in
the Status Register.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


All interrupts have a separate Interrupt Vector in the Interrupt Vector table. The
interrupts have priority in accordance with their Interrupt Vector position. The lower
the Interrupt Vector address, the higher the priority.
The I/O memory space contains 64 addresses for CPU peripheral functions as
Control Registers, SPI, and other I/O functions. The I/O Memory can be accessed
directly, or as the Data Space locations following those of the Register File, 0x20 0x5F. In addition, the ATmega48/88/168 has Extended I/O space from 0x60 - 0xFF
in SRAM where only the ST/STS/STD and LD/LDS/LDD instructions can be used.
ALU Arithmetic Logic Unit
The high-performance AVR ALU operates in direct connection with all the 32
general purpose working registers. Within a single clock cycle, arithmetic operations
between general purpose registers or between a register and an immediate are
executed. The ALU operations are divided into three main categories arithmetic,
logical, and bit-functions. Some implementations of the architecture also provide a
powerful multiplier supporting both signed/unsigned multiplication and fractional
format. See the Instruction Set section for a detailed description.
Status Register
The Status Register contains information about the result of the most recently
executed arithmetic instruction. This information can be used for altering program
flow in order to perform conditional operations. Note that the Status Register is
updated after all ALU operations, as specified in the Instruction Set Reference. This
will in many cases remove the need for using the dedicated compare instructions,
resulting in faster and more compact code. The Status Register is not automatically
stored when entering an interrupt routine and restored when returning from an
interrupt. This must be handled by software.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


General Purpose Register File
The Register File is optimized for the AVR Enhanced RISC instruction set. In order
to achieve the required performance and flexibility, the following input/output
schemes are supported by the Register File:
One 8-bit output operand and one 8-bit result input
Two 8-bit output operands and one 8-bit result input
Two 8-bit output operands and one 16-bit result input
One 16-bit output operand and one 16-bit result input
Figure shows the structure of the 32 general purpose working registers in the CPU.

Fig.18.Register Structure
Most of the instructions operating on the Register File have direct access to all
registers, and most of them are single cycle instructions. As shown in Figure each
register is also assigned a data memory address, mapping them directly into the first
32 locations of the user Data Space. Although not being physically implemented as
SRAM locations, this memory organization provides great flexibility in access of the

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


registers, as the X-, Y- and Z-pointer registers can be set to index any register in the
file. The X-register, Y-register, and Z-register The registers R26..R31 have some
added functions to their general purpose usage. These registers are 16-bit address
pointers for indirect addressing of the data space.
AVR Memories
Overview
This section describes the different memories in the ATmega48/88/168. The AVR
architecture has two main memory spaces, the Data Memory and the Program
Memory space. In addition, the ATmega48/88/168 features an EEPROM Memory for
data storage. All three memory spaces are linear and regular.
In-System Reprogrammable Flash Program Memory
Counter (PC) is 11/12/13 bits wide, thus addressing the 2K/4K/8K program memory
locations.

Constant tables can be allocated within the entire program memory

address space (see the LPM Load Program Memory instruction description.

Figure .19. Program Memory Map, ATmega48

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Figure .20. Program Memory Map, ATmega88 and ATmega168


SRAM Data Memory
Figure shows how the ATmega48/88/168 SRAM Memory is organized.
ATmega48/88/168 is a complex microcontroller with more peripheral units than can
be supported within the 64 locations reserved in the Opcode for the IN and OUT
instructions. For the Extended I/O space from 0x60 - 0xFF in SRAM, only the
ST/STS/STD and LD/LDS/LDD instructions can be used. The lower 768/1280/1280
data memory locations address both the Register File, the I/O memory, Extended I/O
memory, and the internal data SRAM. The first 32 locations address the Register
File, the next 64 location the standard I/O memory, then 160 locations of Extended
I/O memory, and the next 512/1024/1024 locations address the internal data SRAM.
The five different addressing modes for the data memory cover: Direct, Indirect with
Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Postincrement. In the Register File, registers R26 to R31 feature the indirect addressing
pointer registers. The direct addressing reaches the entire data space. The Indirect
with Displacement mode reaches 63 address locations from the base address given
by the Y-register or Z-register.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


When using register indirect addressing modes with automatic pre-decrement and
post-increment, the address registers X, Y, and Z are decremented or incremented.
The 32 general purpose working registers, 64 I/O Registers, 160 Extended I/O
Registers, and the 512/1024/1024 bytes of internal data SRAM in the
ATmega48/88/168 are all accessible through all these addressing modes.
EEPROM Data Memory
The ATmega48/88/168 contains 256/512/512 bytes of data EEPROM memory. It is
organized as a separate data space, in which single bytes can be read and written. The
EEPROM has an endurance of at least 100,000 write/erase cycles. The access
between the EEPROM and the CPU is described in the following, specifying the
EEPROM Address Registers, the EEPROM Data Register, and the EEPROM Control
Register
EEPROM Read/Write Access
The EEPROM Access Registers are accessible in the I/O space. A self-timing
function, however, lets the user software detect when the next byte can be written. If
the user code contains instructions that write the EEPROM, some precautions must
be taken. In heavily filtered power supplies, VCC is likely to rise or fall slowly on
power-up/down. This causes the device for some period of time to run at a voltage
lower than specified as minimum for the clock frequency used. In order to prevent
unintentional EEPROM writes, a specific write procedure must be followed. Refer to
the description of the EEPROM Control Register for details on this. When the
EEPROM is read, the CPU is halted for four clock cycles before the next instruction
is executed. When the EEPROM is written, the CPU is halted for two clock cycles
before the next instruction is executed.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Preventing EEPROM Corruption
During periods of low VCC, the EEPROM data can be corrupted because the supply
voltage is too low for the CPU and the EEPROM to operate properly. These issues
are the same as for board level systems using EEPROM, and the same design
solutions should be applied. An EEPROM data corruption can be caused by two
situations when the voltage is too low. First, a regular write sequence to the
EEPROM requires a minimum voltage to operate correctly. Secondly, the CPU itself
can execute instructions incorrectly, if the supply voltage is too low. EEPROM data
corruption can easily be avoided by following this design recommendation: Keep the
AVR RESET active (low) during periods of insufficient power supply voltage. This
can be done by enabling the internal Brown-out Detector (BOD). If the detection
level of the internal BOD does not match the needed detection level, an external low
VCC reset Protection circuit can be used. If a reset occurs while a write operation is
in progress, the write operation will be completed provided that the power supply
voltage is sufficient.
I/O Memory
All ATmega48/88/168 I/Os and peripherals are placed in the I/O space. All I/O
locations may be accessed by the LD/LDS/LDD and ST/STS/STD instructions,
transferring data between the 32 general purpose working registers and the I/O space.
I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using
the SBI and CBI instructions. In these registers, the value of single bits can be
checked by using the SBIS and SBIC instructions. Refer to the instruction set section
for more details. When using the I/O specific commands IN and OUT, the I/O
addresses 0x00 - 0x3F must be used. When addressing I/O Registers as data space
using LD and ST instructions, 0x20 must be added to these addresses.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


The ATmega48/88/168 is a complex microcontroller with more peripheral units than
can be supported within the 64 location reserved in Opcode for the IN and OUT
instructions. For the Extended I/O space from 0x60 - 0xFF in SRAM, only the
ST/STS/STD and LD/LDS/LDD instructions can be used. For compatibility with
future devices, reserved bits should be written to zero if accessed. Reserved I/O
memory addresses should never be written. Some of the Status Flags are cleared by
writing a logical one to them. Note that, unlike most other AVRs, the CBI and SBI
instructions will only operate on the specified bit, and can therefore be used on
registers containing such Status Flags. The CBI and SBI instructions work with
registers 0x00 to 0x1F only.
General Purpose I/O Registers
The ATmega48/88/168 contains three General Purpose I/O Registers. These registers
can be used for storing any information, and they are particularly useful for storing
global variables and Status Flags. General Purpose I/O Registers within the address
range 0x00 - 0x1F are directly bit-accessible using the SBI, CBI, SBIS, and SBIC
instructions.
GSM Modem
GSM/GPRS TTL -Modem is built with SIMCOM Make SIM900 Quad-band
GSM/GPRS engine, works on frequencies 850 MHz, 900 MHz, 1800 MHz and 1900
MHz. It is very compact in size and easy to use as plug in GSM Modem. The Modem
is designed with 3V3/5V TTL interfacing circuitry, which allows you to directly
interface to 5V microcontrollers( PIC, Arduino, AVR ect) as well as 3V3
Microcontrollers ( ARM,ARM Cortex XX, ect) .The baud rate can be configurable

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


from 9600-115200 through AT command. Initially Modem is in Autobaud mode. It is
suitable for SMS as well as DATA transfer application in M2M interface. The
modem needed only two wires (Tx,Rx) except Power supply to interface with
microcontroller/Host. The built in Low Dropout Linear voltage regulator allows you
to connect wide range of unregulated power supply (4.2V -13V).
Features

High Quality Product (Not hobby grade)

Quad-Band GSM/GPRS 850/ 900/ 1800/ 1900 MHz

3V3 or 5V interface for direct communication with MCU kit

SMA connector with GSM L Type Antenna.

Built in SIM Card holder.

Built in Network Status LED

Inbuilt Powerful TCP/IP protocol stack for internet data transfer over GPRS.

Audio interface Connector

Most Status & Controlling Pins are available at Connector

Normal operation temperature: -20 C to +55 C

Input Voltage: 5V-12V DC

Figure .21. Modem Dimensions

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Table .3. Modem Operating condition


Operating modes
The table below briefly summarizes the various operating modes referred to in the
following
Turn on GSM Modem Using the PWRKEY Pin (Power on)
You can turn on the Modem by driving the PWRKEY to a low level voltage for a
short time (2-3 sec) and then release. This pin has pulled up to 2.9V in the GSM
Modem. The simple circuit illustrates as the following figures.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Fig.22. Turn on GSM Modem using Open collector circuit


Turn Off GSM Modem
Following ways can be used to turn off the GSM Modem:
1. Normal power down procedure: Turn off GSM Modem using the PWRKEY pin
2. Normal power down procedure: Turn off GSM Modem using AT command
3. Over-voltage or under-voltage automatic shutdown: Take effect if over-voltage or
under-voltage is detected
4.Over-temperature or under-temperature automatic shutdown: Take effect if overtemperature or under-temperature is detected
Turn Off GSM Modem Using the PWRKEY Pin (Power down)
You can turn off the GSM Modem by driving the PWRKEY to a low level voltage
for a short time (2-3 sec) and then release. Please refer to the turn on circuit above.
The power down scenario illustrates as following fig: 8.This procedure lets the
modem log off from the network and allows the software to enter into a secure state

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


and save data before completely disconnecting the power

supply. Before the

completion of the switching off procedure the GSM Modem will send out result
code: NORMAL POWER DOWN After this moment, the AT commands cant be
executed. The modem enters the POWER DOWN mode. POWER DOWN can also
be indicated by STATUS pin, which is a low level voltage in this mode.
Turn Off GSM Modem Using AT Command
You can use the AT command AT+CPOWD=1 to turn off the modem. This
command lets the GSM Modem log off from the network and allows the GSM
Modem to enter into a secure state and save data before completely disconnecting the
power supply. Before the completion of the switching off procedure the GSM
Modem will send out result code: NORMAL POWER DOWN After this moment,
the AT commands cant be executed. The GSM Modem enters the POWER DOWN
mode, only the RTC is still active. POWER DOWN can also be indicated by
STATUS pin, which is a low level voltage in this mode.
Restart GSM Modem Using the PWRKEY Pin
The GSM MODEM can be started by driving the PWRKEY to a low level voltage
for a short time (2-3 sec) and then release, the same as turning on GSM MODEM
using the PWRKEY pin. Before restarting the GSM MODEM, you need delay at
least 500ms from detecting the STATUS low level on. The restarting scenario
illustrates as the following figure.
Power Saving
There are two methods for the GSM Modem to enter into low current consumption
status. AT+CFUN is used to set GSM Modem into minimum functionality mode

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


and DTR hardware interface signal can be used to lead system to be in SLEEP mode
(or slow clocking mode).
Minimum Functionality Mode
The minimum mode is set with the AT+CFUN command which provides the
choice of the functionality levels <fun>=014

0: minimum functionality;

1: full functionality (default);

4: disable phone both transmit and receive RF circuits;

If GSM MODEM has been set to minimum functionality by AT+CFUN=0, the RF


function and SIM card function will be closed. In this case, the serial port is still
accessible, but all AT commands correlative with RF function or SIM card function
will not be accessible. If GSM MODEM has been set by AT+CFUN=4, the RF
function will be closed, the serial port is still active. In this case all AT commands
correlative with RF function will not be accessible After GSM MODEM has been set
by AT+CFUN=0 or AT+CFUN=4, it can return to full functionality by
AT+CFUN=1.
Sleep Mode (Slow Clock Mode)
We can control SIM900 GSM Modem to enter or exit the SLEEP mode in customer
applications through DTR signal. When DTR is in high level and there is no on air
and hardware interrupt (such as GPIO interrupt or data on serial port), GSM
MODEM will enter SLEEP mode automatically. In this mode, GSM MODEM can
still receive paging or SMS from network but the serial port is not accessible. Note:
For GSM MODEM, it requests to set AT command AT+CSCLK=1 to enable the

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


sleep mode; the default value is 0, that cant make the GSM Modem enter sleep
mode. For more details please refer to our AT command list.
Wake Up GSM MODEM from SLEEP Mode
When GSM MODEM is in SLEEP mode, the following methods can wake up the
GSM Modem.

Enable DTR pin to wake up GSM MODEM. If DTR pin is pulled down to a
low level this signal will wake up GSM MODEM from power saving mode.
The serial port will be active after DTR changed to low level for about 50ms.

Receiving a voice or data call from network to wake up GSM MODEM.

Receiving a SMS from network to wake up GSM MODEM.

Summary of State Transitions (except SLEEP mode)


The following figure shows how to proceed from one mode to another.

Fig.23. State Transition Block


Serial Interfaces
The GSM module is designed as a DCE (Data Communication Equipment),
following the traditional DCE-DTE (Data Terminal Equipment) connection. The

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


GSM Modem and the client (DTE) are connected through the following signal (as
following figure shows). Autobauding supports baud rate from 1200bps to 57600bps.
Serial port

TXD: Send data to the RXD signal line of the DTE

RXD: Receive data from the TXD signal line of the DTE

Serial port of the GSM engine supports autobauding for the following baud rates:
1200, 2400, 4800, 9600, 19200,38400 and 57600bps. Factory setting is autobauding
enabled. This gives you the flexibility to put the GSMengine into operation no matter
what baud rate your host application is configured to. To take advantage of
autobauding mode, specific attention should be paid to the following requirements:
Synchronization between DTE and DCE: When DCE powers on with the
autobauding enabled, user must first send A to synchronize the baud rate. It is
recommended to wait 2 to 3 seconds before sending AT character. After receiving
the OK response, DTE and DCE are correctly synchronized. The more information
please refer to the AT command AT+IPR.
Restrictions on autobauding operation

The serial port has to be operated at 8 data bits, no parity and 1 stop bit
(factory setting).

The Unsolicited Result Codes like "RDY", "+CFUN: 1" and "+CPIN:
READY are not indicated when you startup the ME while autobauding is
enabled. This is due to the fact that the new baud rate is not detected unless
DTE and DCE are correctly synchronized as described above.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

AT Command Syntax
When DCE powers on with the autobauding enabled, user must first send A to
synchronize the baud rate. It is recommended to wait 2 to 3 seconds before sending
AT character. After receiving the OK response, DTE and DCE are correctly
synchronized The AT or at prefix must be set at the beginning of each
Command. To terminate a Command line enter <CR> , otherwise known as carriage
return or \r.
Commands are followed by a response that includes
<CR><LF><response><CR><LF>. Only the responses are presented in the
document here, <CR><LF> are omitted intentionally
Example: With Local Echo enabled:
Transmit: AT\r
Receive: AT\r\r\nOK\r\n
SETTINGS FOR EASY MICROCONTROLLER COMMUNICATION
When communicating with the GSM Modem using a microcontroller, you usually
want very short responses, no local echo, and no startup messages. Sticking on the
&W to the end of the command saves the setting into memory.
ATV0&W\r Enable short response
ATE0&W\r Disable Local Echo
AT+CIURC=0;&W\r Disable CALL READY Startup Message
Now instead of commands returning OK or ERROR in plain text, as well as
repeating all written commands, the GSM Modem will not echo what you transmit
and the GSM Modem will return error codes in single bytes. For
example, instead of:
Transmit: AT\r

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Receive: \r\nOK\r\n
Youll have:
Transmit: AT\r
Receive: \r\n0\r\n
SAMPLE AT COMMANDS CODE
1. PHONE COMMUNICATION
Goal: Call a phone
Dial 123-456-7890 = ATD1234567890;\r
This command returns OK or ERROR. Returns NO CARRIER when phone hangs up
2. SEND A TEXT MESSAGE
Goal: Send a text
AT+CMGF=1\r
Returns OK or ERROR
AT+CSCS=GSM\r
Returns OK or ERROR
AT+CSCA=+13123149810 \r
Returns OK or ERROR. This number +13123149810 is the short message center for
AT&T/Cingular service. T-Mobiles is +12063130004
AT+CSMP=17,167,0,240\r
Returns OK or ERROR. These numbers refer to settings for text message sending,
keep them this way.
AT+CMGS=
AT+CMGS=1234567890\r
Returns > , prompting what message to send. 1234567890 is the phone number that
the text message will be sent to. Hello this is a message <Ctrl+z> Type any message,
then press <Ctrl+z>. Returns confirmation message and Message ID number

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


3. SEND A TEXT MESSAGE
Goal: Read a Text
AT+CMGF=1\r
Returns OK or ERROR
AT+CMGDA=DEL ALL
Delete all text
AT+CNMI=0,0
Disable unsolicited error code
AT+CMGR=1
Read Message #1
AT+CMGL=REC UNREAD
Read all received unread messages
Debug port

Null modem port

Only contain Data lines TXD and RXD

Debug Port used for debugging and upgrading firmware. It cannot be used for
CSD call, FAX call. And the Debug port can not use multiplexing function. It
does not support autobauding function.

Debug port supports the communication rates is 115200bps

Software Upgrade and Software Debug


The DBG_TXD, DBG_RXD and GND must be connected to the IO connector when
user need to upgrade software and debug software, the DBG_TXD, DBG_RXD
should be used for software upgrade and for software debugging. The TXD and RXD
also should be connected to the IO connector, if user wants to send AT command or

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


data stream to GSM MODEM. The PWRKEY pin is recommended to connect to the
IO connector. The user also can add a switch between the PWRKEY and the GND.

The PWRKEY should be connected to the GND when GSM MODEM is upgrading
software.
Interfacing the GSM modem

Fig.24. Interfacing the Modem to microcontroller (Basic connection)


The Modem can be directly interface with 5V microcontrollers like PIC ,AVR , 8051
Derivatives , Arduinos and 3V3 Microcontrollers like ARM ,ARM Cortex XX ect.
Make ensure V_INTERFACE pin is supplied with same voltage level as the
microcontroller VCC. As per the Fig:3 there is only 2 connections are required to use
the modem . Connect RX pin of the modem to the TX pin of the microcontroller and

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


TX pin of the modem to microcontrollers RX pin. The connected power supply
(4.2v to 12v dc) should be capable of handling current up to 1 A.

Getting started
1) Insert SIM card Open the SIM cardholder by sliding it as per the arrow mark and
lift up. Insert the SIM card , so as to align the chamfered corner suits in card holder.
After inserting the SIM card, lock the holder by sliding it to the
opposite direction of arrow mark.
2) Connect The Antenna: Fix the Supplied RF antenna to the SMA Antennae
connector and tighten it by Rotating the Nut ( Never rotate the antennae for
tightening ).
3) Connect the Pins: Connect the GSM modem as per the circuit diagram provided
4) Power the Modem: Power the modem from suitable power supply, which is
having enough current capacity (>1A).
5) Check the Status of the LEDs
PWR LED - Red LED will lit immediately
STS LED - Green LED will lit after 1-2 seconds
NET LED -Blue LED will starts to blink in fast for few seconds(Searching For
Network) and becomes slow blinking once the Modem registers with the Network.
6) Network LED: The Network LED indicates the various status of GSM module eg.
Power on, Network registration & GPRS connectivity. When the modem is powered
up, the status LED will blink every second. After the Modem registers in the network
(takes between 10-60 seconds), LED will blink in step of 3 seconds. At this stage you
can start using Modem for your application.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


7) Baud rate: The Baud rate supported by the modem is between 9600 and 115200.
Make sure the host system is set to the supported baud rate.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


Table.4. Pin Description of GSM Modem

5. PROJECT OUTCOME
A s t e p -by-step approach in designing the microcontroller based system for
measurement and control of the four essential parameters for plant growth, i.e.
temperature, humidity, soil moisture, and light intensity, has been followed. The
results obtained from the measurement have shown that the system performance is
quite reliable and accurate. The system has successfully overcome quite a few
shortcomings of

the

existing systems by reducing the power consumption,

maintenance and complexity, at the same time providing a flexible and precise form
of maintaining the environment. The continuously decreasing costs of hardware and
software, the wider acceptance of electronic systems in agriculture, and an emerging
agricultural control system industry in several areas of agricultural production, will
result in reliable control systems that will address several aspects of quality and
quantity of production. Further improvements will be made as less expensive and
more reliable sensors are developed for use in agricultural production. Although the
enhancements mentioned in the previous chapter may seem far in the future, the
required technology and components are available, many such systems have been
independently developed, or are at least tested at a prototype level. Also, integration
of all these technologies is not a daunting task and can be successfully carried out.
Analysis

The test was conducted in electronics lab in the presence of guide. Though this
concept itself is an advanced version, further improvements to this model will make
this an ideal one and can be introduced in the market. We hope a small step in this

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


direction will be acceptable. If the work done by one batch students is continued by
the succeeding batches, we hope this concept can inspire those who are interested to
move in this direction. During this project session we came out with certain facts
that are to be considered for the future improvement. It has also been analyzed that
with the increase in provision for micro controller pin the more parameters can be
controlled in an efficient manner. It can be accomplished through a slight change in
the logic of the program.
Observation:
The temperature sensor senses an abnormal range (eg. below 20C or above 35C) it
will activates the air condition there by controlling the temperature in a surrounding
at the desired range automatically. It will also send a text messages to the user
through GSM modem connected to the micro controller. Similarly the humidity is
also sensed and the message will be send when the value reaches an abnormal value
(eg. 75%). In the case of moisture sensor when the sensor senses a dry condition it
will sends the signal to the water pump. Here the sensing range could be adjusted
easily by adjusting the potentiometer. Similar is the case of light sensor, the sensor
used is LDR where the range could be adjusted by adjusting the potentiometer.
Output Accessibility:
Here the electrical devices like air conditioner, water pump, artificial lights are
indicated with LEDs which could be connected to real one after making it to pass
through suitable relays. Here for the purpose of demonstration one such relay switch
has been provided. The provision for changing the range of sensing values has been
provided at each sensing part. Here the humidity control and messaging of
information regarding light has not been provided due to shortage of microcontroller
pins which can overcome by choosing a microcontroller with more pins. A slight

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


modification in the programming of microcontroller can improve the performance of
the device and can control more number of parameters.

CONCLUSION
The innovative concept of controlling green house parameters has been designed in
this project. By conveying each and every status of green house through text
messages we could inform the user about the condition at green house. Such a
project creates an awareness of such low cost devices which could be bought into
use in daily life with small variations in the programming logic. During this project
session we came out with certain facts that are to be considered for the future
improvement with much more efficiency. Even though LEDs are used to indicate
various electrical devices, while introducing the device in market LEDs are
replaced by real electrical devices through suitable relays. So we the future
engineers need to come up with such ideas which would be useful to common man.
From this project we conclude that this product will help farmers to a large extend.
Though this concept itself is an advanced version, further improvements to this
model will make this an ideal one. This project was broadly classified into three
phases: Idea development, Component identification, Bread board verification of
designed circuit, we could successfully complete all the phases and develop the
desired product in the given time frame. This project is completed with full faith
that the device made will act as an efficient tool for monitoring and controlling of
green house parameters.

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

REFERENCES

1.

Gupta, J.B (2009). Digital Logic Families, Electronic Devices and


Circuits,3

2.

Rebecca Tyson Northen, (1985). Orchids As House Plants, Green House ,2

3.

Muhammad Ali Mazidi, Janice Gillispie Mazidi, Rolin D. Mc Kinlay ,


(2008)Microcontroller & Embedded Systems, Processor and Controller,2

4.

Myke Predko, (1999). Programming and Customizing the Microcontroller,


TMH,.

5.

Kenneth J Ayala, (2004). The Microcontroller Architecture, Programming &


Applications,ATMEGA,2

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

APPENDIX-I
PROGRAM CODE

#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
SoftwareSerial gsm(2, 3);
LiquidCrystal lcd(12, 13, 8, 9, 10, 11);
int RHPin = 1; // analog pin
int TempPin = 3; // analog pin
int tempc = 0; // temperature variable
int samples[8]; // variables to make a better precision
int maxi = -100,mini = 100; // to start max/min temperature
int tempH =0; //humidity variable
int i;
int flag1=0,flag2=0,flag3=0;
void setup()
{
lcd.begin(16,2);

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


gsm.begin(9600);
Serial.begin(9600); // start serial communication
pinMode(4,INPUT);
pinMode(7,OUTPUT);
pinMode(6,OUTPUT);
lcd.print("

CLIMATIC "); // Print a message to the LCD.

delay (1000);
lcd.setCursor(0, 1);
lcd.print(" CONTROLLER ");
delay (3000);
lcd.clear();
}
void loop()
{
for(int i = 0; i <= 7;i++){ // gets 8 samples of temperature
samples[i] = ( 5.0 * analogRead(3) * 100.0) / 1024.0;
tempc = tempc + samples[i];
delay(100);
tempH =(5.0 * analogRead(1) * 1000.0) /1024.0;
}
tempc = tempc/8.0; // better precision

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


//////////////////////////////////////////////////////////////////////
if(tempH>2200)
{

if(flag1==1)
{
lcd.clear();
lcd.print("Waiting");
delay(30000);
lcd.clear();
lcd.print("Wait Complete");
delay(3000);
}
send_sms();
flag1=1;
}
else
{
flag1=0;
}
//////////////////////////////////////////////////////////////////////////
if(tempc>35)
{
if(flag2==1)
{
lcd.clear();

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


lcd.print("Waiting");
delay(30000);
lcd.clear();
lcd.print("Wait complete");
delay(3000);
}
send_smst();
flag2=1;
}
else
{
flag2=0;
}
//////////////////////////////////////////////////////////////////////////
if(analogRead(5)<200)
{
digitalWrite(6,HIGH);
}
else
{
digitalWrite(6,LOW);
}
////////////////////////////////////////////////////////////////////
if(digitalRead(4)==LOW)
{

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


digitalWrite(7,HIGH);
if(flag3==1)
{
lcd.clear();
lcd.print("Waiting");
delay(30000);
lcd.clear();
lcd.print("Wait complete");
delay(3000);
}
send_smsm();
flag3=1;
}
else
{
flag3=0;
digitalWrite(7,LOW);
}
////////////////////////////////////////////////////////////////
lcd.clear();
lcd.print("Temp:");
lcd.setCursor(6,0);
lcd.print(tempc);
lcd.setCursor(9,0);
lcd.print("Celsius, ");

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


lcd.setCursor(0,1);
lcd.print("RH :");
lcd.setCursor(5,1);
lcd.print(tempH);
lcd.setCursor(10,1);
lcd.print(" mV ");

delay(500); // delay before loop


tempc = 0;
tempH = 0;
}
void send_sms()
{
lcd.clear();
lcd.print("Sending Message");
gsm.print("AT\r\n");
delay(3000);
lcd.clear();
lcd.print("...");
gsm.print("ATE0\r\n");

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


delay(3000);
lcd.clear();
lcd.print("......");
gsm.print("AT+CMGF=1\r\n");
delay(3000);
lcd.clear();
lcd.print("...........");
gsm.print("AT+CMGS=\"+918089475739\"\r\n");
delay(3000);
gsm.print("Humidity is more than 75%");
lcd.clear();
lcd.print("................");
gsm.write(0x1A);
lcd.clear();
delay(1500);
lcd.print("Message Send");
delay(1500);
}
void send_smsm()
{
lcd.clear();
lcd.print("Sending Message");
gsm.print("AT\r\n");
delay(3000);

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


lcd.clear();
lcd.print("...");
gsm.print("ATE0\r\n");
delay(3000);
lcd.clear();
lcd.print("......");
gsm.print("AT+CMGF=1\r\n");
delay(3000);
lcd.clear();
lcd.print("...........");
gsm.print("AT+CMGS=\"+918089475739\"\r\n");
delay(3000);
gsm.print("Moisture is low");
lcd.clear();
lcd.print("................");
gsm.write(0x1A);
lcd.clear();
delay(1500);
lcd.print("Message Send");
delay(1500);
}
void send_smst()
{
lcd.clear();

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


lcd.print("Sending Message");
gsm.print("AT\r\n");
delay(3000);
lcd.clear();
lcd.print("...");
gsm.print("ATE0\r\n");
delay(3000);
lcd.clear();
lcd.print("......");
gsm.print("AT+CMGF=1\r\n");
delay(3000);
lcd.clear();
lcd.print("...........");
gsm.print("AT+CMGS=\"+918089475739\"\r\n");
delay(3000);
gsm.print("temp high");
lcd.clear();
lcd.print("................");
gsm.write(0x1A);
lcd.clear();
delay(1500);
lcd.print("Message Send");
delay(1500);

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS


}

APPENDIX-II

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

APPENDIX-III

MONITOR AND CONTROL OF GREEN HOUSE PARAMETERS

Você também pode gostar