Sie sind auf Seite 1von 73

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

ABSTRACT For GSM BASED HOME AUTOMATION

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-1-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

PROJECT DEFINITION / SPECIFICATION

PROJECT TYPE Microcontroller(AT89c51)har !are e%elo&'ent (De%ice Dri%er)( e"i#n !ith "o$t!are

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-2-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

PROJECT DESCRIPTION Thi" )ro*ect +GSM BASED HOME AUTOMATION USING A,- MI.-O.ONT-O//E-0 i" 1"e to control the e%ice" in ho'e a" !ell a" in in 1"trie"2 Ban3"2 an al"o in -e'ote area"( .on%entionall42 !irele""5controlle a&&liance" 1"e -6 circ1it"2 !hich ha%e the ra!7ac3" o$ li'ite !or3in# ran#e2 li'ite $re81enc4 ran#e an li'ite control( U"e o$ a 'o7ile &hone $or e%ice control can o%erco'e the"e li'itation"( It &ro%i e" the a %anta#e" o$ ro71"t control2 !or3in# ran#e a" lar#e a" the co%era#e area o$ the "er%ice &ro%i er2 no inter$erence !ith other controller" an 1& to t!el%e control"( In thi" &ro*ect2 !e control ho'e a&&liance" either A. De%ice or D. De%ice controlle 74 a 'o7ile &hone that 'a3e" a call to the 'o7ile &hone attache to the control 7oar ( In the co1r"e o$ a call2 i$ an4 71tton i" &re""e 2 a tone corre"&on in# to the 71tton &re""e i" hear at the other en o$ the call( Thi" tone i" calle 9 1al5 tone '1lti&le5$re81enc4: (DTM6) tone( The controller &ercei%e" thi" DTM6 tone !ith the hel& o$ the &hone "tac3e in the control 7oar an o&erate(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-3-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

BLOCK DIAGRAM

DE,I.E 1

DE,I.E ;

DTMF DECODER

8051 Controller

DRIVER UNIT

DE,I.E < RELAYS

DE,I.E = RELAYS

RELAYS

PROJECT OUTLINE A 7rie$ intro 1ction to internal architect1re o$ 'icrocontroller( An o%er %ie! o$ &ro#ra''in# o$ 'icrocontroller( An o%er%ie! on . lan#1a#e( An o%er%ie! on 'echanical arran#e'ent( DTM6 inter$acin# !ith 'icrocontroller(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

-4-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

INTERFACES USED Serial co''1nication 1"e $or o!nloa in# the he> co e( DTM6 circ1it inter$ace( U/N;00< inter$acin# -E/A? inter$acin#(

SOFTWARES USED A .ro"" co'&iler $or co'&ilin# an lin3in# the co e !ritten $or AT89c51( Serial co''1nication "o$t!are $or o!nloa in# co e to AT89c51( O&eratin# "4"te'@ Ain o!" B)(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-5-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

INTRODUCTION TO EMBEDDED SYSTEM E'7e e "4"te'" are a "4"te' i" !hich &er$or'" a "&eci$ic or a

&re5 e$ine ta"3( It i" the co'7ination" o$ har !are an "o$t!are( It i" nothin# 71t a co'&1ter in"i e a &ro 1ct( It i" a &ro#ra''a7le har !are e"i#n nothin# 71t an electronic chi&( A #eneral5&1r&o"e e$inition o$ e'7e e "4"te'" i" that the4 are

e%ice" 1"e to control2 'onitor or a""i"t the o&eration o$ e81i&'ent2 'achiner4 or &lant( +E'7e e 0 re$lect" the $act that the4 are an inte#ral &art o$ the "4"te'( e ne"" 'a4 7e "1ch that their &re"ence i" $ar $ro'

In 'an4 ca"e" their e'7e

o7%io1" to the ca"1al o7"er%er an e%en the e81i&'ent $or "o'eti'e 7e$ore 7ein# a7le to concl1 e that an e'7e e control "4"te' !a" in%ol%e in it"

$1nctionin#( At the other e>tre'e a #eneral5&1r&o"e co'&1ter 'a4 7e 1"e to control the o&eration o$ a lar#e co'&le> &roce""in# &lant2 an it" &re"ence !ill 7e o7%io1"(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-6-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

All e'7e

e "4"te'" are or incl1 e co'&1ter" or

'icro&roce""or"( So'e o$ the"e co'&1ter" are ho! e%er %er4 "i'&le "4"te'" a" co'&are !ith a &er"onal co'&1ter( The %er4 "i'&le"t e'7e e "4"te'" are ca&a7le o$ &er$or'in#

onl4 "in#le $1nction" to 'eet "in#le $1nction" to 'eet a "in#le &re eter'ine &1r&o"e( In 'ore co'&le> "4"te'" an a&&lication &ro#ra' that ena7le" the e'7e e "4"te' to 7e 1"e $or a &artic1lar &1r&o"e in a "&eci$ic a&&lication e "4"te'"( The a7ilit4 to ha%e e "4"te' can 7e 1"e $or a %ariet4 o$

eter'ine" the $1nctionin# o$ the e'7e &ro#ra'" 'ean" that the "a'e e'7e

i$$erent &1r&o"e( In "o'e ca"e" a 'icro&roce""or 'a4 7e e"i#ne in "1ch !a4 that a&&lication "o$t!are $or a &artic1lar &1r&o"e can 7e a e to the 7a"ic

"o$t!are in a "econ &roce""2 a$ter !hich it i" not &o""i7le to 'a3e $1rther chan#e"( The a&&lication" "o$t!are on "1ch &roce""or" i" "o'eti'e" re$erre to a" $ir'!are( The "i'&le"t e%ice" con"i"t o$ a "in#le 'icro&roce""or (o$ten calle a +chi&0)2 !hich 'a4 it"el$ 7e &ac3a#e !ith other chi&" in a h47ri "4"te'" or A&&lication S&eci$ic Inte#rate .irc1it (ASI.)( It" in&1t co'e" $ro' a etector or "en"or an it" o1t&1t #oe" to a "!itch or a acti%ator !hich ($or e>a'&le) 'a4 "tart or "to& the o&eration o$ a 'achine or2 o&eratin# a %al1e2 'a4 control the $lo! o$ $1el to an en#ine(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-7-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

PROCESSORS: )roce""or" are the one" !hich &er$or'" "o'e "&eci$ic ta"3 or o&eration( The"e are i%i e in to "e%eral t4&e" li3e@ 1( Di#ital Si#nal )roce""or"( ;( A&&lication S&eci$ic Inte#rate .irc1it"( <( Micro )roce""or"( =( Micro .ontroller"( D ! "#$ S !%#$ Pro&'((or(: Thi" i" a one !hich &er$or'" "cienti$ic an 'athe'atical .alc1lation"( The o1t&1t o$ thi" t4&e o$ &roce""or" !ill 7e in $loatin# &oint %al1e"( Hence2 !e can #et acc1rate %al1e" a" o1t&1t"( Be"t e>a'&le o$ a Di#ital Si#nal )roce""or" !ill 7e Aeather 6oreca"tin#( A))$ &#" o%( ()'& * & I%"'!r#"'+ C r&, "(:
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

-8-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

A" the na'e it"el$ "&eci$ie"2 thi" i" inte#rate circ1it e"i#ne $or a "&eci$ic a&&lication( I. e"i#ne $or one "&eci$ic a&&lication cannot 7e 1"e in other a&&lication"( Be"t E>a'&le $or ASI. !ill 7e .ell &hone car ( M &ro)ro&'((or(: The"e are the one" !hich &er$or' arith'etic an lo#ical o&eration"(

B$o&- D #!r#. o* M &ro)ro&'((or:

Arith'etic an lo#ical 1nit &er$or'" arith'etical an lo#ical calc1lation"( .ontrol 1nit control" all the &eri&heral e%ice" connecte to the 'icro&roce""or"( Me'or4 i" a one !hich i" 1"e to "tore "o'e ata or in$or'ation(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

-9-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Be"t E>a'&le $or a 'icro&roce""or !ill 7e o1r )er"onal .o'&1ter( M &ro Co%"ro$$'r(: The"e are the one" !hich are "i'ilar to that o$ a 'icro&roce""or !hich &er$or'" arith'etic an lo#ical calc1lation"( The"e ha%e a that it i" ha%in# a itional in71ilt $eat1re" li3e@ itional a %anta#e to

1( Electricall4 Era"a7le )ro#ra''a7le -ea Onl4 (EE)-OM)

Me'or4

;( Uni%er"al S4nchrono1" A"4nchrono1" -ecei%er an Tran"'itter (USA-T)( <( Analo# to Di#ital .on%erter (AD.)( =( Di#ital to Analo# .on%erter (DA.)( 5( O"cillator"( C( Ti'er"( D( Man4 other"(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 10 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

The o1t&1t o$ a 'icrocontroller i" a al!a4" in inte#er $or'at onl4( It cannot &ro%i e acc1rate %al1e" or $loatin# &oint %al1e"( Be"t E>a'&le $or Micro .ontroller !ill 7e Tra$$ic /i#ht .ontroller( O1t o$ all the"e )roce""or"2 !e are 1"in# Micro .ontroller"( .o'in# to the "o$t!are &oint o$ ,ie!2 !e ha%e 'an4 "o$t!are lan#1a#e"( O1t o$ all2 !e are 1"in# A""e'7l4 /e%el /an#1a#e to loa the &ro#ra' in to the controller( A/) co in# i" one an loa e into the 'icrocontroller( The"e are i$$erent co'&anie" that 'an1$act1re Microcontroller" li3e At'el2 Motorola2 Intel2 )hili&"2 )I.2 etc( Ae are 1"in# At'el 'an1$act1re 'icrocontroller"( At'el .o'&an4 'an1$act1re" i$$erent "erie" o$ 'icrocontroller" li3e AT89.2 AT90S2 ATMe#a2 AT.AN( Here !e are 1"in# ATMe#a Microcontroller"( A#ain in ATMe#a !e are ha%in# i$$erent ATMe#a 82 ATMe#a 85152 ATMe#a 1C2 ATMe#a <;2 AT Me#a 1C;%2 etc(Here2 in thi" &ro*ect !e are 1"in# AT89c51 Microcontroller( I%"ro+,&" o% "o #))$ &#" o%( o* E./'++'+ S0("'.: E'7e e .ontroller" 'a4 7e $o1n in 'an4 i$$erent 3in " o$ "4"te' an

are 1"e $or 'an4 i$$erent a&&lication"( The li"t2 !hich $ollo!"2 i" a in icati%e rather than e>ha1"ti%e( An ite' in the li"t 'a4 7e rele%ant to a &artic1lar co'&an4 7eca1"e either (a) It i" or in%ol%e" a core &roce"" or &ro 1ct2

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 11 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

(7) It i" or in%ol%e" an ancillar4 $1nction or "er%ice" &er$or'e 74 the co'&an4 or (c) It re$er" to a &ro 1ct or "er%ice" &ro%i e 74 a contractor 1n er "o'e $or' o$ a#ree'ent an the %1lnera7ilit4 o$ the "1&&lier 'a4 nee to 7e con"i ere ( L (" o* A))$ &#" o%( o* E./'++'+ S0("'.(: 1#2 M#%,*#&",r %! #%+ )ro&'(( &o%"ro$: Man1$act1rin# &lant"( Aater an "e!a#e "4"te'"( )o!er "tation"( )o!er #ri "4"te'"( Oil re$inerie" an relate "tora#e $acilitie"( Bottlin# &lant"( A1to'ate $actorie"( Si'1lator"( Te"t e81i&'ent $or control "4"te' e%elo&'ent2 'aintenance an te"tin#( 1/2 Co%("r,&" o% %+,("r0: S1r%e4in# an location E81i&'ent( .on"tr1ction )lant(

1&2 Tr#%()or": Aero &lane" Train" an B1"e"(


GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

- 12 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Marine cra$t (3no!n ca"e" incl1 e@ ra ar 'a&&in#E 7alla"t 'onitorin#E car#o loa in#E "hi& 'ain control "4"te')

A1to'o7ile" 61el "er%ice"( Air Tra$$ic .ontrol S4"te'"( Si#nalin# "4"te'( -a ar S4"te'"( Tra$$ic /i#ht"( Tic3etin# "4"te'" an Machine"( .ar )ar3in# an other 'eter"(

1+2 B, $+ %!( #%+ )r'. ('(: Electricall4 "1&&l45 "1&&l42 'ea"1re'ent2 control2 &rotection( Bac3in# li#htin# an #enerator"( 6ire control "4"te'"( Heatin# an %entilatin# "4"te'"( /i$t" Ele%ator"2 e"calator"( Sec1rit4 S4"te'"( Sec1rit4 .a'era"( Door loc3"(

1'2 Do.'(" & ('r3 &': .aterin#(


GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

- 13 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

.leanin#(

1*2 Co..,% &#" o%(: Tele&hone( .a7le "4"te'"( Tele&hone "!itche"( Satellite"(

1!2 O** &' (0("'.( #%+ .o/ $' .#%#!'.'%": Tele&hone "4"te'" 6a>e" an .o&ier( Ti'e recor in# "4"te'"( Mo7ile tele&hone" Still an ,i eo .a'era"(

142 B#%- %!5 F %#%&' #%+ Co..'r& #$: A1to'ate teller "4"te'"( .re it car S4"te'"( )oint o$ "cale "4"te'" incl1 in# "canner F ca"h "4"te'"(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 14 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

MI.-O.ONT-O//E-

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 15 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

WHAT IS A MICROCONTROLLER?
A microcontroller is n inte!r te" c#i$ t# t is o%ten $ rt o% n em&e""e" s'stem( T#e microcontroller incl)"es timers li-e C*U+ RAM+ ROM+ I,O $orts+ n" sin!le st n" r" Com$)ter+ &)t &ec )se t#e' re "esi!ne" to e.ec)te onl'

s$eci%ic t s- to control sin!le s'stem+ t#e' re m)c# sm ller n" sim$li%ie" so t# t t#e' c n incl)"e ll t#e %)nctions re/)ire" on sin!le c#i$(

A microcontroller "i%%ers %rom micro$rocessor+ 0#ic# is !ener l1 $)r$ose c#i$ t# t is )se" to cre te m)lti1%)nction com$)ter or "e2ice n" re/)ires m)lti$le c#i$s to # n"le 2 rio)s t s-s( A microcontroller is me nt to &e more sel%1 cont ine" n" in"e$en"ent+ n" %)nctions s tin'+ "e"ic te" com$)ter(

T#e !re t "2 nt !e o% microcontrollers+ s o$$ose" to )sin! l r!er micro$rocessors+ is t# t t#e $ rts1co)nt n" "esi!n costs o% t#e item &ein! controlle" c n &e -e$t to minim)m( T#e' re t'$ic ll' "esi!ne" )sin! CMOS 3com$lement r' met l o.i"e semicon")ctor4 tec#nolo!'+ n e%%icient % &ric tion tec#ni/)e t# t )ses less $o0er n" is more imm)ne to $o0er s$i-es t# n ot#er tec#ni/)es(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 16 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

T#ere re lso m)lti$le rc#itect)res )se"+ &)t t#e $re"omin nt rc#itect)re is CISC 3Com$le. Instr)ction Set Com$)ter4+ 0#ic# m cro instr)ction( Some )se cons)m$tion( llo0s t#e microcontroller to cont in m)lti$le control instr)ctions t# t c n &e e.ec)te" 0it# sin!le RISC 3Re")ce" Instr)ction Set Com$)ter4+ rc#itect)re+ 0#ic# im$lements %e0er instr)ctions+ &)t "eli2ers !re ter sim$licit' n" lo0er $o0er

Microproc !!or!"
Micro$rocessors re more com$le. n" so$#istic te"( T#e' m ' c )se $ro&lems i% )se" in con5)nction 0it# 8$ersistent9 $ro&lems( $ro!r m t# t is connecte" to re l1time cloc-( It is estim te" t# t 67 o% t#ese 0ill # 2e 8tr nsient9 $ro&lems+ :7 m ' # 2e

#or $%&p' "


T#e microcontroller insi"e TV t -es in$)t %rom t#e remote control n" "is$l 's o)t$)t on t#e TV screen( T#e controller controls t#e c# nnel selector+ t#e s$e -er s'stem n" cert in "5)stments on t#e $ict)re t)&e electronics s)c# s tint n" &ri!#tness(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 17 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

MICROCONTROLLER ( AT89C51

I)*ro+,c*io) *o Microco)*ro'' r"


T#e sec)re microcontroller % mil' is line o% 80511com$ tile "e2ice t# t )se non2ol tile 3NV4 RAM r t#er t# n ROM %or $ro!r m stor !e( NV RAM llo0s t#e "esi!n o% so%t microcontroller t# t $ro2i"es m n' )ni/)e %e t)res %or em&e""e" s'stem "esi!ners( T#e en# nce" sec)rit' %e t)res em$lo'e" &' t#e sec)re microcontroller % mil' $rotect t#e )ser1 $$lic tion so%t0 re ! inst $ir c' n" tem$erin!( T#ese "e2ices o%%er 2 r'in! "e!rees o% sec)rit'+ r n!in! %rom sim$le ccess $re2ention to $rotecte" in%orm tion res)lt in t#e sel%1"estr)ction o% ll " t (
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

%)ll

encr'$tion o% $ro!r m n" " te memor' o% t#e "e2ice( Attem$ts to ! in ccess to

- 18 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

T#e sec)re microcontroller % mil' is t#e #e rt o%

0i"e r n!e o%

critic l $$lic tions s)c# s electronic & n-in!+ commerci l tr ns ctions+ n" $ '1TV ccess control+ or n' $$lic tion t# t re/)ires t#e $rotection o% $ro$riet r' so%t0 re n" l!orit#ms( T#e sec)re microcontroller % mil' is "i2i"e" &et0een c#i$s n" mo")les( T#e c#i$s re monolit#ic micro$rocessors t# t connect to & tter' in st n" r" SRAM n" lit#i)m $re ssem&le"+ $reteste" mo")le( De$en"in! on t#e s$eci l con%i!)r tion+

mo")les re 2 il &le in eit#er enc $s)l te" DI* or SIMM mo")le %orm t( In A""ition to NV RAM+ D ll s semicon")ctors o%%er n)m&er o%

$eri$#er ls t# t sim$l' re")ce t#e cost o% em&e""e" s'stems( Alt#o)!# t#e s$eci%ic %e t)res o% e c# c#i$ or mo")le 2 r'+ ll "e2ices o%%er t#e %ollo0in! & sic %e t)res set;

1007 co"e1com$ ti&le 0it# 8051 Directl' ""resses <= >? $ro!r m,<=>? " t memor'( Non2ol tile memor' control circ)itr'( 101'e rs " t retention in t#e &sence o% $o0er In1s'stem re$ro!r mmin! 2i seri l $ort( 1:8 &'tes % st ccess scr tc#$ " RAM T0o 1< &it !ener l1$)r$ose timer,co)nters One UART Fi2e interr)$ts 0it# t0o e.tern l De"ic te" memor' &)s+ $reser2in! %o)r 81&it $orts %or !ener l $)r$ose I,O
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 19 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

*o0er1% il reset E rl' 0 rnin! $o0er1% il interr)$ts( @ tc#"o! timer(

MICROCONTROLLER;
A microcontroller is n inte!r te" c#i$ 0it# minim)m re/)ire" "e2ices( T#e microcontroller incl)"es I,O $orts+ n" timers li-e onl' C*U; ALU+ *C+S* n" re!isters+ RAM+ ROM+

st n" r" com$)ter+ &)t &ec )se t#e' re "esi!ne" to e.ec)te sin!le s'stem+ t#e' re m)c# sm ller n"

