Post on 03-Jun-2018
8/12/2019 1.Green House Automation System
1/84
GREEN HOUSE AUTOMATION SYSTEM
INDEX
CONTENTS1. Abbreviations
2. Figures locations
3. Introduction
. !loc" Diagra#
$. !loc" Diagra# Descri%tion
&. Sc'e#atic(. Sc'e#atic Descri%tion
). *ard+are Co#%onents
,. Circuit Descri%tion
1-. So t+are co#%onents
a. About /iel
b. E#bedded 0C
11. /EI %rocedure descri%tion
12. Conclusion or4 S5no%sis
13. Future As%ects
1 . !ibliogra%'5
8/12/2019 1.Green House Automation System
2/84
8/12/2019 1.Green House Automation System
3/84
INT6OD8CTION
E9!EDDED S:STE9;
An e#bedded s5ste# is a special-purpose system in which the computer is
completely encapsulated by or dedicated to the device or system it controls. Unlike
a general-purpose computer, such as a personal computer, an embedded system
performs one or a few prede ned tasks, usually with very speci c requirements.
Since the system is dedicated to speci c tasks, design engineers can optimi e it,
reducing the si e and cost of the product. !mbedded systems are often mass-produced, bene ting from economies of scale.
"ersonal digital assistants #"$As% or handheld computers are generally
considered embedded devices because of the nature of their hardware design, even
though they are more e&pandable in software terms. 'his line of de nition continues
to blur as devices e&pand. (ith the introduction of the )*) +odel with the
(indows " operating system and ports such as a US port / both features usuallybelong to 0general purpose computers0, / the line of nomenclature blurs even
more.
"hysically, embedded systems ranges from portable devices such as digital
watches and +"1 players, to large stationary installations like tra2c lights, factory
controllers, or the systems controlling nuclear power plants.
3n terms of comple&ity embedded systems can range from very simple with a
single microcontroller chip, to very comple& with multiple units, peripherals and
networks mounted inside a large chassis or enclosure.
8/12/2019 1.Green House Automation System
4/84
E
8/12/2019 1.Green House Automation System
5/84
PO.ER SUPP&Y B&O-/$IAGRAM0
Step down 'ransformer
9ilter :egulator )utputridge:ecti er
8/12/2019 1.Green House Automation System
6/84
HAR$.ARE RE1UIREMENTS0
1 89s52
2 RELAYs
3 LOADs
4 LCD
5 ADC
6 POWER SUPPLY
7 LDR
8 HUMIDITY SENSOR
9 TEMPERATURE SENSOR
8/12/2019 1.Green House Automation System
7/84
AT23-4) MI-RO-ONTRO&&ER
5EATURES
80C51 !s"# !$%&'("%()$"
4*+ ,("s -. -/*%&' R" $- $! ! " F !s& M" -$,
128 8 RAM
T - 16* '( T' "$ C-)/("$s
F) #) " s"$'! %&!//" B-- "!/ $-%"ss-$
F-)$ 8* '( I O -$(s 32 I O '/"s
M" -$, !##$"ss'/ %! ! ' '(,
64+ ROM !/# 64+ RAM
P- "$ s! " -#"s:
I# " !/# - "$*#- /
S' '/("$$) ( s-)$%"s M-s( '/s($)%('-/s " "%)(" '/ 0;3 )s
CMOS !/# TTL %- !(' "
M! ' ) s ""#: 40 MH< = >%% ? 5>
I/#)s($'! (" "$!()$" ! !' ! "
P!%@! "s ! !' ! ":
40* '/ DIP
44* '/ PLCC
44* '/ P FP
8/12/2019 1.Green House Automation System
8/84
GENERA& $ES-RIPTION0 THE MI-RO-ONTRO&&ER0
A '%$-%-/($- "$ 's ! "/"$! )$ -s" #" '%" )( (&!( 's "!/( (- $"!# #!(! "$.-$
' '("# %! %) !('-/s -/ (&!( #!(! !/# %-/($- '(s "/ '$-/ "/( !s"# -/ (&-s" %! %) !('-/s; T&"
$' " )s" -. ! '%$-%-/($- "$ 's (- %-/($- (&" - "$!('-/ -. ! !%&'/" )s'/ ! .' "# $- $! (&!(
's s(-$"# '/ ROM !/# (&!( #-"s /-( %&!/ " - "$ (&" '."(' " -. (&" s,s(" ; T&" '%$-%-/($- "$
#"s' / )s"s ! )%& -$" ' '("# s"( -. s'/ " !/# #-) " ,(" '/s($)%('-/s (&!( !$" )s"# (- - "
#!(! !/# %-#" .$- '/("$/! " -$, (- (&" ALU; T&" '%$-%-/($- "$ 's %-/%"$/"# '(& "(('/
#!(! .$- !/# (- '(s - / '/s (&" !$%&'("%()$" !/# '/s($)%('-/ s"( !$" - (' '
8/12/2019 1.Green House Automation System
9/84
Pi# co#,iguratio# o, AT23c4) Microco#troller
8/12/2019 1.Green House Automation System
10/84
8/12/2019 1.Green House Automation System
11/84
PIN $ES-RIPTION :
6--
S) , - (! "
GN$
$-)/#
Port (
P-$( 0 's !/ 8* '( - "/ #$!'/ '*#'$"%('-/! I O -$(; As !/ -)( )( -$( "!%& '/ %!/ s'/@ "' &(
TTL '/ )(s; W&"/ 1s !$" $'(("/ (- -$( 0 '/s (&" '/s %!/ " )s"# !s &' & ' "#!/%" '/ )(s;
P-$( 0 %!/ ! s- " %-/.' )$"# (- " (&" ) (' " "# - -$#"$ !##$"ss #!(! )s #)$'/
!%%"ss (- " ("$/! $- $! !/# #!(! " -$,; I/ (&'s -#" P 0 &!s '/("$/! ) *) s; P-$( 0 ! s-
$"%"' "s (&" %-#" ,("s #)$'/ F !s& $- $! '/ !/# -)( )(s (&" %-#" ,("s #)$'/ $- $!
"$'.'%!('-/; E ("$/! ) *) s !$" $"G)'$"# #)$'/ $- $! "$'.'%!('-/;
Port )
P-$( 1 's !/ 8* '( '*#'$"%('-/! I O -$( '(& '/("$/! ) *) s; T&" -$( 1-)( )( ).."$s
%!/ s'/@ s-)$%" .-)$ TTL '/ )(s; W&"/ 1s !$" $'(("/ (- -$( 1 '/s (&", !$" ) "# &' & , (&"'/("$/! ) *) s %!/ " )s"# !s '/ )(s; As '/ )(s P-$( 1 '/s (&!( !$" " ("$/! , "'/ ) "# -
' s-)$%" %)$$"/( 1 "%!)s" -. (&" '/("$/! ) *) s;
Port %
P-$( 2 's !/ 8* '( '*#'$"%('-/! I O -$( '(& '/("$/! ) *) s; T&" -$( 2 -)( )( ).."$s
%!/ s'/@ s-)$%" .-)$ TTL '/ )(s; W&"/ 1s !$" $'(("/ (- -$( 2 '/s (&", !$" ) "# &' & , (&"'/("$/! ) *) s %!/ " )s"# !s '/ )(s; As '/ )(s P-$( 2 '/s (&!( !$" " ("$/! , "'/ ) "# -
' s-)$%" %)$$"/( "%!)s" -. (&" '/("$/! ) *) s;
P-$( 2 " '(s (&" &' &*-$#"$ !##$"ss ,(" #)$'/ ."(%&"s .$- " ("$/! $- $! " -$,
!/# #)$'/ !%%"ss (- DPTR; I/ (&'s ! '%!('-/ P-$( 2 )s"s s($-/ '/("$/! ) *) s &"/ " '(('/
8/12/2019 1.Green House Automation System
12/84
1s; D)$'/ !%%"ss"s (- " ("$/! #!(! " -$, (&!( )s" 8* '( #!(! !##$"ss MO> =R1 P-$( 2
" '(s (&" %-/("/(s -. (&" P2 S "%'! F)/%('-/ R" 's("$; P-$( 2 ! s- $"%"' "s (&" &' &*-$#"$
!##$"ss '(s !/# s- " %-/($- s' /! s #)$'/ F !s& $- $! '/ !/# "$'.'%!('-/;
Port *
P-$( 3 's !/ 8* '( '*#'$"%('-/! I O -$( '(& '/("$/! ) *) s; T&" -$( 3 -)( )( ).."$s
%!/ s'/@ s-)$%" .-)$ TTL '/ )(s; W&"/ 1s !$" $'(("/ (- -$( 3 '/s (&", !$" ) "# &' & , (&"
'/("$/! ) *) s %!/ " )s"# !s '/ )(s; As '/ )(s P-$( 3 '/s (&!( !$" " ("$/! , "'/ ) "# -
' s-)$%" %)$$"/( "%!)s" -. (&" '/("$/! ) *) s;
P-$( 3 ! s- $"%"' "s s- " %-/($- s' /! s .-$ F !s& P$- $! '/ !/# "$'.'%!('-/
=ort
%in
Alternate Functions
"1.; : $#serial input port%
"1.< ' $#serial input port%
"1. 3=';#e&ternal interrupt ;%
"1.1 3='
8/12/2019 1.Green House Automation System
13/84
R"s( '/ )( A -/ (&'s '/ .-$ ( - !%&'/" %,% "s &' " (&" -s%' !(-$ 's $)//'/ $"s"(s (&" #" '%";
A&E+PROG0
A##$"ss L!(%& E/! " 's !/ -)( )( ) s" .-$ !(%&'/ (&" - ,(" -. (&" !##$"ss #)$'/
!%%"ss (- " ("$/! " -$,; T&'s '/ 's ! s- (&" $- $! ) s" '/ )( PRO #)$'/ F !s&
$- $! '/ ;
I/ /-$ ! - "$!('-/ ALE 's " '(("# !( ! %-/s(!/( $!(" -. 1 16 (&" -s%' !(-$ .$"G)"/%, !/#
!, " )s"# .-$ " ("$/! (' '/ -$ % -%@'/ )$ -s"; N-(" &- " "$ (&!( -/" ALE ) s" 's
s@' "# #)$'/ "!%& !%%"ss (- " ("$/! D!(! " -$,;
PSEN
P$- $! S(-$" E/! " 's (&" $"!# s($- " (- " ("$/! $- $! " -$, &"/ (&" AT89%51
's " "%)('/ %-#" .$- " ("$/! $- $! " -$, PSEN 's !%(' !("# ( '%" "!%& !%&'/" %,% "
" %" ( (&!( ( - PSEN !%(' !('-/s !$" s@' "# #)$'/ "!%& !%%"ss (- " ("$/! #!(! " -$,;
EA +6PP
E ("$/! A%%"ss E/! " EA )s( " s($! "# (- ND '/ -$#"$ (- "/! " (&" #" '%" (-
."(%& %-#" .$- " ("$/! $- $! " -$, -%!('-/s s(!$('/ !( 0000& ) (- FFFFH; N-("
&- " "$ (&!( '. -%@ '( 1 's $- $! "# EA ' " '/("$/! , !(%&"# -/ $"s"(; EA s&-) # "
s($! "# (- >%% .-$ '/("$/! $- $! " "%)('-/s; T&'s '/ ! s- $"%"' "s (&" 12* - ( $- $! '/
"/! " - (! " > #)$'/ F !s& $- $! '/ &"/ 12* - ( $- $! '/ 's s" "%("#;
7TA&)
I/ )( (- (&" '/ "$('/ -s%' !(-$ ! '.'"$ !/# '/ )( (- (&" '/("$/! % -%@ - "$!('/ %'$%)'(;
8/12/2019 1.Green House Automation System
14/84
7TA& %
O)( )( .$- (&" '/ "$('/ -s%' !(-$ ! '.'"$;
OPERATING $ES-RIPTION
T&" #"(!' #"s%$' ('-/ -. (&" AT89C51 '/% )#"# '/ (&'s #"s%$' ('-/ 's:
J M" -$, M! !/# R" 's("$s
J T' "$ C-)/("$s
J I/("$$) ( S,s("
MEMORY MAP AN$ REGISTERS
Memory
T&" AT89C51 &!s s" !$!(" !##$"ss s !%"s .-$ $- $! !/# #!(! " -$,; T&" $- $!
!/# #!(! " -$, %!/ " ) (- 64+ ,("s -/ ; T&" - "$ 4+ $- $! " -$, %!/ $"s'#" -/*
%&' ; T&" AT89C51 &!s 128 ,("s -. -/*%&' RAM; T&" - "$ 128 ,("s %!/ " !%%"ss"# "'(&"$
, #'$"%( !##$"ss'/ -$ , '/#'$"%( !##$"ss'/ ; T&" - "$ 128 ,("s -. RAM %!/ " #' '#"# '/(-
3 s" "/(s !s 's("# " -
1; Register Ba#!s (8*0 -%!('-/s 00H (&$-) & 1FH 32 ,("s ; T&" #" '%" !.("$ $"s"( #".!) (s (-
$" 's("$ !/@ 0; T- )s" (&" -(&"$ $" 's("$ !/@s (&" )s"$ )s( s" "%( (&" '/ s-.( !$"; E!%&
$" 's("$ !/@ %-/(!'/s "' &( 1* ,(" $" 's("$s R0*R7; R"s"( '/'('! '
8/12/2019 1.Green House Automation System
15/84
3; Scratc' Pa Area0 30H*7FH !$" ! !' ! " (- (&" )s"$ !s #!(! RAM; H- " "$ '. (&" #!(!
-'/("$ &!s ""/ '/'('! '
8/12/2019 1.Green House Automation System
16/84
Accumulator 9A--:
ACC 's (&" A%%) ) !(-$ $" 's("$; T&" /" -/'%s .-$ A%%) ) !(-$*s "%'.'% '/s($)%('-/s
&- " "$ $"."$ (- (&" A%%) ) !(-$ s' , !s A;
B Register 9B:
T&" B $" 's("$ 's )s"# #)$'/ ) (' , !/# #' '#" - "$!('-/s; F-$ -(&"$ '/s($)%('-/s '( %!/ "
($"!("# !s !/-(&"$ s%$!(%& !# $" 's("$;
Program Status .or 9PS.:
T&" PSW $" 's("$ %-/(!'/s $- $! s(!()s '/.-$ !('-/;
Stac! Poi#ter 9SP:
T&" S(!%@ P-'/("$ R" 's("$ 's "' &( '(s '#"; I( 's '/%$" "/("# ".-$" #!(! 's s(-$"# #)$'/
PUSH !/# CALL " "%)('-/s; W&' " (&" s(!%@ !, $"s'#" !/, &"$" '/ -/ %&' RAM (&" S(!%@
P-'/("$ 's '/'('! '
8/12/2019 1.Green House Automation System
17/84
-o#trol Registers
S "%'! F)/%('-/ R" 's("$s IP IE TMOD TCON SCON !/# PCON %-/(!'/ %-/($- !/# s(!()s
'(s .-$ (&" '/("$$) ( s,s(" (&" T' "$ C-)/("$s !/# (&" s"$'! -$(;
TIMER+-OUNTERS
T&" IS89C51 &!s ( - 16* '( T' "$ C-)/("$ $" 's("$s: T' "$ 0 !/# T' "$ 1; A ( - %!/
" %-/.' )$"# (- - "$!(" "'(&"$ !s T' "$s -$ " "/( %-)/("$s; As ! T' "$ (&" $" 's("$ 's
'/%$" "/("# " "$, !%&'/" %,% "; T&)s (&" $" 's("$ %-)/(s !%&'/" %,% "s; S'/%" ! !%&'/"
%,% " %-/s's(s -. 12 -s%' !(-$ "$'-#s (&" %-)/( $!(" 's 1 12 -. (&" -s%' !(-$ .$"G)"/%,;
As ! C-)/("$ (&" $" 's("$ 's '/%$" "/("# '/ $"s -/s" (- ! 1*(-*0 ($!/s'('-/ !( '(s
%-$$"s -/#'/ " ("$/! '/ )( '/ T0 !/# T1; T&" " ("$/! '/ )( 's s! "# #)$'/ S5P2 -. " "$,
!%&'/" %,% "; W&"/ (&" s! "s s&- ! &' & '/ -/" %,% " !/# ! - '/ (&" /" (
%,% " (&" %-)/( 's '/%$" "/("#; T&" /" %-)/( ! )" ! "!$s '/ (&" $" 's("$ #)$'/ S3P1 -. (&"
%,% " .- - '/ (&" -/" '/ &'%& (&" ($!/s'('-/ !s #"("%("#; S'/%" ( - !%&'/" %,% "s 24
-s%' !(-$ "$'-#s !$" $"G)'$"# (- $"%- /'
8/12/2019 1.Green House Automation System
18/84
T&" s "%'! .)/%('-/ $" 's("$s )s"# '/ (' "$s !$"
TMOD R" 's("$
TCON R" 's("$
T' "$ T0 (' "$ T1 R" 's("$s
9i: TMO$ Register0
TMOD 's #"#'%!("# s- " , (- (&" ( - (' "$s T0 T1 ;
T&" (' "$ -#" SFR 's )s"# (- %-/.' )$" (&" -#" -. - "$!('-/ -. "!%& -. (&" ( -(' "$s; Us'/ (&'s SFR ,-)$ $- $! !, %-/.' )$" "!%& (' "$ (- " ! 16* '( (' "$ -$ 13
'( (' "$ 8* '( !)(- $" -!# (' "$ -$ ( - s" !$!(" (' "$s; A##'('-/! , ,-) !, %-/.' )$"
(&" (' "$s (- -/ , %-)/( &"/ !/ " ("$/! '/ 's !%(' !("# -$ (- %-)/( " "/(s (&!( !$"
'/#'%!("# -/ !/ " ("$/! '/;
I( %!/ %-/s'#"$ !s ( - #) '%!(" 4* '( $" 's("$s "!%& -. &'%& %-/($- s (&" !%('-/ -. -/"
-. (&" (' "$s;
9ii: T-ON Register
T&" (' "$ %-/($- SFR 's )s"# (- %-/.' )$" !/# -#'., (&" !, '/ &'%& (&" 8051 s ( -
(' "$s - "$!("; T&'s SFR %-/($- s &"(&"$ "!%& -. (&" ( - (' "$s 's $)//'/ -$ s(- "#
!/# %-/(!'/s ! . ! (- '/#'%!(" (&!( "!%& (' "$ &!s - "$. - "#; A##'('-/! , s- " /-/*
(' "$ $" !("# '(s !$" -%!("# '/ TCON SFR;
T&"s" '(s !$" )s"# (- %-/.' )$" (&" !, '/ &'%& (&" " ("$/! '/("$$) ( . ! s !$"
!%(' !("# &'%& !$" s"( &"/ !/ " ("$/! '/("$$) ( -%%)$s;
9iii: TIMER ( 9T(:0
TO T' "$ 0 - &' & !##$"ss 8A 8C &
8/12/2019 1.Green House Automation System
19/84
T&"s" ( - SFR s (!@"/ (- "(&"$ $" $"s"/( (' "$ 0; T&"'$ " !%( "&! '-$ #" "/#s
-/ &- (&" (' "$ 's %-/.' )$"# '/ (&" TMOD SFR &- " "$ (&"s" (' "$s ! !,s %-)/(
) ; W&!( 's %-/.' )$! " 's &- !/# &"/ (&", '/%$" "/( '/ ! )";
TH0 TL0
9i
8/12/2019 1.Green House Automation System
20/84
'#(& "!s)$" "/(s; TR1 's ! %-/($- '( '/ (&" S "%'! F)/%('-/ R" 's("$ TCON; !(" 's '/
TMOD;
T&" 13* '( $" 's("$ %-/s's(s -. ! "' &( '(s -. TH1 !/# (&" - "$ .' " '(s -. TL1; T&"
) "$ (&$"" '(s -. TL1 !$" '/#"("$ '/!(" !/# s&-) # " ' /-$"#; S"(('/ (&" $)/ . ! TR1 #-"s/-( % "!$ (&" $" 's("$s;
M-#" 0 - "$!('-/ 's (&" s! " .-$ T' "$ 0 !s .-$ T' "$ 1 " %" ( (&!( TR0 TF0 !/# INT0
$" !%" (&" %-$$"s -/#'/ T' "$ 1 s' /! s; T&"$" !$" ( - #'.."$"/( ATE '(s -/" .-$ T' "$ 1
TMOD;7 !/# -/" .-$ T' "$ 0 TMOD;3 ;
Mo e )
M-#" 1 's (&" s! " !s M-#" 0 " %" ( (&!( (&" T' "$ $" 's("$ 's $)/ '(& ! 16 '(s; T&"% -%@ 's ! '"# (- (&" %- '/"# &' & !/# - (' "$ $" 's("$s TL1 TH1 ; As % -%@ ) s"s !$"
$"%"' "# (&" (' "$ %-)/(s ) : 0000H 0001H 0002H "(%; A/ - "$. - -%%)$s -/ (&" FFFFH*(-*
0000H - "$. - . ! ; T&" (' "$ %-/('/)"s (- %-)/(; T&" - "$. - . ! 's (&" TF1 '( '/ TCON
(&!( 's $"!# -$ $'(("/ , s-.( !$"
Mo e %
M-#" 2 %-/.' )$"s (&" T' "$ $" 's("$ !s !/ 8* '( C-)/("$ TL1 '(& !)(- !('% $" -!# !s
s&- / '/ F' )$" 10; O "$. - .$- TL1 /-( -/ , s"(s TF1 )( ! s- $" -!#s TL1 '(& (&"
%-/("/(s -. TH1 &'%& 's $"s"( , s-.( !$"; T&" $" -!# "! "s (&" TH1 )/%&!/ "#; M-#" 2
- "$!('-/ 's (&" s! " .-$ T' "$ C-)/("$ 0;
Mo e *
T' "$ 1 '/ M-#" 3 s' , &- #s '(s %-)/(; T&" ".."%( 's (&" s! " !s s"(('/ TR1 ? 0;
T' "$ 0 '/ M-#" 3 "s(! 's&"s TL0!/# TH0 !s ( - s" !$!(" %-)/("$s; T&" - '% .-$ M-#" 3 -/
T' "$ 0 's s&- / '/ F' )$" 11; TL0 )s"s (&" T' "$ 0 %-/($- '(s: C T ATE TR0 INT0 !/#
TF0; TH0 's -%@"# '/(- ! (' "$ .)/%('-/ %-)/('/ !%&'/" %,% "s !/# - "$ (&" )s" -. TR1 !/#
TF1 .$- T' "$ 1; T&)s TH0 /- %-/($- s (&" T' "$ 1 '/("$$) (;
8/12/2019 1.Green House Automation System
21/84
M-#" 3 's .-$ ! '%!('-/s $"G)'$'/ !/ " ($! 8* '( (' "$ -$ %-)/("$; W'(& T' "$ 0 '/
M-#" 3 (&" AT89C51 %!/ ! "!$ (- &! " (&$"" T' "$ C-)/("$s; W&"/ T' "$ 0 's '/ M-#" 3
T' "$ 1 %!/ " ()$/"# -/ !/# -.. , s '(%&'/ '( -)( -. !/# '/(- '(s - / M-#" 3; I/ (&'s %!s"
T' "$ 1 %!/ s(' " )s"# , (&" s"$'! -$( !s ! !)# $!(" "/"$!(-$ -$ '/ !/, ! '%!('-/ /-(
$"G)'$'/ !/ '/("$$) (;
INTERRUPT SYSTEM
A/ '/("$$) ( 's !/ " ("$/! -$ '/("$/! " "/( (&!( s)s "/#s (&" - "$!('-/ -. '%$-
%-/($- "$ (- '/.-$ '( (&!( ! #" '%" /""#s '(s s"$ '%"; I/ '/("$$) ( "(&-# &"/" "$ !/, #" '%"
/""#s '(s s"$ '%" (&" #" '%" /-('.'"s (&" '%$- %-/($- "$ , s"/#'/ '( !/ '/("$$) ( s' /! ; U -/
$"%"' '/ !/ '/("$$) ( s' /! (&" '%$- %-/($- "$ '/("$$) (s &!(" "$ '( 's #-'/ !/# s"$ "s (&"
#" '%"; T&" $- $! !ss-%'!("# '(& '/("$$) ( 's %! "# !s '/("$$) ( s"$ '%" s) $-)('/"
ISR ;M!'/ !# !/(! " '(& '/("$$) (s 's (&!( (&" '%$- %-/($- "$ %!/ s"$ " !/, #" '%"s;
Bau Rate
T&" !)# $!(" '/ M-#" 0 's .' "# !s s&- / '/ (&" .- - '/ "G)!('-/; M-#" 0 B!)# R!("
? Os%' !(-$ F$"G)"/%, 12 (&" !)# $!(" '/ M-#" 2 #" "/#s -/ (&" ! )" -. (&" SMOD '( '/
S "%'! F)/%('-/ R" 's("$ PCON; I. SMOD ? 0 (&" !)# $!(" 's 1 64 -. (&" -s%' !(-$ .$"G)"/%,;
I. SMOD ? 1 (&" !)# $!(" 's 1 32 -. (&" -s%' !(-$ .$"G)"/%,;
M-#" 2 B!)# R!(" ? 2SMOD Os%' !(-$ F$"G)"/%, 64;
I/ (&" IS89C51 (&" T' "$ 1 - "$. - $!(" #"("$ '/"s (&" !)# $!("s '/ M-#"s 1 !/# 3;
NUMBER O5 INTERRUPTS IN 23-4)0
T&"$" !$" !s'%! , .' " '/("$$) (s ! !' ! " (- (&" )s"$; R"s"( 's ! s- %-/s'#"$"# !s !/
'/("$$) (; T&"$" !$" ( - '/("$$) (s .-$ (' "$ ( - '/("$$) (s .-$ " ("$/! &!$# !$" '/("$$) ( !/#
-/" '/("$$) ( .-$ s"$'! %- )/'%!('-/;
M" -$, -%!('-/ I/("$$) ( /! "
0000H R"s"(
8/12/2019 1.Green House Automation System
22/84
0003H E ("$/! '/("$$) ( 0
000BH T' "$ '/("$$) ( 0
0013H E ("$/! '/("$$) ( 1
001BH T' "$ '/("$$) ( 1
0023H S"$'! COM '/("$$) (
L- "$ (&" "%(-$ &' &"$ (&" $'-$'(,; T&" E ("$/! I/("$$) (s INT0 !/# INT1 %!/ "!%& "
"'(&"$ " " *!%(' !("# -$ ($!/s'('-/*!%(' !("# #" "/#'/ -/ '(s IT0 !/# IT1 '/ R" 's("$ TCON;
T&" . ! s (&!( !%()! , "/"$!(" (&"s" '/("$$) (s !$" (&" IE0 !/# IE1 '(s '/ TCON; W&"/ (&"s"$ '%" $-)('/" 's "%(-$"# &!$# !$" % "!$s (&" . ! (&!( "/"$!("# !/ " ("$/! '/("$$) ( -/ , '.
(&" '/("$$) ( !s ($!/s'('-/*!%(' !("#; I. (&" '/("$$) ( !s " " *!%(' !("# (&"/ (&" " ("$/!
$"G)"s('/ s-)$%" $!(&"$ (&!/ (&" -/*%&' &!$# !$" %-/($- s (&" $"G)"s( . ! ;
T&" T' "$ 0 !/# T' "$ 1 I/("$$) (s !$" "/"$!("# , TF0!/# TF1 &'%& !$" s"( , !
$- - "$ '/ (&"'$ $"s "%(' " T' "$ C-)/("$ $" 's("$s " %" ( .-$ T' "$ 0 '/ M-#" 3 ;W&"/ ! (' "$
'/("$$) ( 's "/"$!("# (&" -/*%&' &!$# !$" % "!$s (&" . ! (&!( 's "/"$!("#;
T&" S"$'! P-$( I/("$$) ( 's "/"$!("# , (&" - '%! OR -. RI !/# TI; T&" s"$ '%" $-)('/"
/-$ ! , )s( #"("$ '/" &"(&"$ RI -$ TI "/"$!("# (&" '/("$$) ( !/# (&" '( )s( " % "!$"# '/
s-.( !$"; A -. (&" '(s (&!( "/"$!(" '/("$$) (s %!/ " s"( -$ % "!$"# , s-.( !$" '(& (&" s! "
$"s) ( !s (&-) & (&", &!# ""/ s"( -$ % "!$"# , &!$# !$"; T&!( 's '/("$$) (s %!/ " "/"$!("#
!/# "/#'/ '/("$$) (s %!/ " %!/%" "# '/ s-.( !$";
E!%& -. (&"s" '/("$$) ( s-)$%"s %!/ " '/#' '#)! , "/! "# -$ #'s! "# , s"(('/ -$
% "!$'/ ! '( '/ S "%'! F)/%('-/ R" 's("$ IE '/("$$) ( "/! " !( !##$"ss 0A8H; T&"$" 's !
- ! "/! " #'s! " '( (&!( 's % "!$"# (- #'s! " ! '/("$$) (s -$ (- s"( (&" '/("$$) (s;
IE 9I#terru"t e#able register:
Ste"s i# e#abli#g a# i#terru"t
8/12/2019 1.Green House Automation System
23/84
B'( D7 -. (&" IE $" 's("$ )s( " s"( (- &' & (- ! - (&" $"s( -. $" 's("$ (- (!@" ".."%(; I.
EA?1 '/("$$) (s !$" "/! "# !/# ' " $"s -/#"# (- '. (&"'$ %-$$"s -/#'/ '(s '/ IE !$" &' &;
I. EA?0 /- '/("$$) ( ' " $"s -/#"# (- " "/ '. (&" !ss-%'!("# '( '/ (&" IE $" 's("$ 's &' &;
$escri"tio# o, eac' bit i# IE register
D7 '(: D's! "s ! '/("$$) (s; I. EA ?0 /- '/("$$) ( 's !%@/- "# "# '. EA?1 "!%&
'/("$$) ( s-)$%" 's '/#' '#)! , "/! "# -$ #'s! "# , s"(('/ -$ % "!$'/ '(s "/! " '(;
D6 '(: R"s"$ "#;
D5 '(: E/! "s -$ #'s! "s (' "$ 2 - "$ . - '/("$$) ( '/ 8052 ;
D4 '(: E/! "s -$ #'s! "s s"$'! -$( '/("$$) (;
D3 '(: E/! "s -$ #'s! "s (' "$ 1 - "$ . - '/("$$) (;
D2 '(: E/! "s -$ #'s! "s " ("$/! '/("$$) ( 1;
D1 '(: E/! "s -$ #'s! "s (' "$ 0 - "$ . - '/("$$) (;
D0 '(: E/! "s -$ #'s! "s " ("$/! '/("$$) ( 0;
I#terru"t "riority i# 23-4)
T&"$" 's -/" -$" SRF (- !ss' / $'-$'(, (- (&" '/("$$) (s &'%& 's /! "# !s '/("$$) (
$'-$'(, IP ; Us"$ &!s ' "/ (&" $- 's'-/ (- !ss' / $'-$'(, (- -/" '/("$$) (; W$'('/ -/" (- (&!(
!$('%) !$ '( '/ (&" IP $" 's("$ .) .' s (&" (!s@ -. !ss' /'/ (&" $'-$'(,;
$escri"tio# o, eac' bit i# IP register
D7 '(: R"s"$ "#;
D6 '(: R"s"$ "#;
D5 '(: T' "$ 2 '/("$$) ( $'-$'(, '( '/ 8052 ;
D4 '(: S"$'! -$( '/("$$) ( $'-$'(, '(;
D3 '(: T' "$ 1 '/("$$) ( $'-$'(, '(;
8/12/2019 1.Green House Automation System
24/84
D2 '(: E ("$/! '/("$$) ( 1 $'-$'(, '(;
D1 '(: T' "$ 0 '/("$$) ( $'-$'(, '(;
D0 '(: E ("$/! '/("$$) ( 0 $'-$'(, '(;
PO.ER SUPP&Y
I/ (&'s $- "%( " &! " - "$ s) '"s '(& 5> *5> - ('-/ /-$ ! , 5> 's "/-) &
.-$ (-(! %'$%)'(; A/-(&"$ *5> s) , 's )s"# '/ %!s" -. OP ! %'$%)'( ;T$!/s.-$ "$ $' !$,
s'#" &!s 230 50HQ AC - (! " &"$"!s !( (&" s"%-/#!$, '/#'/ (&" - (! " 's s(" #- /"# (-
12 50&< !/# (&'s - (! " 's $"%('.'"# )s'/ ( - .) ! " $"%('.'"$s ;(&" $"%('.'"# -)( )( 's ' "/ (-
! .' ("$ %'$%)'( (- .'("$ (&" )/ !/("# !% '/ (&" s' /! A.("$ (&!( (&" -)( )( 's ! !'/ ! '"# (- !
$" ) !(-$ LM7805 (- $- '#" 5 $" ) !(-$; W&"$"!s LM7905 's .-$ $- '#'/ 5> $" ) !('-/;
12> %'$%)'( 's )s"# .-$ s(" "$ -(-$s F!/ !/# R" !, , )s'/ LM7812 $" ) !(-$ s! "
$-%"ss '@" ! - " s) '"s;
*=% $escri"tio# o, Tra#s,ormer
A ($!/s.-$ "$ 's ! #" '%" (&!( ($!/s."$s " "%($'%! "/"$ , .$- -/" %'$%)'( (-
!/-(&"$ (&$-) & '/#)%(' " , %-) "# %-/#)%(-$s (&" ($!/s.-$ "$Ks %-' s; A !$,'/
%)$$"/( '/ (&" .'$s( -$ primary '/#'/ %$"!("s ! !$,'/ ! /"('% . ) '/ (&"
($!/s.-$ "$Ks %-$" !/# (&)s ! !$,'/ ! /"('% .'" # (&$-) & (&" secondary
'/#'/ ; T&'s !$,'/ ! /"('% .'" # '/#)%"s ! !$,'/ " "%($- -(' " .-$%" EMF
-$ - (! " '/ (&" s"%-/#!$, '/#'/ ; T&'s ".."%( 's %! "# )()! '/#)%('-/ ;
http://en.wikipedia.org/wiki/Electrical_energyhttp://en.wikipedia.org/wiki/Electrical_networkhttp://en.wikipedia.org/wiki/Inductive_couplinghttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromotive_forcehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Mutual_inductionhttp://en.wikipedia.org/wiki/Electrical_energyhttp://en.wikipedia.org/wiki/Electrical_networkhttp://en.wikipedia.org/wiki/Inductive_couplinghttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Electromotive_forcehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Mutual_induction8/12/2019 1.Green House Automation System
25/84
5igure0 Tra#s,ormer Symbol
T$!/s.-$ "$ 's ! #" '%" (&!( %-/ "$(s (&" -/" .-$ "/"$ , (- !/-(&"$ .-$ -.
"/"$ , '@" ! ($!/s#)%"$;
5igure0 Tra#s,ormer
*=* Basic Pri#ci"le o, Tra#s,ormer 0
A ($!/s.-$ "$ !@"s )s" -. F!$!#!,Ks ! !/# (&" ."$$- ! /"('% $- "$('"s -. !/
'$-/ %-$" (- "..'%'"/( , $!'s" -$ - "$ AC - (! "s; I( -. %-)$s" %!//-( '/%$"!s" - "$ s- (&!( '. (&" - (! " 's $!'s"# (&" %)$$"/( 's $- -$('-/! , - "$"# !/# '%"
"$s!;
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/farlaw.html#c1http://hyperphysics.phy-astr.gsu.edu/hbase/solids/ferro.html#c4http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/elemag.html#c4http://hyperphysics.phy-astr.gsu.edu/hbase/electric/powerac.html#c1http://hyperphysics.phy-astr.gsu.edu/hbase/electric/farlaw.html#c1http://hyperphysics.phy-astr.gsu.edu/hbase/solids/ferro.html#c4http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/elemag.html#c4http://hyperphysics.phy-astr.gsu.edu/hbase/electric/powerac.html#c18/12/2019 1.Green House Automation System
26/84
5igure0 Basic Pri#ci"le Tra#s,ormer
*=> Tra#s,ormer .or!i#g0
A ($!/s.-$ "$ %-/s's(s -. ( - %-' s -.("/ %! "# K '/#'/ sK '/@"# , !/
'$-/ %-$" !s s&- / '/ .' )$" " - ; T&"$" 's /- " "%($'%! %-//"%('-/ "( ""/ (&"
%-' s '/s("!# (&", !$" '/@"# , ! ! /"('% .'" # %$"!("# '/ (&" %-$";
8/12/2019 1.Green House Automation System
27/84
5igure0 Basic Tra#s,ormer
T$!/s.-$ "$s !$" )s"# (- %-/ "$( " "%($'%'(, .$- -/" - (! " (- !/-(&"$ '(&
'/' ! -ss -. - "$; T&", -/ , -$@ '(& AC ! ("$/!('/ %)$$"/( "%!)s" (&",
$"G)'$" ! %&!/ '/ ! /"('% .'" # (- " %$"!("# '/ (&"'$ %-$"; T$!/s.-$ "$s %!/
'/%$"!s" - (! " s(" *) !s " !s $"#)%" - (! " s(" *#- / ;
A ("$/!('/ %)$$"/( . - '/ '/ (&" $' !$, '/ )( %-' %$"!("s ! %-/('/)! ,%&!/ '/ ! /"('% .'" # '/ (&" '$-/ %-$"; T&'s .'" # ! s- !ss"s (&$-) & (&"
s"%-/#!$, -)( )( %-' !/# (&" %&!/ '/ s($"/ (& -. (&" ! /"('% .'" # '/#)%"s !/
! ("$/!('/ - (! " '/ (&" s"%-/#!$, %-' ; I. (&" s"%-/#!$, %-' 's %-//"%("# (- !
-!# (&" '/#)%"# - (! " ' !@" !/ '/#)%"# %)$$"/( . - ; T&" %-$$"%( ("$ .-$
(&" '/#)%"# - (! " 's K'/#)%"# " "%($- -(' " .-$%"K &'%& 's )s)! , ! $" '!("# (-
'/#)%"# "; ;.;
T&" '$-/ %-$" 's ! '/!("# (- $" "/( K"##, %)$$"/(sK . - '/ '/ (&" %-$";
T&"s" !$" %)$$"/(s $-#)%"# , (&" ! ("$/!('/ ! /"('% .'" # '/#)%'/ ! s !
- (! " '/ (&" %-$" )s( '@" (&!( '/#)%"# '/ (&" s"%-/#!$, %-' ; E##, %)$$"/(s
!s(" - "$ , /""# "ss , &"!('/ ) (&" %-$" )( (&", !$" $"#)%"# (- ! /" ' ' "
8/12/2019 1.Green House Automation System
28/84
8/12/2019 1.Green House Automation System
29/84
(&" $' !$, -$ '/ )( '( ! /"('
8/12/2019 1.Green House Automation System
30/84
S'/ " &!s" s(" #- / ($!/s.-$ "$s 1 @ ! !/# !$ "$ !, ! s- " $" "$s"
%-//"%("# (- s(" *#- / -$ s(" *) - (! "s; N-(": s'/ " &!s" s(" ) -$ s("
#- / ($!/s.-$ "$s s'A s&-) # /-( " $" "$s" %-//"%("# "%!)s"
(&" s"%-/#!$, '/#'/ s &! " !##'('-/! ()$/s (- - "$%- " ! - (! " #$- &"/ (&"-!# 's ! '"#; I. $" "$s" %-//"%("# (&" -)( )( - (! " ' " "ss (&!/ #"s'$"#;
Ste"8U" Tra#s,ormer0
A s(" ) ($!/s.-$ "$ &!s -$" ()$/s -. '$" -/ (&" s"%-/#!$, %-' &'%&
!@"s ! !$ "$ '/#)%"# - (! " '/ (&" s"%-/#!$, %-' ; I( 's %! "# ! s(" )
($!/s.-$ "$ "%!)s" (&" - (! " -)( )( 's !$ "$ (&!/ (&" - (! " '/ )(;
S(" *) ($!/s.-$ "$ 110 220 #"s' / 's -/" &-s" s"%-/#!$, - (! " 's
$"!("$ (&!/ '(s $' !$, - (! "; T&'s @'/# -. ($!/s.-$ "$ s(" s ) (&" - (! "
! '"# (- '(; F-$ '/s(!/%" ! s(" ) ($!/s.-$ "$ 's /""#"# (- )s" ! 220 $-#)%( '/
! %-)/($, '(& ! 110 s) ,;
A s(" ) ($!/s.-$ "$ 110 220 %-/ "$(s ! ("$/!('/ %)$$"/( AC .$- -/"
- (! " (- !/-(&"$ - (! "; I( &!s /- - '/ !$(s !/# -$@s -/ ! ! /"('%
'/#)%('-/ $'/%' " '( %!/ " #"s' /"# (- s(" *) -$ s(" *#- / - (! "; S- !
s(" ) ($!/s.-$ "$ '/%$"!s"s (&" - (! " !/# ! s(" #- / ($!/s.-$ "$ #"%$"!s"s
(&" - (! ";
T&" $' !$, %- -/"/(s .-$ - (! " ($!/s.-$ !('-/ !$" (&" s(" )
($!/s.-$ "$ %-$" !/# %-' ; T&" '/s) !('-/ 's !%"# "( ""/ (&" ()$/s -. '$" (- $" "/( s&-$('/ (- -/" !/-(&"$ -$ (- $-)/#; T&'s 's (, '%! , %- $'s"# -. M, !$
/- " +$!.( ! "$ !$/'s& -$ -(&"$ !("$'! s; As ! ($!/s.-$ "$ &!s /- - '/
!$(s '( ' (, '%! , &! " ! '." " "%(!/%, "( ""/ 20 !/# 25 ,"!$s;
http://www.gcsescience.com/pme16.htmhttp://www.gcsescience.com/pme16.htm8/12/2019 1.Green House Automation System
31/84
5igure0 Ste"8U" Tra#s,ormer
A""licatio#s
"/"$! , (&"s" S(" *U T$!/s.-$ "$s !$" )s"# '/ '/#)s($'"s ! '%!('-/s -/ ,;
Tur#s Ratio a# 6oltage
T&" $!('- -. (&" /) "$ -. ()$/s -/ (&" $' !$, !/# s"%-/#!$, %-' s
#"("$ '/"s (&" $!('- -. (&" - (! "s;;;
;;; &"$" > 's (&" $' !$, '/ )( - (! " > s 's (&" s"%-/#!$, -)( )( - (! " N
's (&" /) "$ -. ()$/s -/ (&" $' !$, %-' !/# N s 's (&" /) "$ -. ()$/s -/ (&"
s"%-/#!$, %-' ;
$io es0
D'-#"s ! - " "%($'%'(, (- . - '/ -/ , -/" #'$"%('-/; T&" !$$- -. (&"
%'$%)'( s, - s&- s (&" #'$"%('-/ '/ &'%& (&" %)$$"/( %!/ . - ; D'-#"s !$" (&"
" "%($'%! "$s'-/ -. ! ! " !/# "!$ , #'-#"s "$" !%()! , %! "# ! "s;
8/12/2019 1.Green House Automation System
32/84
5igure0 $io e Symbol
A #'-#" 's ! #" '%" &'%& -/ , ! - s %)$$"/( (- . - (&$-) & '( '/ -/"
#'$"%('-/; I/ (&'s #'$"%('-/ (&" #'-#" 's s!'# (- " K.-$ !$#* '!s"#K !/# (&" -/ ,
".."%( -/ (&" s' /! 's (&!( (&"$" ' " ! - (! " -ss -. !$-)/# 0;7>; I/ (&"
- -s'(" #'$"%('-/ (&" #'-#" 's s!'# (- " K$" "$s"* '!s"#K !/# /- %)$$"/( ' . -
(&$-) & '(;
Recti,ier
T&" )$ -s" -. ! $"%('.'"$ 's (- %-/ "$( !/ AC ! ".-$ '/(- ! DC
! ".-$ OR R"%('.'"$ %-/ "$(s AC %)$$"/( -$ - (! "s '/(- DC %)$$"/( -$
- (! "; T&"$" !$" ( - #'.."$"/( $"%('.'%!('-/ %'$%)'(s @/- / !s K&! .* ! "K !/#
K.) * ! "K $"%('.'"$s; B-(& )s" %- -/"/(s %! "# #'-#"s (- %-/ "$( AC '/(- DC;
T'e Hal,8wa
8/12/2019 1.Green House Automation System
33/84
T&" &! .* ! " $"%('.'"$ 's (&" s' "s( (, " -. $"%('.'"$ s'/%" '( -/ , )s"s -/"
#'-#" !s s&- / '/ .' )$" .
5igure0 Hal, .a "ss (&!/ >s;
5igure0 Hal,8.a
8/12/2019 1.Green House Automation System
34/84
8/12/2019 1.Green House Automation System
35/84
8/12/2019 1.Green House Automation System
36/84
8/12/2019 1.Green House Automation System
37/84
-. ! !$'! " $" ) !("# - "$ s) ,; W&' " ! #"#'%!("# s) , 's G)'(" &!/#, "; ; 5> -$ 12> '(Ks
)%& &!/#'"$ (- &! " ! !$'! " s) , -/ &!/# "s "%'! , .-$ ("s('/ ;
M-s( #' '(! - '% %'$%)'(s !/# $-%"ss-$s /""# ! 5 - ( - "$ s) ,; T- )s" (&"s" !$(s " /""#
(- )' # ! $" ) !("# 5 - ( s-)$%"; Us)! , ,-) s(!$( '(& !/ )/$" ) !("# - "$ s) , $!/ '/.$- 9 - (s (- 24 - (s DC T- !@" ! 5 - ( - "$ s) , " )s" ! LM7805 - (! " $" ) !(-$
IC I/(" $!("# C'$%)'( ; T&" IC 's s&- / " - ;
T&" LM7805 's s' " (- )s"; Y-) s' , %-//"%( (&" -s'(' " "!# -. ,-)$ )/$" ) !("# DC
- "$ s) , !/,(&'/ .$- 9>DC (- 24>DC (- (&" I/ )( '/ %-//"%( (&" /" !(' " "!# (- (&"%- -/ '/ !/# (&"/ &"/ ,-) ()$/ -/ (&" - "$ ,-) "( ! 5 - ( s) , .$- (&" O)( )( '/;
B -%@ D'! $! :
9igB ?. .
8/12/2019 1.Green House Automation System
38/84
F' 5;2;2: * B -%@ D'! $! -. P- "$ s) ,
-ircuit 5eatures0
B$'". #"s%$' ('-/ -. - "$!('-/: ' "s -)( " $" ) !("# 5> -)( )( -)( )( %)$$"/(
%! ! ' '(, -. 100 A ;C'$%)'( $-("%('-/: B)' (*'/ - "$&"!('/ $-("%('-/ s&)(s #- / -)( )( &"/
$" ) !(-$ IC "(s (-- &-( C'$%)'( %- " '(,: >"$, s' " !/# "!s, (- )' # C'$%)'(
"$.-$ !/%": >"$, s(! " 5> -)( )( - (! " $" '! " - "$!('-/ A!' ! ' '(, -. %- -/"/(s:
E!s, (- "( )s"s -/ , "$, %- -/ !s'% %- -/"/(s D"s' / ("s('/ : B!s"# -/ #!(!s&""(
" ! " %'$%)'( I &! " )s"# (&'s %'$%)'( s)%%"ss.) , !s !$( -. !/, " "%($-/'%s $- "%(s
A '%!('-/s: P!$( -. " "%($-/'%s #" '%"s s ! ! -$!(-$, - "$ s) ,
P- "$ s) , - (! ": U/$" ) !("# DC 8*18> - "$ s) ,
P- "$ s) , %)$$"/(: N""#"# -)( )( %)$$"/( 5 A
C- -/"/( %-s(s: F" #- !$s .-$ (&" " "%($-/'%s %- -/"/(s (&" '/ )( ($!/s.-$ "$ %-s(;
8/12/2019 1.Green House Automation System
39/84
TEMPERATURE SENSOR
T" "$!()$" S"/s-$ &'%& %-/ "$(s (" "$!()$" ! )" '/(- " "%($'%!s' /! s;W" )s"# IC %! "# LM 35 !s ! (" "$!()$" s"/s-$; LM35 s"$'"s s"/s-$s !$"
$"%'s'-/ '/(" $!("#*%'$%)'( (" "$!()$" s"/s-$s &-s" -)( )( - (! " 's '/"!$ ,
$- -$('-/! (- (&" C" s')s (" "$!()$"; T&" LM35 $"G)'$"s /- " ("$/! %! ' $!('-/
s'/%" '( 's '/("$/! , %! ' $!("#; ; T&" LM35 #-"s /-( $"G)'$" !/, " ("$/!
%! ' $!('-/ -$ ($' '/ (- $- '#" (, '%! !%%)$!%'"s -. 1V4 C !( $--
(" "$!()$" !/# 3V4 C - "$ ! .) X55 (- 150 C (" "$!()$" $!/ ";
T&" LM35 s - -)( )( ' "#!/%" '/"!$ -)( )( !/# $"%'s" '/&"$"/( %! ' $!('-/
!@" '/("$.!%'/ (- $"!#-)( -$ %-/($- %'$%)'($, "s "%'! , "!s,; I( %!/ " )s"# '(&
s'/ " - "$ s) '"s -$ '(& )s !/# '/)s s) '"s; As '( #$! s -/ , 60 A
.$- '(s s) , '( &!s "$, - s" .*&"!('/ "ss (&!/ 0;1 C '/ s(' !'$;
5eatures
C! ' $!("# #'$"%( , '/ C" s')s C"/(' $!#"
L'/"!$ 10;0 > C s%! " .!%(-$ 0;5 C !%%)$!%, )!$!/(""# !( 25 C
R!("# .-$ .) X55 (- 150 C $!/ "
S)'(! " .-$ $" -(" ! '%!('-/s
8/12/2019 1.Green House Automation System
40/84
L- %-s( #)" (- !."$* " " ($' '/
O "$!("s .$- 4 (- 30 - (s
L"ss (&!/ 60 A %)$$"/( #$!'/
L- s" .*&"!('/ 0;08 C '/ s(' !'$
N-/ '/"!$'(, -/ , 1V4 C (, '%!
L- ' "#!/%" -)( )( 0;1 W .-$ 1 A -!#
5igure0 Tem"erature Se#sor
>=* &M*4
LM35 's $"%'s'-/ '/(" $!("# %'$%)'( (" "$!()$" s"/s-$; I(s -)( )(
- (! " 's '/"!$ , $- -$('-/! (- (" "$!()$" '/ %" s')s ;
8/12/2019 1.Green House Automation System
41/84
T&" LM35 (&)s &!s !/!# !/(! " - "$ '/"!$ (" "$!()$" s"/s-$s
%! ' $!("# '/ +" '/ !s (&" )s"$ 's /-( $"G)'$"# (- s) ($!%( ! !$ "
%-/s(!/( - (! " .$- '(s -)( )( (- - (!'/ %-/ "/'"/( C"/(' $!#" s%! '/ ;
T&" LM35 #-"s /-( $"G)'$" !/, " ("$/! %! ' $!('-/ -$ ($' '/ (-
$- '#" (, '%! !%%)$!%'"s -. 1V4 C !( $-- (" "$!()$" !/# 3V4 C
- "$ ! .) X55 (- 150 C (" "$!()$" $!/ "
I( %!/ " )s"# '(& s'/ " - "$ s) '"s -$ '(& )s !/# '/)s
s) '"s; As '( #$! s -/ , 60 A .$- '(s s) , '( &!s "$, - s" .*
&"!('/ "ss (&!/ 0;1 C '/ s(' !'$;
T'e c'aracteristic o, t'is &M*4 se#sor is0
F-$ "!%& #" $"" -. %"/(' $!#" (" "$!()$" '( -)( )(s 10 ' ' - (s;ADC
!%%" (s (&" -)( )( .$- LM35 !/# %-/ "$(s (&!( #!(! '/(- #' '(! .-$ &'%& 's
s"/( (- '%$-%-/($- "$ .-$ .)$(&"$ $-%"ss'/ ;
>=> TEMPERATURE SENSING -IR-UIT
T&" "(&-#s -. (" "$!()$" "!s)$" "/( !, " #' '#"# '/(- ( - !'/
% !ss"s !%%-$#'/ !s (&" " %&!/ " -. &"!( "( ""/ (&" ("s('/ -#, !/# (&" &-(
s,s(" (!@"s !%" , %-/(!%( -$ , $!#'!('-/ !%$-ss ! s !%"; I/ (&" %-/(!%(
"(&-#s (&"$ - "("$s -$ (&"$ -%-) "s !$" )s"# !/# (&", !$" ' "$s"# '/ s- '#s
-$ 'G)'#s;
T&" (&"$ -#,/! '% "G)' ' $') "( ""/ (&" &-( -#, !/# (&" ("s('/ -#,'s "s(! 's&"# , !("$'! %-/(!%(; I/ (&" /-/*%-/(!%( "(&-#s (&"
(&"$ -#,/! '% "G)' ' $') 's "s(! 's&"# , (&" $!#'!('-/ " '(("# !s " %'("# !(-
!/# - "%) "s '/ (&" &-( -#, $"()$/ (- (&" $-)/# s(!(";
8/12/2019 1.Green House Automation System
42/84
5igure= Tem"erature Se#si#g -ircuit
LIGHT DEPENDENT RESISTOR (LDR)
A &-(- $"s's(-$ 's !/ " "%($-/'% %- -/"/( &-s" $"s's(!/%" #"%$"!s"s '(& '/%$"!s'/
'/%'#"/( ' &( '/("/s'(,; I( %!/ ! s- " %! "# ! ' &(*#" "/#"/( $"s's(-$ LDR -$ &-(-
%-/#)%(-$;
O(&"$ ' &( #" "/#"/( $"s's(-$s -$ &-(- $"s's(-$s &! " ""/ !#" )s'/ !("$'! s
'/% )#'/ C!# ') S) &'#" L"!# S) &'#" !/# (&" -$" %- -/ , )s"# s" '%-/#)%(-$
!("$'! s '/% )#'/ " S' !/# !As;
F' 3;3;1: * S%&" !('% S, - -. LDR
R6R
R5R
t
RT 1T HERMI ST O R
1
2 VCC_CI RCLE
VCC_CI RCLE
R5R
Q 1BC107
3
2
1
8/12/2019 1.Green House Automation System
43/84
A ' &( #" "/#"/( $"s's(-$
T&" &-(- $"s's(-$ -$ L' &( D" "/#"/( R"s's(-$ .'/#s !/, )s"s !s ! - %-s( &-(-
s"/s'(' " " " "/( !/# !s )s"# .-$ !/, ,"!$s '/ &-(- $! &'% ' &( "("$s !s " !s -(&"$
! '%!('-/s;s)%& !s . ! " s -@" !/# )$ "$ #"("%(-$s %!$# $"!#"$s !/# ' &('/ %-/($- s .-$ s($""( ! s;U/'(s .-$ (&" ' &( '/("/s'(, !$" L) -$ L) "/%";
Basic structureA (&-) & (&"$" !$" !/, !,s '/ &'%& LDR s -$ &-(- $"s's(-$s %!/ " !/).!%()$"# (&"$ !$"
/!()$! , ! ." -$" %- -/ "(&-#s (&!( !$" s""/; Ess"/('! , (&" LDR -$ &-(- $"s's(-$
%-/s's(s -. ! $"s's(' " !("$'! s"/s'(' " (- ' &( (&!( 's " -s"# (- ' &(; T&" &-(- $"s's(' "
" " "/( %- $'s"s s"%('-/ -. !("$'! '(& %-/(!%(s !( "'(&"$ "/#; A (&-) & !/, -. (&" !("$'!
)s"# .-$ ' &( #" "/#"/( $"s's(-$s !$" s" '%-/#)%(-$s &"/ )s"# !s &-(- $"s's(-$s (&", !$" )s"#
-/ , !s ! $"s's(' " " " "/( !/# (&"$" !$" /- */ )/%('-/s; A%%-$#'/ , (&" #" '%"s )$" ,
!ss' ";
A (, '%! s($)%()$" .-$ ! L' &( D" "/#"/( R"s's(-$ )s"s !/ !%(' " s" '%-/#)%(-$ !,"$ (&!(
's #" -s'("# -/ !/ '/s) !('/ s) s($!("; T&" s" '%-/#)%(-$ 's /-$ ! , ' &( , #- "# (- "/! " '(
(- &! " (&" $"G)'$"# " " -. %-/#)%(' '(,; C-/(!%(s (&"/ !%"# "'(&"$ s'#" -. (&" " -s"# !$"!;
I/ !/, '/s(!/%"s (&" !$"! "( ""/ (&" %-/(!%(s 's '/ (&" .-$ -.
T&'s ! ' '
8/12/2019 1.Green House Automation System
44/84
8/12/2019 1.Green House Automation System
45/84
? 1 F(% ? 10;764 ) "/s
F' 3;3;2: * C&!$!%("$'s('%s -. LDR
LDR pp!ications:
LDR s !$" "$, )s".) "s "%'! , '/ ' &( #!$@ s"/s-$ %'$%)'(s; N-$ ! , (&" $"s's(!/%" -.
LDR 's "$, &' & s- "(' "s !s &' & !s 1000@ -& s )( &"/ (&", !$" ' ) '/!("# '(& ' &(
$"s's(!/%" #$- s ' "#'!(" ,;
1; C! "$! ' &( "("$s;
2; C -%@ $!#'-s;
3; S"%)$'(, ! !$ s;
4; O ('%! s '(%&"s;
5; F!$ '/.$!$"# #"("%(-$;6; S($""( ' &(s;
Testin" circuit of LDR:
Vout
470K
+5v
&$R
F' 3;3;3: * T"s('/ C'$%)'( -. LDR
7U+3$3'C S!=S):S
8/12/2019 1.Green House Automation System
46/84
7umidity sensors are gaining more signi cance in diverse areas of
measurement and 6ontrol technology. +anufacturers are not only improving the
accuracy and long-term drift of their sensors, they are improving their durability for
use in diDerent environments, and simultaneously reducing the component si e and
the price.
9ollowing this trend, Swiss-based Sensation AE has introduced a new generation
of integrated, digital, and calibrated humidity and temperature sensors using 6+)S
0micro-machined0 chip technology. 'he new products, SC7 and SC7- S, are a
single chip relative humidity and temperature multi sensor module with a calibrated
digital output which allows for simple and quick system integration.
6onventional sensors determine relative air humidity using capacitive
measurement technology. 9or this principle, the sensor element is built out of a lm
capacitor on diDerent substrates #glass, ceramic, etc.%. 'he dielectric is a polymer
which absorbs or releases water proportional to the relative environmental
humidity, and thus changes the capacitance of the capacitor, which is measured by
an onboard electronic circuit.
8/12/2019 1.Green House Automation System
47/84
7umidity is a important factor in personal comfort and in quality control for
materials, machinery etc. =ow we are using SC7 and SC7- S humidity sensors in
most of the circuits.
S%eci>cations;
3tems SC7 and SC7- S
:ated voltage A6
8/12/2019 1.Green House Automation System
48/84
Storage temperature -1;/I?degrees centigrade
Storage humidity within F?G:7
7umidity accuracy J5- ?G:7 #at ?degrees centigrade,@;G:7%
7umidity response time K@;sec #>;-I-G:7%
7ysteresis J5- G:7 #>;-I;G:7%
8/12/2019 1.Green House Automation System
49/84
CD i?uid Cristal Dis%la54
Introduction;
A liquid crystal display #L6$% is a thin, 4at display device madeup of any number of color or monochrome pi&els arrayed in front of a light source or
re4ector. !ach pi&el consists of a column of liquid crystal molecules suspended
between two transparent electrodes, and two polari ing lters, the a&es of polarity
of which are perpendicular to each other. (ithout the liquid crystals between them,
light passing through one would be blocked by the other. 'he liquid crystal twists
the polari ation of light entering one lter to allow it to pass through the other.
A program must interact with the outside world using input and
output devices that communicate directly with a human being. )ne of the most
common devices attached to an controller is an L6$ display. Some of the most
common L6$s connected to the contollers are
8/12/2019 1.Green House Automation System
50/84
available. Line leng
8/12/2019 1.Green House Automation System
51/84
+any microcontroller devices use Msmart L6$M displays to output visual
information. L6$ displays designed around L6$ ='-6
8/12/2019 1.Green House Automation System
52/84
#< %. uilt-in oscillator.
$ata can be placed at any location on the L6$. 9or
8/12/2019 1.Green House Automation System
53/84
!ven limited to character based modules,there is still a wide variety of shapes
and si es available. Line lenghs of I,,1 and >; charecters are all standard,
in one, two and four line versions.
Several diDerent L6 technologies e&ists. OsupertwistP types, for e&le, oDer
3mproved contrast and viewing angle over the older Otwisted nematicP types. Some
modules are available with back lighting, so so that they can be viewed in dimly-lit
conditions. 'he back lighting may be either Oelectro-luminescentP, requiring a high
voltage inverter circuit, or simple L!$ illumination.
8/12/2019 1.Green House Automation System
54/84
Electrical bloc! iagram0
Power su""ly ,or lc ri
8/12/2019 1.Green House Automation System
55/84
+ost L6$s with < controller has "ins and L6$s with controller has
8/12/2019 1.Green House Automation System
56/84
-ONTRO& &INES0
EN :
L'/" 's %! "# E/! "; T&'s %-/($- '/" 's )s"# (- (" (&" LCD (&!( ,-) !$" s"/#'/ '(#!(!; T- s"/# #!(! (- (&" LCD ,-)$ $- $! s&-) # !@" s)$" (&'s '/" 's - 0 !/# (&"/ s"(
(&" -(&"$ ( - %-/($- '/"s !/# -$ )( #!(! -/ (&" #!(! )s; W&"/ (&" -(&"$ '/"s !$" %- "(" ,
$"!#, $'/ EN &' & 1 !/# !'( .-$ (&" '/' ) ! -)/( -. (' " $"G)'$"# , (&" LCD
#!(!s&""( (&'s !$'"s .$- LCD (- LCD !/# "/# , $'/ '/ '( - 0 ! !'/;
RS :
L'/" 's (&" R" 's("$ S" "%( '/"; W&"/ RS 's - 0 (&" #!(! 's (- " ($"!("# !s !%- !/# -$ s "%'! '/s($)%('-/ s)%& !s % "!$ s%$""/ -s'('-/ %)$s-$ "(%; ; W&"/ RS 's &' & 1
(&" #!(! "'/ s"/( 's (" ( #!(! &'%& s-) # " #'s !,"# -/ (&" s%$""/; F-$ " ! " (- #'s !,
(&" "(("$ T -/ (&" s%$""/ ,-) -) # s"( RS &' &;
R. :
8/12/2019 1.Green House Automation System
57/84
L'/" 's (&" R"!# W$'(" %-/($- '/"; W&"/ RW 's - 0 (&" '/.-$ !('-/ -/ (&" #!(!
)s 's "'/ $'(("/ (- (&" LCD; W&"/ RW 's &' & 1 (&" $- $! 's ".."%(' " , G)"$,'/ -$
$"!#'/ (&" LCD; O/ , -/" '/s($)%('-/ "( LCD s(!()s 's ! $"!# %- !/#; A -(&"$s !$"
$'(" %- !/#s s- RW ' ! -s( ! !,s " - ;
F'/! , (&" #!(! )s %-/s's(s -. 4 -$ 8 '/"s #" "/#'/ -/ (&" -#" -. - "$!('-/ s" "%("#
, (&" )s"$ ; I/ (&" %!s" -. !/ 8* '( #!(! )s (&" '/"s !$" $"."$$"# (- !s DB0 DB1 DB2 DB3
DB4 DB5 DB6 !/# DB7;
&ogic status o# co#trol li#es0
J E * 0 A%%"ss (- LCD #'s! "#
* 1 A%%"ss (- LCD "/! "#
Q :5( - ; (riting data to L6$
- < :eading data from L6$
Q :S - ; 3nstructions
* < 6haracter
riting data to t'e CD;
% Set ! line to high
?% Set ! line to low
6ead data ro# data lines i it is reading4on CD;
8/12/2019 1.Green House Automation System
58/84
% Set ! line to high
?% Set ! line to low
Entering Te
8/12/2019 1.Green House Automation System
59/84
OupP #logic
8/12/2019 1.Green House Automation System
60/84
8/12/2019 1.Green House Automation System
61/84
Initiali@ation b5 Instructions;
8/12/2019 1.Green House Automation System
62/84
3f the power conditions for the normal operation of the internal
reset circuit are not satis ed, then e&ecuting a series of instructions mustinitiali e L6$ unit. 'he procedure for this initiali ation process is as above
show.
6E A:S
Introduction;
A $" !, 's !/ " "%($'%! s '(%& (&!( - "/s !/# % -s"s )/#"$ (&" %-/($- -. !/-(&"$ " "%($'%!%'$%)'(; I/ (&" -$' '/! .-$ (&" s '(%& 's - "$!("# , !/ " "%($- ! /"( (- - "/ -$ % -s" -/" -$
!/, s"(s -. %-/(!%(s; A $" !, 's ! " (- %-/($- !/ -)( )( %'$%)'( -. &' &"$ - "$ (&!/ (&" '/ )(
%'$%)'( '( %!/ " %-/s'#"$"# (- " '/ ! $-!# s"/s" ! .-$ -. !/ " "%($'%! ! '.'"$;
:elays are usuallly S"$' #single pole double through switch%or $"$' #double
pole double through switch% but they can have many more sets of switch contacts,
for e&le relays with > sets of changeover contacts are readily available.
8/12/2019 1.Green House Automation System
63/84
Basic o"eratio# o, a relay0
A/ " "%($'% %)$$"/( (&$-) & ! %-/#)%(-$ ' $-#)%" ! ! /"('% .'" # !( $' &( !/ "s (- (&"
#'$"%('-/ -. " "%($-/ . - ; I. (&!( %-/#)%(-$ 's $! "# '/(- ! %-' s&! " (&" ! /"('% .'" #
$-#)%"# ' " -$'"/("# ! -/ (&" "/ (& -. (&" %-' ; T&" $"!("$ (&" %)$$"/( (&" $"!("$ (&"
s($"/ (& -. (&" ! /"('% .'" # ! -(&"$ .!%(-$s "'/ "G)! ;
8/12/2019 1.Green House Automation System
64/84
I/#)%(-$s $"!%( ! !'/s( %&!/ "s '/ %)$$"/( "%!)s" -. (&" "/"$ , s(-$"# '/ (&'s ! /"('%
.'" #; W&"/ " %-/s($)%( ! ($!/s.-$ "$ .$- ( - '/#)%(-$ %-' s !$-)/# ! %- -/ '$-/ %-$" "
)s" (&'s .'" # (- ($!/s."$ "/"$ , .$- -/" %-' (- (&" -(&"$; H- " "$ (&"$" !$" s' "$ !/# -$"#'$"%( )s"s .-$ " "%($- ! /"('% .'" #s (&!/ (&" ! '%!('-/s "K " s""/ '(& '/#)%(-$s !/#
($!/s.-$ "$s; T&" ! /"('% .'" # $-#)%"# , ! %-' -. %)$$"/(*%!$$,'/ '$" %!/ " )s"# (- " "$(
! "%&!/'%! .-$%" -/ !/, ! /"('% - "%( )s( !s " %!/ )s" ! "$ !/"/( ! /"( (- !(($!%(
! /"('% - "%(s " %" ( (&!( (&'s ! /"( .-$ "# , (&" %-' %!/ " ()$/"# -/ -$ -.. ,
s '(%&'/ (&" %)$$"/( -/ -$ -.. (&$-) & (&" %-' ;
I. " !%" ! ! /"('% - "%( /"!$ s)%& ! %-' .-$ (&" )$ -s" -. !@'/ (&!( - "%( - "
&"/ " "/"$ '
8/12/2019 1.Green House Automation System
65/84
Biased Relays:
B'!s"# $" !,s &! " ! "$ !/"/( ! /"( ! - " (&" !$ !()$"; T&" $" !, - "$!("s '. (&"
%)$$"/( (&$-) & (&" %-' '/#'/ "s(! 's&"s ! ! /"(-* -(' " .-$%" (&!( - -s"s (&" . ) , (&"
"$ !/"/( ! /"(; I. (&" . ) "s !$" '/ (&" s! " #'$"%('-/ (&" $" !, ' /-( - "$!(" " "/ .-$ !$"!("$ %)$$"/( (&$-) & (&" %-' ;
Polarized Relays:
L'@" (&" '!s"# $" !,s (&" - !$'
8/12/2019 1.Green House Automation System
66/84
(&" %-/(!%(s; A /-$ ! $" !, -) # " s - !/# !@" s !$@s &'%& '/ ()$/ !, " # (&" %-/(!%(s
(- "(&"$;
A $" !,s &! " ( - - "$!('/ ! )"s - (! "s -/" '%@*) !/# (&" -(&"$ -(&"$ #$-
! !,; T&" '%@*) ! )" 's &' &"$ (&!/ (&" #$- ! !, ! )";
A""licatio#s0
'o control a high-voltage circuit with a low-voltage signal, as in some types of
modems or audio ampli ers, 'o control a high-current circuit with a low-current signal, as in the starter
solenoid of an automobile,
'o detect and isolate faults on transmission and distribution lines by opening
and closing circuit breakers #protection relays%,
'o isolate the controlling circuit from the controlled circuit when the two are
at diDerent potentials, for e&le when controlling a mains-powered device
from a low-voltage switch. 'he latter is often applied to control o2ce lighting
as the low voltage wires are easily installed in partitions, which may be often
moved as needs change. 'hey may also be controlled by room occupancy
detectors in an eDort to conserve energy,
'o perform logic functions. 9or e&le, the boolean A=$ function is realised
by connecting =) relay contacts in series, the ): function by connecting =)
contacts in parallel. 'he change-over or 9orm 6 contacts perform the ):
#e&clusive or% function. Similar functions for =A=$ and =): are accomplished
using =6 contacts. 'he Ladder programming language is often used for
designing relay logic networks.
o !arly computing. efore vacuum tubes and transistors, relays were
used as logical elements in digital computers. See A::A #computer%,
7arvard +ark 33, Wuse W , and Wuse W1.
o Safety-critical logic. ecause relays are much more resistant than
semiconductors to nuclear radiation, they are widely used in safety-
8/12/2019 1.Green House Automation System
67/84
critical logic, such as the control panels of radioactive waste-handling
machinery.
'o perform time delay functions. :elays can be modi ed to delay opening or
delay closing a set of contacts. A very short #a fraction of a second% delay
would use a copper disk between the armature and moving blade assembly.
6urrent 4owing in the disk maintains magnetic eld for a short time,
lengthening release time. 9or a slightly longer #up to a minute% delay, a
dashpot is used. A dashpot is a piston lled with 4uid that is allowed to
escape slowly. 'he time period can be varied by increasing or decreasing the
4ow rate. 9or longer time periods, a mechanical clockwork timer is installed
SOFT A6E DESC6I=TION
ABOUT SO5T.ARE
S-.( !$" )s"#:XHeil software for c programming
A!O8T /EI SOFT A6E;
3t is possible to create the source les in a te&t editor such as =otepad, run the6ompiler on each 6 source le, specifying a list of controls, run the Assembler oneach Assembler source le, specifying another list of controls, run either the Library
8/12/2019 1.Green House Automation System
68/84
+anager or Linker #again specifying a list of controls% and nally running the )bTect-7! 6onverter to convert the Linker output le to an 3ntel 7e& 9ile. )nce that hasbeen completed the 7e& 9ile can be downloaded to the target hardware anddebugged. Alternatively H!3L can be used to create source lesY automaticallycompile, link and covert using options set with an easy to use user interface and
nally simulate or perform debugging on the hardware with access to 6 variablesand memory. Unless you have to use the tolls on the command line, the choice isclear. H!3L Ereatly simpli es the process of creating and testing an embeddedapplication.
=roBects;
'he user of H!3L centers on OproTectsP. A proTect is a list of all the source lesrequired to build a single application, all the tool options which specify e&actly howto build the application, and Z if required Z how the application should be simulated.A proTect contains enough information to take a set of source les and generatee&actly the binary code required for the application. ecause of the high degree of 4e&ibility required from the tools, there are many options that can be set tocon gure the tools to operate in a speci c manner. 3t would be tedious to have toset these options up every time the application is being builtY therefore they arestored in a proTect le. Loading the proTect le into H!3L informs H!3L which sourceles are required, where they are, and how to con gure the tools in the correct way.H!3L can then e&ecute each tool with the correct options. 3t is also possible to create
new proTects in H!3L. Source les are added to the proTect and the tool options areset as required. 'he proTect can then be saved to preserve the settings. 'he proTectis reloaded and the simulator or debugger started, all the desired windows areopened. H!3L proTect les have the e&tension
Si#ulator Debugger;
'he simulator5 debugger in H!3L can perform a very detailed simulation of amicro controller along with e&ternal signals. 3t is possible to view the precisee&ecution time of a single assembly instruction, or a single line of 6 code, all theway up to the entire application, simply by entering the crystal frequency. A windowcan be opened for each peripheral on the device, showing the state of theperipheral. 'his enables quick trouble shooting of mis-con gured peripherals.reakpoints may be set on either assembly instructions or lines of 6 code, ande&ecution may be stepped through one instruction or 6 line at a time. 'he contentsof all the memory areas may be viewed along with ability to nd speci c variables.
8/12/2019 1.Green House Automation System
69/84
3n addition the registers may be viewed allowing a detailed view of what themicrocontroller is doing at any point in time.
'he Heil Software I;?< development tools listed below are the programsyou use to compile your 6 code, assemble your assembler source les, link your
program together, create 7! les, and debug your target program. [8ision for(indows\ 3ntegrated $evelopment !nvironmentB combines "roTect +anagement,Source 6ode !diting, and "rogram $ebugging in one powerful environment.
6?< A=S3 )ptimi ing 6 6ross 6ompilerB creates relocatable obTect modules fromyour 6 source code,A?< +acro AssemblerB creates relocatable obTect modules from yourI;?< assembler source code,L?< Linker5LocatorB combines relocatable obTect modules created by thecompiler and assembler into the nal absolute obTect module,L3 ?< Library +anagerB combines obTect modules into a library, which may beused by the linker,)7?< )bTect-7! 6onverterB creates 3ntel 7! les from absolute obTectmodules.
.'at@s New i# 6isio#*
[8ision1 adds many new features to the !ditor like 'e&t 'emplates, *uick 9unction=avigation, and Synta& 6oloring with brace high lighting 6on guration (i ard fordialog based startup and debugger setup. [8ision1 is fully compatible to [8isionand can be used in parallel with [8ision .
.'at is 6isio#*
[8ision1 is an 3$! #3ntegrated $evelopment !nvironment% that helps you write,
compile, and debug embedded programs. 3t encapsulates the followingcomponentsB
A proTect manager. A make facility. 'ool con guration. !ditor. A powerful debugger.
'o help you get started, several e&le programs #located in the C$1 E
8/12/2019 1.Green House Automation System
70/84
8/12/2019 1.Green House Automation System
71/84
[8ision creates a new proTect le with the name ":) !6'
8/12/2019 1.Green House Automation System
72/84
of the 6"U you have selected are con gured from the $evice.
Database selection;
you have made when you create your proTect target. :efer to page ?I for more
3nformation about selecting a device. Cou may select and display the on-chipperipheral components using the $ebug menu. Cou can also change the aspects of each peripheral using the controls in the dialog bo&es.
Start Debugging;
Cou start the debug mode of [8ision with the $ebug Z Start5Stop $ebug
Session command. $epending on the )ptions for 'arget Z $ebug
6on guration, [8ision will load the application program and run the startup
code [8ision saves the editor screen layout and restores the screen layout of thelast debug session. 3f the program e&ecution stops, [8ision opens an
editor window with the source te&t or shows 6"U instructions in the disassemblywindow. 'he ne&t e&ecutable statement is marked with a yellow arrow. $uringdebugging, most editor features are still available.
9or e&le, you can use the nd command or correct program errors. "rogramsource te&t of your application is shown in the same windows. 'he [8ision debugmode diDers from the edit mode in the following aspectsB
_ 'he O$ebug +enu and $ebug 6ommandsP described on page I areAvailable. 'he additional debug windows are discussed in the following.
_ 'he proTect structure or tool parameters cannot be modi ed. All build
6ommands are disabled.
Disasse#bl5 indo+
'he $isassembly window shows your target program as mi&ed source and assemblyprogram or Tust assembly code. A trace history of previously e&ecuted instructionsmay be displayed with $ebug Z 8iew 'race :ecords. 'o enable the trace history, set$ebug Z !nable5$isable 'race :ecording.
3f you select the $isassembly (indow as the active window all program stepcommands work on 6"U instruction level rather than program source lines. Cou can
8/12/2019 1.Green House Automation System
73/84
select a te&t line and set or modify code breakpoints using toolbar buttons or theconte&t menu commands.
Cou may use the dialog $ebug Z 3nline Assembly] to modify the 6"Uinstructions. 'hat allows you to correct mistakes or to make temporary changes to
the target program you are debugging.
SOFT A6E CO9=ONENTS
About /eil
1. 6lick on the Heil u 8ision 3con on $esktop
2. 'he following g will appear
8/12/2019 1.Green House Automation System
74/84
3. 6lick on the "roTect menu from the title bar
. 'hen 6lick on =ew "roTect
$. Save the "roTect by typing suitable proTect name with no e&tension in u rown folder sited in either 6B` or $B`
8/12/2019 1.Green House Automation System
75/84
&. 'hen 6lick on Save button above.
(. Select the component for u r proTect. i.e. Atmel]]
). 6lick on the J Symbol beside of Atmel
8/12/2019 1.Green House Automation System
76/84
,. Select A'IF6?< as shown below
1-. 'hen 6lick on O)HP
11. 'he 9ollowing g will appear
8/12/2019 1.Green House Automation System
77/84
12. 'hen 6lick either C!S or =)]]]mostly O=)P
13. =ow your proTect is ready to US!1 . =ow double click on the 'arget
8/12/2019 1.Green House Automation System
78/84
1$. 6lick on the le option from menu bar and select OnewP
1&. 'he ne&t screen will be as shown in ne&t page, and Tust ma&imi e it bydouble clicking on its blue boarder.
8/12/2019 1.Green House Automation System
79/84
1(. =ow start writing program in either in O6P or OAS+P
1). 9or a program written in Assembly, then save it with e&tension O. asmPand for O6P based program save it with e&tension O .6P
8/12/2019 1.Green House Automation System
80/84
)3= N- $' &( % '%@ -/ S-)$%" $-) 1 !/# % '%@ -/ A ,iles to Grou" Source
%(= N- ,-) ' "( !/-(&"$ '/#- -/ &'%& , #".!) ( C .' "s ' ! "!$;
%)= N- s" "%( !s "$ ,-)$ .' " " ("/s'-/ ' "/ &' " s! '/ (&" .' "
8/12/2019 1.Green House Automation System
81/84
8/12/2019 1.Green House Automation System
82/84
%D= N- C '%@ -/ (&" P"$' &"$! s .$- "/) !$ !/# %&"%@ ,-)$ $"G)'$"# -$( !s s&- /
'/ .' " -
%2= D$! (&" -$( ! s'#" !/# % '%@ '/ (&" $- $! .' ";
%3= N- @"" P$"ss'/ .)/%('-/ @", F11 s - , !/# - s"$ ";
*(= Y-) !$" $)//'/ ,-)$ $- $! s)%%"ss.) ,
8/12/2019 1.Green House Automation System
83/84
E#bedded C;
'at is an e#bedded s5ste#J
An embedded system is an application that contains at least one
programmable computer and which is used by individuals who are, in the main,
unaware that the system is computer-based.
'ic' %rogra##ing language s'ould 5ou useJ
7aving decided to use an I;?< processor as the basis of your embedded system,
the ne&t key decision that needs to be made is the choice of programming
language. 3n order to identify a suitable language for embedded systems, we might
begin by making the following observationsB
6omputers #such as microcontroller, microprocessor or $S" chips% only
accept instructions in machine code # obTect codes %. +achine code is, byde nition, in the language of the computer, rather than that of the
programmer. 3nterpretation of the code by the programmer is di2cult and
error prone. All software, whether in assembly, 6, 6JJ, ava or Ada must ultimately be
translated into machine code in order to be e&ecuted by the computer. !mbedded processors Z like the I;?< Z have limited processor power and
very limited memory availableB the language used must be e2cient. 'he language chosen should be in common use .
Su##ar5 o C language Features;
8/12/2019 1.Green House Automation System
84/84
3t is mid-level , with high-level features #such as support for functions and
modules%, and low-level features #such as good access to hardware via pointers%.
3t is very e2cient.
3t is popular and well understood. !ven desktop developers who have used only ava or 6JJ can soon
understand 6 synta&. Eood, well-proven compilers are available for every embedded processor #I-
bit to 1 -bit or more%.