+ All Categories
Home > Documents > 60888878 Report Prepaid Energy Meter

60888878 Report Prepaid Energy Meter

Date post: 07-Jul-2018
Category:
Upload: himanshu-sharma
View: 225 times
Download: 0 times
Share this document with a friend

of 93

Transcript
  • 8/18/2019 60888878 Report Prepaid Energy Meter

    1/93

    CHAPTER – 1

    INTRODUCTION

     

    1.1OVERVIEW OF THE PROJECT

    Prepaid energy meter is an advantageous concept for the future. This advancing

    technology overheads the conventional digital meters at home. Its facilitates the

    exemption from electricity bills. Electricity coupons will be available at nearby shops.

    Maximum units to be used is programmed. This data is given to IC 8!". 8!" is

    connected to digital energy meter. 8!" is programmed to decrement the maximum units

    as a response to the info from the digital energy meter. #u$$er is used to warn the user.

    %hen maximum use is made& relay will cut off and controller have to be reset.

     

    "

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    2/93

    CHAPTER 2

    LITERATURE REVIEW

     

    2.1 EMBEDDED SYSTEMS 

    Embedded system is a combination of hardware and software design to meet a specific

    need with performance in a given time frame. Embedded system is a subsystem which we

    can embed with a big system to enhance the functionality of the big system. 'or example

     printers and mouse con be considered as the embedded systems of the computer.

    (n embedded controller is a controller or computer that is embedded into some devicefor some purpose other than to provide general purpose computing.

    Each day& our lives become more dependent on )embedded systems)& digital information

    technology that is embedded in our environment. This includes not only safety*critical

    applications such as automotive devices and controls& railways& aircraft& aerospace and

    medical devices& but also communications& )mobile worlds) and )e*worlds)& the )smart)

    home& clothes& factories etc. (ll of these have wide*ranging impacts on society& including

    security& privacy and modes of wor+ing and living. More than ,8- of processors applied

    today are in embedded systems& and are no longer visible to the customer as )computers)

    in the ordinary sense. ew processors and methods of processing& sensors& actuators&

    communications and infrastructures are )enablers) for this very pervasive computing.

    They are in a sense ubi/uitous& that is& almost invisible to the user and almost

    omnipresent. (s such& they form the basis for a significant economic push. These

    applications are )vision driven)& as in the following examples0

    • (utomotive0 (ccident free driving

    • (erospace0 ( free& safe s+y for all

    • Medical 1evices0 2obotic surgeon

    • Communications0 3eamless connectivity

    4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    3/93

    • e*5ife0 ubi/uitous6pervasive computing

    2.2 INRTODUCTION TO MICROCONTROLLERS

    Microcontroller is a general purpose device meant to read data& to perform limitedcalculations on that data and to control its environment based on those calculations. The

     prime use of a microcontroller is to control the operation of a machine using a fixed

     program that is stored in 27M and that does not change over the lifetime of the system.

    Microcontroller is a true computer on a chip. It incorporates all the features found in a

    microprocessor li+e CP& (5& PC& 3P and registers. It also has additional features

    needed to ma+e a complete computer li+e 27M& 2(M& parallel input*output& serial input*

    output& counters and a cloc+ circuit.

    ( microcontroller 9often abbreviated MC: is a single computer chip 9integrated circuit:

    that executes a user program& normally for the purpose of controlling some device hence

    named as microcontroller.

    The program is normally contained either in a second chip& called an EP27M& or within

    the same chip as the microcontroller itself. ( microcontroller is normally found in devices

    such as microwave ovens& automobiles& +eyboards& C1 players& cell phones& ;C2s&

    security systems& time < attendance cloc+s& etc.

     Microcontroller*based systems are generally smaller& more reliable& and cheaper. They

    are ideal for the types of applications described above where cost and unit si$e are very

    important considerations. In such applications it is almost always desirable to produce

    circuits that re/uire the smallest number of integrated circuits& that re/uire the smallest

    amount of physical space& re/uire the least amount of energy& and cost as little as

     possible.

    Microcontrollers are hidden inside a surprising number of products these days. If your 

    microwave oven has an 5E1 or 5C1 screen and a +eypad& it contains a microcontroller.

    =

    http://computer.howstuffworks.com/led.htmhttp://computer.howstuffworks.com/lcd.htmhttp://computer.howstuffworks.com/led.htmhttp://computer.howstuffworks.com/lcd.htm

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    4/93

    (ll modern automobiles contain at least one microcontroller& and can have as many as six

    or seven. The engine is controlled by a microcontroller& as are the anti*loc+ bra+es& the

    cruise control and so on. (ny device that has a remote control almost certainly contains a

    microcontroller0 T;s& ;C2s  and high*end stereo systems all fall into this category.

    1igital cameras& cell phones& answering machines&  laser printers& telephones 9the ones

    with caller I1& 4*number memory& etc.:& pagers& and refrigerators& dishwashers& washers

    and dryers 9the ones with displays and +eypads:. #asically& any product or device that

    interacts with its user has a microcontroller buried inside.

    2.2.1 FEATUES OF MICROCONTROLLERS

    ". Perform a single set of functions.

    4. %or+s in a time constrained environment.

    =. Provides high*performance and reliability.

    >. Mostly Embedded systems have low cost because they are mass produced in millions.

    !. 3ome Embedded systems have mechanical moving parts li+e dis+ drives as they are

    less reliable as compared to solid state parts such as 'lash memory.

    ?. @igh Integration of 'unctionality.

    A. Microcontrollers sometimes are called single*chip computers because they have on*

    chip memory and I67 circuitry and other circuitries that enable them to function as small

    standalone computers without other supporting circuitry.

    8. 'ield Programmability& 'lexibility.

    ,. Microcontrollers often use EEP27M or EP27M as their storage device to allow field

     programmability so they are flexible to use. 7nce the program is tested to be correct then

    large /uantities of microcontrollers can be programmed to be used in embedded systems.

    >

    http://computer.howstuffworks.com/engine.htmhttp://computer.howstuffworks.com/anti-lock-brake.htmhttp://computer.howstuffworks.com/cruise-control.htmhttp://computer.howstuffworks.com/tv.htmhttp://computer.howstuffworks.com/vcr.htmhttp://computer.howstuffworks.com/digital-camera.htmhttp://computer.howstuffworks.com/cell-phone.htmhttp://computer.howstuffworks.com/question21.htmhttp://computer.howstuffworks.com/laser-printer.htmhttp://computer.howstuffworks.com/telephone.htmhttp://computer.howstuffworks.com/refrigerator.htmhttp://computer.howstuffworks.com/washer.htmhttp://computer.howstuffworks.com/dryer.htmhttp://computer.howstuffworks.com/engine.htmhttp://computer.howstuffworks.com/anti-lock-brake.htmhttp://computer.howstuffworks.com/cruise-control.htmhttp://computer.howstuffworks.com/tv.htmhttp://computer.howstuffworks.com/vcr.htmhttp://computer.howstuffworks.com/digital-camera.htmhttp://computer.howstuffworks.com/cell-phone.htmhttp://computer.howstuffworks.com/question21.htmhttp://computer.howstuffworks.com/laser-printer.htmhttp://computer.howstuffworks.com/telephone.htmhttp://computer.howstuffworks.com/refrigerator.htmhttp://computer.howstuffworks.com/washer.htmhttp://computer.howstuffworks.com/dryer.htm

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    5/93

    ". Easy to se0 (ssembly language is often used in microcontrollers and since they

    usually follow 2I3C architecture& the instruction set is small. The development pac+age

    of microcontrollers often includes an assembler& a simulator& a programmer to BburnB the

    chip and a demonstration board. 3ome pac+ages include a high level language compiler 

    such as a C compiler and more sophisticated libraries.

    "". Eight bit CP with registers ( and #.

    "4. 3ixteen bit program counter and data pointer.

    "=. Eight bit program status word.

    ">. Eight bit stac+ pointer.

    "!. Internal 27M of >.

    "?. Internal 2(M of "48 bytes0 'our register ban+s& each containing eight registers.

    3ixteen bytes& which may be addressed at bit level. Eighty bytes of general*purpose data

    memory.

    "A. Thirty two input6output pins arranged as four 8*bit ports0 P*P=.

    "8. Two "?*bit timer6counters0 T and T".

    ",. 'ull duplex serial data receiver6transmitter0 3#'.

    4. Control register0 TC7& TM71& 3C7& PC7& IP.

    4". Two external and three internal interrupt sources.

    44. 7scillator and cloc+ circuits.

    !

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    6/93

    2.2.2 TYPES OF MICROCONTROLLERS

    ( micro controller can be of four types0*

    ": > D #it Micro controller.4: 8 D #it Micro controller 

    =: "? D #it Micro controller 

    >: =4 D #it Micro controller 

    4 – BIT MICRO CONTROLLER:-

    They are the most popular micro controller in terms of production numbers

    They are economical.

    (pplications0 (ppliances and toys.

    8 – BIT MICRO CONTROLLER:-

    2epresent a transition $one between dedicated& high*volume& >*bit micro*

    controllers and the high performance "? bit microcontrollers

    (pplication0 simple appliance control& high*speed machine control& data

    collection

    16 – BIT MICRO CONTROLLER:

    Provides faster response and more sophisticated calculation.

    (pplications0 They have their application mostly in 2obotics.

    2 – BIT MICRO CONTROLLER:

    In these micro controllers basically the emphasis is on the high speed computation

    features

    (pplication0 These types have application in 2obotics& @ighly intelligent

    instrumentation system& telecommunication& automobiles etc.

    ?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    7/93

    2.2. BLOC! DIA"RAM OF MICROCONROLLERS

    The figure below shows the bloc+ diagram of Microcontrollers0*

     F#$ 2.1 B%&'( D#)$*)+ &, 81

    The bloc+ diagram of microcontroller basically explains0

    " ITE22PT C7T2750 *  The interrupt control basically handles the

    interrupts whether they should be handled or not. 'or the same purpose two

    registers of 8*bits are present i.e. IP and IE i.e. interrupt priority and interrupt

    enable.

    4 7 C@IP '5(3@0 - 'lash memory is present on the chip.

    = 7 C@IP 2(M0 - 2(M is also present on the chip.

    > TIME230 * Timer control registers of 8 bits are also present on the chip. The

    counter input is given to the timers.

    A

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    8/93

    ! 3E2I(5 P72T30 * the serial ports are also present on chip which allows the

    microcontroller to communicate serially.

    ? I67 P72T30 * the I67 ports basically provides the input and output ports. These

    are present on the chip of microcontroller itself. They are of 8 bits. There is no

    re/uirement for providing the external interface. #asically there are > ports i.e.

     port & port "& port 4 and port =. P72T provides both data and addresses along

    with I67 pins. P72T " provides only I67 pins. P72T 4 provides I67 pins and the

    remaining addresses. P72T = provides I67 pins and

    %2&21&T&T"&IT&IT"&21&T1

    A #3 C7T2750 * The control registers are present i.e. TC7& TM71&

    3C7& PC7& IP& IE.

    8 73CI55(T72 0 *( particular fre/uency is provided i.e. "".!,4 M@$ by a

    crystal oscillator.

    2.2.4 PIN DIA"RAM OF 81

    PIN DESCRIPTION8!" is a > pin IC pac+ed in 1IP 91ual line pac+aging:. This means that the pin

     performs the dual functions. #asically 8!" is a > pin IC but it performs ?> functions.

    This is due to the reason that 4> pins are multiplexed pins. 3o these pins perform dual

    functions and ma+e it a total of ?> functions.

    ". ;CC0  * PI 9>: * This pin is used to supply voltage to the micro controller.

    Fenerally G!; is provided to microcontroller.

    4. F10 * PI 94: * This pin is used for ground.

    8

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    9/93

    81

    MICRO

    CONTROLLER 

    "

    4

    =>

    !

    ?

    A

    8

    ,

    "

    ""

    "4

    "=

    ">

    "!

    "?

    "A

    "8

    ",

    4

    >

    =,

    =8=A

    =?

    =!

    =>

    ==

    =4

    ="

    =

    4,

    48

    4A

    4?

    4!

    4>

    4=

    44

    4"

      P".

      P"."

      P".4  P".=

      P".>

      P".!

      P".?

      P".A

      23T

      9 21 : P=.

      9T1: P=."

      9IT : P=.4

      9IT": P=.=

      9T: P=.>

      9T": P=.!

      9%2: P=.?

      921: P=.A

      T(54

    T(5"

      F1

    ;CC

    P.A 9(1:

    P.? 9(1":P.! 9(14:

    P.> 9(1=:

    P.= 9(1>:

    P.4 9(1!:

    P." 9(1?:

    P. 9(1A:

      E(H;PP

    (5E

    P3E

      P4.A 9("!:

    P4.? 9(">:

      P4.! 9("=:

    P4.> 9("4:

      P4.= 9("":

      P4.4 9(":

    P4." 9(,:

    P4. 9(8:

      F#$ 2.2 P#/ D#)$*)+ &, 81

    =. 23T0 * 9PI ,: It is a 2eset Input. %hen this pin is given a high for the two

    continuous machine cycles while the oscillator is running& the device gets resets.

    ,

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    10/93

    >. (5E0 * 9PI =:0 * It is an (ddress latch enable. %ith the bit set the (5E is

    enabled during the M7; or M7;C instruction.

    !. P3E  0 * 9PI 4,:0 * Program 3tore Enabled is the read strobe to external

     program memory. %hen the (T8,C!" is executing code from external memory&

    This pin is activated during each machine cycle& except that two activation are

    s+ipped during each access to external data memory.

    ?. P72T  0*9 PI3 =4*=, i.e. P.*P.A: Port is an 8 D bit bi*directional I67 port.

    %hen "s are written to the pins then port acts as high impedance inputs. Port

    may also be configured to be the multiplexed address6data bus 9i.e. (1*(1A:

    during accesses to external program and data memory.

    A. P72T "0* Port " is an 8 bit bi*directional I67 port with internal pull*ups.

    %hen "s are written to the port " pins they are pulled high by the internal pull*

    ups and can be used as inputs. (s inputs& Port " pins that are externally being

     pulled low will source current because of internal pull*ups. Port " also receives

    the low order addresses bytes during 'lash programming and verification.

      8. P72T 40* Port 4 is an 8 bit bi*directional I67 port with internal pull*ups. %hen

    "s are written to Port 4 pins they are pulled high by the internal pull ups and can

     be used as inputs. (s inputs& Port 4 pins that are externally being pulled low will

    source current because of internal pull ups. Port 4 emits the high order addresses

     byte during fetches from external program memory and during accesses to

    external program memory& data memory that use "?bit addresses. In this

    application& this uses strong internal pull*ups when emitting "s.

    "

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    11/93

    ,. P72T =0* 9PI3 "*"A i.e. P=.*P=.A: Port = is an 8*bit bi*directional I67 port.

    3o along with providing the I67 various other operations are also performed. In

    this each pin performs the different operations. They are explained as0

    T)0% 2.1 P&* P#/3 )/ A%*/) F5/'#&/3

    P72T PI3

     

    (5TE2(TE 'CTI73

    P=. 21 9 serial input port:* This is used in serial communication at

    receivers sideP=." T1 9serial output port:* This is used in serial communication at

    transmitters side

    P=.4 IT 9external interrupt : * This pin is used for providing the interrupts.

    P=.= IT" 9external interrupt ": * This pin is used for providing the interrupts.

    P=.> T 9timer external input: * This pin is used for providing the timers.

    P=.! T" 9timer " external input: * This pin is used for providing the timers.

    P=.? %2 9external data memory write strobe: * This pin is used when we have

    to perform a write operation

    P=.A 21 9external data memory read strobe: * This pin is used when we have to

     perform a write operation.

    ". E( 6 ;PP 0 * 9PI =":0 * External access enabled. E( must be strapped to ground

    in order to enable the device to fetch code from external program memory location

    starting at @ to ''''@. E( should be strapped to ;CC for internal program

    execution. This pin also receives the "4 *;olt programming enabled voltage during

    'lash Programming& for parts that re/uire "4*volt ;PP. %here ;PP is a pea+ to

     pea+ voltage.

    "".T(5"& T(5 4  0 * 9PI3 "8*",:0 * These pins are connected with a crystal

    oscillator which provides a fre/uency of "".!,4 M@$ to a microcontroller. %ith an

    ""

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    12/93

    oscillator two capacitors are connected. The oscillator so formed by crystal&

    capacitors generates a pulse train at the fre/uency of crystal.

    2.2. CRYSTAL OSCILLATORS CONNECTION

    F#$ 2. C*73)% O3'#%%)&* C&//'#&/

    The heart of 8!" is a circuitry that generates the cloc+ pulses by which all internal

    operations are synchroni$ed. Pins T(5" and T(54 are provided for connecting a

    resonant networ+ to form an oscillator. The crystal oscillator is the basic internal cloc+ 

    fre/uency of microcontroller. The typical maximum fre/uency is "? M@$ and the lowest

    is " M@$.

    The oscillator so formed by the crystal and the two capacitors generates a pulse train at

    the fre/uency of crystal. The smallest interval of time to accomplish any simple

    instruction or a part of complex instruction is a M(C@IE CJC5E. It is itself made up

    of ? states. ( state is a basic time interval for discrete operation such as fetching anopcode byte& decoding an opcode& executing an opcode or writing a data byte. Two

    oscillator pulses define each state. Program instructions may re/uire "& 4& > machine

    cycle to be executed depending upon the type of instruction. Instructions are fetched and

    executed by the microcontroller automatically beginning with the instruction located at

    "4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    13/93

    27M memory address h at the time the microcontroller is first reset. Fenerally we

    use a fre/uency of "".!,4 M@$.

    2.2.6 MEMORY OR"ANISATION

    The diagram showing the organi$ation of memory in a microcontroller is as follows0

    The8!" microcontroller actually includes a whole family of microcontrollers that have

    numbers ranging from 8=" to 8A!" and are available in M73 and CM73

    constructions in a variety of pac+age types. The 8!" has internal 2(M and 27M.

    Memory for variable data can be altered as the program runs.

    "=

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    14/93

    F#$ 2.4 M+&*7 O*$)/#)#&/

    ">

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    15/93

    ITE2(5 2(M

    The "48*byte internal 2(M is organi$ed into three distinct areas0

    • Thirty*two bytes from address h to "'h that ma+e up =4 wor+ing registers

    organi$ed as four ban+s of eight registers each.

    • ( bit addressable area of "? bytes occupies 2(M byte addresses 4h to 4'h forming

    a total of "48 addressable bits.

    • ( general purpose 2(M area above the bit area& from =h to A'h& addressable as

     bytes.

    ITE2(5 27M

    In 8!"& data memory and program code memory are two different entities. Internal

    27M occupies code addresses h to '''h. If program address exceeds '''h then

    8!" automatically fetches code from external program memory. Code bytes could also

     be fetched exclusively from external memory h to ''''h by connecting the E( pin

    to the ground.

    MEM72J EP(1IF

    In case the built*in amount of memory 9either 2(M or 27M: is not sufficient for the

    needs& there is always an option of adding two external ?># memory chips. %hen

    added& they are addressed and accessed via I67 ports P4 and P=. 'rom user)s point of 

    view it)s all very simple& because if properly connected most of the Kob is carried out

    automatically by MC. 8!" MC has two separate read signals& 21 #(2 and P3E

    #(2. The first one is active in case of reading byte from the external data memory

    92(M:& and the second one is active in case of reading byte from the external program

    memory 927M:.#oth signals are active on low logical level. ( typical scheme for such

    an expansion using separate chips for 2(M&27M is +nown as  Harvard architecture.

    Memory can also be mapped as a single bloc+ functioning as both data memory and

     program memory simultaneously 9only one memory chip is used:. This approach is

    +nown as Von Neumann architecture. To be able to read the same bloc+ using 21 #(2 

    "!

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    16/93

    or P3E #(2& these two signals were combined via logical (1. In this way& output of 

    (1 circuit is low if any of the two inputs is low. sing the @arvard architecture

    effectively doubles MC memory& but that)s not the only advantage offered by the

    method.

    2.2.9 81 RE"ISTERS

      8!" Microcontrollers have 4 types of registers*

     FEE2(5 P2P73E 2EFI3TE23

    ": 2egisters 92 D 2A:0*  It is the set 8 auxiliary registers namely 2& 2"...2A.

    There are > such ban+s in lower 2(M.

    4: 1ata Pointer 91PT2:0* It is made of "?*bit register further composed pf two 8

     D bit registers& namely 1P@ and 1P5 used to furnish memory addresses for internal

    and external code access and external data access.

    1PT2 

    1P@  1P5

    =: Program Counter 9PC:0* It is a "? D bit register and it hold the address of the

    next program instruction to be executed and automatically gets incremented after 

    each instruction is fetched.

    "?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    17/93

    >: 3tac+ Pointer 93P:0* It is an 8 D bit register and is used to hold an internal

     2(M address called the Top of the 3tac+. (s the data is pushed in the stac+& firstly

    the pointer is incremented and then data is pushed and when the data is to be popped

    off then firstly the data is popped off and then stac+ pointer gets decremented.

    2.2.8 SPECIAL PURPOSE RE"ISTERS

    The 8!" operations that do not use the internal "48*byte 2am addresses from h to A'h

    are done by a group of specific internal register& each called a special function register

    93'2:.

    T)0% 2.2 S'#)% F5/'#&/ R$#3*3

     

    "A

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    18/93

    ": (CCM5(T72 0 * It is an 8 D bit register and used as wor+ing register 

    for the (rithmetic& 5ogical instructions. (ll the calculations are performed using this

    register. It can also be used as Feneral purpose register. It is very necessary for some

    instructions. It is denoted by (.

    4: # D 2EFI3TE2 0 * It also an 8 D bit register and can be used as Feneral

    Purpose register. It is very necessary for the multiplication and division operations

    without it the operations are not accomplished.

    =: P3%0 P27F2(M 3T(T3 %721 9bit (ddressable:0*

    T)0% 2. PSW

    CJ (C ' 23" 23 7; ********* P

    CJ P3%.A carry flag

    (C P3%.? auxiliary carry flag

    ' P3%.! flag available to the user for general purpose.

    23" P3%.> 2egister #an+ selector bit ".

    23 P3%.= 2egister #an+ selector bit .

    7; P3%.4 7verflow 'lag

    *** P3%." ser definable flag.

    P P3%. Parity 'lag.

    The following table shows the different combinations of 23 and 23"0 *

      T)0% 2.4 R$#3* B)/( S%'

    23" 23 2egister #an+ (ddress

    h * Ah " " 8h * 'h" 4 "h * "Ah" " = "8h * "'h

    The above table shows that 23 and 23" are responsible for selecting the particular

    2egister ban+ i.e. by using the different combinations of 23 and 23" the 2egister 

    "8

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    19/93

    #an+s are selected.

     

    >: TIME2 M71E 2EFI3TE23

    (TE C6T M" M F(TE C6T M" M

    T)0% 2. TMOD

    Modes 0 *The Timer Counter function is selected by the control bits C6T in the 3pecial

    function register TM71. These two timers have four operating modes selected by the bit

     pairs 9M"& M: in TM71.

    F(TE 0 * Fating control when set. Timer6Counter x is enabled only while IT pin is

    high and T2 control pin is set. %hen cleared& Timer x is enabled whenever T2x control

     bit is set.

    C6T0 * Timer or Counter selector 0 * %hen the Timer operation is to be performed

    then it gets reset and gets set for Counter operation.

    !: TC70 TIME2 C7T275 2EFI3TE2 

    T)0% 2.6 TCON

    T'" T2 " T' T2 IE" IT" IE IT

      T'"& T'0* These are the 7ver flow flags for timer " and timer .

    T2"& T20* It runs the control bits from Timer " and Timer . 3et to run reset to

    hold.

    ",

    TIMER 1 TIMER

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    20/93

    IE"& IE0*It is the Edge flag for the external interrupts " and . It is set by the

    interrupt edge and cleared when the interrupt is processed. These are not related to

    counter6timer operation.

    IT"& IT0* It is a type bit for external interrupts and gets set for falling edge

    interrupts and reset for level interrupts. These are also not related to counter6timer 

    operation.

    ?: 3C70 3E2I(5 C7T275 2EFI3TE2 

    This register is an 8*bit register and is used to control the various pins which are

    responsible for transmitting and receiving the data i.e. for the serial transmission.

      A: 3#'0 3E2I(5 #''E2 

    The serial port is full duplex i.e. it can transmit and receive simultaneously. It can

    also receive buffer which means that it can begin receiving a second byte before

    the previously received byte has been read from the receive register. The serial

     port receive and transmit registers are both accessed by the 3pecial 'unction

    2egister 3#' i.e. 3E2I(5 #''E2. %riting to the 3#' register loads the

    transmit register& and reading. 3#' accesses a physically separate receive

    register.

      8: IE 0 ITE22PT E(#5E1

    T)0% 2.9 IE

    E( ***** **** E3 ET" E" ET E

     

    E( 0 * Flobal Interrupt 2egister.

    E3 0 * 3erial interface

    ET" 0 * Timer "

    E" 0 * External interrupts "

    4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    21/93

    ET 0 * Timer

    E 0 * External interrupts

    ** 1isabled

    " D Enabled

    %henever the timer and external interrupt is to be enabled then E" and ET" is used and

    whenever the timer and external interrupt is to be disabled then E and ET is used  

    ,: IP 0 ITE22PT P2I72ITJ 2EFI3TE2 

    T)0% 2.8 IP

      P3 0*3erial Interface

    PT" 0*Timer "

    P" 0*External Interrupt "

    PT 0*Timer

    P 0*External Interrupt

      * 5ow Priority

      "* @igh Priority

    The interrupt priority registers basically provides the priority to the interrupts that

    which interrupt will be served first. %henever the interrupt of low priority is

    served then PT and P are made high and when the interrupt of high priority is

    served then PT" and P" are made high

      ": PC70 P7%E2 C7T275 2EFI3TE2 

    PC7 is not bit addressable. It is also a special function register.

    **** ***** **** P3 PT" P" PT P

    4"

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    22/93

    3M71 ***** ****** ***** F'" F' P1 I15

    T)0% 2.; PCON

      P1 9P7%E2 17% 7PE2(TI7: 0 *

    This power down operation performs the various operations which are as below0*

    3etting P1 bit stops the oscillator 

    2am contents are saved

    Exit via 2eset

    3ome 9newer: 8!" derivatives allow power down wa+e up via Interrupt

    I15 9I15E M71E 7PE2(TI7: 0*

    The idle mode operation also performs the various operations which are as below0*

    3etting I15 Fates cloc+s off& leaves the oscillator running.

    (ll registers and 2(M contents are saved.

    F' (1 F'" 0 * These are general purpose software flags. These can be set or 

    reset according to the programmers wish.

    3M71 93E2I(5 #(1 2(TE M71I'J #IT: 0   * It is set to " by the

     programmer to double the baud rate using the timer " for modes "& 4& =. It is cleared

    to by program to use timer " baud rate.

    2.2.; APPLICATIONS OF MICROCONTROLLERS

    1. Telecom0 * Mobile phone systems 9handsets and base stations:& Modems&

    44

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    23/93

    2outers.

    2. (utomotive applications0* #ra+ing systems& Traction control& (irbag release

    systems& Engine*management units& 3teer*by*wire systems& Cruise control

    applications.

    . 1omestic appliances0* 1ishwashers& Televisions& %ashing machines&

    Microwave ovens& ;ideo recorders& 3ecurity systems& Farage door controllers&

    Calculators& 1igital watches& ;C2s& 1igital cameras& 2emote controls&

    Treadmills.

    4. 2obotic0* 'ire fighting robot& (utomatic floor cleaner& 2obotic arm.

    . (erospace applications0* 'light control systems& Engine controllers&

    (utopilots& Passenger in*flight entertainment systems.

    6. Medical e/uipment0* (n aesthesia monitoring systems& ECF monitors&

    Pacema+ers& 1rug delivery systems& M2I scanners.9. 1efence systems0* 2adar systems& 'ighter aircraft flight control systems& 2adio

    systems& Missile guidance systems.

    8. 7ffice (utomation0* 5aser printers& 'ax machines& Pagers& Cash registers& Fas

     pumps& Credit61ebit card readers& Thermostats& Frain analy$ers.

    2. DIODE

    In electronics& a diode is a two*terminal device 9 thermionic diodes may also have one or 

    two ancillary terminals for a heater:.

    4=

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    24/93

    1iodes have two active electrodes between which the signal of interest may flow& and

    most are used for their unidirectional electric current property. The varicap diode is used

    as an electrically adKustable capacitor.

    The directionality of current flow most diodes exhibit is sometimes generically called the

    rectifying property. The most common function of a diode is to allow an electric current

    to pass in one direction 9called the forward biased condition: and to bloc+ the current in

    the opposite direction 9the reverse biased condition:. Thus& the diode can be thought of as

    an electronic version of a chec+ valve.

     

    F#$ 2. V)*#&53 73 &, #&3

    2eal diodes do not display such a perfect on*off directionality but have a more complex

    non*linear electrical characteristic& which depends on the particular type of diode

    technology. 1iodes also have many other functions in which they are not designed to

    operate in this on*off manner.

    4>

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    25/93

    S+#'&/5'&* #&3

    Most modern diodes are based on semiconductor p*n Kunctions. In a p*n diode&

    conventional current can flow from the p*type side 9the anode: to the n*type side 9the

    cathode:& but cannot flow in the opposite direction. (nother type of semiconductor diode&

    the 3chott+y diode& is formed from the contact between a metal and a semiconductor

    rather than by a p*n Kunction.

    C5**/–

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    26/93

    F#$. 2.6 V-I C=)*)'*#3#'3 &, P-N J5/'#&/ D#&

    @owever& the depletion width cannot grow without limit. 'or each electron*hole pair that

    recombines& a positively*charged dopant ion is left behind in the *doped region& and a

    negatively charged dopant ion is left behind in the P*doped region. (s recombination

     proceeds and more ions are created& an increasing electric field develops through the

    depletion $one which acts to slow and then finally stop recombination. (t this point& there

    is a Bbuilt*inB potential across the depletion $one.

    If an external voltage is placed across the diode with the same polarity as the built*in

     potential& the depletion $one continues to act as an insulator& preventing any significant

    electric current flow. This is the reverse bias phenomenon. @owever& if the polarity of the

    external voltage opposes the built*in potential& recombination can once again proceed&

    resulting in substantial electric current through the p*n Kunction. 'or silicon diodes& the

     built*in potential is approximately .? ;. Thus& if an external current is passed through the

    diode& about .? ; will be developed across the diode such that the P*doped region is

     positive with respect to the *doped region and the diode is said to be Bturned onB as it

    has a forward bias.

     

    ( diodes ID; characteristic can be approximated by four regions of operation 9see the

    figure at right:.

    4?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    27/93

    (t very large reverse bias& beyond the pea+ inverse voltage or PI;& a process called

    reverse brea+down occurs which causes a large increase in current that usually damages

    the device permanently. The avalanche diode is deliberately designed for use in the

    avalanche region. In the $ener diode& the concept of PI; is not applicable. ( $ener diode

    contains a heavily doped p*n Kunction allowing electrons to tunnel from the valence band

    of the p*type material to the conduction band of the n*type material& such that the reverse

    voltage is BclampedB to a +nown value 9called the $ener voltage:& and avalanche does not

    occur. #oth devices& however& do have a limit to the maximum current and power in the

    clamped reverse voltage region. (lso& following the end of forward conduction in any

    diode& there is reverse current for a short time. The device does not attain its full bloc+ing

    capability until the reverse current ceases.

    The second region& at reverse biases more positive than the PI;& has only a very small

    reverse saturation current. In the reverse bias region for a normal P* rectifier diode& the

    current through the device is very low 9in the L( range:.

    The third region is forward but small bias& where only a small forward current is

    conducted.

    (s the potential difference is increased above an arbitrarily defined Bcut*in voltageB or 

    Bon*voltageB or Bdiode forward voltage drop 9;d:B& the diode current becomes

    appreciable 9the level of current considered BappreciableB and the value of cut*in voltage

    depends on the application:& and the diode presents a very low resistance.

    T73 &, 3+#'&/5'&* #&

    4A

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    28/93

    There are several types of Kunction diodes& which either emphasi$e a different physical

    aspect of a diode often by geometric scaling& doping level& choosing the right electrodes&

    are Kust an application of a diode in a special circuit& or are really different devices li+e

    the Funn and laser diode and the M73'ET0

     

    F#$. 2.9 S7+0&% &, D#&

     ormal 9p*n: diodes& which operate as described above& are usually made of doped

    silicon or& more rarely& germanium. #efore the development of modern silicon power 

    rectifier diodes& cuprous oxide and later selenium was used its low efficiency gave it a

    much higher forward voltage drop 9typically ".>D".A ; per NcellO& with multiple cells

    stac+ed to increase the pea+ inverse voltage rating in high voltage rectifiers:& and re/uired

    a large heat sin+ 9often an extension of the diodes metal substrate:& much larger than a

    silicon diode of the same current ratings would re/uire. The vast maKority of all diodes

    are the p*n diodes found in CM73 integrated circuits& which include two diodes per pin

    and many other internal diodes.

    A

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    29/93

    These have a region of operation showing negative resistance caused by /uantum

    tunneling& thus allowing amplification of signals and very simple bistable circuits. These

    diodes are also the type most resistant to nuclear radiation.

    F#$. 2.8 S7+0&% &, T5//% D#&

    "5// #&3

    These are similar to tunnel diodes in that they are made of materials such as Fa(s or InP

    that exhibit a region of negative differential resistance. %ith appropriate biasing& dipole

    domains form and travel across the diode& allowing high fre/uency microwave oscillators

    to be built

    L#$=-+##/$ #&3 >LED3?

    In a diode formed from a direct band*gap semiconductor& such as gallium arsenide&

    carriers that cross the Kunction emit photons when they recombine with the maKority

    carrier on the other side. 1epending on the material& wavelengths 9or colors: from the

    infrared to the near ultraviolet may be produced.

    F#$. 2.; S7+0&% &, LED

    L)3* #&3

    %hen an 5E1*li+e structure is contained in a resonant cavity formed by polishing the

     parallel end faces& a laser can be formed. 5aser diodes are commonly used in optical

    storage devices and for high speed optical communication.

    P=&&#&3

    4,

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    30/93

    (ll semiconductors are subKect to optical charge carrier generation. This is typically an

    undesired effect& so most semiconductors are pac+aged in light bloc+ing material.

    Photodiodes are intended to sense light9photodetector:& so they are pac+aged in materials

    that allow light to pass& and are usually PI 9the +ind of diode most sensitive to light:.

    F#$. 2.1 S7+0&% &, P=&& #&

    V)*)'&* #&3

    These are used as voltage*controlled capacitors. These are important in P55 9phase*

    loc+ed loop: and '55 9fre/uency*loc+ed loop: circuits& allowing tuning circuits& such as

    those in television receivers& to loc+ /uic+ly& replacing older designs that too+ a long time

    to warm up and loc+.

    F#$. 2.11 S7+0&% &, V)*)'&* #&

    @/* #&3

    1iodes that can be made to conduct bac+wards. This effect& called ener brea+down&

    occurs at a precisely defined voltage& allowing the diode to be used as a precision voltage

    reference. In practical voltage reference circuits ener and switching diodes are

    connected in series and opposite directions to balance the temperature coefficient to near 

    $ero.

    =

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    31/93

    F#$. 2.12 S7+0&% &, @/* #&

    2.4 CAPACITOR 

    ( capacitor is a passive electrical component that can store energy in the electric field

     between a pair of conductors 9called BplatesB:. The process of storing energy in the

    capacitor is +nown as BchargingB& and involves electric charges of e/ual magnitude& but

    opposite polarity& building up on each plate. ( capacitor)s ability to store charge is

    measured by its capacitance& in units of farads.

    Capacitors are often used in electric and electronic circuits as energy*storage devices.

    They can also be used to differentiate between high*fre/uency and low*fre/uency signals.

    This property ma+es them useful in electronic filters. Practical capacitors have series

    resistance& internal lea+age of charge& series inductance and other non*ideal properties not

    found in a theoretical& ideal& capacitor.

    2.4.1 THEORY OF OPERATION

    ( capacitor consists of two conductive electrodes& or plates& separated by a dielectric&

    which prevents charge from moving directly between the plates. Charge may however 

    move from one plate to the other through an external circuit& such as a battery connected

     between the terminals.

    ="

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    32/93

    F#$. 2.1 D#%'*#' #3 %)' 0/ & '&/5'#/$ %)3 )'= &, )*) A )/ #= )

    3)*)#&/ &, .

    %hen any external connection is removed& the charge on the plates persists. The

    separated charges attract each other& and an electric field is present between the plates.The simplest practical capacitor consists of two wide& flat& parallel plates separated by a

    thin dielectric layer.

    2.4.2 CAPACITANCE

    ( capacitor)s ability to store charge is measured by its capacitance QC& the ratio of the

    amount of charge stored on each plate to the voltage0

    'or an ideal parallel plate capacitor with a plate area Q( and a plate separation Qd 0

    In 3I units& a capacitor has a capacitance of one farad when one coulomb of charge stored

    on each plate causes a voltage difference of one volt between its plates. 3ince the farad is

    a very large unit& capacitance is usually expressed in microfarads 9L':& nanofarads 9n':&

    or picofarads 9p':. In general& capacitance is greater in devices with large plate areas&

    separated by small distances. %hen a dielectric is present between two charged plates& its

    molecules become polari$ed and reduce the internal electric field and hence the voltage.

    This allows the capacitor to store more charge for a given voltage& so a dielectric

    =4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    33/93

    increases the capacitance of a capacitor& by an amount given by the dielectric constant& &

    of the material.

    2.4. ELECTROLYTIC CAPACITORS

    Electrolytic capacitors are the most popular type for values greater than about "

    microfarad. Electrolytic capacitors are constructed using a thin film of oxide on an

    aluminium foil. (n electrolyte is used to ma+e contact with the other plate. The two

     plates are wound around on one another and then placed into a can that is often

    aluminium.

    F#$.2.14 E%'*&%7#' C))'#&*3

    Electrolytic capacitors are polarised& and care should be ta+en to ensure they are placed in

    circuit the correct way round. If they are connected incorrectly they can be damaged& and

    in some extreme instances they can explode.

    Electrolytic capacitors have a wide tolerance. Typically the value of the component may

     be stated with a tolerance of *!- G"-. 1espite this they are widely used in audio

    applications as coupling capacitors& and in smoothing applications for power supplies.

    Electrolytic capacitors are available in both leaded and surface mount formats. The

    surface mount electrolytic capacitors are available in rectangular pac+ages whereas the

    leaded versions are normally contained in a tubular aluminium can& each end being

    mar+ed to show its polarity.

     

    ==

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    34/93

    2.4.4 CERAMIC CAPACITOR 

    Ceramic capacitors are normally used for radio fre/uency and some audio applications.

    Ceramic capacitors range in value from figures as low as a few picofarads to around ."

    microfarads. In view of their wide range and suitability for 2' applications they are used

    for coupling and decoupling applications in particular. @ere these ceramic capacitors are

     by far the most commonly used type being cheap and reliable and their loss factor is

     particularly low although this is dependent on the exact dielectric in use. Their stability

    and tolerance is not nearly as good as silver mica types& but their cost is much less. In

    view of their constructional properties& these capacitors are widely used both in leaded

    and surface mount formats.

    There are a number of dielectrics that can be used with ceramic capacitors. 'or low

    values a dielectric designated BCFB is normally used. This has the lowest dielectric

    constant but gives the highest stability and lowest loss. %here higher values are re/uired

    in a given si$e& a dielectric with a higher dielectric constant must be used. Types with

    designations A2 and for higher values& ! are used& however their stability and loss

    are not as good as the capacitors made with CF dielectric.

    2.4. SILVER MICA CAPACITOR 

    3ilver mica capacitors are not as widely used these days as they used to be. @owever 

    these electronic components can still be obtained and are used where stability of value is

    of the utmost importance and where low loss is re/uired. In view of this one of their 

    maKor uses is within the tuned elements of circuits li+e oscillators& or within filters.

    ;alues are normally in the range between a few picofarads up to two or possibly three

    thousand picofarads.

    =>

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    35/93

    F#$.2.1 S#%

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    36/93

     F#$. 2.16 S7+0&% &, F# R3#3&* F#$. 2.19 S7+0&% &, V)*#)0% R3#3&*

    2esistors are characteri$ed primarily by their resistance and the power they can dissipate.

    7ther characteristics include temperature coefficient& noise& and inductance. Practical

    resistors can be made of resistive wire& and various compounds and films& and they can

     be integrated into hybrid and printed circuits. 3i$e& and position of leads are relevant to

    e/uipment designers resistors must be physically large enough not to overheat when

    dissipating their power. ;ariable resistors& adKustable by changing the position of a

    tapping on the resistive element& and resistors with a movable tap 9BpotentiometersB:&

    either adKustable by the user of e/uipment or contained within& are also used.

    2esistors are used as part of electrical networ+s and electronic circuits.

    There are special types of resistor whose resistance varies with various /uantities& most of 

    which have names& and articles& of their own0 the resistance of thermistors varies greatlywith temperature& whether external or due to dissipation& so they can be used for 

    temperature or current sensing metal oxide varistors drop to a very low resistance when a

    high voltage is applied& ma+ing them suitable for over*voltage protection the resistance

    of a strain gauge varies with mechanical load the resistance of photoresistors varies with

    illumination the resistance of a Suantum Tunnelling Composite can vary by a factor of 

    ""4 with mechanical pressure applied and so on.

    =?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    37/93

    F#$. 2.18 V-I C=)*)'*#3#'3

    UNITS

    The ohm 9symbol0 : is the 3I unit of electrical resistance& named after Feorg 7hm. The

    most commonly used multiples and submultiples in electrical and electronic usage are the

    milliohm& ohm& +ilohm& and megohm.

    2..1 TYPES OF RESISTORS

    (lthough resistors come in various forms we can divide them up into Kust two basic

    types0*

    ". 'ixed resistors

    4. ;ariable resistors 9or Qpotentiometers:

    ( fixed resistor is a component with two wires which obeys 7hm)s 5aw U i.e. it)s a bit of 

    material which behaves as we described in the last section. Electronic engineers and

    manufacturers have adopted some standards for resistors. These are intended to +eep the

    cost down and ma+e it easier for you to buy them from whichever supplier you li+e

    without having to redesign the e/uipment you want to put them in.

    =A

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    38/93

    F#$. 2.1; F# R3#3&*3

    In an electrical circuit& some obKects may need a lesser amount of current than the input

    value. In such cases& fixed resistors are used to reduce the flow of current. They are

     placed in such a way that a higher voltage must first pass through them before it flows

    further. The value of the resistance is fixed and does not change with change in the

    applied voltage or current flowing through it. The resistance value is measured in ohms

    and the value ranges from a few milliohms to about a giga*ohm.

    ;ariable resistors consist of a resistance trac+ with connections at both ends and a wiper 

    which moves along the trac+ as you turn the spindle. The trac+ may be made from

    carbon& cermet 9ceramic and metal mixture: or a coil of wire 9for low resistances:. The

    trac+ is usually rotary but straight trac+ versions& usually called sliders& are also available.

    ;ariable resistors may be used as a rheostat with two connections 9the wiper and Kust one

    end of the trac+: or as a potentiometer with all three connections in use. Miniature

    versions called presets are made for setting up circuits which will not re/uire further 

    adKustment.

    F#$2.2 V)*#)0% R3#3&*

    =8

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    39/93

    ;ariable resistors are often called potentiometers in boo+s and catalogues. They are

    specified by their maximum resistance& linear or logarithmic trac+& and their physical

    si$e. The standard spindle diameter is ?mm.

    2..2 RESISTOR COLOR CODE

     

    F#$. 2.21 4-B)/ C&%&* C& &, R3#3&*

    2.. CALCULATIN" RESISTOR VALUES

    The Bleft*handB or the most significant coloured band is the band which is nearest to a

    connecting lead with the colour coded bands being read from left*to*right as follows

    =,

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    40/93

    1igit& 1igit& Multiplier R Colour& Colour x " colour   in 7hm)s 9)s:

    'or example& a 2esistor has the following coloured mar+ings

    Jellow ;iolet 2ed R > A 4 R > A x " 4 R >A or >+A.

    The fourth band if used determines the percentage tolerance of the resistor and is given

    as

    #rown R "-& 2ed R 4-& Fold R !-& 3ilver R " -

    If resistor has no fourth tolerance band then the default tolerance would be at 4-.

    It is sometimes easier to remember the resistor colour codes by using mnemonics& which

    is a saying that has a separate word to represent each of the Ten G Two colours in thecode. @owever& these sayings are often crude but never the less effective and here are a

    few of the more BcleanerB versions0

    Bad Boo$e R ots Our Young "uts But Vod+a "oes Well

    Bad Boys R ing Our Young "irls But Vic+y "oes Without

    Bad Boys R ing Our Young "irls But Vic+y "ives Willingly ** "et Some Now

    9This one is only slightly better because it includes the tolerance bands of "old& Silver&

    and None:.

    2.6 LED >L#$= E+##/$ D#&?

    ( light*emitting*diode 95E1: is a semiconductor diode that emits light when an electric

    current is applied in the forward direction of the device& as in the simple 5E1 circuit. The

    effect is a form of electroluminescence where incoherent and narrow*spectrum light is

    emitted from the p*n Kunction.

    >

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    41/93

    F#$. 2.22 LED3

    5E1s are widely used as indicator lights on electronic devices and increasingly in higher 

     power applications such as flashlights and area lighting. (n 5E1 is usually a small area

    9less than " mm4: light source& often with optics added to the chip to shape its radiation

     pattern and assist in reflection. The color of the emitted light depends on the composition

    and condition of the semiconducting material used& and can be infrared& visible& or 

    ultraviolet. #esides lighting& interesting applications include using ;*5E1s for 

    sterili$ation of water and disinfection of devices& and as a grow light to enhance

     photosynthesis in plants.

    2.6.1 LED TECHNOLO"Y

    5i+e a normal diode& the 5E1 consists of a chip of semiconducting material impregnated&

    or doped& with impurities to create a p*n Kunction. (s in other diodes& current flows easily

    from the p*side& or anode& to the n*side& or cathode& but not in the reverse direction.

    Charge*carriersUelectrons and holesUflow into the Kunction from electrodes with

    different voltages. %hen an electron meets a hole& it falls into a lower energy level& and

    releases energy in the form of a photon.

    The wavelength of the light emitted& and therefore its color& depends on the band gap

    energy of the materials forming the p*n Kunction. In silicon or germanium diodes& the

    >"

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    42/93

    electrons and holes recombine by a non*radiative transition which produces no optical

    emission& because these are indirect band gap materials. The materials used for the 5E1

    have a direct band gap with energies corresponding to near*infrared& visible or near*

    ultraviolet light.

     

    F#$. 2.2 I//* W&*(#/$ &, LED

    5E1 development began with infrared and red devices made with gallium arsenide.

    (dvances in materials science have made possible the production of devices with ever*

    shorter wavelengths& producing light in a variety of colors.

    5E1s are usually built on an n*type substrate& with an electrode attached to the p*type

    layer deposited on its surface. P*type substrates& while less common& occur as well. Many

    commercial 5E1s& especially Fa6InFa& also use sapphire substrate.

    >4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    43/93

    F#$. 2.24 V-I #)$*)+ ,&* ) #& )/ LED #%% 0$#/ & +# %#$= =/ = &/-

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    44/93

    efficiency. The refractive index of the pac+age material should also match the index of 

    the semiconductor& to minimi$e bac+*reflection. (n anti*reflection coating may be added

    as well.

    The pac+age may be colored& but this is only for cosmetic reasons or to improve the

    contrast ratio the color of the pac+aging does not substantially affect the color of the

    light emitted.

    2.6. COLOR AND MATERIALS

    Conventional 5E1s are made from a variety of inorganic semiconductor materials& the

    following table shows the available colors with wavelength range& voltage drop and

    material0

    T)0% 2.1 C&%&* )/ T=#* R3'#. Indium gallium nitride 9InFa: 6

    >>

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    45/93

    Fallium9III: nitride 9Fa:

    #lue >! Y V Y ! 4.>8 Y X; Y =.A inc selenide 9n3e:

    Indium gallium nitride 9InFa:

    Purple multiple types 4.>8 Y X; Y =.A 1ual blue6red 5E1s&

     blue with red phosphor&or white with purple plastic

    ;iolet > Y V Y >! 4.A? Y X; Y >. Indium gallium nitride 9InFa:

    ltraviolet V Y > =." Y X; Y >.> diamond 9C:

    (luminium nitride 9(l:

    white #road spectrum X; R =.! #lue6; diode with yellow

     phosphor

    2.6.4 EFFICIENCY AND OPERATIONAL PARAMETERS

    Typical indicator 5E1s are designed to operate with no more than =D? milliwatts

    9m%: of electrical power. (round ",,,& Philips 5umileds introduced power 5E1s

    capable of continuous use at one watt 9%:. These 5E1s used much larger semiconductor 

    die si$es to handle the large power inputs. (lso& the semiconductor dies were mounted

    onto metal slugs to allow for heat removal from the 5E1 die.

    7ne of the +ey advantages of 5E1*based lighting is its high efficiency& as measured by

    its light output per unit power input. %hite 5E1s /uic+ly matched and overtoo+ the

    efficiency of standard incandescent lighting systems. In 44& 5umileds made five*watt

    5E1s available with a luminous efficiency of "8D44 lumens per watt 9lm6%:. 'or 

    comparison& a conventional ?D" % incandescent lightbulb produces around "! lm6%&

    and standard fluorescent lights produce up to "l m6%.

    2.6. CONSIDERATIONS IN USE

    >!

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    46/93

    nli+e incandescent light bulbs& which illuminate regardless of the electrical polarity&

    5E1s will only light with correct electrical polarity. %hen the voltage across the p*n

     Kunction is in the correct direction& a significant current flows and the device is said to be

    forward*biased. If the voltage is of the wrong polarity& the device is said to be reverse

     biased& very little current flows& and no light is emitted. 5E1s can be operated on an

    alternating current voltage& but they will only light with positive voltage& causing the

    5E1 to turn on and off at the fre/uency of the (C supply.

    Most 5E1s have low reverse brea+down voltage ratings& so they will also be damaged by

    an applied reverse voltage above this threshold. If it is desired to drive the 5E1 directly

    from an (C supply of more than the reverse brea+down voltage then it may be protected

     by placing a diode 9or another 5E1: in inverse parallel.

     

    F#$. 2.2 I/#,#')#&/ &, LED

    2.6.6 TYPES OF LEDS

    The main types of 5E1s are miniature& high power devices and custom designs such as

    alphanumeric or multi*color.

    1. M#/#)5* LED3

    >?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    47/93

     These are mostly single*die 5E1s used as indicators& and they come in various*si$e

     pac+ages0

    ". 3urface mount

    4. 4 mm

    =.= mm 9T":

    >. ! mm 9T"Z[ :₄

    !. " mm

    7ther si$es are also available& but less common.

    Common pac+age shapes0

    ". 2ound& dome top

    4. 2ound& flat top

    =. 2ectangular& flat top 9often seen in 5E1 bar*graph displays:

    >. Triangular or s/uare& flat top

    The encapsulation may also be clear or semi opa/ue to improve contrast and viewing

    angle.

    There are three main categories of miniature single die 5E1s0

    ". 5ow current U typically rated for 4 m( at around 4 ; 9approximately > m%

    consumption:.

    4. 3tandard U 4 m( 5E1s at around 4 ; 9approximately > m%: for red& orange&

    yellow < green& and 4 m( at >D! ; 9approximately " m%: for blue& violet and white.

    =. ltra*high output U 4 m( at approximately 4 ; or >D! ;& designed for viewing in

    direct sunlight.

     

    2. F#

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    48/93

    . F%)3=#/$ LED3

    'lashing 5E1s are used as attention see+ing indicators where it is desired to avoid the

    complexity of external electronics. 'lashing 5E1s resemble standard 5E1s but they

    contain an integrated multivibrator circuit inside which causes the 5E1 to flash with a

    typical period of one second. In diffused lens 5E1s this is visible as a small blac+ dot.

    Most flashing 5E1s emit light of a single color& but more sophisticated devices can flash

     between multiple colors and even fade through a color se/uence using 2F# color 

    mixing.

    4. H#$= &* LED3

    @igh power 5E1s 9@P5E1: can be driven at hundreds of m( 9vs. tens of m( for other 

    5E1s:& some with more than one ampere of current& and give out large amounts of light.

    3ince overheating is destructive& the @P5E1s must be highly efficient to minimi$e excess

    heat furthermore& they are often mounted on a heat sin+ to allow for heat dissipation. If 

    the heat from a @P5E1 is not removed& the device will burn out in seconds.

    ( single @P5E1 can often replace an incandescent bulb in a flashlight& or be set in an

    array to form a powerful 5E1 lamp.

    5E1s have been developed that can run directly from mains power without the need for a

    1C converter. 'or each half cycle part of the 5E1 emits light and part is dar+& and this is

    reversed during the next half cycle. The efficiency of @P5E1s is typically > lm6%\>4].

    (s of ovember 48 some @P5E1s manufactured by Cree& Inc exceed ,! lm6% \>=]

    9e.g. the 5amp MC*E 5E1 chip emitting Cool %hite light: and are being sold in lamps

    intended to replace incandescent& halogen& and even fluorescent style lights as 5E1s

     become more cost competitive.

    . M5%#-'&%&* LED3

    >8

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    49/93

    ( Nbi*color 5E1O is actually two different 5E1s in one case. It consists of two dies

    connected to the same two leads but in opposite directions. Current flow in one direction

     produces one color& and current in the opposite direction produces the other color.

    (lternating the two colors with sufficient fre/uency causes the appearance of a blended

    third color. 'or example& a red6green 5E1 operated in this fashion will color blend to

     produce a yellow appearance.

    ( Ntri*color 5E1O is also two 5E1s in one case& but the two 5E1s are connected to

    separate leads so that the two 5E1s can be controlled independently and lit

    simultaneously. ( three*lead arrangement is typical with one commmon lead 9anode or 

    cathode:.

    2F# 5E1s contain red& green and blue emitters& generally using a four*wire connection

    with one common lead 9anode or cathode:.

    The Taiwanese 5E1 manufacturer Everlight has introduced a = watt 2F# pac+age

    capable of driving each die at " watt.

    6. A%=)/5+*#' LED3

      5E1 displays are available in seven*segment and starburst format. 3even*segment

    displays handle all numbers and a limited set of letters. 3tarburst displays can display all

    letters.

    3even*segment 5E1 displays were in widespread use in the ",As and ",8s& but

    increasing use of li/uid crystal displays& with their lower power consumption and greater 

    display flexibility& has reduced the popularity of numeric and alphanumeric 5E1 display.

    2.6.9 ADVANTA"ES OF USIN" LEDS

    ". E,,#'#/'70 5E1s produce more light per watt than incandescent bulbs this is useful in

     battery powered or energy*saving devices.\==]

    4. C&%&*0 5E1s can emit light of an intended color without the use of color filters that

    traditional lighting methods re/uire. This is more efficient and can lower initial costs.

    >,

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    50/93

    =. S#0 5E1s can be very small 9W4 mm4: and are easily populated onto printed circuit

     boards.

    >. O/O,, #+0 5E1s light up very /uic+ly. ( typical red indicator 5E1 will achieve full

     brightness in microseconds\=>]. 5E1s used in communications devices can have even

    faster response times.

    !.  C7'%#/$0 5E1s are ideal for use in applications that are subKect to fre/uent on*off 

    cycling& unli+e fluorescent lamps that burn out more /uic+ly when cycled fre/uently& or 

    @I1 lamps that re/uire a long time before restarting.

    ?. D#++#/$0 5E1s can very easily be dimmed either by Pulse*width modulation or 

    lowering the forward current.

    A. C&&% %#$=0 In contrast to most light sources& 5E1s generate light and waste heat by

    different mechanisms D respectively radiation and conduction D so that suitably designed

    luminaires can produce a relatively cool light stream.

    8. S%& ,)#%5*0 5E1s mostly fail by dimming over time& rather than the abrupt burn*out

    of incandescent bulbs.

    ,. L#,#+0 5E1s can have a relatively long useful life. 7ne report estimates =!& to

    !& hours of useful life& though time to complete failure may be longer. 'luorescent

    tubes typically are rated at about "& to "!& hours& depending partly on the

    conditions of use& and incandescent light bulbs at "&D4& hours.

    ". S=&'( *3#3)/'0 5E1s& being solid state components& are difficult to damage with

    external shoc+& unli+e fluorescent and incandescent bulbs which are fragile.

    !

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    51/93

    "". F&'530 The solid pac+age of the 5E1 can be designed to focus its light. Incandescent

    and fluorescent sources often re/uire an external reflector to collect light and direct it in a

    usable manner.

    "4. T&#'#70 5E1s do not contain mercury& unli+e fluorescent lamps.

    2.6.8 DISADVANTA"ES OF USIN" LEDS

    ". H#$= *#'0 5E1s are currently more expensive& price per lumen& on an initial capital

    cost basis& than most conventional lighting technologies. The additional expense partially

    stems from the relatively low lumen output and the drive circuitry and power supplies

    needed.

    4. T+*)5* //'0 5E1 performance largely depends on the ambient

    temperature of the operating environment. 7ver*driving the 5E1 in high ambient

    temperatures may result in overheating of the 5E1 pac+age& eventually leading to device

    failure.

    =. V&%)$ 3/3##. L#$= 5)%#70 Most white 5E1s have spectra that differ significantly from a blac+ 

     body radiator li+e the sun or an incandescent light. The spi+e at >? nm and dip at !

    nm can cause the color of obKects to be perceived differently under 5E1 illumination than

    sunlight or incandescent sources& due to metamerism&\=8] red surfaces being rendered

     particularly badly by typical phosphor based 5E1s white 5E1s.

    !. A*) %#$= 3&5*'0 5E1s do not approximate a Npoint sourceO of light& so cannot be

    used in applications needing a spherical light field. 5E1s are not capable of providing

    !"

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    52/93

    divergence below a few degrees. This is contrasted with lasers& which can produce beams

    with divergences of .4 degrees or less.

     

    2.9 DI"ITAL ENER"Y METER 

    (n electric meter or energy meter is a device that measures the amount of electrical

    energy consumed by a residence& business& or an electrically*powered device.

    Electric meters are typically calibrated in billing units& the most common one being the

    +ilowatt hour . Periodic readings of electric meters establishes billing cycles and energy

    used during a cycle.

    In settings when energy savings during certain periods are desired& meters may measure

    demand& the maximum use of power in some interval. In some areas& the electric rates are

    higher during certain times of day& to encourage reduction in use. (lso& in some areas

    meters have relays to turn off nonessential e/uipment.

    The first accurate& recording electricity consumption meter was a 1C meter by 1r 

    @ermann (ron& who patented it in "88=. @ugo @irst of the Feneral Electric Company

    introduced it commercially into Freat #ritain from "888. \4] Meters had been used prior to

    this& but they measured the rate of power consumption at that particular moment. (ron)s

    meter recorded the total energy used over time& and showed it on a series of cloc+ dials.

    The most common unit of measurement on the electricity meter is the +ilowatt hour &

    which is e/ual to the amount of energy used by a load of one +ilowatt over a period of 

    one hour & or =&?& Koules. 3ome electricity companies use the 3I megaKoule instead.

    Electricity meters operate by continuously measuring the instantaneous voltage  9volts:

    and current  9amperes: and finding the product of these to give instantaneous electrical

     power  9watts: which is then integrated against time to give energy used 9 Koules& +ilowatt*

    hours etc:. Meters for smaller services 9 such as small residential customers: can be

    !4

    http://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Househttp://en.wikipedia.org/wiki/Businesshttp://en.wikipedia.org/wiki/Kilowatt_hourhttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Hermann_Aronhttp://en.wikipedia.org/wiki/Hermann_Aronhttp://en.wikipedia.org/w/index.php?title=Hugo_Hirst&action=edit&redlink=1http://en.wikipedia.org/wiki/General_Electric_Company_plchttp://en.wikipedia.org/wiki/Electricity_meter#cite_note-Whyte.2C_1930-1http://en.wikipedia.org/wiki/Electricity_meter#cite_note-Whyte.2C_1930-1http://en.wikipedia.org/wiki/Kilowatt_hourhttp://en.wikipedia.org/wiki/Kilowatthttp://en.wikipedia.org/wiki/Hourhttp://en.wikipedia.org/wiki/Joulehttp://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Megajoulehttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Amperehttp://en.wikipedia.org/wiki/Product_(mathematics)http://en.wikipedia.org/wiki/Electric_powerhttp://en.wikipedia.org/wiki/Electric_powerhttp://en.wikipedia.org/wiki/Watthttp://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Jouleshttp://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Househttp://en.wikipedia.org/wiki/Businesshttp://en.wikipedia.org/wiki/Kilowatt_hourhttp://en.wikipedia.org/wiki/Direct_currenthttp://en.wikipedia.org/wiki/Hermann_Aronhttp://en.wikipedia.org/wiki/Hermann_Aronhttp://en.wikipedia.org/w/index.php?title=Hugo_Hirst&action=edit&redlink=1http://en.wikipedia.org/wiki/General_Electric_Company_plchttp://en.wikipedia.org/wiki/Electricity_meter#cite_note-Whyte.2C_1930-1http://en.wikipedia.org/wiki/Kilowatt_hourhttp://en.wikipedia.org/wiki/Kilowatthttp://en.wikipedia.org/wiki/Hourhttp://en.wikipedia.org/wiki/Joulehttp://en.wikipedia.org/wiki/SIhttp://en.wikipedia.org/wiki/Megajoulehttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Volthttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Amperehttp://en.wikipedia.org/wiki/Product_(mathematics)http://en.wikipedia.org/wiki/Electric_powerhttp://en.wikipedia.org/wiki/Electric_powerhttp://en.wikipedia.org/wiki/Watthttp://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Joules

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    53/93

    connected directly in*line between source and customer. 'or larger loads& more than

    about 4 amps of load& current transformers are used& so that the meter can be located

    other than in line with the service conductors. The meters fall into two basic categories&

    electromechanical and electronic.

    2.9.1 ELECTROMECHANICAL METERS

    The electromechanical induction  meter operates by counting the revolutions of an

    aluminium disc which is made to rotate at a speed proportional to the power. The number 

    of revolutions is thus proportional to the energy usage. It consumes a small amount of 

     power& typically around 4 watts.

    The metallic disc is acted upon by two coils. 7ne coil is connected in such a way that it

     produces a magnetic flux in proportion to the voltage and the other produces a magnetic

    flux in proportion to the current. The field of the voltage coil is delayed by , degrees

    using a lag coil. This produces eddy currents in the disc and the effect is such that a force

    is exerted on the disc in proportion to the product of the instantaneous current and

    voltage. (  permanent magnet  exerts an opposing force proportional to the speed of 

    rotation of the disc. The e/uilibrium between these two opposing forces results in the disc

    rotating at a speed  proportional  to the power being used. The disc drives a register 

    mechanism which integrates  the speed of the disc over time by counting revolutions&

    much li+e the odometer  in a car& in order to render a measurement of the total energy used

    over a period of time.

    The type of meter described above is used on a single*phase (C supply. 1ifferent phase

    configurations use additional voltage and current coils.

    !=

    http://en.wikipedia.org/wiki/Current_transformerhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Aluminiumhttp://en.wikipedia.org/wiki/Induction_coilhttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Eddy_currenthttp://en.wikipedia.org/wiki/Forcehttp://en.wikipedia.org/wiki/Permanent_magnethttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/Proportionality_(mathematics)http://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Odometerhttp://en.wikipedia.org/wiki/Single-phase_electric_powerhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Polyphase_systemhttp://en.wikipedia.org/wiki/Polyphase_systemhttp://en.wikipedia.org/wiki/Current_transformerhttp://en.wikipedia.org/wiki/Electromagnetic_inductionhttp://en.wikipedia.org/wiki/Aluminiumhttp://en.wikipedia.org/wiki/Induction_coilhttp://en.wikipedia.org/wiki/Magnetic_fluxhttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Eddy_currenthttp://en.wikipedia.org/wiki/Forcehttp://en.wikipedia.org/wiki/Permanent_magnethttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/Angular_velocityhttp://en.wikipedia.org/wiki/Proportionality_(mathematics)http://en.wikipedia.org/wiki/Integralhttp://en.wikipedia.org/wiki/Odometerhttp://en.wikipedia.org/wiki/Single-phase_electric_powerhttp://en.wikipedia.org/wiki/Alternating_currenthttp://en.wikipedia.org/wiki/Polyphase_systemhttp://en.wikipedia.org/wiki/Polyphase_system

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    54/93

    F#$. 2.26 E%'*&+'=)/#')% M*

    Three*phase electromechanical induction meter& metering " ( 4=6> ; supply.

    @ori$ontal aluminum rotor disc is visible in center of meter 

    The aluminum disc is supported by a spindle which has a worm gear  which drives the

    register. The register is a series of dials which record the amount of energy used. The

    dials may be of the cyclometer type& an odometer*li+e display that is easy to read where

    for each dial a single digit is shown through a window in the face of the meter& or of the

     pointer type where a pointer indicates each digit. %ith the dial pointer type& adKacent

     pointers generally rotate in opposite directions due to the gearing mechanism.

    The amount of energy represented by one revolution of the disc is denoted by the symbol

    h which is given in units of watt*hours per revolution. The value A.4 is commonly seen.

    sing the value of h& one can determine their power consumption at any given time by

    timing the disc with a stopwatch. If the time in seconds ta+en by the disc to complete one

    revolution is t& then the power in watts is . 'or example& if h R A.4&

    as above& and one revolution too+ place in ">.> seconds& the power is "8 watts. This

    !>

    http://en.wikipedia.org/wiki/Three-phase_electric_powerhttp://en.wikipedia.org/wiki/Gear#Worm_gearhttp://en.wikipedia.org/wiki/Numerical_digithttp://en.wikipedia.org/wiki/File:ThreePhaseElectricityMeter.jpghttp://en.wikipedia.org/wiki/Three-phase_electric_powerhttp://en.wikipedia.org/wiki/Gear#Worm_gearhttp://en.wikipedia.org/wiki/Numerical_digit

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    55/93

    method can be used to determine the power consumption of household devices by

    switching them on one by one.

    Most domestic electricity meters must be read manually& whether by a representative of 

    the power company or by the customer. %here the customer reads the meter& the reading

    may be supplied to the power company by telephone&  post  or over the  internet. The

    electricity company will normally re/uire a visit by a company representative at least

    annually in order to verify customer*supplied readings and to ma+e a basic safety chec+ 

    of the meter.

    In an induction type meter& creep is a phenomenon that can adversely affect accuracy& that

    occurs when the meter disc rotates continuously with potential applied and the load

    terminals open circuited. ( test for error due to creep is called a creep test.

    2.9.2 ELECTRONIC METERS

    Electronic meters display the energy used on an 5C1 or 5E1 display& and can also

    transmit readings to remote places. In addition to measuring energy used& electronic

    meters can also record other parameters of the load and supply such as maximum

    demand&  power factor and reactive power  used etc. They can also support time*of*day

     billing& for example& recording the amount of energy used during on*pea+ and off*pea+ 

    hours.

    2.8 IC

    The !!! timer is an integrated circuit 9chip: implementing a variety of timer and

    multivibrator applications. It was produced by 3ignetics Corporation in early ",A. The

    original name was the 3E!!!6E!!! and was called BThe IC Time MachineB. The !!!

    gets its name from the three !* resistors used in typical early implementations. It is

    widely used because of its ease to use& low price and reliability.

    !!

    http://en.wikipedia.org/wiki/Electricity_retailinghttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Mailhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/LCDhttp://en.wikipedia.org/wiki/Power_factorhttp://en.wikipedia.org/wiki/Reactive_powerhttp://en.wikipedia.org/wiki/Electricity_retailinghttp://en.wikipedia.org/wiki/Telephonehttp://en.wikipedia.org/wiki/Mailhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/LCDhttp://en.wikipedia.org/wiki/Power_factorhttp://en.wikipedia.org/wiki/Reactive_power

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    56/93

    It is one of the most popular and versatile integrated circuits which can be used to build

    lots of different circuits. It includes 4= transistors& 4 diodes and "? resistors on a silicon

    chip installed in an 8*pin mini dual*in*line pac+age 91IP*8:.

    The !!! Timer is a monolithic timing circuit that can produce accurate and highly stable

    time delays or oscillations. The timer basically operates in one of the two modesU 

    monostable 9one*shot: multivibrator or as an astable 9free*running: multivibrator. In the

    monostable mode& it can produce accurate time delays from microseconds to hours. In the

    astable mode& it can produce rectangular waves with a variable duty cycle. 're/uently& the

    !!! is used in astable mode to generate a continuous series of pulses& but you can also use

    the !!! to ma+e a one*shot or monostable circuit.

    (pplications of !!! timer in monostable mode include timers& missing pulse detection&

     bounce free switches& touch switches& fre/uency divider& capacitance measurement& pulse

    width modulation 9P%M: etc.

    In astable or free running mode& the !!! can operate as an oscillator. The uses include

    5E1 and lamp flashers& logic cloc+s& security alarms& pulse generation& tone generation&

     pulse position modulation& etc. In the bistable mode& the !!! can operate as a flip*flop

    and is used to ma+e bounce*free latched switches& etc.

    F#$. 2.29 P#/ #)$*)+ &, T#+*

    !?

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    57/93

    F#$. 2.28 B%&'( D#)$*)+ &, T#+*

    The connection of the pins is as follows0

    N*. N)+ P5*&3

    " F1 Fround& low level 9 ;:

    4 T2IF ( short pulse high*to*low on the trigger starts the timer = 7T 1uring a timing interval& the output stays at GV CC

    > 2E3ET ( timing interval can be interrupted by applying a reset pulse to low 9 ;:

    ! CT25 Control voltage allows access to the internal voltage divider 946= V CC:

    ? T@2  The threshold at which the interval ends 9it ends if the voltage at T@2 is at

    least 46= V CC:

    A 1I3Connected to a capacitor whose discharge time will influence the timing

    interval

    8 V G& V CC The positive supply voltage which must be between = and "! ;

    2.8.1 ASTABLE MULTIVIBRATOR 

    'igure shows !!! timer connected as an astable multivibrator. Pin ! is bypassed to

    ground through a ." ^' capacitor. The power supply 9G;CC: is connected to common

    of pin > and pin 8 and pin " is grounded. If the output is high initially& capacitor C starts

    !A

    http://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Vcchttp://en.wikipedia.org/wiki/Vcc

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    58/93

    charging towards through 2( and 2#. (s soon as the voltage across the capacitor 

     becomes e/ual to CC;CC;=4& the upper comparator triggers the flip*flop& and the output

     becomes low. The capacitor now starts discharging through 2# and transistor S". %hen

    the voltage across the capacitor becomes CC;="& the output of the lower comparator 

    triggers the flip*flop& and the output becomes high. The cycle then repeats. The output

    voltage and capacitor voltage waveforms are shown in 'igure.

    F#$. 2.2; C#*'5# #)$*)+ ,&* A3)0% M5%#

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    59/93

    F#$. 2. O55

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    60/93

    negative*going input signal with an amplitude larger than CC;=". The time for which the

    output remains high is given by

    Tp R "." 2a C

    where 2a is in ohms& C in farads and tp in seconds. 7nce the circuit is triggered& the

    output will remain high for the time interval tp. It will not change even if an input trigger 

    is applied during this time interval. In other words& the circuit is said to be non*

    retriggerable. @owever& the timing can be interrupted by the application of a negative

    signal at the reset input on pin >. ( voltage level going from CC;G to ground at the reset

    input will cause the timer to immediately switch bac+ to its stable state with the output

    low.

    F#$. 2.1 M&/&3)0% M5%#

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    61/93

    5E1 and the resistance value used will be of the order of M. In this case the trigger can

     be supplied manually by grounding the trigger input for a fraction of a second.

    F#$. 2.2 I/5 )/ &55

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    62/93

    depending on ambient temperature and number of drivers turned on simultaneously.

    Typical loads include relays& solenoids& stepping motors& magnetic print hammers&

    multiplexed 5E1 and incandescent displays& and heaters.

    These 1arlington arrays are furnished in "8*pin dual in*line plastic pac+ages or "8*lead

    small*outline plastic pac+ages. (ll devices are pinned with outputs opposite inputs to

    facilitate ease of circuit board layout. Prefix Q5 devices are rated for operation over

    the temperature range of *4_C to G8!_C.

    F#$. 2. P#/ D#)$*)+ &, ULN 284

    FEATURES

    • TT5& 1T5& PM73& or CM73 Compatible Inputs

    • 7utput Current to ! m(

    • 7utput ;oltage to ,! ;

    ?4

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    63/93

    • Transient*Protected 7utputs

    • 1ual In*5ine Pac+age or %ide*#ody 3mall*7utline Pac+age

    RATIN"S

    7utput ;oltage& ;CE 5 48> ..................... V

    Input ;oltage& ;I .............................. V

    Continuous 7utput Current& IC .... +A

    Continuous Input Current& I I ....... 2 +A

    Power 1issipation& P1 9one 1arlington pair: .................. 1. W

    7perating Temperature 2ange& T( Prefix Q5.............. -2_C & G 8_C

    3torage Temperature 2ange& T3................................ -_C & G1_C

    2.1 LCD DISPLAY

    5i/uid crystal displays 95C1: are widely used in recent years as compares to 5E1s.

    This is due to the declining prices of 5C1& the ability to display numbers& characters and

    graphics& incorporation of a refreshing controller into the 5C1& their by relieving the

    CP of the tas+ of refreshing the 5C1 and also the ease of programming for characters

    and graphics. @1 >>A8 based 5C1s are most commonly used.

     

    F#$. 2.4 A $/*)% 5*&3 )%=)/5+*#' LCD #= & %#/3 &, 16 '=)*)'*3

    2.1.1 LCD PIN DESCRIPTION

    ?=

  • 8/18/2019 60888878 Report Prepaid Energy Meter

    64/93

    The 5C1 discuss in this section has the most common connector used for the @itatchi

    >>A8 based 5C1 is "> pins in a row and modes of operation and how to program and

    interface with microcontroller is describes in this section.

    F#$. 2. LCD D#3%)7

    • VCC, VSS, VEE 

    The voltage ;


Recommended