sin!le s$eci%ic t s- to control

sim$li%ie" so t# t t#e' c n incl)"e ll t#e %)nctions re/)ire" on sin!le c#i$(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 20 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Microcontroller ?loc- Di !r m(

Mo!* &icroco)*ro'' r! -i'' %'!o co&.i) o*/ r + 0ic ! !,c/ %!"


A Timer mo")le to llo0 t#e microcontroller to $er%orm t s-s %or cert in time $erio"s( A seri l I,O $ort to llo0 " t to %lo0 &et0een t#e microcontroller n" ot#er "e2ices s)c# s *C or not#er microcontroller( An ADC to llo0 t#e microcontroller to cce$t n lo!)e in$)t " t %or $rocessin! (

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 21 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

A 1LOC: 3IA9RAM O# MICROCONTROLLER <E=7AN3E3>

AL8 ACC8M8LATOR RE9ISTERS

TIMER;CO8NTER

I;O 7ORTS I;O 7ORTS INTERNAL CIRC8ITS CLOC: CIRC8IT

INTERNAL RAM STAC: 7OINTER

INTERNAL ROM

7RO9RAM CO8NTER #,)c*io)%' 1'oc2 3i%4r%& o5 Microco)*ro'' r

MICROCONTROLLER 6! MICRO7ROCESSOR
A microcontroller is me nt to &e more sel%1cont ine" n" in"e$en"ent+ n" %)nctions s tin'+ "e"ic te" com$)ter t# n micro$rocessor( T#e microcontroller m ' %)nction s com$)ter 0it# ""ition o% e.tern l "i!it l

$ rtsA t#e micro$rocessor m)st # 2e m n' ""ition l $ rts to &e o$er tion l( Most micro$rocessors # 2e m n' o$er tion l co"es 3o$co"es4 %or mo2in! " t %rom e.tern l memor' to t#e C*UA microcontrollers m ' # 2e one or t0o(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 22 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Microcontrollers re "esi!ne" &' )sin! CMOS 3com$lement r' met l o.i"e semicon")ctor4 tec#nolo!'+ n e%%icient % &ric tion tec#ni/)e t# t )ses less

