8/19/2019 Greenhouse Monitoring Using Zigbee1
1/104
GREENHOUSE MONITORING USING ZIGBEE
ABSTRACT
Monitoring and control of greenhouse environment play an important role ingreenhouse production and management. To monitor the greenhouse environment
parameters effectively, it is necessary to design a measurement and control system.
The aim of this project is to monitor the conditions in green house by using sensor nodes which collect the signals from the humidity sensor, soil moisture sensor andcontrol the actuators, and transmit the data through the wireless RF transceiver; themaster node receives the data through the RF transceiver .
All the parameters can be measured by using ATM ! "#s$% microcontroller transmitted to far distance by using wireless communication system called &igbee. .Result shows that the system is practical and reliable, and has wide application in thefuture
Page1
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
2/104
INTRODUCTION
'e 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. )ne such field is that of
agriculture. Agriculture has been one of the primary occupations of man since earlycivili*ations and even today manual interventions in farming are inevitable.
+reenhouses 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.
CURRENT SCENARIO:
+reenhouses in ndia are being deployed in the high(altitude regions where the
sub( *ero temperature up to (- / 0 ma1es any 1ind of plantation almost impossible
and in arid regions where conditions for plant growth are hostile. The e2isting set(ups
primarily are3
MANUAL SET-UP:
Page2
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
3/104
This set(up involves visual inspection of the plant growth, manual irrigation of
plants, turning )4 and )FF the temperature controllers, manual spraying of the
fertili*ers and pesticides. t is time consuming, vulnerable to human error and
hence less accurate and unreliable.
PARTIALLY AUTOMATED SET-UP :
This set(up is a combination of manual supervision and partial automation
and is similar to manual set(up in most respects but it reduces the labor
involved in terms of
irrigating the set(up .
FULLY- AUTOMATED:
This is a sophisticated set(up which is well e5uipped to react to most of the climatic
changes occurring inside the greenhouse. t wor1s on a feedbac1 system which helps it
to respond to the e2ternal stimuli efficiently. Although this set(up overcomes the
problems caused due to human errors it is not completely automated and e2pensive.
3.BLOCK DIAGRAM OF THE PROJECT
Page3
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
4/104
Page4
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
5/104
Fig 3.1-BLOCK DIAGRAM
4.Power Supply
Block Diagram:
There are many types of power supply. Most are designed to convert high voltage A0
mains electricity to a suitable low voltage supply for electronics circuits and other
devices. A power supply can by bro1en down into a series of bloc1s, each of which
performs a particular function.
For e2ample a $6 regulated supply3
Page5
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
6/104
FIG 4.1
ach of the bloc1s is described in more detail below3
• Transformer ( steps down high voltage A0 mains to low voltage A0.
• Rectifier ( converts A0 to 70, but the 70 output is varying.
• 8moothing ( smoothes the 70 from varying greatly to a small ripple.
• Regulator ( eliminates ripple by setting 70 output to a fi2ed voltage.
9ower supplies made from these bloc1s are described below with a circuit diagram and a
graph of their output3
• Transformer only
• Transformer : Rectifier
• Transformer : Rectifier : 8moothing
• Transformer : Rectifier : 8moothing : Regulator
Dual Supplies:
Page6
DEPATMENT OF EIE
http://www.kpsec.freeuk.com/powersup.htm#transformer%23transformerhttp://www.kpsec.freeuk.com/powersup.htm#rectifier%23rectifierhttp://www.kpsec.freeuk.com/powersup.htm#smoothing%23smoothinghttp://www.kpsec.freeuk.com/powersup.htm#regulator%23regulatorhttp://www.kpsec.freeuk.com/powersup.htm#tonly%23tonlyhttp://www.kpsec.freeuk.com/powersup.htm#tr%23trhttp://www.kpsec.freeuk.com/powersup.htm#trs%23trshttp://www.kpsec.freeuk.com/powersup.htm#trsr%23trsrhttp://www.kpsec.freeuk.com/powersup.htm#rectifier%23rectifierhttp://www.kpsec.freeuk.com/powersup.htm#smoothing%23smoothinghttp://www.kpsec.freeuk.com/powersup.htm#regulator%23regulatorhttp://www.kpsec.freeuk.com/powersup.htm#tonly%23tonlyhttp://www.kpsec.freeuk.com/powersup.htm#tr%23trhttp://www.kpsec.freeuk.com/powersup.htm#trs%23trshttp://www.kpsec.freeuk.com/powersup.htm#trsr%23trsrhttp://www.kpsec.freeuk.com/powersup.htm#transformer%23transformer
8/19/2019 Greenhouse Monitoring Using Zigbee1
7/104
8ome electronic circuits re5uire a power supply with positive and negative outputs as
well as *ero volts 6#6 supply has :#6, 6 and (#6outputs .
Transformer only:
The low vol !"# AC output is suitable for lamps, heaters and special A0 motors. t is
$o suitable for electronic circuits unless they include a rectifier and a smoothing
capacitor.
Transformer + Rectifier:
Page7
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
8/104
The v!%&'$" DC output is suitable for lamps, heaters and standard motors. t is $o
suitable for electronic circuits unless they include a smoothing capacitor.
Transformer + Rectifier + Smoothing:
The ()oo * DC output has a small ripple. t is suitable for most electronic circuits.
Transformer + Rectifier + Smoothing + Regulator:
Page8
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
9/104
The %#"+l! #, DC output is very smooth with no ripple. t is suitable for all electronic
circuits.
Transformer:
Transformer circuit symbol
Transformers convert A0 electricity from one voltage to another with little loss of
power. Transformers wor1 only with A0 and this is one of the reasons why mains
electricity is A0.
8tep(up transformers increase voltage, step(down transformers reduce voltage. Most
power supplies use a step(down transformer to reduce the dangerously high mains
voltage %? 6 in @ < to a safer low voltage.Page9
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
10/104
The input coil is called the %')!%& and the output coil is called the (# o$,!%& . There is
no electrical connection between the two coils, instead they are lin1ed by an alternating
magnetic field created in the soft(iron core of the transformer. The two lines in the
middle of the circuit symbol represent the core.
Transformers waste very little power so the power out is almost< e5ual to the power in.
4ote that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the +%$( %! 'o, determines the ratio
of the voltages. A step(down transformer has a large number of turns on its primary
input< coil which is connected to the high voltage mains supply, and a small number of
turns on its secondary output< coil to give a low output voltage.
Rectifier:
There are several ways of connecting diodes to ma1e a rectifier to convert A0 to 70.The bridge rectifier is the most important and it produces /+ll-w!v#
varying 70. A full(wave rectifier can also be made from just two diodes if a centre(tap
transformer is used, but this method is rarely used now that diodes are cheaper. A
single diode can be used as a rectifier but it only uses the positive :< parts of the A0
wave to produce *!l/-w!v# varying 70.
Bridge rectifier:
Page10
DEPATMENT OF EIE
http://www.kpsec.freeuk.com/powersup.htm#bridgerectifier%23bridgerectifierhttp://www.kpsec.freeuk.com/powersup.htm#singlediode%23singlediodehttp://www.kpsec.freeuk.com/powersup.htm#bridgerectifier%23bridgerectifierhttp://www.kpsec.freeuk.com/powersup.htm#singlediode%23singlediode
8/19/2019 Greenhouse Monitoring Using Zigbee1
11/104
A bridge rectifier can be made using four individual diodes, but it is also available in
special pac1ages containing the four diodes re5uired. t is called a full(wave rectifier
because it uses the entire A0 wave both positive and negative sections
8/19/2019 Greenhouse Monitoring Using Zigbee1
12/104
Bridge re !i"ier
Alternate pairs of diodes conduct, changing
over
the connections so the alternating
directions of
A0 isconverted to one direction of 70 .
Ou!pu!# "ull-w$%e %$ryi&g DC
using all the A0 wave<
Single diode rectifier:
A single diode can be used as a rectifier but this produces *!l/-w!v# varying 70 which
has gaps when the A0 is negative. t is hard to smooth this sufficiently well to supply
electronic circuits unless they re5uire a very small current so the smoothing capacitor
does not significantly discharge during the gaps. 9lease see the 7iodes page for some
e2amples of rectifier diodes.
Si&gle diode re !i"ier Ou!pu!# '$l"-w$%e %$ryi&g DC
(using only half the AC wave)
Smoothing:
Page12
DEPATMENT OF EIE
http://www.kpsec.freeuk.com/components/diode.htm#rectifierhttp://www.kpsec.freeuk.com/components/diode.htm#rectifier
8/19/2019 Greenhouse Monitoring Using Zigbee1
13/104
8moothing is performed by a large value electrolytic capacitor connected across the 70
supply to act as a reservoir, supplying current to the output when the varying 70 voltage
from the rectifier is falling. The diagram shows the unsmoothed varying 70 dotted
line< and the smoothed 70 solid line
8/19/2019 Greenhouse Monitoring Using Zigbee1
14/104
!moothing ca"acitor for #$% ri""le& C '
0 G smoothing capacitance in farads F<
o G output current from the supply in amps A<
6s G supply voltage in volts 6
8/19/2019 Greenhouse Monitoring Using Zigbee1
15/104
Voltage Regulator:
Page15
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
16/104
6oltage regulator 0s are available with fi2ed typically $, B% and B$6< or variable
output voltages. They are also rated by the ma2imum current they can pass. 4egative
voltage regulators are available, mainly for use in dual supplies. Most regulators include
some automatic protection from e2cessive current =overload protection=< and
overheating =thermal protection=
8/19/2019 Greenhouse Monitoring Using Zigbee1
17/104
Zener diode regulator:
For low current power supplies a simple voltage regulator can be made with a resistor
and a *ener diode connected '$ %#v#%(# as shown in the diagram. &ener diodes are rated
by their 0%#!1,ow$ vol !"# 2 and )!4')+) ow#% P typically - m' or B.?'
8/19/2019 Greenhouse Monitoring Using Zigbee1
18/104
$. The %#('( o% %#('( !$ #3 R G 6s ( 6*< K ma2
. The %#('( o% ow#% %! '$"3 9 J 6s ( 6*< E ma2
5.MICRO CONTROLLER A )' %o o$ %oll#% or MCU < is a computer(on(a(chip used to control electronic
devices. t is a type of microprocessor emphasi*ing self(sufficiency and cost(
effectiveness, in contrast to a general(purpose microprocessor the 1ind used in a 90
8/19/2019 Greenhouse Monitoring Using Zigbee1
19/104
A typical mid range vehicle has as many as $ or more microcontrollers. They can also
be found in almost any electrical device3 washing machines, microwave ovens,
telephones etc
T!0l# 5.6 8ome of the commonly used microcontrollers.
-(bit
Microcontrollers
Te2as nstruments TM8 B
4ational 0)9-%
Iitachi IM08-
Toshiba T!08-C
"(bit
Microcontrollers
ntel " -"
ntel " $B
Microchip 9 0B 0$
4ational 0)9"%
Motorola "I0BB
Te2as nstruments TM8C$
&ilog &"
B (bit
Microntrollers
Motorola M0 "??%
ntel M08(# Family of Microcontrollers includes
Page19
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
20/104
" # DI, " 0B# D, and " 0B# 0<
Motorola "I0B
4ational I90B B -
Iitachi I"K$?%
?%(bit
Microcontrollers
ntel " # 0A, A, D, M0
!R ??
AM7 Am%# $
48 ?%
A microcontroller contains a complete central processing unit 09@< along with a
full complement of interfacing peripherals. The complete range of binary inputKoutput,
both parallel and serial, and synchronous and asynchronous is available on most of the
microcontrollers. The objective is to ma1e the microcontrollers not primarily message
handlers but to allow effective communication with other similar devices. )ne of the
important features of a microcontroller is the on(chip analog(to(digital converter A70
8/19/2019 Greenhouse Monitoring Using Zigbee1
21/104
Another important feature of a microcontroller is the availability of on(chip
timers. Most microcontrollers have versatile timers that can be configured in real time.
These timers can be reprogrammed as to the duration of time that they will measure, the
type of interrupt that they will generate, and whether they will reload and continue to
time the ne2t time period automatically. A second type of timer called a watchdog timer
is also usually available on(chip. This timer is used to restart the microcontroller if it
fails to be reset at regular intervals. The interval between clearing the watchdog timer is
usually programmable and is chosen to fit the type of application.
Microcontrollers are available with different types and amounts of on(chip
memories. For e2ample, ntel " 0B# D has " 1ilobytes of on(chip 9R)M and %?%
bytes of on(chip RAM while ntel " 0B# 0 has B 1ilobytes of 9R)M and -""
bytes of on(chip RAM. )nly a small amount of on(chip RAM is provided because
microcontrollers usually compute transient 5uantities; they are not meant to be word
processors.
A functioning microcontroller system re5uires only e2ternal R8%?% voltage
converters and a crystal oscillator. Iowever, a microcontroller system used for comple2
applications may include e2ternal memory.
Page21
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
22/104
B!(' ( %+ +%# o/ ! )' %o o$ %oll#%
Figure shows the bloc1 diagram of a typical microcontroller. The four basic parts
of a microcontroller are3 central processing unit 09@
8/19/2019 Greenhouse Monitoring Using Zigbee1
23/104
The 09@ of a microcontroller consists of arithmetic and logic unit A!@
8/19/2019 Greenhouse Monitoring Using Zigbee1
24/104
code and operand s
8/19/2019 Greenhouse Monitoring Using Zigbee1
25/104
information stored in memory, it is performing a read operation. 'hen the 09@ sends
information to be stored in the memory, it is performing a write operation. Memory is
classified as internal and e2ternal memory. nternal memory is on(chip memory and is a
semiconductor type with low capacity and high speeds. 2ternal memory is outside the
chip and includes the semiconductor type and serial memory such as magnetic dis1s,
magnetic tapes, and bubble memory. 8emiconductor memory may be volatile or
nonvolatile. 6olatile memory loses its contents after the power is removed from the
memory chip. 4onvolatile memory does not lose its contents when power is removed.
The nonvolatile memory can store information permanently or at least semi(permanently
ten years or more
8/19/2019 Greenhouse Monitoring Using Zigbee1
26/104
The storage cell of a R)M Read(only memory< consists of a DOT Dipolar
Ounction Transistor
8/19/2019 Greenhouse Monitoring Using Zigbee1
27/104
7.MICROCONTROLLER AT89S ;
Page27
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
28/104
F'"7.6 :A% *' # +%# o/ 89S ;
F AT@R 83
0ompatible with M08($B 9roducts.
" Dytes of n(8ystem Reprogrammable Flash Memory.ndurance3 B, 'riteK rase 0ycles.
QFully 8tatic )peration3 I* to %- MI*.Three(level 9rogram Memory !oc1.%$ 2 "(Dit nternal RAM.?% 9rogrammable K) !ines.Three B (bit TimerK0ounters.
ight nterrupt 8ources.9rogrammable 8erial 0hannel.
!ow 9ower dle and 9ower 7own Modes
Page28
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
29/104
9 4 7 A+RAM A47 T8 7 80R 9T )43
The microcontroller generic part number actually includes a whole family of
microcontrollers that have numbers ranging from " ?Bto "C$B and are available in 4(
0hannel Metal )2ide 8ilicon 4M)8< and 0omplementary Metal )2ide 8ilicon
0M)8< construction in a variety of pac1age types.
PIN DIAGRAM
Page29
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
30/104
F'"7.; : P'$ D'!"%!)
'ith - bytes of Flash 9rogrammable and rasable Read )nly Memory
9 R)M
8/19/2019 Greenhouse Monitoring Using Zigbee1
31/104
with Flash on a monolithic chip, the Atmel AT"#8$% is a powerful microcomputer which
provides a highly fle2ible and cost effective solution to many embedded control
applications.
The AT"#8$% provides the following standard features3 - bytes of Flash, %$
bytes of RAM, ?% K) lines, two B (bit timerKcounters, five vector two(level interrupt
architecture, a full duple2 serial port, on(chip oscillator and cloc1 circuitry. n addition,
the AT"#8$% is designed with static logic for operation down to *ero fre5uency and
supports two software selectable power saving modes. The dle Mode stops the 09@
while allowing the RAM, timerKcounters, serial port and interrupt system to continue
functioning. The 9ower down Mode saves the RAM contents but free*es the oscillator
disabling all other chip functions until the ne2t hardware reset.
Po%
8/19/2019 Greenhouse Monitoring Using Zigbee1
32/104
Po% 6:9ort B is an "(bit bi(directional K) port with internal pull(ups. The 9ort B output
buffers can sin1Ksource four TT! inputs. 'hen Bs are written to 9ort B pins they are
pulled high by the internal pull(ups and can be used as inputs. As inputs, 9ort B pins that
are e2ternally being pulled low will source current !< because of the internal pull(ups.
9ort B also receives the low(order address bytes during Flash programming and program
verification.
Alternate functions of port 1
Po% ;:
9ort % is an "(bit bidirectional K) port with internal pullups. The 9ort % output
buffers can sin1Ksource four TT! inputs. 'hen Bs are written to 9ort % pins they are
pulled high by the internal pull(ups and can be used as inputs. As inputs, 9ort % pins that
are e2ternally being pulled low will source current !< because of the internal
pullups.9ort % emits the high(order address byte during fetches from e2ternal program
memory and during accesses to e2ternal data memory that use B (bit addresses M)6Page32
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
33/104
A,S79TR
8/19/2019 Greenhouse Monitoring Using Zigbee1
34/104
8/19/2019 Greenhouse Monitoring Using Zigbee1
35/104
wea1ly pulled high. 8etting the A! (disable bit has no effect if the microcontroller is in
e2ternal e2ecution mode.
98 43
9rogram 8tore nable is the read strobe to e2ternal program memory. 'hen the
AT"#0$% is e2ecuting code from e2ternal program memory, 98 4 is activated twice
each machine cycle, e2cept that two 98 4 activations are s1ipped during each access to
e2ternal data memory.
AK6993
2ternal Access nable. A must be strapped to +47 in order to enable the
device to fetch code from e2ternal program memory locations starting at ))))I up to
FFFFI. 4ote, however, that if loc1 bit B is programmed, A will be internally latched
on reset. A should be strapped to 6cc for internal program e2ecutions. This pin also
receives the B%(volt programming enable voltage 6pp< during Flash programming, for
parts that re5uire B%(volt 6pp.
=TAL6: nput to the inverting oscillator amplifier and input to the internal cloc1
operating circuit
=TAL;: )utput from the inverting oscillator amplifier.
T;: 2ternal count input to TimerK0ounter %, 0loc1 out.Page35
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
36/104
T% 3 0ounter % captureKreload trigger direction control.
THE ON-CHIP OSCILLATORS
9ins TA!B and TA!% are provided for connecting a resonant networ1 to form
an oscillator. The crystal fre5uency is basic internal cloc1 fre5uency. The ma2imum and
minimum fre5uencies are specified from Bto %-MI&.
9rogram instructions may re5uire one, two or four machine cycles to be e2ecuteddepending on type of instructions. To calculate the time any particular instructions will
ta1e to be e2ecuted, the number of cycles U0N,
T G 0VB%d K 0rystal fre5uency
Iere, we chose fre5uency as BB. $#%MI&. This is because,
DaudG %Vcloc1 fre5uencyK ?%d. B%dW%$ d(TIBX
8/19/2019 Greenhouse Monitoring Using Zigbee1
37/104
O$-C*' O( 'll! o%(
9rogram Memory !oc1 Dits3
)n the chip there are three loc1 bits which can be left un programmed @< or can
be programmed 9< to obtain the additional features .'hen loc1 bit B is programmed, the
logic level at the A pin is sampled and latched during reset. f the device is powered up
without a reset, the latch initiali*es to a random value, and holds that value until reset is
activated. t is necessary that the latched value of A be in agreement with the current
logic level at that pin in order for the device to function properly.
9rogram 0ounter and 7ata 9ointer3
The "#0$% contains two B (bit registers3 the program counters 90< and the data
pointer 79TR
8/19/2019 Greenhouse Monitoring Using Zigbee1
38/104
program instructions and can be specified by its B (bit name, 79TR, or by each
individual byte name, 79I and 79!. 79TR does not have a single internal address;
79I and 79! are each assigned an address.
A D Registers3
The "#0$% contains ?- general(purpose, wor1ing, registers. Two of these,
registers A and D, hold results of many instructions, particularly math and logical
operations, of the "#0$% 09@. The other ?% are arranged as part of internal RAM in
four ban1s, D (D?, of eight registers. The A register is also used for all data transfers
between the "#0$% and any e2ternal memory. The D register is used for with the A
register for multiplication and division operations.
Flags and the 9rogram 8tatus 'ord 98'
8/19/2019 Greenhouse Monitoring Using Zigbee1
39/104
89 0 A! F@40T )4 R + 8T R83
The "#8$% operations that do not use the internal B%"(byte RAM addresses from
h to CFh are done by a group of specific internal registers, each called a 8pecial
Function register, which may be addressed much li1e internal RAM, using addresses
from " h to FFI. 90 is not part of the 8FR and has no internal RAM address
Page39
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
40/104
TABLE 7.6
8.CIRCUIT DIAGRAM OF TRANSMITTER
Page40
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
41/104
Page41
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
42/104
FIG 8.6
CIRCUIT DIAGRAM >RECEI2ER?
Page42
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
43/104
FIG 8.;
9. ; P'$ Co) o$#$ H+)',' & S#$(o%
A % pin sensor which is designed to measure relative humidity up to # H.The
operation of the sensor is simple,the impedance across the two terminals decreases as
humidity increases.Typical applications include air conditioners and purifiers,weather
stations and data loggers.
.
SPECIFICATION:
0 R$!ed ol!$ge# #VPage43
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
44/104
0 R$!ed Power# $.+m,
0 Oper$!i&g Fre2ue& y R$&ge# 5$$- to
+&$$$-
0 Oper$!i&g e per$!ure R$&ge# $ /C to01$ /C
0 Oper$!i&g u idi!y R$&ge# 2" to 3$% 4-
0 u idi!y A ur$ y# 5%
FIG 9.6 HUMIDITY SENSOR
Page44
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
45/104
6FIG 6
8/19/2019 Greenhouse Monitoring Using Zigbee1
46/104
The two copper leads act as the sensor probes. They are immersed into thespecimen soil whose moisture content is under test. The soil is e2amined under threeconditions
6 C!(#@6: D%& o$,' 'o$ 3 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 outputof the emitter in this case ranges from to .$6.
6 C!(#@;: O ')+) o$,' 'o$ ( 'hen water is added to the soil, it percolatesthrough the successive layers of it and spreads across the layers of soil due tocapillary force. This water increases the moisture content of the soil. This leads toan increase in its conductivity which forms a conductive path between the twosensor 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 ta1en atthe emitter of the transistor in the optimum case ranges from B.# to ?.-6appro2imately.
6 C!(#@3: E4 #(( w! #% o$,' 'o$ ( 'ith the increase in water content beyond theoptimum level, the conductivity of the soil increases drastically and a steadyconduction path is established between the two sensor leads and the voltageoutput from the sensor increases no further beyond a certain limit. The ma2imum
possible value for it is not more than -.%6.
11.R !"#:
A relay is an #l# %' !ll& o #%! #, (w' *. 0urrent flowing through the coil of the relay
creates a magnetic field which attracts a lever and changes the switch contacts. The coil
current can be on or off so relays have two switch positions and they are ,o+0l# *%ow
*!$"#ov#% < switches.
Page46
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
47/104
Relays allow one circuit to switch a second circuit which can be completely separate
from the first. For e2ample a low voltage battery circuit can use a relay to switch a %? 6
A0 mains circuit. There is no electrical connection inside the relay between the two
circuits, the lin1 is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically ? mA for a B%6 relay, but
it can be as much as B mA for relays designed to operate from lower voltages. Most
0s chips< cannot provide this current and a transistor is usually used to amplify the
small 0 current to the larger value re5uired for the relay coil. The ma2imum output
current for the popular $$$ timer 0 is % mA so these devices can supply relay coils
directly without amplification.
Relays are usuallly 897T or 797T but they can have many more sets of switch
contacts, for e2ample relays with - sets of changeover contacts are readily available. For
further information about switch contacts and the terms used to describe them please see
the page on switches .
Most relays are designed for 90D mounting but you can solder wires directly to the pins
providing you ta1e care to avoid melting the plastic case of the relay.
The supplier=s catalogue should show you the relay=s connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high
voltage =spi1es= when they are switched off and this can destroy transistors and 0s in the
circuit. To prevent damage you must connect a protection diode across the relay coil.
The animated picture shows a wor1ing relay with its coil and switch contacts. You can
see a lever on the left being attracted by magnetism when the coil is switched on. This
Page47
DEPATMENT OF EIE
http://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/components/switch.htmhttp://www.kpsec.freeuk.com/trancirc.htm#ichttp://www.kpsec.freeuk.com/components/switch.htm
8/19/2019 Greenhouse Monitoring Using Zigbee1
48/104
lever moves the switch contacts. There is one set of contacts 897T< in the foreground
and another behind them, ma1ing the relay 797T.
The relay=s switch connections are usually labelled 0)M, 40 and 4)3
• COM G 0ommon, always connect to this, it is the moving part of the switch.
• NC G 4ormally 0losed, 0)M is connected to this when the relay coil is o// .
• NO G 4ormally )pen, 0)M is connected to this when the relay coil is o$ .
• 0onnect to 0)M and 4) if you want the switched circuit to be o$ w*#$ *#
%#l!& o'l '( o$ .
• 0onnect to 0)M and 40 if you want the switched circuit to be o$ w*#$ *#
%#l!& o'l '( o// .
CLASSIFICAION OF PROTECTI2E RELAYS BASED ON TECHNOLOGY
9rotective relays can be broadly classified into the following categories
B. lectromagneticrelays
%.8taticrelays
?.Microprocessor(basedrelays
El# %o)!"$# ' %#l!&( 3
t includes attracted armature, moving coil and induction disc and
induction cup type relays. lectromagnetic relays contain an electromagnet or
permanent magnet< and a moving part. 'hen the actuating 5uantity e2ceeds a certain
Page48
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
49/104
predetermined value, an operating tor5ue is developed which is applied on the moving
part. This causes the moving part to travel and to finally close a contact to energi*e the
tripcoilofthebre*a1er.
S ! ' %#l!&(:- 8tatic relays contains electronic circuits which may contain
transistors, 0s, diodes and other electronic components. There is a comparator circuit in
the relay, which compares two or more voltages and gives an output, which is applied to
either a slave Zready or a thyristor circuit. The slave ready is an electromagnetic relay
which finally ;closes the contact. A static relay containing a slave ready is semi(static
relay. A relay 1ising thyristor circuit is a wholly static relay. 8tatic relay possess the
advantage of having ilow burden on 0T and 9T, fast operation, absence of mechanical
inertia and contact trouble, long life and less maintenance. 8tatic relays have proved to
be superior to electromagnetic relays and they are being used for the protection of
important lines, power stations and substations. Yet they have not completely replaced
electromagnetic relays. 8tatic relays are treated as an addition to family of relays.
lectromagnetic relays continue to be in use because of their simplicity and low cost.
Their maintenance can be done by less 5ualified personal, where as the maintenance and
repair of static relays re5uires personnel=s trained in solid(state
M' %o %o #((o%-0!(#, %o # 'v#%#l!&( -
Microprocessor(based protective relays are the latest
development in this area. 'ith the development in 6!8 Technology, 8ophisticated and
fast microprocessor are coming up. Their applications to the problems of protectiverelaying schemes are of current interests to power engineers. The inherit advantages of
microprocessor(based relays over static relays with or a very limited range of
applications, are attractive, fle2ibility due to their programmable approach.Page49
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
50/104
Microprocessor(based protective relays can provide protection at low cost and compete
with conventional relays. The present downward trend in the cost of large(scale
integrated circuit will encourage wide applications of microprocessor(based applications
of microprocessor(based relays for the protection modem comple2 power networ1.
Fig 11.1 R*LA, CIRC+I /
A,v!$ !"#( o/ %#l!&(:Page50
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
51/104
• Relays can switch AC !$, DC , transistors can only switch 70.
• Relays can switch *'"* vol !"#( , transistors cannot.
•
Relays are a better choice for switching l!%"# +%%#$ ( J $A
8/19/2019 Greenhouse Monitoring Using Zigbee1
52/104
9ifferential analog voltage in"uts:ogic in"uts an out"uts meet both ;! an TT: voltage level s"ecifications,or*s with +.5V (:
8/19/2019 Greenhouse Monitoring Using Zigbee1
53/104
FIG 12.2-ADC 0804
13.MAX232
The MAX232 IC is used to convert the TTL/CMOS lo ic levels to !S232 lo ic levels durin
seri"l co##unic"tion o$ #icrocontrollers %ith PC& The controller o'er"tes "t TTL lo ic
level ()*+,- %here"s the seri"l co##unic"tion in PC %or.s on !S232 st"nd"rds (*2+ , to
2+,-& This #".es it di0cult to est"1lish " direct lin. 1et%een the# to co##unic"te
%ith e"ch other&
The inter#edi"te lin. is 'rovided throu h MAX232& It is " du"l driver/receiver th"t
includes " c"'"citive volt" e ener"tor to su''l !S232 volt" e levels $ro# " sin le +,
su''l & E"ch receiver converts !S232 in'uts to +, TTL/CMOS levels& These receivers (! 4
! 2- c"n "cce't 53), in'uts& The drivers (T 4 T 2-6 "lso c"lled tr"ns#itters6 convert the
TTL/CMOS in'ut level into !S232 level&
Page53
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
54/104
The tr"ns#itters t".e in'ut $ro# controller7s seri"l tr"ns#ission 'in "nd send the out'ut
to !S2327s receiver& The receivers6 on the other h"nd6 t".e in'ut $ro# tr"ns#ission 'in o$
!S232 seri"l 'ort "nd ive seri"l out'ut to #icrocontroller7s receiver 'in& MAX232 needs
$our e8tern"l c"'"citors %hose v"lue r"n es $ro# 9F to 229F&
M !"#!#$%"#&&e" MAX232 RS232
T8 T /2 In T /2 Out !8
!8 ! /2 Out ! /2 In T8
P'$ D'!"%!):
FIG 13.1
P $ De'!" (% #$)
P $ F*$!% #$ +a,e
Page54
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
55/104
+#
C"'"citor connection 'ins
C"'"citor 2 C"'"citor 3 3 C"'"citor *: C"'"citor 2 + C"'"citor 2 *
; C"'"citor : *< Out'ut 'in= out'uts the seri"ll tr"ns#itted d"t" "t !S232
lo ic level= connected to receiver 'in o$ PC seri"l 'ort T 2 Out
> In'ut 'in= receives seri"ll tr"ns#itted d"t" "t !S 232lo ic level= connected to tr"ns#itter 'in o$ PC seri"l 'ort
! 2 In
? Out'ut 'in= out'uts the seri"ll tr"ns#itted d"t" "t TTLlo ic level= connected to receiver 'in o$ controller&
! 2 Out
) In'ut 'ins= receive the seri"l d"t" "t TTL lo ic level=connected to seri"l tr"ns#itter 'in o$ controller&
T 2 InT In
2 Out'ut 'in= out'uts the seri"ll tr"ns#itted d"t" "t TTLlo ic level= connected to receiver 'in o$ controller&
! Out
3 In'ut 'in= receives seri"ll tr"ns#itted d"t" "t !S 232lo ic level= connected to tr"ns#itter 'in o$ PC seri"l 'ort
! In
: Out'ut 'in= out'uts the seri"ll tr"ns#itted d"t" "t !S232lo ic level= connected to receiver 'in o$ PC seri"l 'ort
T Out
+ @round (),- @round; Su''l volt" e= +, (:&+, +&+,- ,cc
TABLE 13.1
Page55
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
56/104
FIG 13.8
14.I6 *RFACI6G LCD O * MICROCO6 ROLL*R
This is the first interfacing e am"le for the "arallel "ort. ,e will star with somethingsim"le. This e am"le oes not use the Bi= irectional feature foun on newer "orts& thus it shoul wor*with most& if no all arallel orts. It however oes not show the use of the status "ort as an in"ut. !owhat are we interfacingD A #1 Character + :ine :C9 o ule to the "arallel "ort. These :C9
o ules are very common these ays& an are @uite sim"le to wor* with& as all the logic re@uire
running them is on boar .
FeaturesG
Interface with either H=bit or 7=bit micro"rocessor.
Page56
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
57/104
9is"lay ata 4A
7 bits (7$ characters). 7$
Character generator 4;
J ot=matri character "atterns. #1$ ifferent 5
Character generator 4A
J ot=matri "atterns. 7 ifferent users "rogramme 5
9is"lay ata 4A an character generator 4A may be
Accesse by the micro"rocessor.
>umerous instructions
Clear 9is"lay& Cursor -ome& 9is"lay ;>K;FF& Cursor
;>K;FF& Blin* Character& Cursor !hift& 9is"lay !hift.
Built=in reset circuit is triggere at "ower ;>.
A general "ur"ose al"hanumeric :C9& with two lines of #1 characters.
FIG 14.1
Page57
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
58/104
Pi& di$gr$ # FIG-14.8/
Page58
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
59/104
ABL* 14.1
In the above table Vcc an Vss are su""ly "ins an VEE ( in no.o.H is 4s "in for selecting the register& there are two very im"ortant registers are therein si e the :C9. The 4! "in is use for their selection as follows. If 4!'$& the instruction commanco e register is selecte & allowing the user to sen ata to be is"laye on the :C9. 4K, is a rea or writes in& which allows the user to write information to the :C9 or rea information from it. 4K,'#when rea ing 4K,'$ when writing. The :C9 to latch information "resente to its ata "ins uses theenable (E) "in. The 7=bit ata "ins& 9$=9J& are use to sen information to the :C9 or rea thecontents of the :C9Ls internal registers. To is"lay letters an numbers& we must sen A!CII co es for the letters A=M& an number $ =3 to these "ins while ma*ing 4!'#.
AB!;:2TE A I 2 4ATI>N!G
#. ELECTRICAL ABSOLUTE MAXIMUM RATINGS G
Page59
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
60/104
9u$li!y o&!rol G
!ome :C9 "anels have efective transistors& causing "ermanently lit or unlit "i elswhich are commonly referre to as stuc* "i els or ea "i els res"ectively. 2nli*e integrate circuits(ICs)& :C9 "anels with a few efective "i els are usually still usable. It is also economically "rohibitive
to iscar a "anel with ?ust a few efective "i els because :C9 "anels are much larger than ICs.
Color di5pl$y5 G
In color :C9s each in ivi ual "i el is ivi e into three cells& or sub "i els& which arecolore re & green& an blue& res"ectively& by a itional filters ("igment filters& ye filters an mo i e filters). Each sub "i el can be controlle in e"en ently to yiel thousan s or millions of "ossible
colors for each "i el. C4T monitors em"loy a similar 8sub "i el8 structures via "hos"hors& although theanalog electron beam em"loye in C4Ts o not hit e act 8sub "i els8.
Color com"onents may be arraye in various "i el geometries& e"en ing on themonitor8s usage. If software *nows which ty"e of geometry is being use in a given :C9& this can beuse to increase the a""arent resolution of the monitor through sub "i el ren ering. This techni@ue ises"ecially useful for te t anti=aliasing.
To re uce smu ging in a moving "icture when "i els o not res"on @uic*ly enough to
color changes& so=calle "i el over rive may be use .
Page60
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
61/104
15. C MP +E+T DESCRIPTI +
TRANSISTOR: -
A transistor consists of two junctions formed by sandwiching either p(type or n(
type semiconductor between a pair of opposite types. Accordingly, there are two types of
transistors namely3 (
B< n(p(n transistor %< p(n(p transistor
>NPN? >PNP?
An n(p(n transistor is composed of two n(type semiconductors separated by a thin
section of p type. Iowever a p(n(p transistor is formed by two p sections separated by a
thin section of n(type. n each type of transistor the following points may be noted.
B. There are two p(n junctions, therefore a transistor may be regarded as
combination of two diodes connected bac1 to bac1.
%. There are three terminals ta1en from each type of semiconductor.
Page61
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
62/104
?. The middle section is a very thin layer, which is the most important factor in the
functioning of a transistor.
-. Transistor can be used as an Amplifier also.
A transistor raises the strength of a wea1 signal and thus acts as an amplifier. The
wea1 signal is applied between emitter base junction and output is ta1en across the load
Rc connected in the collector circuit in common emitter configuration
8/19/2019 Greenhouse Monitoring Using Zigbee1
63/104
during the transformation. Transformers play a major role in the transmission and
distribution of ac power.
P%'$ ' l#: (
Transformer wor1s on the principle of mutual induction. A transformer consists of
laminated magnetic core forming the magnetic frame. 9rimary and secondary coils are
wound upon the two cores of the magnetic frame, lin1ed by the common magnetic flu2.
'hen an alternating voltage is applied across the primary coil, a current flows in the
primary coil producing magnetic flu2 in the transformer core. This flu2 induces voltage
in secondary coil.
Transformers are classified as3 (
a< Dased on position of the windings with respect to core i.e.
B< 0ore type transformer
%< 8hell type transformer
b< Transformation ratio3
B< 8tep up transformer
%< 8tep down transformer
a< 0ore shell types3 Transformer is simplest electrical machine, which consists of
windings on the laminated magnetic core. There are two possibilities of putting
up the windings on the core.
B< 'inding encircle the core in the case of core type transformer
%< 0ores encircle the windings on shell type transformer.
Page63
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
64/104
b< 8tep up and 8tep down3 n these 6oltage transformation ta1es place according to
whether the
9rimary is high voltage coil or a low voltage coil.
B< !ower to higher(J 8tep up%< Iigher to lower(J 8tep down
Page64
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
65/104
1 !P!C!"! MA#U$AC%U&I#' P&OC SS
t is an important process in the fabrication of electronic e5uipment. The design of 90Ds
9rinted 0ircuit Doards< depends on circuit re5uirements li1e noise immunity, wor1ing
fre5uency and voltage levels etc. Iigh power 90Ds re5uire a special design strategy.
The fabrication process to the printed circuit board will determine to a large e2tent
the price and reliability of the e5uipment. A common target aimed is the fabrication of
small series of highly reliable professional 5uality 90Ds with low investment. The target
becomes especially important for customer tailored e5uipments in the area of industrial
electronics.
The layout of a 90D has to incorporate all the information of the board before one can
go on the artwor1 preparation. This means that a concept which clearly defines all the
details of the circuit and partly defines the final e5uipment, is prere5uisite before the
actual lay out can start. The detailed circuit diagram is very important for the layout
designer but he must also be familiar with the design concept and with the philosophy
behind the e5uipment.
BOARD TYPES 3
The two most popular 90D types are3
S'$"l# S',#, Bo!%,(
The single sided 90Ds are mostly used in entertainment electronics where
manufacturing costs have to be 1ept at a minimum. Iowever in industrial electronics
cost factors cannot be neglected and single sided boards should be used wherever a particular circuit can be accommodated on such boards.
Do+0l# S',#, Bo!%,(
Page65
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
66/104
7ouble(sided 90Ds can be made with or without plated through holes. The production
of boards with plated through holes is fairly e2pensive. Therefore plated through hole
boards are only chosen where the circuit comple2ities and density of components does
not leave any other choice.
DESIGN SPECIFICATION
STEPS TAKEN HILE PREPARING CIRCUIT
>A? PCB DESIGNING
The main purpose of printed circuit is in the routing of electric currents and signal
through a thin copper layer that is bounded firmly to an insulating base material
sometimes called the substrate. This base is manufactured with an integrally bounded
layers of thin copper foil which has to be partly etched or removed to arrive at a pre(
designed pattern to suit the circuit connections or other applications as re5uired.
The term printed circuit board is derived from the original method where a printed
pattern is used as the mas1 over wanted areas of copper. The 90D provides an ideal
baseboard upon which to assemble and hold firmly most of the small components.
From the constructorNs point of view, the main attraction of using 90D is its role as themechanical support for small components. There is less need for complicated and time
consuming metal wor1 of chassis contraception e2cept perhaps in providing the final
enclosure. Most straight forward circuit designs can be easily converted in to printed
wiring layer the thought re5uired to carry out the inversion cab footed high light an
possible error that would otherwise be missed in conventional point to point wiring .The
finished project is usually neater and truly a wor1 of art.
Actual si*e 90D layout for the circuit shown is drawn on the copper board. The board is
then immersed in Fe0l 3 solution for B% hours. n this process only the e2posed copper
portion is etched out by the solution.
Page66
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
67/104
4ow the petrol washes out the paint and the copper layout on 90D is rubbed with a
smooth sand paper slowly and lightly such that only the o2ide layers over the 0u are
removed. 4ow the holes are drilled at the respective places according to component
layout as shown in figure.
>B
8/19/2019 Greenhouse Monitoring Using Zigbee1
68/104
increased width where termination holes are needed. From this aspect, it can become
little tric1y to negotiate the route to connect small transistors.
There are basically two ways of copper interconnection patterns under side the
board. The first is the removal of only the amount of copper necessary to isolate the
junctions of the components to oneanother. The second is to ma1e the interconnection
pattern loo1ing more li1e conventional point wiring by routing uniform width of copper
from component to component.
>C?ETCHING PROCESS:
tching process re5uires the use of chemicals. acid resistant dishes and running water
supply. Ferric chloride is mostly used solution but other etching materials such as
ammonium per sulphate can be used. 4itric acid can be used but in general it is not used
due to poisonous fumes.
The pattern prepared is glued to the copper surface of the board using a late2 type
of adhesive that can be cubed after use. The pattern is laid firmly on the copper using a
very sharp 1nife to cut round the pattern carefully to remove the paper corresponding to
the re5uired copper pattern areas. Then apply the resistant solution, which can be a 1ind
of in1 solution for the purpose of maintaining smooth clean outlines as far as possible.
'hile the board is drying, test all the components.
>D? COMPONENT ASSEMBLY 3 (
Page68
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
69/104
From the greatest variety of electronic components available, which runs into thousands
of different types it is often a perple2ing tas1 to 1now which is right for a given job.
There could be damage such as hairline crac1 on 90D. f there are, then they can be
repaired by soldering a short lin1 of bare copper wire over the affected part.
The most popular method of holding all the items is to bring the wires far apart after
they have been inserted in the appropriate holes. This will hold the component in
position ready for soldering.
8ome components will be considerably larger .8o it is best to start mounting the smallest
first and progressing through to the largest. Defore starting, be certain that no further
drilling is li1ely to be necessary because access may be impossible later.
4e2t will probably be the resistor, small signal diodes or other similar si*e
components. 8ome capacitors are also very small but it would be best to fit these
afterwards. 'hen fitting each group of components mar1 off each one on the circuit as it
is fitted so that if we have to leave the job we 1now where to recommence.
Although transistors and integrated circuits are small items there are good reasons for
leaving the soldering of these until the last step. The main point is that these components
are very sensitive to heat and if subjected to prolonged application of the soldering iron,
they could be internally damaged.
All the components before mounting are rubbed with sand paper so that o2ide layer is
removed from the tips. 4ow they are mounted according to the component layout.
Page69
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
70/104
>E? SOLDERING: -
This is the operation of joining the components with 90D after this operation the circuit
will be ready to use to avoid any damage or fault during this operation following care
must be ta1en.
B. A longer duration contact between soldering iron bit components lead can e2ceed
the temperature rating of device cause partial or total damage of the device. Ience
before soldering we must carefully read the ma2imum soldering temperature
soldering time for device.
%. The wattage of soldering iron should be selected as minimum as permissible for that
soldering place.
?. To protect the devices by lea1age current of iron its bit should be earthed properly.
-.'e should select the soldering wire with proper ratio of 9b Tn to provide the
suitable melting temperature.
$.9roper amount of good 5uality flu2 must be applied on the soldering point to avoid dry
soldering.
Page70
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
71/104
17.Basic Concept-KEIL
$ntroduction
This tutorial will assist you in writing your first " $B Assembly language program usingthe popular eil
0ompiler. eil offers an evaluation pac1age that will allow the assembly and debuggingof files % or less. This
pac1age is freely available at their web site. eilNs website address is www.1eil.com.
The sample program included in the tutorial toggles 9orts B and % on the " $B. Thecompiled program
has been tested using the " $B board from Micro7igital d.com. The program alsowor1s with other systems that
have 9ort B and % available.
Dasic eil Tutorial
B. )pen eil from the 8tart menu
%. The Figure below shows the basic names of the windows referred in this document
Page71
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
72/104
8tarting a new Assembler 9roject
B. 8elect 4ew 9roject from the 9roject Menu.
Page72
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
73/104
%. 4ame the project UToggle.a$BN
?. 0lic1 on the 8ave Dutton.
-. The device window will be displayed.
$. 8elect the part you will be using to test with.
Page73
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
74/104
. 7ouble 0lic1 on the 7allas 8emiconductor.Page74
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
75/104
C. 8croll down and select the 78"#0-% 9art
". 0lic1 )
0reating 8ource File
B. 0lic1 File Menu and select 4ew.
Page75
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
76/104
%. A new window will open up in the eil 7 .
Page76
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
77/104
?. 0opy the e2ample to the Right into the new window. This file will toggle 9orts B and% with a delay.
-. 0lic1 on File menu and select 8ave As[
)R+ I
M)6 A, \$$I
A+A 43
M)6 9B, A
M)6 9%, A
A0A!! 7 !AY
09! A
8OM9 A+A 4
7 !AY3
M)6 R?, \%
)@T R3 M)6 R%, \ %$$44 R3 7O4& R%, 44 R
7O4& R?, )@T R
R T
47
Page77
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
78/104
$. 4ame the file Toggle.a$B
. 0lic1 the 8ave Dutton
Adding File to the 9roject
B. 2pand Target B in the Tree Menu
Page78
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
79/104
%. 0lic1 on 9roject and select Targets, +roups, Files[
Page79
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
80/104
?. 0lic1 on +roupsKAdd Files tab
-. @nder Available +roups select 8ource +roup B
$. 0lic1 Add Files to +roup[ button
. 0hange file type to Asm 8ource file V.aV;
V.src<
C. 0lic1 on toggle.a$B
". 0lic1 Add button
#. 0lic1 0lose Dutton
B . 0lic1 ) button when you return to Target, +roups, Files[ dialog bo2
Page80
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
81/104
BB. 2pand the 8ource +roup B in the Tree menu to ensure that the file
was added to the project.
0reating I for the 9art
B. 0lic1 on Target B in Tree menu
Page81
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
82/104
%. 0lic1 on 9roject Menu and select )ptions for Target B
?. 8elect Target Tab
-. 0hange tal Mh*< from $ . to BB. $#%
$. 8elect )utput Tab
. 0lic1 on 0reate Ie2 File chec1 bo2
C. 0lic1 ) Dutton
Page82
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
83/104
8/19/2019 Greenhouse Monitoring Using Zigbee1
84/104
Testing 9rogram in 7ebugger
B. 0omment out line A0A!! 7 !AY by placing a 8emicolon
at the beginning. This will allow you to see the port change immediately.%. 0lic1 on the File Menu and select 8ave
Page84
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
85/104
?. 0lic1 on 9roject Menu and select Rebuild all Target Files
-. n the Duild 'indow it should report U rrors s
8/19/2019 Greenhouse Monitoring Using Zigbee1
86/104
$. 0lic1 on 7ebug Menu and 8elect 8tartK8top 7ebug 8ession
Page86
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
87/104
Running the eil 7ebugger
B. The eil 7ebugger should be now be Running.
Page87
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
88/104
%. 0lic1 on 9eripherals. 8elect K) 9orts, 8elect 9ort B
?. A new window should port will pop up. This represent the 9ort and 9ins
Page88
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
89/104
-. 8tep through the code by pressing FBB on the eyboard. The 9arallel 9ort B Do2should change you completely step through the code
. To e2it out, 0lic1 on 7ebug Menu and 8elect 8tartK8top 7ebug 8ession
68.ZIGBEE MODULE
Features and Denefits3
oint to "oint& "oint to multi "oint& esh an "eer=to="eer to"ologies on "ro"rietary stac*. 9irect !e@uence !"rea !"ectrum technology.
Each irect se@uence channel has 1HO uni@ue networ* a resses Transmit owerG ++ Bm. 4F ata rateG +5$ *b"s. Ac*nowle gement mo e communication with retries. ower saving mo es. !ource K estination a ressing.
Page89
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
90/104
2nicast an broa cast communication. Analog to igital conversion an igital IK; line su""ort. 9efault configuration for rea y to use.
S # '/' ! 'o$(:
Power !u""ly Voltage I9& Channel an a ressesMe '$&i $l
9imensions
8/19/2019 Greenhouse Monitoring Using Zigbee1
91/104
F'" 68.6
1%.&'D$()
TR"(S*$TT R :
\include]reg$B.hJ
sbit rdG9?^$;
sbit wrG9?^-;
sbit intrG9?^?;
sbit rsG9?^C;
sbit eG9?^ ;
sbit watersensorG9%^ ;
sbit motorG9 ^B; KKconnect pull up B 1
unsigned convert unsigned int
8/19/2019 Greenhouse Monitoring Using Zigbee1
92/104
unsigned int i,j;
for iG ;i]t;i::<
for jG ;j]B%C$;j::
8/19/2019 Greenhouse Monitoring Using Zigbee1
93/104
wrGB;
while B<
_
wrG ;
wrGB;
while intrGGB
8/19/2019 Greenhouse Monitoring Using Zigbee1
94/104
`
if watersensor GG <
_
motorGB;
sert2 =o=
8/19/2019 Greenhouse Monitoring Using Zigbee1
95/104
dGbHB ;
aGa 2? ;
cGc 2? ;
dGd 2? ;
sert2 =V=
8/19/2019 Greenhouse Monitoring Using Zigbee1
96/104
9%Gp;
rsG ;
eGB;
delay $
8/19/2019 Greenhouse Monitoring Using Zigbee1
97/104
unsigned char r2;
while R GG
8/19/2019 Greenhouse Monitoring Using Zigbee1
98/104
lcd dat =3=
8/19/2019 Greenhouse Monitoring Using Zigbee1
99/104
aBGreceive
8/19/2019 Greenhouse Monitoring Using Zigbee1
100/104
SCOPE FO R FURT HER DE 2ELOPMENT
B< The performance of the system can be further improved in terms of the operating
speed, memory capacity, instruction cycle period of the microcontroller.The number
of channels can be increased to interface more number of sensors which is possible
by using advanced versions of
microcontrollers.
%< The system can be modified with the use of a datalogger and a graphical !07
panel showing the measured sensor data over a period of time.
?< This system can be connected to communication devices such as modems, cellular
phones or satellite terminal to enable the remote collection of recorded data or
alarming of certain parameters.
-< The device can be made to perform better by providing the power supply with the
help of battery source which can be rechargeable or non(rechargeable, to reduce the
re5uirement of main A0 power.Page100
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
101/104
$< Time bound administration of fertili*ers, insecticides and pesticides can beintroduced.
< A multi(controller system can be developed that will enable a master controller along with its slave controllers to automate multiple greenhousessimultaneously.
CO NCLUSION
A step(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 5uite reliable and accurate.
The system has successfully overcome 5uite a few shortcomings of the
e2isting systems by reducing the power consumption, maintenance and comple2ity, at
the same time providing a fle2ible 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
Page101
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
102/104
system industry in several areas of agricultural production, will result in reliable
control systems that will address several aspects of 5uality and 5uantity of
production. Further improvements will be made as less e2pensive 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 re5uired 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 tas1 and can be successfully carried out.
RE FERE NCE S
WBX 7r. R. Oayanthi, 9rof. of Iorticulture, @A8, + 6 , Dangalore.
IEEE P! #%(:
WBX 8tipanicev 7., Marasovic O., Networked embedded greenhouse monitoring andcontrol,
9roceedings of % ? 0onference on 0ontrol Applications, Oune % ?.
W%X Turnell, 7.O. de Fatima, .6., Turnell, M., 7eep, +.8., Freire, R.0.8., FarmWeb-an integrated, modular farm automation system, 9roceedings of
Page102
DEPATMENT OF EIE
8/19/2019 Greenhouse Monitoring Using Zigbee1
103/104
nternational 0onference on 8ystems, Man, and 0ybernetics, 6ol. %,)ct. B##".
Boo1(:
WBX Rebecca Tyson 4orthen, Orchids As House Plants , 7over 9ublications, 4ew
Yor1, %nd
dition, B#"$.
W%X Muhammad Ali Ma*idi, Oanice +illispie Ma*idi, Rolin 7. Mc inlay , he !"#$ %icrocontroller & 'mbedded (ystems , 9earson ducation nc. % nd dition, % ".
W?X My1e 9red1o, Programming and )ustomising the !"#$ %icrocontroller, TMI,B###.
W-X enneth O Ayala, he !"#$ %icrocontroller Architecture, Programming & A**lications,9enram nternational, % nd dition, B##F.
W$X Rama1ant +aya1wad, O*erational Am*lifiers +inear ntegrated )ircuits, 9renticeIall of
ndia, ? rd dition.
W X 4ational 8emiconductors, )%O( +ogic atabook
WCX('N(O (- he /ournal of A**lied (ensing echnology, Advanstar0ommunications nc
#0 R#(o+% #(
WBX h ttp 3K Kf r eew e b s.c o mKma h eshwan 1 ede
W%X h ttp 3K Kw w w .f a lu d i. c o m
W?X h tt p 3K Kwww.e l ec t r o ( tech(o n li n e.c o m
W-X h ttp 3K Kw w w ." $%. c o m
W$X h ttp 3K Kwww." $ B p roje c ts.net K f o r u m
W X h ttp 3K Kw w w .d at a s h e e td ir e c t. c om
Page103
DEPATMENT OF EIE
http://freewebs.com/maheshwankedehttp://www.faludi.com/http://www.faludi.com/http://www.electro-tech-online.com/http://www.electro-tech-online.com/http://www.8052.com/http://www.8052.com/http://www.8051projects.net/forumhttp://www.datasheetdirect.com/http://www.datasheetdirect.com/http://freewebs.com/maheshwankedehttp://www.faludi.com/http://www.electro-tech-online.com/http://www.8052.com/http://www.8051projects.net/forumhttp://www.datasheetdirect.com/
8/19/2019 Greenhouse Monitoring Using Zigbee1
104/104
WCX h ttp 3K Kw ww .1 eil .co mKa ppnotes
W"X http3KKwww.google.com
http://www.keil.com/appnoteshttp://www.keil.com/appnoteshttp://www.keil.com/appnotesTop Related