Automatic Street Light Control by Using Rtc Microcontroller

download Automatic Street Light Control by Using Rtc Microcontroller

of 42

Transcript of Automatic Street Light Control by Using Rtc Microcontroller

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    1/42

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    2/42

    CONTENTS

    CHAPTER NO DESCRIPTION PAGE NO

    1 ABSTRACT 4

    2 INTRODUCTION 4

    3 BLOCK DIAGRAM 5

    4 BLOCK DIAGRAM DESCRIPTION

    4.1 TRANSFORMER 64.2 PRECISION RECTIFIER 64.3 KEYPAD 64.4 RTC 64.5 MICROCONTROLLER 64.6 RELAY DRIVER & RELAY 6

      5 COMPONENTS’ DETAILED EXPLANATION

      5.1 MICROCONTROLLER

      5.2 TRANSFORMER 31

      5.3 RTC!DS13"# 32  5.4 SEVEN SEGMENT DISPLAY 34

      5.5 RELAY 34

     

    6 PCB DESIGN

    6.1 INTRODUCTION 35

      6.2 MANUFACTURING 35

      6.3 SOFT$ARE 35

      6.4 PANELISATION 35

      6.5 DRILLING 35

      6.6 PLATING 36

    6. ETC%ING 36

      6. SOLDER MASK 36

      6.' %OT AIR LEVELING 36

    CHAPTER NO DESCRIPTION PAGE NO

    2

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    3/42

     

    SOFT$ARE

    SOFT$ARE TOOLS

    .1 KEIL 3

      .2 ASSEMBLING & RUNNING 4"

    AN "51

     

    OVERALL CIRCUIT DIAGRAM

    ' OVERALL CIRCUIT DIAGRAM

    DESCRIPTION

    1" ADVANTAGES 41

      11 APPLICATIONS 41

      12 CONCLUSION 42

      13 BIBLIOGRAP%Y 42

    1. ABSTRACT:

    3

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    4/42

    T()* P+,-/0 0* ,+ 0( *0+0 )(0 0,70),8. I0 +9/* 0( M8 S:)0/()8 ,;0( *0+0 )(0. I0 (* 8 I8

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    5/42

    4. Block Di!"# E$%l&'io&:

    5

    M)/+,/,80+,+ B,+@ C,79+0,+ 

    OPTOC,9+ 

     TRAIC

     LDR 

     S0+0 )(0

    RTC

    LCD @)*9?

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    6/42

    4.1 TRANS(ORMER:

     

    A 0+8*;,+7+ /(8* !0+8*;,+7*# 8 0+80)8 ,0 ;+,7 ,8 0,

    8,0(+. I0 /,8*)*0* ,; 0:, /,)*> /@ 0( 9+)7+? 8@ */,8@+? :)8@)8> :()/( + 8,0

    /,88/0@ /0+)/?. T( :)8@)8* + )0(+ ,8 ,8 0,9 ,; 0( ,0(+ ,+ + *)@

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    7/42

    A 7)/+,/,80+,+ !*, MCU ,+ C# )* ;8/0),8 /,790+  *?*07,8/()9.

    I0 /,80)8* 9+,/**,+ /,+> 77,+?> 8@ 9+,+77 77,+? ! *7 7,80 ,; RAM> 9+,+7

    77,+?> ,+

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    8/42

    ARCHITECTURE O( ATS,2

    ,1 A"c5i')c'6"):

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    9/42

    "51 A+/()0/0+ /,80)8* 0( ;,,:)8

    • CPU

    • ALU

    • IO 9,+0*

    •RAM

    • ROM

    • 2 T)7+*C,80+*

    • G8+ P+9,* +)*0+*

    • S9/) F8/0),8 +)*0+*

    • C+?*0 O*/)0,+*

    • S+) 9,+0*

    • I80++90*

    • PS$

    • P+,+7 C,80+ 

    • S0/ 9,)80+ 

    ,1 A++")77i&! Mo+)7

    A8 @@+**)8 7,@ +;+* 0, (,: ?, + @@+**)8 )8 77,+? ,/0),8. I8

    *77+?> 0( @@+**)8 7,@* + * ;,,:*> :)0( 8 79 ,; /(

    I##)+i') A++")77i&! MOV A>H2"(

    Di")c' A++")77i&! MOV A>3"(I&+i")c' A++")77i&! MOV A>R"

    E$')"&l Di")c' MOVX A>DPTR 

    Co+) I&+i")c' MOVC A>AJDPTR 

    E/( ,; 0(* @@+**)8 7,@* 9+,)@* )79,+080 ;)

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    10/42

    T()* )8*0+/0),8 ** I77@)0 A@@+**)8

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    11/42

    MO8 A9;R 

    T()* )8*0+/0),8 /** 0( "51 0, 8? 0( ,; 0( R" +)*0+. T( "51 :)

    0(8 ,@ 0( //70,+ :)0( 0( ;+,7 I80+8 RAM :()/( )* ;,8@ 0 0(

    @@+** )8@)/0@

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    12/42

    E0+8 77,+? /8 *, 0( ,; R" )* ;)+*0 +@ 8@ 0( ,; 0( A//70,+ )* :+)008 0,

    0(0 @@+** )8 E0+8 RAM. S)8/ 0( ,; R" /8 ,8?

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    13/42

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    14/42

    • T( SMP /,778@> ) 0( /,8@)0),8 /8 ,8? -79 0,

    8 @@+** :)0()8 J 12 I :+,0 9+,+7 0(0 +=)+@ 21""

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    15/42

    T( RET )8*0+/0),8> :(8 /0@> +0+8* 0, 0( @@+** ;,,:)8 0( )8*0+/0),8 0(0

    /@ 0( )8 * )0 +0+8* 0, 0( @@+** 0(0 )* *0,+@ ,8 0(

    *0/.

    T( RET /,778@ )* @)+/0 )8 0( *8* 0(0 )0 :?* /(8* 9+,+7 ;,: :)0(,0

      )0 )* 8/**+? 0, 8@+*08@

    *,7 8@+?)8 )8;,+70),8 /,8/+8)8 0)7)8.

    T( "51 ,9+0* :(8

    8+? )* 99)@> 7)0* 9** 0 ;)@ ;+=8/?. O8 /8 ;)8@ /+?*0* ,; )+0? 8?

    ;+=8/? @98@)8 ,8 0( 99)/0),8 +=)+780*. $(8 *)8 8 "51> 0( 7,*0

    /,77,8 /+?*0 ;+=8/)* + 12 7(+0 8@ 11."5' 7(+0:)0( 11."5'

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    16/42

    E;;/0)?> 0( "51 ,9+0* *)8 :(0 + /@ 7/()8 /?/*. A *)8 7/()8

    /?/ )* 0( 7)8)77 7,80 ,; 0)7 )8 :()/( *)8 "51 )8*0+/0),8 /8 )8 +)0?> 12 9** ,; 0( /+?*0. T(0 )* 0, *?> ); 8 )8*0+/0),8 0* ,8

    7/()8 /?/ 0, /0> )0 :) 0 12 9** ,; 0( /+?*0 0, /0. S)8/ : 8,:

    0( /+?*0 )* 9*)8 11>"5'>""" 0)7* 9+ */,8@ 8@ 0(0 ,8 7/()8 /?/ )* 12

     9**> : /8 //0 (,: 78? )8*0+/0),8 /?/* 0( "51 /8 /0 9+ */,8@

    11>"5'>""" 12 '21>53

    T()* 78* 0(0 0( "51 /8 /0 '21>53 *)8/?/ )8*0+/0),8* 9+ */,8@. S)8/

    + 87 0(,( )8 +)0? )0

    )* **8@> @98@)8 ,8 0( )8*0+/0),8* 8 *0)70 ,; """

    )8*0+/0),8* 9+ */,8@ )* 7,+ +)*0)/.

    F,+ 79> ); ?, + *)8 /*)? 2/?/ )8*0+/0),8* ?, :,@ ;)8@ 0(0 0(

    "51 :,@ /0 46">'1 )8*0+/0),8* 9+ */,8@. T( "51 *, (* 0:, +? *,:

    )8*0+/0),8* 0(0 +=)+ ; 4 /?/* 0, /0); ?, :+ 0, /0 8,0()8 78?

    ,90)7)@ +*),8* ,; 0( "51 /0 )8*0+/0),8* )8 4 ,*/)0,+ /?/* )8*0@ ,; 12

    */( /()9 :,@

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    17/42

    ,1 Ti#)"7

    T( "51 /,7* =)99@ :)0( 0:, 0)7+*> +@>

    8@ /,8;)+@ )8@))@?. T( "51 0)7+* ( 0(+ 8+ ;8/0),8* 1# K9)8

    0)7 8@,+ //0)8 0( 7,80 ,; 0)7 2# C,80)8 0( 80*

    0(7**> ,+ 3# G8+0)8

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    18/42

    T(* ); 0)7+ (* /,80@ ;+,7 " 0, 5">""" ?, 7? //0

    5">""" '21>53 ."542

    ."542 */,8@* ( 9**@. I8 9)8 E8)*(> ,+ ,8

    0:80)0( ,; */,8@.

    O

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    19/42

    T( SFR* +0)8 0, 0)7+* +

    S(R N#) D)7c"i%'io& S(R A++")77

    T%" T)7+ " %)( B?0 C(

    TL" T)7+ " L,: B?0 A(T%1 T)7+ 1 %)( B?0 D(

    TL1 T)7+ 1 L,: B?0 B(

    TCON T)7+ C,80+, (

    TMOD T)7+ M,@ '(

    $(8 ?, 80+ 0( 87 ,; 8 SFR )80, 8 **7 )0 )80+8? /,8+0* )0 0,

    87 0( /,778@

    MOV T%">H25(7,* 0( 25( )80, 0( T%" SFR. %,:+> *)8/ T%" )* 0( *7 * SFR @@+**

    C( 0()* /,778@ )* =)80 0,

    MOV C(>H25(

     N,:> 0’* 0 ?, 7? -*0 0()8 ,; 0()* * 0( ()( 8@ ,:

      :(8 T)7+ " (* ,; ">

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    20/42

    T( ()( ;,+

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    21/42

    $(8 0( 0)7+ )* )8 13 TL :) /,80 ;+,7 " 0, 31. $(8 TL )* )8/+780@

    ;+,7 31> )0 :) +*0 0, " 8@ )8/+780 T%. T(*> ;;/0)?> ,8? 13

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    22/42

    A* ?, /8 *> 0( ,; T%" 8+ /(8@. I8 ;/0> :(8 ?, * 7,@ 2 ?,

    7,*0 :?* *0 T% 0, 8,:8 8@ TL )* 0( SFR 0(0 )* /,8*080?

    )8/+780@.

    $(0’* 0( 0( + T)7+ 1 !).. T%1 8@ TL1# /8 )8 0()* /*> :) @@)0),8?>

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    23/42

    T( TCON SFR (* 0( ;,,:)8 *0+/0+

    TCON !(# SFR

    Bi' N#)Bi'

    A++")77E$%l&'io& o@ (6&c'io& Ti#)"

    TF1 F( Ti#)" 1 O)"@lo

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    24/42

    16H"1(

    T)7+ " )* 8,: )8 16 0( 0)7+ )* 8,0 +88)8. T, *0+0 0( 0)7+ 

    +88)8 : 7*0 *0 0( TR"

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    25/42

    :()/( )* 8,: *0,+@ )8 0( A//70,+)* 0( *7 * 0( /++80 T)7+ " ()(

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    26/42

    9 /0)8 0()* *7 )8*0+/0),8. A;0+ 12"0( ,; */,8@ 0)7+ " :) ,+;,:> *0

    0( TF" 8@ 9+,+7 /0),8 :) 0(8

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    27/42

    NB P1."> I; /+ (*80 +)*@ 0( *)8> 9 :)0)8

    B P1."> T( )8 )* ()( :()/( 78* 0( /+ )* ,8 0( *8*,+ +)(0 8,:

    INC COUNTER T( /+ (* 9**@ /,790?> *, : /,80 )0

    A* ?, /8 *> )0* ,8? 0(+ )8* ,; /,@. B0 :(0 ); ?, 8@ 0, 0( "51 /,80* 1" 0+8*)0),8* ,8 0( P3.4 )8. T()* 78* 0(0 :(8

    /+ ;)+*0 +8* ,+ ,+ *8*,+ )0 :) +)* 0( )890 0, ()( !1# /,8@)0),8. A0 0(0 9,)800( "51 :) 8,0 /,80 8?0()8 *)8/ 0()* )* "1 0+8*)0),8. %,:+> :(8 0( /+ (*

     9**@ 0( *8*,+ :) ;

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    28/42

    T( AT'S52 )* ,:9,:+> ()(9+;,+78/ CMOS

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    29/42

     

    PIN DESCRIPTION

    8CC:S99? ,0.

    GND:

    G+,8@.

    Po"' :

    P,+0 " )* 8

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    30/42

     9@ ()(

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    31/42

    TAL2:

    O090 ;+,7 0( )8+0)8 ,*/)0,+ 79);)+.

      Po"' Pi& Al')"&') (6&c'io&7

      P3."

      P3.1

      P3.2

      P3.3

      P3.4

      P3.5

      P3.6

      P3.

     RXD !*+) )890 9,+0#

     TXD !*+) ,090 9,+0#

     INT" !0+8 )80++90 "#

     INT1 !0+8 )80++90 1#

     T" !0)7+ " 0+8 )890#

     T1 !0)7+ 1 0+8 )890#

     $R !0+8 @0 77,+? :+)0 *0+,

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    32/42

    A c6"")&' '"&7@o"#)"  )* @*)8@ 0, 9+,)@ /++80 )8 )0* */,8@+? :()/( )*

    //+0? 9+,9,+0),8 0, 0( /++80 ;,:)8 )8 )0* 9+)7+?.

    C++80 0+8*;,+7+* + /,77,8? *@ )8 /0+)/)0? 70+*  0, ;/))00 0(

    7*+780 ,; + /++80* :()/( :,@

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    33/42

     Q U8@+:+)0+* L

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    34/42

    +)*0+ @@+**. S )* ;,+7 ,; /0+,8)/

    @)*9? @)/ ;,+ @)*9?)8 @/)7 87+* 0(0 )* 8 0+80) 0, 0( 7,+ /,79

    @,0 70+) @)*9?*.

    S8*780 @)*9?* + :)@? *@ )8 @))0 /,/*> /0+,8)/ 70+*> 8@ ,0(+ 

    /0+,8)/ @)/* ;,+ @)*9?)8 87+)/ )8;,+70),8.

    I8 *)79 LED 9/> 0?9)/? ,; 0( /0(,@* !80) 0+7)8*# ,+ ,; 0(

    8,@* !9,*)0) 0+7)8*# ,; 0( *780 LED* + /,88/0@ 8@ 8@,+ *9/* :(+ 9)8* :,@ ,> )8

    ,+@+ 0, 70/( *08@+@ IC *,/0*. I80+0@ @)*9?* *, )*0> :)0( *)8 ,+ 70)9

    @))0*. S,7 ,; 0(* )80+0@ @)*9?* )8/,+9,+0 0()+ ,:8 )80+8 @/,@+> 0(,(7,*0 @, 8,0 /( )8@))@ LED )*

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    35/42

    -. PCB DESIGN

    D*)8 8@ F 9+,/**

    /,80+,> 0/,778)/0),8* 8@ )8*0+7800),8.

    -.2 MANU(ATCURING:

    T( 78;/0+)8 9+,/** /,8*)*0* ,; 0:, 70(,@* 9+)80 8@ 0/(> 8@ 9+)80> 90 8@

    0/(. T( *)8 *)@@ PCB* + *? 7@ *)8 0( 9+)80 8@ 0/( 70(,@. T(@,

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    36/42

    -. ETCHING:

    O8/ 70)9?+ 0( )7 )

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    37/42

    K) @,9780 0,,* ;,+ 0( "51 M)/+,/,80+,+ A+/()0/0+ *99,+0 +? ,; 

    *,;0:+ @,9+ ;+,7 0( 9+,;**),8 99)/0),8* 8)8+ 0, 0( *0@80 -*0 +8)8

    S)8 8@ E70,+* *99,+0 "51 @+)0)* 8@ (9 ?,

    0 ?,+ 9+,-/0* /,790@ ,8 */(@. T( K) "51 D,9780 T,,* + @*)8@ 0,

    *, 0( /,79 9+, 8@ 77,+? ,90),8*

    ;,+ ?,.

     N7+,* 79 9+,+7* + )8/@@ 0, (9 ?, 0 *0+0@ :)0( 0( 7,*0 9,9+ 

    7 ?, /8 :+)0 8@ 0*0 99)/0),8*

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    38/42

    S09

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    39/42

    3. M,)8 V 0(0 )* 0,, + )80, +)*0+ :) /* ++,+.

    MOV A> HF2% F2%

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    40/42

    1. F)+*0 : * 8 @)0,+ 0, 0?9 )8 9+,+7. M8? /80 @)0,+* + )

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    41/42

    99+* )8 0( 9+,+7 )0* /,8*080 :) 0( 9+,+77+ /8 /(8 )0* ,8/ 8@ 0( **7 +0(+ 0(8 *+/( 0( 80)+ 9+,+7 0+?)8 0, ;)8@

    +? ,//++8/.

    END +i")c'i):

    T()* )8@)/0* 0, 0( **7 7,

  • 8/18/2019 Automatic Street Light Control by Using Rtc Microcontroller

    42/42

    13. Bilio!"%5*:

    ]1^ V.K.M(0 8@ R,()0 M(0> ZP+)8/)9* ,; P,:+ S?*07[> 40( @> S. C(8@

     9 2"".

    ]2^ A*(;= %*)8> ZE/0+)/ P,:+ S?*07[> 50( @> CBS P ZT/(8)/ ,** //0),8