$o0er n" is more imm)ne to $o0er s$i-es t# n ot#er tec#ni/)es(

A36ANTA9ES O# MICROCONTROLLERS
T#eir $o0er%)l+ cle2erl' c#osen electronics is &le to control o% $rocesses n" "e2ices 3in")stri l 2 riet'

)tom tics+ 2olt !e+ tem$er t)re+ en!ines+ etc4

in"e$en"entl' or &' me ns o% I,O instr)ments s)c# s s0itc#es+ &)ttons+ sensors+ LCD screens+ rel 's etc(

T?7ES O# 8051 MICROCONTROLLER

T#e 8051 # s t#e 0i"est r n!e o% 2 ri nts o% n' em&e""e" controller on t#e m r-et( T#e sm llest "e2ice is t#e Atmel 8Bc1051+ :0 *in FLASC 2 ri nt 0it#

: timers+ UART+ :0mA( T#e % stest $ rts re %rom D ll s+ 0it# $er%orm nce close to 10 MI*SD T#e most $o0er%)l c#i$ is t#e In%ineon Tec#nolo!ies 80C516A+ 0it# E: ?it ALU+ : UARTS+ :> RAM+ *LCC8= Amon! t#e MAFOR m n)% ct)rers re; $ c- !e+ 8 . 1< ?it *@Ms+ n" ot#er %e t)res(

AMD Atmel

En# nce" 8051 $ rts 3no lon!er $ro")cin! 80.51 $ rts4 FLASC n" semi1c)stom $ rts
GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

- 23 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

C'!n l D ll s Intel ISSI M tr O>I *#ili$s In%ineon SMC SSI

F stest 8051 0it# Fl s# 0it# 1:1&it 1LS? A,D( :0MCG intern l clocF st 2 ri nt( Also & tter' & c-e" 8051 t#ro)!# 80C51H? , 80C51Sl( T#e' in2ente" t#e 8051 IS80C51,E1 r)ns )$ to =0MCG 80C15=+ lo0 2olt !e st tic 2 ri nts 80C15=+ m s- $ rts 86C6=8 t#ro)!# 8BC588+ mostl' ol" le! c' 8051 $ rts %rom Si!netics 80C501 t#ro)!# 80C516A+ n" 0i"e 2 riet' o% CAN "e2ices( COM:0051 0it# ARCNET to-en &)s net0or- en!ine 80.5:+ : . CDLC 2 ri nt %or MODEM )se

#EAT8RES
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 24 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Com$ ti&le 0it# MCS151I *ro")cts => ?'tes o% In1S'stem Re$ro!r mm &le Fl s# Memor' En")r nce; 1+000 @rite,Er se C'cles F)ll' St tic O$er tion; 0 CG to := MCG T#ree1le2el *ro!r m Memor' Loc 1:8 . 81&it Intern l RAM E: *ro!r mm &le I,O Lines T0o 1<1&it Timer,Co)nters Si. Interr)$t So)rces *ro!r mm &le Seri l C# nnel Lo01$o0er I"le n" *o0er1"o0n Mo"e

MICROCONTROLLER ( AT89C51
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 25 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

3 !crip*io)"
T#e AT8BC51 is lo01$o0er+ #i!#1$er%orm nce CMOS 81&it microcom$)ter 0it# => &'tes o% Fl s# $ro!r mm &le n" er s &le re " onl' memor' 3*EROM4( T#e "e2ice is m n)% ct)re" )sin! AtmelJs #i!#1"ensit' non2ol tile memor' tec#nolo!' n" is com$ ti&le 0it# t#e in")str'1st n" r" 80C51 n" 80C5: instr)ction set n" $in o)t( T#e on1c#i$ Fl s# llo0s t#e $ro!r m memor' to &e re$ro!r mme" in1s'stem or &' con2ention l non2ol tile memor' $ro!r mmer( ?' com&inin! Fl s# on $ro2i"es monolit#ic c#i$+ t#e Atmel AT8BC51 is #i!#l' %le.i&le 2ers tile 81&it C*U 0it# $o0er%)l microcom$)ter+ 0#ic#

n" cost1e%%ecti2e sol)tion to m n' em&e""e" control si.12ector t0o1le2el

$$lic tions( T#e AT8BC51 $ro2i"es t#e %ollo0in! st n" r" %e t)res; => &'tes o% Fl s#+ 1:8 &'tes o% RAM+ E: I,O lines+ t0o 1<1&it timer,co)nters+ interr)$t rc#itect)re+ %)ll1")$le. seri l $ort3UART4 0#ic# o$er tes t 11(05B: MCG+

on1c#i$ oscill tor+ n" cloc- circ)itr'( In ""ition+ t#e AT8BC51 is "esi!ne" 0it# st tic lo!ic %or o$er tion "o0n to Gero %re/)enc' n" s)$$orts t0o so%t0 re select &le $o0er s 2in! mo"es( T#e I"le Mo"e sto$s t#e C*U 0#ile llo0in! t#e RAMA timer,co)nters+ seri l $ort+ n" interr)$t s'stem to contin)e %)nctionin!( T#e *o0er1"o0n mo"e s 2es t#e RAM contents &)t %reeGes t#e oscill tor+ "is &lin! ll ot#er c#i$ %)nctions )ntil t#e ne.t # r"0 re reset(

# %*,r !"

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 26 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

8 &it 80511com$ ti&le microcontroller " $ts to t s- t # n"( 8 or E: - &'tes o% non2ol tile RAM %or $ro!r m memor' stor !e( Initi l "o0nlo "in! so%t0 re in en" s'stem 2i on c#i$ seri l $ort( C $ &le o% mo"i%'in! its o0n $ro!r m n",or " te memor' in en" )se( n" ,or " t

Cr s#$roo% o$er tion; M int ins ll non2ol tile reso)rces %or 10 'e rs in t#e &sence o% VCC *o0er1F il Reset( E rl' @ rnin! $o0er1F il Interr)$t( @ tc#"o! Timer(

So%t0 re sec)rit' %e t)re; E.ec)tes encr'$te" so%t0 re to $re2ent )n )t#oriGe" "isclos)re(

On1c#i$+ %)ll1")$le. seri l I,O $orts( T0o on1c#i$ timer,e2ents co)nter E: $ r llel I,O lines( Com$ ti&le 0it# in")str' st n" r" 8051 instr)ction set n" $ino)t( O$tion l $erm nentl' $o0ere" re l timer cloc-(

Microco)*ro'' r Arc/i* c*,r "


T#e sec)re microcontroller % mil' is & se" on n 80511com$ ti&le core 0it# memor' inter% ce n" I,O lo!ic &)il" ro)n" it( In !ener l+ most rc#itect)re %e t)res re i"entic l to st n" r" 8051s n" $$l' to ll mem&ers o% t#e sec)re microcontroller % mil'( Di%%erences &et0een 2ersions re mentione"( T#is section &rie%l' "oc)ments t#e im$ort nt %e t)res( Fi!)re E(1 s#o0s n)mero)s te.ts on t#e s)&5ect( &loc- "i !r m o% t#e microcontroller core( Users intereste" in more t#o)!# e.$l n tion o% t#e 8051 rc#itect)re re re%erre" to n' o% t#e

Microco)*ro'' r Arc/i* c*,r


Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 27 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 28 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

1,! Or4%)i@%*io)"
T#ere re %o)r m 5or &)ses in t#e sec)re micro$rocessor; t#e intern l " t &)s+ t#e intern l ""ress &)s+ t#e &'te 0i"e memor' &)s+ n" t#e e.$ n"e" &)s( All ""resses n" " t t# t re tr ns%erre" ")rin! $ro!r m e.ec)tion re $ sse" on t#e intern l ""ress n" " t &)ses( User $ro!r m n" " t memor' is l0 's ccesse" %rom eit#er t#e &'te 0i"e $ro!r m," t RAM or %rom e.tern l memor' loc te" on t#e e.$ n"e" &)s( T#e &'te 0i"e memor' &)s llo0s ccess memor' loc te" on t#e e.$ n"e" &)s( T#e &'te 0i"e memor' &)s llo0s ccess to $ro!r m," t RAM in t#e s ne 0 ' s n 8051 % mil' "e2ice 0o)l" ccess intern l ROM or E*ROM memor'( T#is &)s c n &e )se" in $l ce o% t#e e.$ n"e" &)s+ %reein! *ort: n" *ort0 $ins %or !ener l I,O )se(

C78 R 4i!* r!"


T#e C*U re!isters re m $$e" s s$eci l %)nction re!isters 3SFRs4( T#e' re i"entic l in n)m&er n" %)nction to t#ose $re2ents 0it#in t#e 8051( T#ese re!isters re "escri&e" &rie%l'(

Acc,&,'%*or"
T#e cc)m)l tor 3A or ACC4 is )se" s eit#er so)rce n",or "estin tion re!ister in ll rit#metic instr)ctions( It m ' lso &e s)e" in most ot#er t'$es o% instr)ctions(

S*%c2 7oi)* r"


T#e st c- $ointer 3S*4 is n 8 &it re!ister t# t m r-s t#e loc tion o% t#e l st &'te o% " t store" in t#e st c-( T#e st c- itsel% c n &e loc te" n'0#ere in t#e on1c#i$ 1:8 &'te scr tc#$ " re!ister re ( T#e st c- $ointer $re1increments ")rin! $ost1"ecrements ")rin! st c- $o$(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

st c- $)s# n"

- 29 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

7ro4r%& S*%*,! Wor+"


T#e *ro!r m st t)s 0or" 3*S@4 cont ins st t)s %l !s t# t re set ccor"in! to t#e res)lts o% select &its( $re2io)sl' e.ec)te" instr)ction( In ""ition+ t#e *S@ cont ins re!ister & n-

3%*% 7oi)* r"


T#e D t $ointer 3D*TR4 is )se" to ccess " t memor' t# t c n &e m $$e" into &'te 0i"e " t RAM or onto e.tern l memor' "e2ices on t#e e.$ n"e" &)s( T#e D*TR is ccesse" &' t#e )sers $ro!r m s eit#er t0o 8 &it SFRs or s 1<1&it re!ister 0it# cert in instr)ctions(

7ro4r%&&%.' Ti& r!"


T0o 1< &it $ro!r mm &le timers re incl)"e" t# t c n $er%orm 2 rio)s timin! n" co)ntin! %)nctions( Fo)r re!isters 3TC1+ TL1+ TC0 n" TL04 ccess t#e )$$er n" lo0er # l2es o% e c# o% t#e t0o timer,co)nters( A sin!le control re!ister 3TCON4 is )se" to select t#e 2 rio)s o$er tin! mo"es o% t#e t0o timers( T0o e.tern l I,O $ins 3*E(=+ *E(54 c n &e $ro!r mme" to ser2e s e.tern l co)nter in$)ts+ one $in %or e c# o% t#e t0o timer,co)nters(

7%r%'' ' I;O"


Fo)r SFRs $ro2i"e ccess %or t#e %o)r $ r llel I,O $ort l tc#es( T#ese I,O $orts re "enote" s *0+ *1+ *: n" *E( E: &its o% $ r llel I,O is 2 il &le t#ro)!# t#ese I,O $orts( Co0e2er+ )$ to 1< &its re s cri%ice" 0#en t#e e.$ n"e" &)s mo"e is )se" to inter% ce to e.tern l memor' n" )$ to < &its c n &e s cri%ice" i% n' e.tern l interr)$t in$)ts+ timer co)nter in$)ts+ or seri l I,O %)nctions re )se"( @#en )sin! t#e &'te 0i"e &)s+ $orts re not %%ecte"(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 30 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

A*& ' A*89c51 7i)o,* %)+ 3 !crip*io)"


T#e sm llest c)rrent "e2ice is t#e ATMEL 8Bc51+ =0 *in FLASC 2 ri nt 0it# : timers+ UART+ 500mA( ATMEL 0 s t#e %irst 0it# st n" r" FLASC+ n" 0it# more $ro!r m c'cles t# n ot#er c)stom FLASC( T#ese $ rts com$ete 0it# OT* n" MAS> $ro")ct on $rice+ &)t elimin te in2entor' $ro&lems "e2elo$ment( n" t#e #i""en costs o% OT*

W/A - 4o 5or AT89C51?


T#e AT8BC51 is lo0 $o0er+ #i!# $er%orm nce CMOS 81&it microcontroller

0it# =>&'tes o% Fl s# $ro!r mm &le n" er s &le re " onl' memor' 3*EROM4( T#is "e2ice is com$ ti&le 0it# t#e in")str' st n" r" 8051 instr)ction set n" $ino)t( T#e on1 c#i$ Fl s# llo0s t#e $ro!r m memor' to &e /)ic-l' re$ro!r mme" )sin! non2ol tile

memor' $ro!r mmer s)c# s t#e *HE0: 30it# t#e ADT86 " $ter4( ?' com&inin! n in")str' st n" r" 81&it C*U 0it# Fl s# on microcom$)ter 0#ic# $ro2i"es em&e""e" control $$lic tions( monolit#ic c#i$+ t#e 8B51 is $o0er%)l

#i!#l' %le.i&le n" cost e%%ecti2e sol)tion to m n'

# %*,r ! o5 AT89C51"

1( It is 81&it microcontroller( :( It # s %l s# memor' o% =>? %or storin! t#e $ro!r m( E( It # s RAM o% 1:8 &'tes(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 31 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

=( It # s E: I,O $orts( 1*ort 0 3$in EB to $in E:4( 1*ort 1 3$in 1 to $in 84( 1*ort : 3$in :1 to $in :84( 1*ort E 3$in 10 to $in 164( 5( It # s %o)r re!ister & n-s( <( It # s t0o 1<1&it timers( 1 1 Timer 0 Timer 1

6( It # s %)ll ")$le. s'nc#rono)s seri l $ort( 8( It c n s)$$ort )$ to <=>? o% e.tern l memor' 0it# t#e #el$ o% *C n" B( It # s 1<1&it ""ress &)s( 10( Si. interr)$ts 0it# t0o $riorit' le2els 1: !ener l $)r$ose interr)$ts 3INT0+ INT14( 1= $re$ro!r mme" interr)$t 3Timer0+ Timer1+ Seri l interr)$t+ Reset interr)$t4( 11( @i"e r n!e o% %re/)enc' o% o$er tion 30 to := MCG4( 1:( It 0ill o$er te on 5V "c s)$$l'( 1E( It c n s)$$ort m .im)m o% 500mA o% c)rrent( D*TR(

In ""ition+ t#e 8BC51 is "esi!ne" 0it# st tic lo!ic %or o$er tion "o0n to Gero %re/)enc' n" s)$$orts t0o so%t0 re select &le $o0er s 2in! mo"es( T#e I"le Mo"e sto$s t#e C*U 0#ile llo0in! t#e RAM+ timer,co)nters+ seri l *ort n" interr)$t s'stem

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 32 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

to contin)e %)nctionin!( T#e *o0er Do0n Mo"e s 2es t#e RAM contents &)t %reeGes t#e oscill tor "is &lin! ll ot#er c#i$ %)nctions )ntil t#e ne.t # r"0 re reset(

7INO8T 3IA9RAM

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 33 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Microco)*ro'' r 7i) 3i%4r%&B

7IN 3ESCRI7TION"
B1(8" 7or* 1" E c# o% t#ese $ins c n &e )se" s eit#er in$)t or o)t$)t( Also+ $ins
1 n" : 3*1(0 n" *1(14 # 2e s$eci l %)nctions ssoci te" 0it# Timer :(

9" R ! * Si4)%'" Ci!# lo!ic l st te on t#is in$)t # lts t#e MCU n" cle rs ll
t#e re!isters( ?rin!in! t#is $in & c- to lo!ic l st te Gero st rts t#e $ro!r m ne0 s i% t#e $o0er # " 5)st &een t)rne" on( In not#er 0or"s+ $ositi2e 2olt !e im$)lse on t#is $in resets t#e MCU( De$en"in! on t#e "e2iceKs $)r$ose n" en2irons+ t#is $in is )s) ll' connecte" to t#e $)s#1&)tton+ reset1)$on1st rt circ)it or &ro0n o)t reset circ)it( T#e im !e s#o0s one sim$le circ)it %or s %e reset

)$on st rtin! t#e controller(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 34 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

10-17" 7or* 3" As 0it# *ort 1+ e c# o% t#ese $ins c n &e )se" s )ni2ers l in$)t
or o)t$)t( Co0e2er+ e c# $in o% *ort E # s n ltern ti2e %)nction;

B7i) 10" R=3 1 Seri l in$)t %or s'nc#rono)s comm)nic tion or seri l o)t$)t %or
s'nc#rono)s comm)nic tion(

7i) 11" T=3 1 Seri l o)t$)t %or s'nc#rono)s comm)nic tion or cloc- o)t$)t
%or s'nc#rono)s comm)nic tion

7i) 12" INT0 1 In$)t %or interr)$t 0 7i) 13" INT1 1 In$)t %or interr)$t 1

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 35 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

7i) 14" T0 1 Cloc- in$)t o% co)nter 0 7i) 15" T1 1 Cloc- in$)t o% co)nter 1 7i) 16" WR 1 Si!n l %or 0ritin! to e.tern l 3 ""1on4 RAM memor' 7i) 17" R3 1 Si!n l %or re "in! %rom e.tern l RAM memor' 18-19" =2 %)+ =1" In$)t n" o)t$)t o% intern l oscill tor( L) rtG cr'st l
controllin! t#e %re/)enc' commonl' connects to t#ese $ins( C $ cit nces 0it#in t#e oscill tor mec# nism 3see t#e im !e4 re not critic l n" re norm ll' &o)t E0$F( Ne0 MCUs 0or- t %re/)encies %rom 0CG to 50MCGM(

C'oc2 Circ,i*
B 20" 9N3; Hro)n"

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 36 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

21- 28" 7or* 2" I% e.tern l memor' is not $resent+ $ins o% *ort : ct s )ni2ers l
in$)t,o)t$)t( I% e.tern l memor' is $resent+ t#en t#ese $ins ser2e s t#e loc tion o% t#e #i!#er ""ress &'te+ i(e( ""resses A8 N A15( It is im$ort nt to note t# t in c ses 0#en not ll t#e 8 &its re )se" %or ""ressin! t#e memor' 3i(e( memor' is sm ller t# n <=-?4+ t#e rest o% t#e )n)se" &its re not 2 il &le s in$)t,o)t$)t(

29" 7SEN" MCU cti2 tes t#is &it 3&rin!s to lo0 st te4 )$on e c# re "in! o%
&'te 3instr)ction4 %rom $ro!r m memor'( I% e.tern l ROM is )se" %or storin! t#e $ro!r m+ *SEN is "irectl' connecte" to its control $ins(

30" ALE" ?e%ore e c# re "in! o% t#e e.tern l memor'+ MCU sen"s t#e lo0er
&'te o% t#e ""ress re!ister 3 ""resses A0 N A64 to $ort *0 n" cti2 tes t#e o)t$)t ALE( E.tern l re!ister 36=CCTE6E or 6=CCTE65 circ)its re common4+ memoriGes t#e st te o% $ort *0 )$on recei2in! si!n l %rom ALE $in+ n" )ses it s $ rt o% t#e ""ress %or memor' c#i$( D)rin! t#e secon" $ rt o% t#e mec# nic l MCU c'cle+ si!n l on ALE is o%%+ n" $ort *0 is )se" s D t ?)s( In t#is 0 '+ &' ""in! onl' one c#e $ inte!r te" circ)it+ " t %rom $ort c n &e m)lti$le.e" n" t#e $ort sim)lt neo)sl' )se" %or tr ns%errin! &ot# ""resses n" " t (

31" EA" ?rin!in! t#is $in to t#e lo!ic l st te Gero "esi!n tes t#e $orts *: n"
*E %or tr ns%errin! ""resses re! r"less o% t#e $resence o% t#e intern l memor'( T#is me ns t# t e2en i% t#ere is $ro!r m lo "e" in t#e MCU it 0ill not &e

e.ec)te"+ &)t t#e one %rom t#e e.tern l ROM 0ill &e )se" inste "( Con2ersel'+
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 37 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

&rin!in! t#e $in to t#e #i!# lo!ic l st te c )ses t#e controller to )se &ot# memories+ %irst t#e intern l+ n" t#en t#e e.tern l 3i% $resent4(

32-39" 7or* 0" Simil r to *ort :+ $ins o% *ort 0 c n &e )se" s )ni2ers l
in$)t,o)t$)t+ i% e.tern l memor' is not )se"( I% e.tern l memor' is )se"+ *0 &e# 2es s ""ress o)t$)t 3A0 N A64 0#en ALE $in is t #i!# lo!ic l le2el+ or s " t o)t$)t 3D t ?)s4 0#en ALE $in is t lo0 lo!ic l le2el(

40" 6CC" *o0er M5V

IN78T ( O8T78T <I;O> 7ORTS


E2er' MCU %rom 8051 % mil' # s = I,O $orts o% 8 &its e c#( T#is $ro2i"es t#e )ser 0it# E: I,O lines %or connectin! MCU to t#e en2irons(

7or* 0

*ort 0 # s t0o %ol" role; i% e.tern l memor' is )se"+ it cont ins t#e lo0er ""ress &'te 3A01A64+ ot#er0ise ll &its o% t#e $ort re eit#er in$)t or

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 38 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

o)t$)t( Anot#er %e t)re o% t#is $ort comes to $l ' 0#en it # s &een "esi!n te" s o)t$)t( *ort 0 l c-s t#e O$)ll )$O resistor 3resistor 0it# M5V on one en"4( T#ere%ore+ to !et one 35V4 on t#e o)t$)t+ e.tern l O$)ll )$O resistor nee"s to &e ""e" %or connectin! t#e $in to t#e $ositi2e $ole(

Port 1
T#is is Otr)eO I,O $ort+ "e2oi" o% ") l %)nction c# r cteristic %or *ort 0( C 2in! t#e O$)ll )$O resistor+ *ort 1 is %)ll' com$ ti&le 0it# TTL circ)its(

Port 2
@#en )sin! e.tern l memor'+ t#is $ort cont ins t#e #i!#er ""ress &'te 3 ""resses A8NA154( Ot#er0ise+ it c n &e )se" s )ni2ers l I,O $ort(

Port 3
?esi"e its role s )ni2ers l I,O $ort+ e c# $in o% *ort E # s n ltern te %)nction( In or"er to )se one o% t#ese %)nctions+ t#e $in in /)estion # s to &e "esi!n te" s in$)t+ i(e( t#e $$ro$ri te &it o% re!ister *E nee"s to &e set( From # r"0 re st n"$oint+ *ort E is simil r to *ort 0(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 39 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Memory in 8051 Microcontroller:


T#e 8051 # s t#ree 2er' !ener l t'$es o% memor'( T#e memor' t'$es ill)str te" in t#e %ollo0in! %i!)re; On1C#i$ Memor'+ E.tern l Co"e Memor'+ E.tern l RAMB re n"

M &orA 1'oc2 3i%4r%&(

On1C#i$ Memor' re%ers to n' memor' 3Co"e+ RAM+ or ot#er4 t# t $#'sic ll' e.ists on t#e microcontroller itsel%( E.tern l Co"e Memor' is co"e 3or $ro!r m4 memor' t# t resi"es o%%1c#i$( T#is is o%ten in t#e %orm o% n e.tern l E*ROM( E.tern l RAM is RAM memor' t# t resi"es o%%1c#i$( T#is is o%ten in t#e %orm o% st n" r" st tic RAM or %l s# RAM(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 40 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

D)rin! t#e r)ntime+ microcontroller )ses t0o "i%%erent t'$es o% memor'; one %or #ol"in! t#e $ro!r m &ein! e.ec)te" 3ROM memor'4+ n" t#e ot#er %or tem$or r' stor !e o% " t n" ).ili r' 2 ri &les 3RAM memor'4(

ROM & &orA


In t#is MCU cont in = -ilo&'tes o% t#e %l s# memor' on t#e c#i$( It is o% EE*ROM( @e c n )se 1:2 to $ro!r m MCU( T#is o$tion is cost1e%%ecti2e onl' %or l r!e series( T#e m in $)r$ose o% ROM is to store t#e $ro!r ms to &e e.ec)te"(

RAM memory
RAM is )se" %or storin! tem$or r' " t n" ).ili r' res)lts !ener te" n)m&er o% re!isters;

")rin! t#e r)ntime( A$ rt %rom t# t+ RAM com$rises

# r"0 re co)nters n" timers+ I,O $orts+ &)%%er %or seri l connection+ etc( @it# ol"er 2ersions+ RAM s$ nne" :5< loc tions+ 0#ile ne0 mo"els %e t)re ""ition l 1:8 re!isters( First :5< memor' loc tions %orm t#e & sis o% RAM 3 ""resses 0 N FF#4 o% e2er' 8051 MCU( Loc tions t# t re 2 il &le to t#e )ser s$ n ""resses %rom 0 to 6F#+ i(e( %irst 1:8 re!isters+ n" t#is $ rt o% RAM is s$lit into se2er l &loc-s s c n &e seen in t#e %ollo0in! %i!)re(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 41 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

RAM M &orA(
T#e m in $)r$ose o% RAM is to $ro2i"e s'nc#roniG tion &et0een ROM n" C*U so s to incre se t#e s$ee" o% microcontroller(

1i* M &orA
T#e 8051+ &ein! t#e &ilit' to ccess comm)nic tions1oriente" microcontroller+ !i2es t#e )ser

n)m&er o% &it 2 ri &les( T#ese 2 ri &les m ' &e eit#er 1 or

0( T#ere re 1:8 &it 2 ri &les 2 il &le to t#e )ser+ n)m&ere" 00# t#ro)!# 6F#(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 42 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Sp ci%' #,)c*io) R 4i!* r <S#R> M &orA


S$eci l F)nction Re!isters 3SFRs4 re re s o% memor' t# t control s$eci%ic %)nction lit' o% t#e 8051 $rocessor( It m ' $$e r t# t SFR is $ rt o% Intern l Memor'( Co0e2er+ 0#en )sin! t#is met#o" o% memor' ccess 3its c lle" "irect ""ress4+ n' instr)ction t# t # s n ""ress o% 00# t#ro)!# 6F# re%ers to n Intern l RAM memor' ""ressA n' instr)ction 0it# n ""ress o% 80# t#ro)!# FF# re%ers to n SFR control re!ister(

R 4i!* r 1%)2!
9 ) r%' 7,rpo! r 4i!* r!"
T#e 8051 )ses 8 ORO re!isters 0#ic# re )se" in m n' o% its instr)ctions( T#ese ORO re!isters re n)m&ere" %rom 0 t#ro)!# 6 3R0+ R1+ R:+ RE+ R=+ R5+ R<+ n" R64( T#ese re!isters re !ener ll' )se" to ssist in m ni$)l tin! 2 l)es n" mo2in! " t %rom one memor' loc tion to not#er(

SFR Registers (Special Function Registers)


SFR re!isters c n &e seen s monitorin! t#e microcontroller( sort o% control $ nel %or m n !in! n"

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 43 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Sp ci%' #,)c*io) R 4i!* r!B

TIMERS"
T#e 8051 comes e/)i$$e" 0it# t0o timers+ &ot# o% 0#ic# m ' &e controlle"+ set+ re "+ n" con%i!)re" in"i2i") ll'( T#e 8051 timers # 2e t#ree !ener l %)nctions; 14 >ee$in! time n",or c lc)l tin! t#e mo)nt o% time &et0een e2ents+ :4 Co)ntin! t#e e2ents t#emsel2es+ or E4 Hener tin! & )" r tes %or t#e seri l $ort(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 44 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

8SIN9 TIMERS TO MEAS8RE TIME


O&2io)sl'+ one o% t#e $rim r' )ses o% timers is to me s)re time( @#en timer is

)se" to me s)re time it is lso c lle" n Ointer2 l timerO since it is me s)rin! t#e time o% t#e inter2 l &et0een t0o e2ents( (

Ti& r S#R!
T#e 8051 # s t0o timers 0#ic# e c# %)nction essenti ll' t#e s me 0 '( One timer is TIMER0 n" t#e ot#er is TIMER1( T#e t0o timers s# re t0o SFRs 3TMOD n" TCON4 0#ic# control t#e timers+ n" e c# timer lso # s t0o SFRs "e"ic te" solel' to itsel% 3TC0,TL0 n" TC1,TL14( An SFR # s n)meric ""ress( It is o%ten )se%)l to -no0 t#e n)meric

""ress t# t corres$on"s to n SFR n me( @#en 'o) enter t#e n me o% n SFR into n ssem&ler+ it intern ll' con2erts it to n)m&er(

T/ TMO3 S#R <Ti& r Mo+ >"


T#e TMOD SFR is )se" to control t#e mo"e o% o$er tion o% &ot# timers( E c# &it o% t#e SFR !i2es t#e microcontroller s$eci%ic in%orm tion concernin! #o0 to r)n timer( T#e #i!# %o)r &its 3&its = t#ro)!# 64 rel te to Timer 1 0#ere s t#e

lo0 %o)r &its 3&its 0 t#ro)!# E4 $er%orm t#e e. ct s me %)nctions+ &)t %or timer 0(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 45 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

T#e in"i2i") l &its o% TMOD # 2e t#e %ollo0in! %)nctions;

?it N me

E.$l n tion o% F)nction @#en t#is &it is set t#e timer 0ill onl' r)n 0#en

Timer

HATE1 INT1 3*E(E4 is #i!#( @#en t#is &it is cle r t#e timer 1 0ill r)n re! r"less o% t#e st te o% INT1( @#en t#is &it is set t#e timer 0ill co)nt e2ents on

<

C,T1

T1 3*E(54( @#en t#is &it is cle r t#e timer 0ill &e incremente" e2er' m c#ine c'cle(

5 =

T1M1 T1M0

Timer mo"e &it 3see &elo04 Timer mo"e &it 3see &elo04 @#en t#is &it is set t#e timer 0ill onl' r)n 0#en

1 1

HATE0 INT0 3*E(:4 is #i!#( @#en t#is &it is cle r t#e timer 0 0ill r)n re! r"less o% t#e st te o% INT0( @#en t#is &it is set t#e timer 0ill co)nt e2ents on

C,T0

T0 3*E(=4( @#en t#is &it is cle r t#e timer 0ill &e incremente" e2er' m c#ine c'cle(

1 0

T0M1 T0M0

Timer mo"e &it 3see &elo04 Timer mo"e &it 3see &elo04

0 0

Fo)r &its 3t0o %or e c# timer4 re )se" to s$eci%' mo"e o% o$er tion( T#e mo"es o% o$er tion re; T.M1 0 0 1 1 T.M0 0 1 0 1 Timer Mo"e 0 1 : E Descri$tion o% Mo"e 1E1&it Timer( 1<1&it Timer 81&it )to1relo " S$lit timer mo"e
GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

- 46 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

T/ TCON S#R
T#ere is one more SFR t# t controls t#e t0o timers n" $ro2i"es 2 l) &le in%orm tion &o)t t#em( T#e TCON SFR # s t#e %ollo0in! str)ct)re;
TCON 388#4 SFR ?it ?it N me A""ress Timer 1 O2er%lo0( T#is &it is set &' t#e 6 TF1 8F# microcontroller 0#en Timer 1 o2er%lo0s( Timer 1 R)n( @#en t#is &it is set Timer 1 is t)rne" < TR1 8E# on( @#en t#is &it is cle r Timer 1 is o%%( Timer 0 O2er%lo0( T#is &it is set &' t#e 5 TF0 8D# microcontroller 0#en Timer 0 o2er%lo0s( Timer 0 R)n( @#en t#is &it is set Timer 0 is t)rne" = TR0 8C# on( @#en t#is &it is cle r Timer 0 is o%%( 0 0 1 1 E.$l n tion o% F)nction Timer

Onl' %o)r &its o% SFR re )se" %or timers+ t#e rem inin! %o)r re )se" %or interr)$ts(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 47 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 48 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

C r&, " + #!r#.

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 49 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

67 POWER SUPPLY 671 I%"ro+,&" o%: An4 in%ention o$ late"t technolo#4 cannot 7e acti%ate !itho1t the "o1rce o$ &o!er( So in thi" $a"t 'o%in# !orl !e eli7eratel4 nee a &ro&er &o!er "o1rce !hich !ill 7e a&t $or a &artic1lar re81ire'ent( All the electronic co'&onent" "tartin# $ro' io e to I.:" onl4 !or3 !ith a D. "1&&l4 ran#in# $ro' 5, to 1;,(Ae are 1tiliGin# $or the "a'e2 the chea&e"t an co''onl4 a%aila7le ener#4 "o1rce o$ ;<0,550HG an "te&&in# o!n2 recti$4in#2 $ilterin# an re#1latin# the %olta#e( ( Microcontroller o&erate" at H5% D. an al"o $or other I." an i"&la4"( A ;;0% ac to 1;5051;% tran"$or'er i" 1"e an $or recti$ication2 $o1r io e" IN=00D are connecte $or recti$ication o$ the "te& o!n ac "1&&l4( 6ilter ca&acitor o$ 1000U$ i" 1"e ( It i" re#1late to H5% 1"in# a re#1lator D805( 0(1 U6 ca&acitor i" 1"e $or $iltration o$ hi#h $re81enc4 noi"e( (The &o!er "1&&l4 circ1it i" "ho!n 7elo!( 678 DESCRIPTION: 67871 Tr#%(*or.'r A 7ri #e recti$ier co1&le !ith a "te& o!n tran"$or'er i" 1"e $or o1r e"i#n( The %olta#e ratin# o$ tran"$or'er 1"e i" 051;, an the c1rrent ratin# i" 500'A( Ahen A. %olta#e o$ ;<0, i" a&&lie acro"" the &ri'ar4 !in in# an o1t&1t A. %olta#e o$ 1;, i" o7taine ( One
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 50 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

alteration o$ in&1t ca1"e" the to& o$ tran"$or'er to 7e &o"iti%e an the 7otto' ne#ati%e( The ne>t alteration !ill te'&oraril4 ca1"e the re%er"e( 67878 R'&" * 'r In the &o!er "1&&l4 1nit2 recti$ication i" nor'all4 achie%e ea"il4 at one irection at &ro&er 1"in# a "oli "tate io e( Dio e ha" the &ro&ert4 that !ill let the electron $lo!

F ! 671 POWER SUPPLY CIRCIUT 7ia"in# con ition( Bri #e recti$ier" o$ = io e" are 1"e to achie%e $1ll !a%e recti$ication( T!o io e" !ill con 1ct 1rin# the ne#ati%e c4cle an the other t!o !ill con 1ct 1rin# the &o"iti%e hal$ c4cle( 67879 F $"'r %! ,% "
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 51 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

6ilter circ1it !hich i" 1"1all4 a ca&acitor act" a" a "1r#e arre"ter al!a4" $ollo!" the recti$ier 1nit( Thi" ca&acitor i" al"o calle a" a eco1&lin# ca&acitor or a 74&a"" ca&acitor2 i" 1"e not onl4 to "hort the ri&&le !ith $re81enc4 to #ro1n 71t al"o lea%e the $re81enc4 o$ the D. to a&&ear at the o1t&1t( 67876 R'!,$#"or( The %olta#e re#1lator" &la4 an i'&ortant role in an4 &o!er "1&&l4 1nit( The &ri'ar4 &1r&o"e o$ a re#1lator i" to ai the recti$ier an $ilter circ1it in &ro%i in# a con"tant D. %olta#e to the e%ice( )o!er "1&&lie" !itho1t re#1lator" ha%e an inherent &ro7le' o$ chan#in# D. %olta#e %al1e" 1e to %ariation" in the loa or 1e to $l1ct1ation" in the A. line %olta#e( Aith a re#1lator connecte to D. o1t&1t2 the %olta#e can 7e 'aintaine !ithin a clo"e tolerant re#ion o$ the e"ire o1t&1t( I. D805 an D81; re#1lator" are 1"e in thi" &ro*ect $or &ro%i in# a D. %olta#e o$ H5, an H1;, re"&ecti%el4( 67875 T'&4% &#$ D'"# $(: Tran"$or'er@ Dio e"@ ;<0F1; %olt" "te& o!n tran"$or'er2 1 a'&ere IN =00D

,olta#e re#1lator"@ D8/ Serie" D81;@ The D81; "1&&lie" 1; %olt" at ; a'& 'a>i'1' !ith an in&1t o$ 1<5;5 %olt" D805@ The D805 "1&&lie" 5 %olt" at 1 a'& 'a>i'1' !ith an in&1t o$ D5;5 %olt" Electrol4tic .a&acitor"@ 100&62 <<0&6 an ;5,( 6787: F'#",r'(:
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

100I62 &o!er ratin# o$

- 52 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Gi%e" a !ell re#1late H1;, an H5, o1t&1t %olta#e" B1ilt in o%erheatin# &rotection "h1t" o!n o1t&1t !hen re#1lator I. #et" too hot( ,er4 "ta7le o1t&1t %olta#e"2 relia7le o&eration The circ1it ha" o%erloa an ther'al &rotection(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 53 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

DTMF DECODER D1al5tone '1lti5$re81enc4 (DTM6) "i#nalin# i" 1"e $or tele&hone "i#nalin# o%er the line in the %oice5$re81enc4 7an to the call "!itchin# center( The %er"ion o$ DTM6 1"e $or tele&hone tone ialin# i" 3no!n 74 the tra e'ar3e ter' To1ch5Tone2 an i" "tan ar i"e 74 ITU5T -eco''en ation J(;<( Other '1lti5$re81enc4 "4"te'" are 1"e $or "i#nalin# internal to the tele&hone net!or3 Hi"tor4 In the ti'e &rece in# the e%elo&'ent o$ DTM62 tele&hone "4"te'" e'&lo4e a "4"te' co''onl4 re$erre to a" &1l"e (Dial )1l"e or D) in the USA) or loo& i"connect (/D) "i#nallin# to ial n1'7er"2 !hich $1nction" 74 ra&i l4 i"connectin# an connectin# the callin# &art4K" tele&hone line2 "i'ilar to $lic3in# a li#ht "!itch on an o$$( The re&eate connection an i"connection2 a" the ial "&in"2 "o1n " li3e a "erie" o$ clic3"( The e>chan#e e81i&'ent co1nt" tho"e clic3" or ial &1l"e" to eter'ine the calle n1'7er( /oo& i"connect ran#e !a" re"tricte 74 tele#ra&hic i"tortion an other technical &ro7le'"2 an &lacin# call" o%er lon#er i"tance" re81ire either o&erator a""i"tance (o&erator" 1"e an earlier 3in o$ '1lti5$re81enc4 ial) or the &ro%i"ion o$ "17"cri7er tr1n3 iallin# e81i&'ent( DTM6 !a" e%elo&e at Bell /a7" in or er to allo! ialin# "i#nal" to ial lon#5 i"tance n1'7er"2 &otentiall4 o%er non!ire lin3" "1ch a" 'icro!a%e ra io rela4 lin3" or "atellite"( 6or a $e! non cro""7ar
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 54 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

o$$ice"2 enco erF eco er" !ere a

e that !o1l con%ert the ol er

&1l"e "i#nal" into DTM6 tone" an &la4 the' o!n the line to the re'ote en o$$ice( At the re'ote "ite another enco erF eco er co1l eco e the tone" an &er$or' &1l"e ialin#2 $or e>a'&le $or Stro!#er "!itche"( It !a" a" i$ 4o1 !ere connecte irectl4 to that en o$$ice2 4et the "i#nalin# !o1l !or3 o%er an4 "ort o$ lin3( Thi" i ea o$ 1"in# the e>i"tin# net!or3 $or "i#nalin# a" !ell a" the 'e""a#e i" 3no!n a" in57an "i#nalin#( It !a" clear e%en in the late 1950" !hen DTM6 !a" 7ein# e%elo&e that the $1t1re o$ "!itchin# la4 in electronic "!itche"2 a" o&&o"e to the electro'echanical cro""7ar "4"te'" then in 1"e( Either "!itchin# "4"te' co1l 1"e either ial "4"te'2 71t DTM6 &ro'i"e "horter hol in# ti'e"2 !hich !a" 'ore i'&ortant in the lar#er an 'ore co'&le> re#i"ter" 1"e in cro""7ar "4"te'"( In thi" ca"e &1l"e ialin# 'a e no "en"e at an4 &oint in the circ1it2 an &lan" !ere 'a e to roll DTM6 o1t to en 1"er" a" "oon a" &o""i7le( Te"t" o$ the "4"te' occ1rre in the earl4 19C0"2 !here DTM6 7eca'e 3no!n a" To1ch Tone( Tho1#h To1ch Tone &hone" !ere alrea 4 in 1"e in a $e! &lace"2 the4 !ere %i#oro1"l4 &ro'ote at the 19C= Ne! ?or3 Aorl K" 6air( The To1ch Tone "4"te' al"o intro 1ce a "tan ar iGe 3e4&a la4o1t( A$ter te"tin# 18 i$$erent la4o1t"2 the4 e%ent1all4 cho"e the one $a'iliar to 1" to a42 !ith 1 in the 1&&er5le$t an 0 at the 7otto'( The a in#5'achine la4o1t2 !ith 1 in the lo!er5le$t !a" al"o trie 2 71t
GSM BASED HOME AUTOMATION USING 8051

Project Definition / Specification

- 55 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

at that ti'e $e! &eo&le 1"e a

in# 'achine"2 an ha%in# the 1 at

the L"tartL (in E1ro&ean lan#1a#e rea in# or er) le to $e!er t4&in# error"( In retro"&ect2 'an4 &eo&le con"i er that thi" !a" a 'i"ta3e( Aith the !i e"&rea intro 1ction o$ co'&1ter" an 7an3 'achine"2 the &hone 3e47oar ha" 7eco'e Lo 7allL2 ca1"in# 'i"ta3e"(

In another "en"e2 DTM6 !a" o7"olete a eca e a$ter it !a" in"tit1te 2 a" 6SM 'etho " !ith $e!er $re81encie" 7eca'e chea&er2 $a"ter an 'ore relia7le( Ho!e%er2 the technical co'&le>itie" o$ i#ital $ilterin# !ere 'ore e>&en"i%e to eal !ith than *1n3in# an a e81ate "4"te'(

N2 O2 A2 B2 .2 an D The en#ineer" ha en%i"ione &hone" 7ein# 1"e to acce"" co'&1ter"2 an "1r%e4e a n1'7er o$ co'&anie" to "ee !hat the4 !o1l nee $or thi" role( Thi" le to the a ition o$ the n1'7er "i#n (N) an "tar (O) 3e4" (al"o 3no!n a" h1'&hrie")2Pcitation nee e Q a" !ell a" a #ro1& o$ 3e4" $or 'en1 "election@ A2 B2 . an D( In the en 2 the lettere 3e4" !ere ro&&e $ro' 'o"t &hone"2 an it !a" 'an4 4ear" 7e$ore the h1'&hrie" 7eca'e !i el4 1"e $or %ertical "er%ice co e" "1ch a" OCD in the Unite State" an .ana a to "1&&re"" caller ID( )17lic &a4&hone" that acce&t cre it car " 1"e the"e a to "en the in$or'ation $ro' the 'a#netic "tri&(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

itional co e"

- 56 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

The U(S( 'ilitar4 al"o 1"e the letter"2 rela7ele 2 in their no! e$1nct A1to%on &hone "4"te'( Here the4 !ere 1"e 7e$ore ialin# the &hone in or er to #i%e "o'e call" &riorit42 c1ttin# in o%er e>i"tin# call" i$ nee 7e( The i ea !a" to allo! i'&ortant tra$$ic to #et thro1#h e%er4 ti'e( The le%el" o$ &riorit4 a%aila7le !ere 6la"h O%erri e (A)2 6la"h (B)2 I''e iate (.)2 an )riorit4 (D)2 !ith 6la"h O%erri e 7ein# the hi#he"t &riorit4( )re""in# one o$ the"e 3e4" #a%e 4o1r call &riorit42 o%erri in# other con%er"ation" on the net!or3( )re""in# .2 I''e iate2 7e$ore ialin# !o1l 'a3e the "!itch $ir"t loo3 $or an4 $ree line"2 an i$ all line" !ere in 1"e2 it !o1l other call o$$ the tr1n3" 7et!een the ori#in an i"connect an4 non5 e"tination( &riorit4 call"2 an then an4 &riorit4 call"( 6la"h O%erri e !ill 3ic3 e%er4 .on"e81entl42 it i" li'ite to the Ahite Ho1"e .o''1nication" A#enc4( )rece ence ialin# i" "till one on the 'ilitar4 &hone net!or3"2 71t 1"in# n1'7er co'7ination" (E>a'&le@Enterin# 9< 7e$ore a n1'7er i" a &riorit4 call) rather than the "e&arate tone"( )re"ent5 a4 1"e" o$ the A2 B2 . an D 3e4" on tele&hone net!or3" are $e!2 an e>cl1"i%e to net!or3 control( 6or e>a'&le2 the A 3e4 i" 1"e on "o'e net!or3" to c4cle thro1#h i$$erent carrier" at !ill (there74 li"tenin# in on call")( Their 1"e i" &ro7a7l4 &rohi7ite 74 'o"t carrier"( The A2 B2 . an D tone" are 1"e in a'ate1r ra io &hone &atch an re&eater o&eration" to allo!2 a'on# other 1"e"2 control o$ the re&eater !hile connecte to an acti%e &hone line(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 57 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

DTM6 tone" are al"o 1"e 74 "o'e ca7le tele%i"ion net!or3" an ra io net!or3" to "i#nal the local ca7le co'&an4Fnet!or3 "tation to in"ert a local a %erti"e'ent or "tation i enti$ication( The"e tone" !ere o$ten hear 1rin# a "tation ID &rece in# a local a in"ert( )re%io1"l42 terre"trial tele%i"ion "tation" al"o 1"e DTM6 tone" to "h1t o$$ an t1rn on re'ote tran"'itter"( DTM6 tone" are al"o "o'eti'e" 1"e in caller ID "4"te'" to tran"$er the caller ID in$or'ation2 ho!e%er in the USA onl4 Bell ;0; 'o 1late 6SM "i#nallin# i" 1"e to tran"$er the ata( Me4&a The DTM6 3e4&a i" lai o1t in a =R= 'atri>2 !ith each ro! re&re"entin# a lo! $re81enc42 an each col1'n re&re"entin# a hi#h $re81enc4( )re""in# a "in#le 3e4 "1ch a" K1K !ill "en a "in1"oi al tone o$ the t!o $re81encie" C9D an 1;09 hertG (HG)( The ori#inal 3e4&a " ha le%er" in"i e2 "o each 71tton acti%ate t!o contact"( The '1lti&le tone" are the rea"on $or callin# the "4"te' '1lti$re81enc4( The"e tone" are then eco e 74 the "!itchin# center to eter'ine !hich 3e4 !a" &re""e ( DTM6 3e4&a $re81encie" .lic3 here $or 8051 Microcontroller 6O-UM

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 58 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

1;09 HG C9D HG DD0 HG 85; HG 9=1 HG 1 = D O

1<<C HG ; 5 8 0 < C 9 N

1=DD HG A B . D

1C<< HG

MT 88D0 DTM6 eco er@ I. MT88D0FMT<1D0 "er%e" a" DTM6 eco er( Thi" I. ta3e" DTM6 "i#nal co'in# %ia tele&hone line an con%ert" that "i#nal into re"&ecti%e B.D n1'7er( It 1"e" "a'e o"cillator $re81enc4 1"e in the re'ote "ection "o "a'e cr4"tal o"cillator !ith $re81enc4 o$ <(85M HG i" 1"e in thi" I.( Aor3in# o$ I. MT88D0@ The MT588D0 i" a $1ll DTM6 -ecei%er that inte#rate" 7oth 7an "&lit $ilter an eco er $1nction" into a "in#le 185&in DI)( It" $ilter "ection 1"e" "!itche ca&acitor technolo#4 $or 7oth the hi#h an lo! #ro1& $ilter" an $or ial tone re*ection( It" eco er 1"e" i#ital co1ntin# techni81e" to etect an eco e all 1C DTM6 tone &air" into a =57it co e( E>ternal co'&onent co1nt i" 'ini'iGe 74 &ro%i"ion o$ an on5 chi& i$$erential in&1t a'&li$ier2 cloc3 #enerator2 an latche tri5"tate inter$ace 71"( Mini'al e>ternal co'&onent" re81ire incl1 e a lo!5
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 59 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

co"t <(5D95=5 MHG cr4"tal2 a ti'in# re"i"tor2 an a ti'in# ca&acitor( The MT588D050; can al"o inhi7it the eco in# o$ $o1rth col1'n i#it"( MT588D0 o&eratin# $1nction" incl1 e a 7an "&lit $ilter that "e&arate" the hi#h an lo! tone" o$ the recei%e &air2 an a i#ital eco er that %eri$ie" 7oth the $re81enc4 an 1ration o$ the recei%e tone" 7e$ore &a""in# the re"1ltin# =57it co e to the o1t&1t 71"( The lo! an hi#h #ro1& tone" are "e&arate 74 a&&l4in# the 1al5 tone "i#nal to the in&1t" o$ t!o Cth or er "!itche ca&acitor 7an &a"" $ilter" !ith 7an !i th" that corre"&on to the 7an " enclo"in# the lo! an hi#h #ro1& tone"( 6i#1re (6)(Bloc3 ia#ra' o$ I. MT88D0 The $ilter al"o incor&orate" notche" at <50 an ==0 HG2 &ro%i in# e>cellent ial tone re*ection( Each $ilter o1t&1t i" $ollo!e 74 a "in#le5 or er "!itche ca&acitor "ection that "'oothe" the "i#nal" &rior to li'itin#( Si#nal li'itin# i" &er$or'e 74 hi#h #ain co'&arator" &ro%i e !ith h4"tere"i" to &re%ent etection o$ 1n!ante lo!5le%el "i#nal" an noi"e( The MT588D0 eco er 1"e" a i#ital co1ntin# techni81e to eter'ine the $re81encie" o$ the li'ite tone" an to %eri$4 that the4 corre"&on to "tan ar DTM6 $re81encie"( Ahen the etector reco#niGe" the "i'1ltaneo1" &re"ence o$ t!o %ali tone" (3no!n a" "i#nal con ition)2 it rai"e" the Earl4 Steerin# $la# (ESt)( An4 "17"e81ent lo"" o$ "i#nal con ition !ill ca1"e ESt to $all( Be$ore
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 60 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

a eco e tone &air i" re#i"tere 2 the recei%er chec3" $or %ali "i#nal 1ration (re$erre to a" character5 reco#nition5con ition)( Thi" chec3 i" &er$or'e 74 an e>ternal -. ti'e con"tant ri%en 74 ESt( A "hort ela4 to allo! the o1t&1t latch to "ettle2 the ela4e "teerin# o1t&1t $la# (StD) #oe" hi#h2 "i#nalin# that a recei%e tone &air ha" 7een re#i"tere ( The content" o$ the

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 61 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

o1t&1t latch are 'a e a%aila7le on the =57it o1t&1t 71" 74 rai"in# the three "tate control in&1t (OE) to lo#ic hi#h( Inhi7it 'o e i" ena7le 74 a lo#ic hi#h in&1t to &in 5 (INH)( It inhi7it" the etection o$ 1C<< HG( The o1t&1t co e !ill re'ain the "a'e a" the &re%io1" etecte co e( On the M5 88D0 'o el"2 thi" &in i" tie to #ro1n (lo#ic lo!)( The in&1t arran#e'ent o$ the MT588D0 &ro%i e" a i$$erential in&1t o&erational a'&li$ier a" !ell a" a 7ia" "o1rce (,-E6) to 7ia" the in&1t" at 'i 5rail( )ro%i"ion i" 'a e $or connection o$ a $ee 7ac3 re"i"tor to the o&5a'& o1t&1t (GS) $or #ain a *1"t'ent( The internal cloc3 circ1it i" co'&lete !ith the a <(5D95=5 MHG cr4"tal( The in&1t arran#e'ent o$ the MT588D0 &ro%i e" a i$$erential in&1t o&erational a'&li$ier a" !ell a" a 7ia" "o1rce (,-E6) to 7ia" the in&1t" at 'i 5rail( )ro%i"ion i" 'a e $or connection o$ a $ee 7ac3 re"i"tor to the o&5a'& o1t&1t (GS) $or #ain a *1"t'ent( The internal cloc3 circ1it i" co'&lete !ith the a "tan ar <(5D95=5 MHG cr4"tal( ition o$ a ition o$ a "tan ar

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 62 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

FEATURES OF ULN8009: U/N;00< i" a 1C 7it I. It i" o$ Darlin#ton &air a'&li$ier (1 to 1000) 1(; A'&" c1rrent i" "1&&orte ( It #i%e" in%erte o1t&1t( REASON FOR USING ULN8009 DRI;ER: Thi" ri%er i" 1"e to a%oi 7ac3 EM6 an &rotect circ1it $ro' 7ac3 EM6(It al"o &ro%i e" c1rrent a'&li$ication( General 'icrocontroller "1&&ort" c1rrent 1& to 500'A 71t "o'e 'otor" re81ire C00'A( In or er to achie%e thi" !e nee c1rrent a'&li$ication( ULN8009 & r&, " + #!r#.:

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 63 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

A< Darlin#ton &air o$ a'&li$ier I5In%erter

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 64 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-ela4"
A rela4 i" an electricall4 o&erate "!itch( .1rrent $lo!in# thro1#h the coil o$ the rela4 create" a 'a#netic $iel !hich attract" a le%er an chan#e" the "!itch contact"( The coil c1rrent can 7e on or o$$ "o rela4" ha%e t!o "!itch &o"ition" an the4 are o17le thro! (chan#eo%er) "!itche"(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 65 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-ela4" allo! one circ1it to "!itch a "econ circ1it !hich can 7e co'&letel4 "e&arate $ro' the $ir"t( 6or e>a'&le a lo! %olta#e 7atter4 circ1it can 1"e a rela4 to "!itch a ;<0, A. 'ain" circ1it( There i" no electrical connection in"i e the rela4 7et!een the t!o circ1it"2 the lin3 i" 'a#netic an 'echanical( The coil o$ a rela4 &a""e" a relati%el4 lar#e c1rrent2 t4&icall4 <0'A $or a 1;, rela42 71t it can 7e a" '1ch a" 100'A $or rela4" e"i#ne to o&erate $ro' lo!er %olta#e"( Mo"t I." (chi&") cannot &ro%i e thi" c1rrent an a tran"i"tor i" 1"1all4 1"e to a'&li$4 the "'all I. c1rrent to the lar#er %al1e re81ire $or the rela4 coil( The 'a>i'1' o1t&1t c1rrent $or the &o&1lar 555 ti'er I. i" ;00'A "o the"e e%ice" can "1&&l4 rela4 coil" irectl4 !itho1t a'&li$ication( -ela4" are 1"1alll4 S)DT or D)DT 71t the4 can ha%e 'an4 'ore "et" o$ "!itch contact"2 $or e>a'&le rela4" !ith = "et" o$ chan#eo%er contact" are rea il4 a%aila7le( 6or $1rther in$or'ation a7o1t "!itch contact" an the ter'" 1"e to e"cri7e the' &lea"e "ee the &a#e on "!itche"( Mo"t rela4" are e"i#ne $or ).B 'o1ntin# 71t 4o1 can "ol er !ire" irectl4 to the &in" &ro%i in# 4o1 ta3e care to a%oi 'eltin# the &la"tic ca"e o$ the rela4( The "1&&lierK" catalo#1e "ho1l "ho! 4o1 the rela4K" connection"( The coil !ill 7e o7%io1" an it 'a4 7e connecte either !a4 ro1n (
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 66 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-ela4 coil" &ro 1ce 7rie$ hi#h %olta#e K"&i3e"K !hen the4 are "!itche o$$ an thi" can e"tro4 tran"i"tor" an I." in the circ1it( To &re%ent a'a#e 4o1 '1"t connect a &rotection io e acro"" the rela4 coil( The ani'ate &ict1re "ho!" a !or3in# rela4 !ith it" coil an "!itch contact"( ?o1 can "ee a le%er on the le$t 7ein# attracte 74 'a#neti"' !hen the coil i" "!itche on( Thi" le%er 'o%e" the "!itch contact"( There i" one "et o$ contact" (S)DT) in the $ore#ro1n an another 7ehin the'2 'a3in# the rela4 D)DT(

The rela4K" "!itch connection" are 1"1all4 la7elle .OM2 N. an NO@ .OM S .o''on2 al!a4" connect to thi"2 it i" the 'o%in# &art o$ the "!itch( N. S Nor'all4 .lo"e 2 .OM i" connecte to thi" !hen the rela4 coil i" o$$( NO S Nor'all4 O&en2 .OM i" connecte to thi" !hen the rela4 coil i" on( .onnect to .OM an NO i$ 4o1 !ant the "!itche circ1it to 7e on !hen the rela4 coil i" on( .onnect to .OM an N. i$ 4o1 !ant the "!itche circ1it to 7e on !hen the rela4 coil i" o$$( .hoo"in# a rela4 ?o1 nee to con"i er "e%eral $eat1re" !hen choo"in# a rela4@
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 67 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

)h4"ical "iGe an &in arran#e'ent I$ 4o1 are choo"in# a rela4 $or an e>i"tin# ).B 4o1 !ill nee to en"1re that it" i'en"ion" an &in arran#e'ent are "1ita7le( ?o1 "ho1l $in thi" in$or'ation in the "1&&lierK" catalo#1e( .oil %olta#e The rela4K" coil %olta#e ratin# an re"i"tance '1"t "1it the circ1it &o!erin# the rela4 coil( Man4 rela4" ha%e a coil rate $or a 1;, "1&&l4 71t 5, an ;=, rela4" are al"o rea il4 a%aila7le( So'e rela4" o&erate &er$ectl4 !ell !ith a "1&&l4 %olta#e !hich i" a little lo!er than their rate %al1e( .oil re"i"tance The circ1it '1"t 7e a7le to "1&&l4 the c1rrent re81ire 74 the rela4 coil( ?o1 can 1"e Oh'K" la! to calc1late the c1rrent@ -ela4 coil c1rrent S "1&&l4 %olta#e coil re"i"tance 6or e>a'&le@ A 1;, "1&&l4 rela4 !ith a coil re"i"tance o$ =00 &a""e" a c1rrent o$ <0'A( Thi" i" OM $or a 555 ti'er I. ('a>i'1' o1t&1t c1rrent ;00'A)2 71t it i" too '1ch $or 'o"t I." an the4 !ill re81ire a tran"i"tor to a'&li$4 the c1rrent( S!itch ratin#" (%olta#e an c1rrent) The rela4K" "!itch contact" '1"t 7e "1ita7le $or the circ1it the4 are to control( ?o1 !ill nee to chec3 the %olta#e an c1rrent ratin#"( Note that the %olta#e ratin# i" 1"1all4 hi#her $or A.2 $or e>a'&le@ L5A at ;=, D. or 1;5, A.L( S!itch contact arran#e'ent (S)DT2 D)DT etc)
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 68 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

Mo"t rela4" are S)DT or D)DT !hich are o$ten e"cri7e a" L"in#le &ole chan#eo%erL (S).O) or L o17le &ole chan#eo%erL (D).O)( 6or $1rther in$or'ation &lea"e "ee the &a#e on "!itche"( )rotection io e" $or rela4" Tran"i"tor" an I." (chi&") '1"t 7e &rotecte $ro' the 7rie$ hi#h %olta#e K"&i3eK &ro 1ce !hen the rela4 coil i" "!itche o$$( The ia#ra' "ho!" ho! a "i#nal io e (e# 1N=1=8) i" connecte acro"" the rela4 coil to &ro%i e thi" &rotection( Note that the io e i" connecte K7ac3!ar "K "o that it !ill nor'all4 not con 1ct( .on 1ction onl4 occ1r" !hen the rela4 coil i" "!itche o$$2 at thi" 'o'ent c1rrent trie" to contin1e $lo!in# thro1#h the coil an it i" har'le""l4 i%erte thro1#h the io e( Aitho1t the io e no c1rrent co1l $lo! an the coil !o1l &ro 1ce a a'a#in# hi#h %olta#e K"&i3eK in it" atte'&t to 3ee& the c1rrent $lo!in#( -ee rela4" -ee -ela4 )hoto#ra&h T -a&i Electronic" -ee rela4" con"i"t o$ a coil "1rro1n in# a ree "!itch( -ee "!itche" are nor'all4 o&erate !ith a 'a#net2 71t in a ree rela4 c1rrent $lo!" thro1#h the coil to create a 'a#netic $iel an clo"e the ree "!itch( -ee rela4" #enerall4 ha%e hi#her coil re"i"tance" than "tan ar rela4" (1000 $or e>a'&le) an a !i e ran#e o$ "1&&l4 %olta#e" (95;0,
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 69 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

$or e>a'&le)( The4 are ca&a7le o$ "!itchin# '1ch 'ore ra&i l4 than "tan ar rela4"2 1& to "e%eral h1n re ti'e" &er "econ E 71t the4 can onl4 "!itch lo! c1rrent" (500'A 'a>i'1' $or e>a'&le)( The ree rela4 "ho!n in the &hoto#ra&h !ill &l1# into a "tan ar 1=5 &in DI/ "oc3et (Kchi& hol erK)( 6or $1rther in$or'ation a7o1t ree "!itche" &lea"e "ee the &a#e on "!itche"( -ela4" an tran"i"tor" co'&are /i3e rela4"2 tran"i"tor" can 7e 1"e a" an electricall4 o&erate "!itch( 6or "!itchin# "'all D. c1rrent" (U 1A) at lo! %olta#e the4 are 1"1all4 a 7etter choice than a rela4( Ho!e%er tran"i"tor" cannot "!itch A. or hi#h %olta#e" ("1ch a" 'ain" electricit4) an the4 are not 1"1all4 a #oo choice $or "!itchin# lar#e c1rrent" (V 5A)( In the"e ca"e" a rela4 !ill 7e nee e 2 71t note that a lo! &o!er tran"i"tor 'a4 "till 7e nee e to "!itch the c1rrent $or the rela4K" coilW The 'ain a %anta#e" an i"a %anta#e" o$ rela4" are li"te 7elo!@

A %anta#e" o$ rela4"@ -ela4" can "!itch A. an D.2 tran"i"tor" can onl4 "!itch D.(
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 70 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

-ela4" can "!itch hi#h %olta#e"2 tran"i"tor" cannot( -ela4" are a 7etter choice $or "!itchin# lar#e c1rrent" (V 5A)( -ela4" can "!itch 'an4 contact" at once( Di"a %anta#e" o$ rela4"@ -ela4" are 71l3ier than tran"i"tor" $or "!itchin# "'all c1rrent"( -ela4" cannot "!itch ra&i l4 (e>ce&t ree rela4")2 tran"i"tor" can "!itch 'an4 ti'e" &er "econ ( -ela4" 1"e 'ore &o!er 1e to the c1rrent $lo!in# thro1#h their coil( -ela4" re81ire 'ore c1rrent than 'an4 chi&" can &ro%i e2 "o a lo! &o!er tran"i"tor 'a4 7e nee e to "!itch the c1rrent $or the rela4K" coil(

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 71 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

1I1LIO9RA7H?
RE#ERENCES" 1OO:S" 1( MICRO CONTROLLERS ?Y RAMESC(S(HAON>R :( DATA SCEETS OF VARIOUS ICJS E( 8051 MANUAL WE1 SITE"
Project Definition / Specification GSM BASED HOME AUTOMATION USING 8051

- 72 -

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

1( :( E( =(

@@@(CCI*(COM @@@(HOOHLEARCC(COM @@@(EM?EDDEDSYSTEMS(COM @@@(VISUAL?ASIC(COM

Project Definition / Specification

GSM BASED HOME AUTOMATION USING 8051

- 73 -

Das könnte Ihnen auch gefallen