Intelligent Street Light

download Intelligent Street Light

of 52

Transcript of Intelligent Street Light

  • 7/23/2019 Intelligent Street Light

    1/52

    CHAPTER 1

    INTRODUCTION

    1.1 Electronics and Micrprocessor

    Electronics is the scienceof how to control theelectric energy, energy in which

    the electronshave a fundamental role. Electronics deals with electrical circuitsthat

    involve active electrical Components such as vacuum tubes,transistors, diodes and

    integrated circuits, and associated passive electrical components and interconnection

    technologies.

    Commonly, electronic devices contain circuitry consisting primarily or exclusively of

    active semiconductorssupplemented with passive elements; such a circuit is described as

    anelectronic circuit.

    The nonlinearbehaviour of active components and their ability to control electron

    flows makes amplification of weak signals possible, and electronics is widely used

    ininformation processing,telecommunication, and signal processing. The ability of

    electronic devices to act as switches makes digital information processing possible.

    Interconnection technologies such as circuit boards,electronics packaging technology, and

    other varied forms of communication infrastructure complete circuit functionality and

    transform the mixed components into a regular working system.

    Electronics is distinct from electrical andelectromechanicalscience and technology, whichdeal with the generation, distribution, switching, storage, and conversion of electrical energy

    to and from other Energy forms using wires, motors,generators,

    batteries, switches, relays,transformers,resistors,and otherpassive components.

    This distinction started around !"#$ with the invention by %ee &e 'orestof

    the triode, which made electricalamplificationof weak radio signals and audio signals

    possible with a nonmechanical device. (ntil !")# this field was called *radio technology*

    because its principal application was the design and theory of radio transmitters, receivers,

    andvacuum tubes.

    Today, most electronic devices usesemiconductorcomponents to perform electron

    control. The study of semiconductor devices and related technology is considered a branch of

    solidstate physics, whereas the design and construction of electronic circuitsto solve

    !

    http://en.wikipedia.org/wiki/Sciencehttp://en.wikipedia.org/wiki/Electric_energyhttp://en.wikipedia.org/wiki/Electronhttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Electronic_circuithttp://en.wikipedia.org/wiki/Nonlinearhttp://en.wikipedia.org/wiki/Information_processinghttp://en.wikipedia.org/wiki/Telecommunicationhttp://en.wikipedia.org/wiki/Signal_processinghttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Circuit_boardhttp://en.wikipedia.org/wiki/Systemhttp://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Electro-mechanicalhttp://en.wikipedia.org/wiki/Wirehttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Electric_generatorhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Transformerhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Passive_componenthttp://en.wikipedia.org/wiki/Lee_De_Foresthttp://en.wikipedia.org/wiki/Triodehttp://en.wikipedia.org/wiki/Amplifierhttp://en.wikipedia.org/wiki/Transmitterhttp://en.wikipedia.org/wiki/Receiver_(radio)http://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Solid-state_physicshttp://en.wikipedia.org/wiki/Electronic_circuithttp://en.wikipedia.org/wiki/Sciencehttp://en.wikipedia.org/wiki/Electric_energyhttp://en.wikipedia.org/wiki/Electronhttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Electronic_circuithttp://en.wikipedia.org/wiki/Nonlinearhttp://en.wikipedia.org/wiki/Information_processinghttp://en.wikipedia.org/wiki/Telecommunicationhttp://en.wikipedia.org/wiki/Signal_processinghttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Circuit_boardhttp://en.wikipedia.org/wiki/Systemhttp://en.wikipedia.org/wiki/Electricityhttp://en.wikipedia.org/wiki/Electro-mechanicalhttp://en.wikipedia.org/wiki/Wirehttp://en.wikipedia.org/wiki/Electric_motorhttp://en.wikipedia.org/wiki/Electric_generatorhttp://en.wikipedia.org/wiki/Battery_(electricity)http://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Relayhttp://en.wikipedia.org/wiki/Transformerhttp://en.wikipedia.org/wiki/Resistorhttp://en.wikipedia.org/wiki/Passive_componenthttp://en.wikipedia.org/wiki/Lee_De_Foresthttp://en.wikipedia.org/wiki/Triodehttp://en.wikipedia.org/wiki/Amplifierhttp://en.wikipedia.org/wiki/Transmitterhttp://en.wikipedia.org/wiki/Receiver_(radio)http://en.wikipedia.org/wiki/Vacuum_tubehttp://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Solid-state_physicshttp://en.wikipedia.org/wiki/Electronic_circuit
  • 7/23/2019 Intelligent Street Light

    2/52

    practical problems come under electronics engineering. This article focuses on engineering

    aspects of electronics.

    + microprocessoris a computer processor that incorporates the functions of

    acomputerscentral processing unit-C(/ on a single integrated circuit-IC/, or at most a

    few integrated circuits. The microprocessor is a multipurpose,programmable device that

    accepts digital dataas input, processes it according to instructions stored in its memory, and

    provides results as output. It is an example of se0uential digital logic, as it has internal

    memory. 1icroprocessors operate on numbers and symbols represented in thebinary

    numeral system.

    The integration of a whole C( onto a singlechipor on a few chips greatly reduced

    the cost of processing power. The integrated circuit processor was produced in large numbers

    by highly automated processes, so unit cost was low. 2inglechip processors increase

    reliability as there are many fewer electrical connections to fail. +s microprocessor designs

    get faster, the cost of manufacturing a chip -with smaller components built on a

    semiconductor chip the same si3e/ generally stays the same.

    4efore microprocessors, small computers had been implemented using racks of

    circuit boards with manymediumand smallscale integrated circuits. 1icroprocessors

    integrated this into one or a few largescaleICs. Continued increases in microprocessor

    capacity have since rendered other forms of computers almost completely obsolete

    -see history of computing hardware/, with one or more microprocessors used in everything

    from the smallest embedded systemsand handheld devicesto the

    largest mainframesand supercomputers.

    AIM OF THE PROJECT

    The important consideration in the present field of Electronics and Electrical related

    technologies are +utomation, ower consumption and cost effectiveness. +utomation is intended

    to reduce manpower with the help of intelligent systems and ower saving is the main

    consideration forever as the source of the power-Thermal, 5ydro etc.,/are getting diminished due

    to various reasons.

    6

    http://en.wikipedia.org/wiki/Electronics_engineeringhttp://en.wikipedia.org/wiki/Engineeringhttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Digital_datahttp://en.wikipedia.org/wiki/Sequential_logichttp://en.wikipedia.org/wiki/Binary_numeral_systemhttp://en.wikipedia.org/wiki/Binary_numeral_systemhttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Medium-scale_integrationhttp://en.wikipedia.org/wiki/Small-scale_integrationhttp://en.wikipedia.org/wiki/Large-scale_integrationhttp://en.wikipedia.org/wiki/History_of_computing_hardwarehttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Handheld_devicehttp://en.wikipedia.org/wiki/Mainframe_computerhttp://en.wikipedia.org/wiki/Supercomputerhttp://en.wikipedia.org/wiki/Electronics_engineeringhttp://en.wikipedia.org/wiki/Engineeringhttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Digital_datahttp://en.wikipedia.org/wiki/Sequential_logichttp://en.wikipedia.org/wiki/Binary_numeral_systemhttp://en.wikipedia.org/wiki/Binary_numeral_systemhttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Medium-scale_integrationhttp://en.wikipedia.org/wiki/Small-scale_integrationhttp://en.wikipedia.org/wiki/Large-scale_integrationhttp://en.wikipedia.org/wiki/History_of_computing_hardwarehttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Handheld_devicehttp://en.wikipedia.org/wiki/Mainframe_computerhttp://en.wikipedia.org/wiki/Supercomputer
  • 7/23/2019 Intelligent Street Light

    3/52

    The idea of designing a new system for the streetlight that do not consume huge

    amount of electricity and illuminate large areas with the highest intensity of light is

    concerning each engineer working in this field. roviding street lighting is one of the most

    important and expensive responsibilities of a city. %ighting can account for !#789: of the

    total energy bill in typical cities worldwide !

  • 7/23/2019 Intelligent Street Light

    4/52

    CHAPTER

    CONTRO!!ER "E!ECTION

    #loc$ Dia%ram&

    Fi%& .1 O'erall #loc$ Dia%ram

    #loc$ Dia%ram E(planation& .

    In this proect, we are going to switch off the street lights automatically as the

    day starts. The duration of the day differs from season to season, accordingly our module

    works based upon the light intensity so as to when to start or stop. 'or this we are using %ight&ependent Besistor -%&B/ as the light sensor, which communicates with the re0uired

    information to the micro controller.

    5ere we are using micro controller, %&B, and relay. 4y using the %&B we can

    operate the lights, i.e when the light is available then it will be in the D'' state and when it is

    dark then the light will be in D@ state, it means %&B is inversely proportional to light. Ahen

    =

  • 7/23/2019 Intelligent Street Light

    5/52

    the light falls on the %&B it sends the commands to the micro controller that it should be in

    the D'' state then it switch offFs the light, all these commands are sent to the controller then

    according to that the devices operate. Ae use a relay to act as an D@ D'' switch, the load is

    connected to these relays.

    HARD)ARE DE"CRIPTION

    The block diagram of the system is as shown in the fig. The system basicallyconsists of a

    !. 1icro controller,6. %&B

    8. BE%+G

    =. ower supply,

    !DR

    %&Bs or %ight &ependent Besistors are very useful especially in lightdark sensor

    circuits. @ormally the resistance of an %&B is very high, sometimes as high as !### ###

    ohms, but when they are illuminated with light resistance drops dramatically.

    )

  • 7/23/2019 Intelligent Street Light

    6/52

    The animation opposite shows that when the torch is turned on, the resistance of the %&B

    falls, allowing current to pass through

    This is an example of a light sensor circuit H

    Ahen the light level is low the resistance of the %&B is high. This prevents current from

    flowing to the base of the transistors. Conse0uently the %E& does not light.

    5owever, when light shines onto the %&B its resistance falls and current flows into the base

    of the first transistor and then the second transistor. The %E& lights.

    The preset resistor can be turned up or down to increase or decrease resistance, in this way it

    can make the circuit more or less sensitive.

    $

  • 7/23/2019 Intelligent Street Light

    7/52

    RE!A*

    Description

    + rela+is an electrical switchthat opens and closes under the control of another electrical

    circuit. In the original form, the switch is operated by an electromagnetto open or close one

    or many sets of contacts. It was invented by oseph 5enryin !98). 4ecause a relay is able to

    control an output circuit of higher power than the input circuit, it can be considered to be, in a

    broad sense, a form of an electrical amplifier.

    Operation

    Ahen a currentflows through the coil, the resulting magnetic field attracts an armaturethat is

    mechanically linked to a moving contact. The movement either makes or breaks a connection

    with a fixed contact. Ahen the current to the coil is switched off, the armature is returned by

    a force approximately half as strong as the magnetic force to its relaxed position. (sually this

    is a spring, but gravity is also used commonly in industrial motor starters. 1ost relays are

    manufactured to operate 0uickly. In a low voltage application, this is to reduce noise. In a

    high voltage or high current application, this is to reduce arcing.

    ?

    http://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Magnethttp://en.wikipedia.org/wiki/Joseph_Henryhttp://en.wikipedia.org/wiki/1835http://en.wikipedia.org/wiki/Amplifierhttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Coilhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Armature_(electrical_engineering)http://en.wikipedia.org/wiki/Spring_(device)http://en.wikipedia.org/wiki/Arcinghttp://en.wikipedia.org/wiki/Image:Relay_symbols.gifhttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Electrical_circuithttp://en.wikipedia.org/wiki/Magnethttp://en.wikipedia.org/wiki/Joseph_Henryhttp://en.wikipedia.org/wiki/1835http://en.wikipedia.org/wiki/Amplifierhttp://en.wikipedia.org/wiki/Current_(electricity)http://en.wikipedia.org/wiki/Coilhttp://en.wikipedia.org/wiki/Magnetic_fieldhttp://en.wikipedia.org/wiki/Armature_(electrical_engineering)http://en.wikipedia.org/wiki/Spring_(device)http://en.wikipedia.org/wiki/Arcing
  • 7/23/2019 Intelligent Street Light

    8/52

    If the coil is energi3ed with &C, a diodeis fre0uently installed across the coil, to dissipate the

    energy from the collapsing magnetic field at deactivation, which would otherwise generate a

    spike of voltage and might cause damage to circuit components. 2ome automotive relaysalready include that diode inside the relay case. +lternatively a contact protection network,

    consisting of a capacitor and resistor in series, may absorb the surge. If the coil is designed to

    be energi3ed with +C, a small copper ring can be crimped to the end of the solenoid. This

    *shading ring* creates a small outofphase current, which increases the minimum pull on the

    armature during the +C cycle.

    4y analogy with the functions of the original electromagnetic device, a solidstate relay is

    made with a thyristoror other solidstate switching device. To achieve electrical isolation an

    opto coupler can be used which is a lightemitting diode -%E&/ coupled with a photo

    transistor.

    2ince relays are switches,the terminology applied to switches is also applied to relays. +

    relay will switch one or more poles, each of whose contacts can be thrownby energi3ing the

    coil in one of three waysH

    @ormallyopen -NO/ contacts connect the circuit when the relay is activated; the

    circuit is disconnected when the relay is inactive. It is also called a Form Acontact or

    *make* contact.

    @ormallyclosed -NC/ contacts disconnect the circuit when the relay is activated; the

    circuit is connected when the relay is inactive. It is also called a Form #contact or

    *break* contact.

    Changeover, or doublethrow, contacts control two circuitsH one normallyopen

    contact and one normallyclosed contact with a common terminal. It is also called aForm Ccontact or *transfer* contact. If this type of contact utili3es a *make before

    break*

    functionality, then it is called a Form Dcontact.

    9

    http://en.wikipedia.org/wiki/Flyback_diodehttp://en.wikipedia.org/wiki/Thyristorhttp://en.wikipedia.org/wiki/Optocouplerhttp://en.wikipedia.org/wiki/Light-emitting_diodehttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Flyback_diodehttp://en.wikipedia.org/wiki/Thyristorhttp://en.wikipedia.org/wiki/Optocouplerhttp://en.wikipedia.org/wiki/Light-emitting_diodehttp://en.wikipedia.org/wiki/Switch
  • 7/23/2019 Intelligent Street Light

    9/52

    The animated picture shows a working relay with its coil and switch contacts. Goucan see a lever on the left being attracted by magnetism when the coil is switched on. This

    lever moves the switch contacts.

    The relays switch connections are usually label led CD1, @C and @DH

    COMJ Common, always connect to this, it is the moving part of the switch.

    NCJ @ormally Closed, CD1 is connected to this when the relay coil is o,,.

    NOJ @ormally Dpen, CD1 is connected to this when the relay coil is on.

    Connect to CD1 and @D if you want the switched circuit to be on -en te rela+

    coil is on.

    Connect to CD1 and @C if you want the switched circuit to be on -en te rela+

    coil is o,,.

    "

  • 7/23/2019 Intelligent Street Light

    10/52

    CHAPTER /

    RE0U!ATED PO)ER "UPP!*

    1. Po-er "ppl+&

    This unit will supply the various voltage re0uirements of each unit.

    The power supplying unit consists of a transformer, a rectifier, a filter and a regulator. The trans,ormergives a 68#K +C supply.

    Therectifier is used to convert this +C supply to an e0uivalent &C source.

    The rectifier used here is a #rid%e recti,ier.

    In power supplies, capacitors are used to smooth -filter/ the pulsating &C

    output after rectification so that a nearly constant &C voltage is supplied.

    The resistors and inductors can be combined with the capacitors to form

    ,ilternetworks.

    The 'olta%e re%latoris used to keep voltages within the prescribed range

    that can be tolerated by the electrical e0uipment using that voltage.

    Transformer 4ridge Bectifier Capacitor 'ilter

    Koltage Begulator

    CIRCUIT DIA0RAM& OUTPUT )A2EFORM"&

    !#

  • 7/23/2019 Intelligent Street Light

    11/52

    DE"CRIPTION

    + variable regulated power supply, also called a variable bench power supply, is onewhere you can continuously adust the output voltage to your re0uirements. Karying the

    output of the power supply is the recommended way to test a proect after having double

    checked parts placement against circuit drawings and the parts placement guide. This type of

    regulation is ideal for having a simple variable bench power supply. +ctually this is 0uite

    important because one of the first proects a hobbyist should undertake is the construction of

    a variable regulated power supply. Ahile a dedicated supply is 0uite handy e.g. )K or !6K,

    its much handier to have a variable supply on hand, especially for testing.

    The %1?9#) is simple to use. Gou simply connect the positive lead of your

    unregulated &C power supply -anything from "K&C to 6=K&C/ to the Input pin, connect the

    negative lead to the Common pin and then when you turn on the power, you get a ) volt

    supply from the Dutput pin.

    CIRCUIT FEATURE"

    4rief description of operationH >ives out well regulated L)K output, output current

    capability of !## m+

    Circuit protectionH 4uiltin overheating protection shuts down output when

    regulator IC gets too hot

    Circuit complexityH Kery simple and easy to build

    !!

  • 7/23/2019 Intelligent Street Light

    12/52

    Circuit performanceH Kery stable L)K output voltage, reliable operation

    +vailability of componentsH Easy to get, uses only very common basic

    components

    &esign testingH 4ased on datasheet example circuit, I have used this circuit

    successfully as part of many electronics proects

    +pplicationsH art of electronics devices, small laboratory power supply

    ower supply voltageH (nregulated &C 9!9K power supply

    ower supply currentH @eeded output current L ) m+

    Component costsH 'ew dollars for the electronics components L the input

    transformer cost

    #!OC3 DIA0RAM

    !6

  • 7/23/2019 Intelligent Street Light

    13/52

    CIRCUIT DIA0RAM

    #A"IC PO)ER "UPP!* CIRCUIT

    +bove is the circuit of a basic nre%lateddc power supply. + bridge rectifier &! to

    &= rectifies the ac from the transformer secondary, which may also be a block rectifier such

    as AD= or even four individual diodes such as !@=##= types. -2ee later re rectifier ratings/.

    The principal advantage of a bridge rectifier is you do not need a centre

    tap on the secondary of the transformer. + further but significant advantage is that the ripple

    fre0uency at the output is twice the line fre0uency -i.e. )# 53 or $# 53/ and makes filtering

    somewhat easier.

    +s a design example consider we wanted a small unregulated bench

    supply for our proects. 5ere we will go for a voltage of about !6 !8K at a maximum output

    current -I%/ of )##ma -#.)+/. 1aximum ripple will be 6.): and load regulation is ):.

    @ow the B12 secondary voltage -primary is whatever is consistent with

    your area/ for our power transformer T! must be our desired output Ko %(2 the voltage

    drops across &6 and &= - 6 M #.?K/ divided by !.=!=.

    This means that Ksec J !8K L !.=K< !.=!= which e0uals about !#.6K. &epending on the

    K+ rating of your transformer, the secondary voltage will vary considerably in accordance

    !8

  • 7/23/2019 Intelligent Street Light

    14/52

    with the applied load. The secondary voltage on a transformer advertised as say 6#K+ will be

    much greater if the secondary is only lightly loaded.

    If we accept the 6.): ripple as ade0uate for our purposes then at !8K this

    becomes !8 M #.#6) J #.86) Krms. The peak to peak value is 6.969 times this value. Krip J

    #.86)K N 6.969 J #."6 K and this value is re0uired to calculate the value of C!. +lso

    re0uired for this calculation is the time interval for charging pulses. If you are on a $#53

    system it it ! -6 M $# / J #.##9888 which is 9.88 milliseconds. 'or a )#53 system it is #.#!

    sec or !# milliseconds.

    Bemember the tolerance of the type of capacitor used here is very loose. The

    important thing to be aware of is the voltage rating should be at least !8K N !.=!= or !9.88.

    5ere you would use at least the standard 6)K or higher -absolutely not !$K/.Aith our

    rectifier diodes or bridge they should have a IK rating of 6.969 times the Ksec or at least

    6"K. &ont search for this rating because it doesnt exist. (se the next highest standard or

    even higher. The current rating should be at least t-icethe load current maximum i.e. 6 N

    #.)+ or !+. + good type to use would be !@=##=, !@=##$ or !@=##9 types.

    These are rated ! +mp at =##IK, $##IK and !###IK respectively. +lways be

    on the lookout for the higher voltage ones when they are on special.

    TRAN"FORMER RATIN0

    In our example above we were taking #.)+ out of the Ksec of !#K. The K+

    re0uired is !# N #.)+ J )K+. This is a small C4 mount transformer available in +ustralia

    and probably elsewhere.

    This would be an absolute minimum and if you anticipated drawing the maximum

    current all the time then go to a higher K+ rating.

    The two capacitors in the primary side are small value types and if you dont know

    precisely andI mean precisely what you are doing then OMITthem. Their loss wont cause

    you heartache or terrible problems.

    !=

  • 7/23/2019 Intelligent Street Light

    15/52

    THE* MU"T #E HI0H 2O!TA0E T*PE" RATED FOR A.C U"E

    The fuse '! must be able to carry the primary current but blow under excessive

    current, in this case we use the formula from the diagram. 5ere @ J 6=#K !#K or perhaps

    !6#K !#K. The fuse calculates in the first instance to 6 N #.)+ < 6=# !#< or .#=+ or =#

    ma. In the second case .#9+ or 9# ma. The difficulty here is to find suitable fuses of that low

    a current and voltage rating. In practice you use the closest you can get -often !## ma /. &ont

    take that too literal and use !+ or )+ fuses.

    CON"TRUCTION

    The whole proect 1(2T be enclosed in a suitable box. The main switch

    -preferably double pole/ must be rated at 6=#K or !6#K at the current rating. +ll exposed

    parts within the box 1(2T be fully insulated, preferably with heat shrink tubing.

    !)

  • 7/23/2019 Intelligent Street Light

    16/52

    CHAPTER 4

    EM#EDDED "*"TEM"

    IC !$'9?? is one of the most advanced microcontroller from 1icrochip. This controller

    is widely used for experimental and modern applications because of its low price, wide rangeof applications, high 0uality, and ease of availability. It is ideal for applications such asmachine control applications, measurement devices, study purpose, and so on. The IC

    !$'9?? features all the components which modern microcontrollers normally have. The

    figure of a IC!$'9?? chip is shown below.

    4.1 FEATURE" OF PIC15F677

    The IC!$'NN series has more advanced and developed features when compared to

    its previous series. The important features of IC!$'9?? series is given below.

    0ENERA! FEATURE"

    5igh performance BI2C C(.

    D@%G 8) simple word instructions.

    +ll single cycle instructions except for program branches which are two cycles.

    Dperating speedH clock input -6##153/, instruction cycle -6##n2/.

    (p to 8$9O9bit of B+1 -data memory/, 6)$O9 of EEBD1 -data memory/, 9kO!=

    of flash memory.

    in out compatible to IC !$C?=4, IC !$C?$, IC !$C??.

    Eight level deep hardware stack.

    !$

  • 7/23/2019 Intelligent Street Light

    17/52

    Interrupt capability -up to != sources/.

    &ifferent types of addressing modes -direct, Indirect, relative addressing modes/.

    ower on Beset -DB/.

    ower(p Timer -ABT/ and oscillator startup timer.

    %ow power high speed C1D2 flashEEBD1.

    'ully static design.

    Aide operating voltage range -6.# 7 ).)$/volts.

    5igh sinksource current -6)m+/.

    Commercial, industrial and extended temperature ranges.

    %ow power consumption -P#.$m+ typical Q8v=153, 6#R+ typical Q8v86153

    and P! + typical standby/.

    3E* FEATURE"

    1aximum operating fre0uency is 6#153.

    'lash program memory -!= bit words/, 9S4.

    &ata memory -bytes/ is 8$9.

    EEBD1 data memory -bytes/ is 6)$.

    ) inputoutput ports.

    8 timers.

    6 CC modules.

    6 serial communication ports -122, (2+BT/.

    2 parallel communication port

    !#bit +& module -9 channels/

    !?

  • 7/23/2019 Intelligent Street Light

    18/52

    4. PIN DIA0RAM

    !9

  • 7/23/2019 Intelligent Street Light

    19/52

    INPUT8OUTPUT PORT"

    IC!$'9?? has ) basic inputoutput ports. They are usually denoted by DBT + -B +/,

    DBT 4 -B4/, DBT C -BC/, DBT & -B&/, and DBT E -BE/. These ports are used forinput output interfacing. In this controller, DBT +U is only $ bits wide -B+# to B+?/,UDBT 4U , DBT CU,UDBT &U are only 9 bits wide -B4# to B4?,BC# to BC?,B

    to B&?/, UDBT EU has only 8 bit wide -BE# to BE?/.

    +ll these ports are bidirectional. The direction of the port is controlled by using

    TBI2-N/ registers -TBI2 + used to set the direction of DBT+, TBI2 4 used to set thedirection for DBT4, etc./. 2etting a TBI2-N/ bit V!F will set the corresponding DBT-N/ bit

    as input. Clearing a TBI2-N/ bit V#F will set the corresponding DBT-N/ bit as output.

    -If we want to set DBT + as an input, ust set TBI2-+/ bit to logical V!F and want to set

    DBT 4 as an output, ust set the DBT 4 bits to logical V#F./

    +nalog input port -+@# TD +@?/ H these ports are used for interfacing analog inputs.

    TN and BNH These are the (2+BT transmission and reception ports.

    2CSH these pins are used for giving synchronous serial clock input.

    2C%H these pins act as an output for both 2I and I6C modes.

    !"

  • 7/23/2019 Intelligent Street Light

    20/52

    &TH these are synchronous data terminals.

    CSH synchronous clock input.

    2H 2I data output -2I 1ode/.

    2&!H 2I &ata input -2I mode/.

    2&+H data inputoutput in I6C 1ode.

    CC! and CC6H these are capturecompareA1 modules.

    D2C!H oscillator inputexternal clock.

    D2C6H oscillator outputclock out.

    1C%BH master clear pin -+ctive low reset/.

    KppH programming voltage input.

    T5KH 5igh voltage test mode controlling.

    Kref -L/H reference voltage.

    22H 2lave select for the synchronous serial port.

    T#CS!H clock input to TI1EB #.

    T!D2DH Timer ! oscillator output.

    T!D2!H Timer ! oscillator input.

    T!CS!H clock input to Timer !.

    >&H 2erial programming data.

    >CH serial programming clock.

    >1H %ow Koltage rogramming input.

    I@TH external interrupt.

    B&H Bead control for parallel slave port.

    6#

  • 7/23/2019 Intelligent Street Light

    21/52

    C2H 2elect control for parallel slave.

    2# to 2?H arallel slave port.

    K&&H positive supply for logic and input pins.

    K22H >round reference for logic and inputoutput pins.

    4./ ARCHITECTURE OF PIC15F677

    6!

  • 7/23/2019 Intelligent Street Light

    22/52

    IC !$'9?? is a =#pin 94it C1D2 '%+25 1icrocontroller from 1icrochip. The core

    architecture is highperformance BI2C C( with only 8) single word! instructions. 2ince it

    follows the BI2C architecture, all single cycle instructions take only one instruction cycleexcept for program branches which take two cycles. !$'9?? comes with 8 operating speeds

    with =, 9, or 6# 153 clock input. 2ince each instruction cycle takes four operating clock

    cycles, each instruction takes #.6 Rs when 6#153 oscillator is used. It has two types ofinternal memoriesH program memory and data memory. rogram memory is provided by 9S

    words -or 9SM!= bits/ of '%+25 1emory, and data memory has two sources. Dne type ofdata memory is a 8$9byte B+1 -random access memory/ and the other is 6)$byte

    EEBD1 -Electrically erasable programmable BD1/. The core feature includes interruptcapability up to != sources, power saving 2%EE mode, and -IC2/ capability. The

    sinksource current, whichsingle )K InCircuit 2erial rogramming indicates a driving

    power from ID port, is high with 6)m+. ower consumption is less than 6 m+ in )Koperating condition. The peripheral features includeH -a/ 8 time blocksH Timer# for 9bit

    timercounter; Timer! for !$bit timercounter; and Timer6H 9bit timercounter with 9bit

    66

  • 7/23/2019 Intelligent Street Light

    23/52

    period register, prescaler and postscaler. -b/ Two Capture, Compare, A1 modules for

    capturing, comparing !$bit, and A1 generation with !#bit resolution. -c/ !#bit multi

    channel -max 9/+nalogto&igital converter module. -1aster 1ode/ and I6-d/ 2ynchronous

    2erial ort -22/ with 2I -1aster2lave/C6 -e/ (niversal 2ynchronous +synchronous

    Beceiver Transmitter -(2+BT2CI/ with "bit address detection -f/ arallel 2lave ort -2/

    9bits wide, with external B&, AB and C2 controls -g/ ID ports. The key feature of !$'9??is summari3ed belowH '%+25 rogram 1emory -!=bit word/ 9S Aords &ata 1emory-B+1/ 8$9 4ytes &ata 1emory -EEBD1/ 6)$ 4ytes Interrupts != ID orts orts +, 4, C,

    &, E Timers 8 CaptureCompareA1 1odules 6 2erial Communications 122, (2+BT ! .

    4./.1 MEMOR* OR0ANI9ATION OF PIC15F677

    The memory of a IC !$'9?? chip is divided into 8 sections. They are

    !.rogram memory

    6.&ata memory and

    8.&ata EEBD1

    Pro%ram memor+

    rogram memory contains the programs that are written by the user. The program

    counter -C/ executes these stored commands one by one. (sually IC!$'9?? devices

    have a !8 bit wide program counter that is capable of addressing 9SO!= bit program

    memory space. This memory is primarily used for storing the programs that are written

    -burned/ to be used by the IC. These devices also have 9SM!= bits of flash memory that

    can be electrically erasable reprogrammed. Each time we write a new program to thecontroller, we must delete the old one at that time.

    68

  • 7/23/2019 Intelligent Street Light

    24/52

    Data Memor+ The data memory is partitioned into multiple banks which contain the >eneral

    urpose Begisters and the 2pecial 'unction Begisters. 4its B! -2tatusP$W/ and B#

    -2tatusP)W/ are the bank select bits. Each bank extends up to ?'h -!69 bytes/. The lowerlocations of each bank are reserved for the 2pecial 'unction Begisters. +bove the 2pecial

    'unction Begisters are >eneral urpose Begisters, implemented as static B+1. +ll

    implemented banks contain 2pecial 'unction Begisters. 2ome fre0uently used 2pecial'unction Begisters from one bank may be mirrored in another bank for code reduction and

    0uicker access.

    .1.1 0ENERA! PURPO"E RE0I"TER

    FI!EThe register file can be accessed either directly, orin directly, through the 'ile 2elect Begister-'2B/.

    6=

  • 7/23/2019 Intelligent Street Light

    25/52

    Data EEPROM and F!A"H

    The data EEBD1 and 'lash program memory is readable and writable during normal

    operation -over the full K&& range/. This memory is not directly mapped in the register filespace. Instead, it is indirectly addressed through the 2pecial 'unction Begisters. There are six2'Bs used to read and write this memoryH

    X EECD@!

    X EECD@6

    X EE&+T+X EE&+T5

    X EE+&B

    6)

  • 7/23/2019 Intelligent Street Light

    26/52

    X EE+&B5

    The EEBD1 data memory allows singlebyte read and writes. The 'lash program

    memory allows singleword reads and fourword block writes. rogram memory writeoperations automatically perform an erasebefore write on blocks of four words. + byte write

    in data EEBD1 memory automatically erases the location and writes the new data -erase

    beforewrite/. The write time is controlled by an onchip timer. The writeerase voltages aregenerated by an onchip charge pump, rated to operate over the voltage range of the device

    for byte or word operations.

    4.4 I8O PORT"2ome pins for these ID ports are multiplexed with an alternate function for the peripheral

    features on the device. In general, when a peripheral is enabled, that pin may not be used as ageneral purpose ID pin.

    4.4.1 PORTA and te TRI"A Re%ister

    DBT+ is a $bit wide, bidirectional port. The corresponding data direction register is

    TBI2+. 2etting a TBI2+ bit -J !/ will make the corresponding DBT+ pin an input -i.e., put

    the corresponding output driver in a 5ighImpedance mode/. Clearing a TBI2+ bit -J #/ willmake the corresponding DBT+ pin an output -i.e., put the contents of the output latch on the

    selected pin/. Beading the DBT+ register reads the status of the pins, whereas writing to it

    will write to the port latch. +ll write operations are readmodifywrite operations. Therefore,

    6$

  • 7/23/2019 Intelligent Street Light

    27/52

    a write to a port implies that the port pins are read, the value is modified and then written to

    the port data latch. in B+= is multiplexed with the Timer# module clock input to become

    the B+=T#CSI pin. The B+=T#CSI pin is a 2chmitt Trigger input and an opendrainoutput.

    +ll other DBT+ pins have TT% input levels and full C1D2 output drivers. Dther

    DBT+ pins are multiplexed with analog inputs and the analog KBE' input for both the +&converters and the comparators. The operation of each pin is selected by clearingsetting the

    appropriate control bits in the +&CD@! andor C1CD@ registers.

    The TBI2+ register controls the direction of the port pins even when they are being used asanalog inputs. The user must ensure the bits in the TBI2+ register are maintained set when

    using them as analog inputs.

    4.4. PORT# and te TRI"# Re%ister

    DBT4 is an 9bit wide, bidirectional port. The corresponding data direction register is

    TBI24. 2etting a TBI24 bit -J !/ will make the corresponding DBT4 pin an input -i.e., putthe corresponding output driver in a 5ighImpedance mode/. Clearing a TBI24 bit -J #/ will

    make the corresponding DBT4 pin an output -i.e., put the contents of the output latch on theselected pin/. Three pins of DBT4 are multiplexed with the InCircuit &ebugger and %owKoltage rogramming functionH B48>1, B4$>C and B4?>&.

    Each of the DBT4 pins has a weak internal pullup. + single control bit can turn on all

    the pullups. This is performed by clearing bit B4( -DTID@YBE>P?W/. The weak pullupis automatically turned off when the port pin is configured as an output. The pullups are

    disabled on a oweron Beset.

    6?

  • 7/23/2019 Intelligent Street Light

    28/52

    'our of the DBT4 pins, B4?HB4=, have an interrupton change feature. Dnly pins

    configured as inputs can cause this interrupt to occur -i.e., any B4?HB4= pin configured as an

    output is excluded from the interrupton change comparison/. The input pins -of B4?HB4=/are compared with the old value latched on the last read of DBT4. The mismatchU outputs

    of B4?HB4= are DBFed together to generate the B4 port change interrupt with flag bit B4I'

    -I@TCD@P#W/.

    4.4./ PORTC and te TRI"C Re%ister

    DBTC is an 9bit wide, bidirectional port. The corresponding data direction register isTBI2C. 2etting a TBI2C bit -J !/ will make the corresponding DBTC pin an input -i.e., put

    the corresponding output driver in a 5ighImpedance mode/. Clearing a TBI2C bit -J #/ will

    make the corresponding DBTC pin an output -i.e., put the contents of the output latch on the

    selected pin/. DBTC is multiplexed with several peripheral functions. DBTC pins have 2chmitt

    Trigger input buffers. Ahen the I6C module is enabled, the DBTCP=H8W pins can beconfigured with normal I6C levels, or with 21 4us levels, by using the CSE bit-222T+TP$W/. Ahen enabling peripheral functions, care should be taken in defining TBI2

    bits for each DBTC pin. 2ome peripherals override the TBI2 bit to make a pin an output,

    while other peripherals override the TBI2 bit to make a pin an input. 2ince the TBI2 bitoverride is in effect while the peripheral is enabled, readmodify write instructions -42',

    4C', NDBA'/ with TBI2C as the destination, should be avoided. The user should refer to

    the corresponding peripheral section for the correct TBI2 bit settings.

    69

  • 7/23/2019 Intelligent Street Light

    29/52

    4.4.4 PORTD and TRI"D Re%isters

    DBT& is an 9bit port with 2chmitt Trigger input buffers. Each pin is individuallyconfigurable as an input or output. DBT& can be configured as an 9bit wide

    microprocessor port -arallel 2lave ort/ by setting control bit, 21D&E -TBI2EP=W/. Inthis mode, the input buffers are TT%.

    4.4.: PORTE and TRI"E Re%ister

    DBTE has three pins -BE#B&+@), BE!AB+@$ and BE6C2+@?/ which are

    individually configurable as inputs or outputs. These pins have 2chmitt Trigger input buffers. The DBTE pins become the ID control inputs for the microprocessor port when bit

    21D&E -TBI2EP=W/ is set. In this mode, the user must make certain that the

    TBI2EP6H#W bits are set and that the pins are configured as digital inputs. +lso, ensure that+&CD@! is configured for digital ID. In this mode, the input buffers are TT%.

    6"

  • 7/23/2019 Intelligent Street Light

    30/52

    Begister =! shows the TBI2E register which also controls the arallel 2lave ort

    operation. DBTE pins are multiplexed with analog inputs. Ahen selected for analog input,

    these pins will read as V#Fs. TBI2E controls the direction of the BE pins, even when they arebeing used as analog inputs. The user must make sure to keep the pins configured as inputs

    when using them as analog inputs.

    4.4.5 Parallel "la'e Port

    The arallel 2lave ort -2/ is not implemented on the IC!$'9?8+ or IC!$'9?$+.DBT& operates as an 9bit wide arallel 2lave ort, or microprocessor port, when control

    bit 21D&E -TBI2EP=W/ is set. In 2lave mode, it is asynchronously readable and writable

    by the external world through B& control input pin, BE#B&+@), and AB control input

    pin, BE!AB+@$. The 2 can directly interface to an 9bit microprocessor data bus. The external

    microprocessor can read or write the DBT& latch as an 9bit latch. 2etting bit 21D&E

    enables port pin BE#B&+@) to be the B& input, BE!AB+@$ to be the AB input andBE6C2+@? to be the C2 -Chip 2elect/ input. 'or this functionality, the corresponding data

    direction bits of the TBI2E register -TBI2EP6H#W/ must be configured as inputs -set/. The

    +& port configuration bits, C'>8HC'># -+&CD@!P8H#W/, must be set to configure pinsBE6HBE# as digital ID.

    There are actually two 9bit latchesH one for data output and one for data input. The user

    writes 9bit data to the DBT& data latch and reads data from the port pin latch -note that

    they have the same address/. In this mode, the TBI2& register is ignored since the externaldevice is controlling the direction of data flow.

    8#

  • 7/23/2019 Intelligent Street Light

    31/52

    + write to the 2 occurs when both the C2 and AB lines are first detected low. Aheneither the C2 or AB lines become high -level triggered/, the Input 4uffer 'ull -I4'/ status

    flag bit -TBI2EP?W/ is set on the Z= clock cycle, following the next Z6 cycle, to signal the

    write is complete . The interrupt flag bit, 2I' -IB!P?W/, is also set on the same Z= clockcycle.

    I4' can only be cleared by reading the DBT& input latch. The Input 4uffer Dverflow-I4DK/ status flag bit -TBI2EP)W/ is set if a second write to the 2 is attempted when the

    previous byte has not been read out of the buffer. + read from the 2 occurs when both the

    C2 and B& lines are first detected low. The Dutput 4uffer 'ull -D4'/ status flag bit

    -TBI2EP$W/ is cleared immediately indicating that the DBT& latch is waiting to be read bythe external bus. Ahen either the C2 or B& pin becomes high -level triggered/, the interrupt

    flag bit 2I' is set on the Z= clock cycle, following the next Z6 cycle, indicating that the

    read is complete. D4' remains low until data is written to DBT& by the user firmware.

    Ahen not in 2 mode, the I4' and D4' bits are held clear. 5owever, if flag bit I4DKwas previously set, it must be cleared in firmware. +n interrupt is generated and latched into

    flag bit 2I' when a read or write operation is completed. 2I' must be cleared by theuser in firmware and the interrupt can be disabled by clearing the interrupt enable bit 2IE

    -IE!P?W/.

    8!

  • 7/23/2019 Intelligent Street Light

    32/52

    PARA!!E! "!A2E PORT )RITE )A2EFORM

    4.4.7 "PECIA! FEATURE" OF THE CPU

    +ll IC!$'9?N+ devices have a host of features intended to maximi3e system reliability,minimi3e cost through elimination of external components, provide power saving operating

    modes and offer code protection. These areH

    X Dscillator 2electionX Beset

    oweron Beset -DB/

    owerup Timer -ABT/ Dscillator 2tartup Timer -D2T/

    4rownout Beset -4DB/

    X Interrupts

    X Aatchdog Timer -A&T/X 2leep

    X Code rotection

    X I& %ocationsX InCircuit 2erial rogramming

    X %owKoltage InCircuit 2erial rogramming

    X InCircuit &ebugger

    IC!$'9?N+ devices have a Aatchdog Timer which can be shutoff only throughconfiguration bits. It runs off its own BC oscillator for added reliability. There are two

    timers that offer necessary delays on powerup. Dne is the Dscillator 2tartup Timer -D2T/,intended to keep the chip in Beset until the crystal oscillator is stable. The other is the ower

    up Timer -ABT/, which provides a fixed delay of ?6 ms -nominal/ on powerup only. It is

    designed to keep the part in Beset while the power supply stabili3es. Aith these two timers

    onchip, most applications need no external Beset circuitry. 2leep mode is designed to offer avery low current powerdown mode. The user can wakeup from 2leep through external

    86

  • 7/23/2019 Intelligent Street Light

    33/52

    Beset, Aatchdog Timer wakeup or through an interrupt. 2everal oscillator options are also

    made available to allow the part to fit the application. The BC oscillator option saves system

    cost while the % crystal option saves power. + set of configuration bits is used to selectvarious options.

    Con,i%ration #its

    The configuration bits can be programmed -read as V#F/, or left un programmed -read asV!F/ to select various device configurations. The erased or un programmed value of the

    Configuration Aord register is 8'''h. These bits are mapped in program memory location

    6##?h. It is important to note that address 6##?h is beyond the user program memory spacewhich can be accessed only during programming.

    ;it 1/ CP& 'lash rogram 1emory Code rotection bit ! J Code protection off # J +ll

    program memory codeprotected

    ;it 1Unimplemented& Bead as V!F;it 11DE#U0& InCircuit &ebugger 1ode bit

    ! J InCircuit &ebugger disabled, B4$ and B4? are general purpose ID pins

    # J InCircuit &ebugger enabled, B4$ and B4? are dedicated to the debugger

    ;it 1)RT1&)RT< 'lash rogram 1emory Arite Enable bits

    'or IC!$'9?$+9??+H

    !! J Arite protection off; all program memory may be written to by EECD@ control

    !# J ####h to ##''h writeprotected; #!##h to !'''h may be written to by EECD@ control#! J ####h to #?''h writeprotected; #9##h to !'''h may be written to by EECD@ control

    ## J ####h to #'''h writeprotected; !###h to !'''h may be written to by EECD@ control

    'or IC!$'9?8+9?=+H

    !! J Arite protection off; all program memory may be written to by EECD@ control!# J ####h to ##''h writeprotected; #!##h to #'''h may be written to by EECD@ control

    #! J ####h to #8''h writeprotected; #=##h to #'''h may be written to by EECD@ control## J ####h to #?''h writeprotected; #9##h to #'''h may be written to by EECD@ control

    ;it 6 CPD& &ata EEBD1 1emory Code rotection bit

    ! J &ata EEBD1 code protection off

    # J &ata EEBD1 codeprotected

    ;it 7 !2PH %owKoltage -2ingle2upply/ InCircuit 2erial rogramming Enable bit

    ! J B48>1 pin has >1 function; lowvoltage programming enabled

    # J B48 is digital ID, 5K on 1C%B must be used for programming

    ;it 5 #ORENH 4rownout Beset Enable bit

    ! J 4DB enabled # J 4DB disabled

    ;it :=4Unimplemented& Bead as V!F

    ;it /P)RTENH owerup Timer Enable bit

    ! J ABT disabled # J ABT enabled

    ;it )DTENH Aatchdog Timer Enable bit

    ! J A&T enabled

    88

  • 7/23/2019 Intelligent Street Light

    34/52

    # J A&T disabled

    ;it 1=

  • 7/23/2019 Intelligent Street Light

    35/52

    2ome registers are not affected in any Beset condition. Their status is unknown on DB

    and unchanged in any other Beset. 1ost other registers are reset to a Beset stateU on ower

    on Beset -DB/, on the 1C%B and A&T Beset, on 1C%B Beset during 2leep and 4rownoutBeset -4DB/. They are not affected by a A&T wakeup which is viewed as the resumption of

    normal operation. The TD and & bits are set or cleared differently in different Beset

    situations as indicated in These bits are used in software to determine the nature of the Beset.

    MC!R

    IC!$'9?N+ devices have a noise filter in the 1C%B Beset path. The filter will detect

    and ignore small pulses. It should be noted that a A&T Beset does not drive 1C%B pin low.

    The behavior of the E2& protection on the 1C%B pin differs from previous devices ofthis family. Koltages applied to the pin that exceed its specification can result in both Besets

    and current consumption outside of device specification during the Beset event. 'or this

    reason, 1icrochip recommends that the 1C%B pin no longer be tied directly to K&&.

    Po-er=on Reset ?POR@

    + oweron Beset pulse is generated onchip when K&& rise is detected -in the range of!.6K!.?K/. To take advantage of the DB, tie the 1C%B pin to K&& through an BC

    network Ahen the device starts normal operation -exits the Beset condition/, device

    operating parameters -voltage, fre0uency, temperature, etc./ must be met to ensure operation.If these conditions are not met, the device must be held in Beset until the operating

    conditions are met. 4rownout Beset may be used to meet the startup conditions.

    Po-er=p Timer ?P)RT@

    The owerup Timer provides a fixed ?6 ms nominal timeout on powerup only from theDB. The ower up Timer operates on an internal BC oscillator. The chip is kept in Beset as

    long as the ABT is active. The ABTFs time delay allows K&& to rise to an acceptable

    level. + configuration bit is provided to enable or disable the ABT. The powerup timedelay will vary from chip to chip due to K&&, temperature and process variation.

    Oscillator "tart=p Timer ?O"T@

    The Dscillator 2tartup Timer -D2T/ provides a delay of !#6= oscillator cycles -from

    D2C! input/ after the ABT delay is over -if ABT is enabled/. This helps to ensure that the

    crystal oscillator or resonator has started and stabili3ed. The D2T timeout is invoked onlyfor NT, % and 52 modes and only on oweron Beset or wakeup from 2leep.

    #ro-n=ot Reset ?#OR@

    The configuration bit, 4D&E@, can enable or disable the 4rownout Beset circuit. Dncethe brownout occurs, the device will remain in 4rownout Beset until K&& rises above

    8)

  • 7/23/2019 Intelligent Street Light

    36/52

    K4DB. The owerup Timer then keeps the device in Beset for TABT -parameter [88,

    about ?6 m2/. If K&& should fall below K4DB during TABT, the 4rownout Beset

    process will restart when K&& rises above K4DB with the owerup Timer Beset. Theowerup Timer is always enabled when the 4rownout Beset circuit is enabled, regardless of

    the state of the ABT configuration bit.

    )atcdo% Timer ?)DT@

    The Aatchdog Timer is a free running, onchip BC oscillator which does not re0uire anyexternal components. This BC oscillator is separate from the BC oscillator of the

    D2C!C%SI pin. That means that the A&T will run even if the clock on the D2C!C%SI and

    D2C6C%SD pins of the device has been stopped, for example, by execution of a 2%EEinstruction. &uring normal operation, a A&T timeout generates a device Beset -Aatchdog

    Timer Beset/. If the device is in 2leep mode, a A&T timeout causes the device to wakeup

    and continue with normal operation -Aatchdog Timer Aakeup/. The TD bit in the 2tatus

    register will be cleared upon a Aatchdog Timer timeout.

    FUNCTIONA! #!OC3 DIA0RAM OF MICROCONTRO!!ER

    = Fnctional ;loc$ dia%ram o, micro controller

    8$

  • 7/23/2019 Intelligent Street Light

    37/52

    CHAPTER=:

    "OFT)ARE "TUD*

    :.1 EM#EDDED C

    Embedded C is a set of language extensions for the C rogramming languageby the C

    2tandards committeeto address commonality issues that exist between C extensions fordifferent embedded systems. 5istorically, embedded C programming re0uires nonstandard

    extensions to the C language in order to support exotic features such as fixedpoint

    arithmetic, multiple distinct memory banks, and basic IDoperations.

    In 6##9, the C 2tandards Committee extended the C language to address these issues byproviding a common standard for all implementations to adhere to. It includes a number of

    features not available in normal C, such as, fixedpoint arithmetic, named address spaces, and

    basic ID hardware addressing. Embedded C uses most of the syntax and semantics of standard C, e.g., main-/ function,

    variable definition, data type declaration, conditional statements -if, switch, case/, loops

    -while, for/, functions, arrays and strings, structures and union, bit operations, macros.

    :. C IN EM#EDDED "*"TEM The C programming language is perhaps the most popular programming language forprogramming embedded systems. -EarlierEmbedded 2ystemsEmbedded 2ystems

    Introduction[Ahich rogramming %anguages Aill This 4ook (se\we mentioned other

    popular programming languages/.

    1ost C programmers are spoiled because they program in environments where not onlyis there a standard library implementation, but there are fre0uently a number of other libraries

    available for use. The cold fact is, that in embedded systems, there rarely are many of the

    libraries that programmers have grown used to, but occasionally an embedded system mightnot have a complete standard library, if there is a standard library at all. 'ew embedded

    systems have capability for dynamic linking, so if standard library functions are to be

    available at all, they often need to be directly linked into the executable. Dftentimes, becauseof space concerns, it is not possible to link in an entire library file, and programmers are

    often forced to *brew their own* standard c library implementations if they want to use them

    at all. Ahile some libraries are bulky and not well suited for use on microcontrollers, many

    development systems still include the standard libraries which are the most common for Cprogrammers.

    C remains a very popular language for microcontroller developers due to the code

    efficiency and reduced overhead and development time. C offers lowlevel control and isconsidered more readable than assembly. 1any free C compilers are available for a wide

    variety of development platforms. The compilers are part of an I&Es with IC& support,

    breakpoints, singlestepping and an assembly window. The performance of C compilers hasimproved considerably in recent years, and they are claimed to be more or less as good as

    assembly, depending on who you ask. 1ost tools now offer options for customi3ing the

    compiler optimi3ation. +dditionally, using C increases portability, since C code can be

    compiled for different types of processors.

    8?

    http://en.wikipedia.org/wiki/C_Languagehttp://en.wikipedia.org/wiki/SC22http://en.wikipedia.org/wiki/SC22http://en.wikipedia.org/wiki/Embedded_systemshttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Memory_bankhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction#Which_Programming_Languages_Will_This_Book_Use.3Fhttp://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction#Which_Programming_Languages_Will_This_Book_Use.3Fhttp://en.wikipedia.org/wiki/C_Languagehttp://en.wikipedia.org/wiki/SC22http://en.wikipedia.org/wiki/SC22http://en.wikipedia.org/wiki/Embedded_systemshttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Memory_bankhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction#Which_Programming_Languages_Will_This_Book_Use.3Fhttp://en.wikibooks.org/wiki/Embedded_Systems/Embedded_Systems_Introduction#Which_Programming_Languages_Will_This_Book_Use.3F
  • 7/23/2019 Intelligent Street Light

    38/52

    :..1 DIFFERENCE #ET)EEN C AND EM#EDDED C

    Though C and em;edded Cappear different and are used in different contexts, they

    have more similarities than the differences. 1ost of the constructs are same; the difference

    lies in their applications.

    C is used for desktop computers, while em;edded Cis for microcontroller basedapplications. +ccordingly, C has the luxury to use resources of a desktop C like memory,

    D2, etc. Ahile programming on desktop systems, we need not bother about memory.

    5owever, embedded C has to use with the limited resources -B+1, BD1, IDs/ on anembedded processor. Thus, program code must fit into the available program memory. If

    code exceeds the limit, the system is likely to crash.

    Compilers for C -+@2I C/ typically generate D2 dependant executables. Em;edded

    Cre0uires compilers to create files to be downloaded to the

    microcontrollersmicroprocessors where it needs to run. Embedded compilers give access to

    all resources which is not provided in compilers for desktop computer applications.

    Embedded systems often have the realtime constraints, which is usually not there withdesktop computer applications.

    Embedded systems often do not have a console, which is available in case of desktopapplications.

    2o, what basically is different while programming with em;edded Cis the mindset; for

    embedded applications, we need to optimally use the resources, make the program codeefficient, and satisfy real time constraints, if any. +ll this is done using the basic constructs,

    syntaxes, and function libraries of VCF.

    :.. "OFT)ARE U"ED IN THE PROJECT

    1%+4 is a freeintegrated development environmentfor the development ofembeddedapplicationson ICand ds IC microcontrollers, and is developed by 1icrochip

    Technology.

    1%+4 N is the latest edition of 1%+4, and is developed on the@et

    4eansplatform. 1%+4 and 1%+4 N support proect management, code editing,debugging and programming of 1icrochip 9bit, !$bit and 86bit IC microcontrollers.

    1%+4 is designed to work with 1%+4certified devices such as the 1%+4 IC&

    8and1%+4 BE+% ICE, for programming and debugging IC microcontrollers usingapersonal computer.IC Sitprogrammers are also supported by 1%+4.

    89

    http://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/PIC_Microcontrollerhttp://en.wikipedia.org/wiki/PIC_microcontroller#PIC24_and_dsPIC_16-bit_microcontrollershttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Microchip_Technologyhttp://en.wikipedia.org/wiki/Microchip_Technologyhttp://en.wikipedia.org/wiki/NetBeanshttp://en.wikipedia.org/wiki/NetBeanshttp://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_ICD_3http://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_ICD_3http://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_REAL_ICEhttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/PICKithttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/PIC_Microcontrollerhttp://en.wikipedia.org/wiki/PIC_microcontroller#PIC24_and_dsPIC_16-bit_microcontrollershttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Microchip_Technologyhttp://en.wikipedia.org/wiki/Microchip_Technologyhttp://en.wikipedia.org/wiki/NetBeanshttp://en.wikipedia.org/wiki/NetBeanshttp://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_ICD_3http://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_ICD_3http://en.wikipedia.org/wiki/MPLAB_devices#MPLAB_REAL_ICEhttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/PICKit
  • 7/23/2019 Intelligent Street Light

    39/52

    "TEP&1

    8"

  • 7/23/2019 Intelligent Street Light

    40/52

    "TEP&/4

    =#

  • 7/23/2019 Intelligent Street Light

    41/52

    "TEP&5=6

    =!

  • 7/23/2019 Intelligent Street Light

    42/52

    "TEP&>

    =6

  • 7/23/2019 Intelligent Street Light

    43/52

    "TEP&1

  • 7/23/2019 Intelligent Street Light

    44/52

    "TEP&1/=14

    ==

  • 7/23/2019 Intelligent Street Light

    45/52

    "TEP&1:=17

    =)

  • 7/23/2019 Intelligent Street Light

    46/52

    "TEP&16=1>

    =$

  • 7/23/2019 Intelligent Street Light

    47/52

    "TEP&

  • 7/23/2019 Intelligent Street Light

    48/52

    "TEP&/

    =9

  • 7/23/2019 Intelligent Street Light

    49/52

    "TEP&4

    ="

  • 7/23/2019 Intelligent Street Light

    50/52

    CHAPTER 5

    CONC!U"ION

    This paper elaborates the design and construction of automatic street control systemcircuit. Circuit works properly to turn street lamp D@D''. +fter designing the circuit which

    controls the light of the street as illustrated in the previous sections. %&B sensor and the

    photoelectric sensors are the two main conditions in working the circuit. If the two conditions

    have been satisfied the circuit will do the desired work according to specific program. Each

    sensor controls the turning D@ or D'' the lighting column. The street lights has been

    successfully controlled by microcontroller. Aith commands from the controller the lights will

    be D@ in the places of the movement when its dark. 'urther more the drawback of the street

    light system using timer controller has been overcome, where the system depends on

    photoelectric sensor. 'inally this control circuit can be used in a long roadways between the

    cities.

    FUTURE ENHANCEMENT

    Aireless is the bu33 of communication industry today. The field of

    wireless communication is growing leaps and bounds day by day. There have been many

    advancements taking place in the semiconductor industry leading to more and more

    advancements in wireless technology.

    The main aim of the proect is to save the power, by using effectively we can save

    more power, as we know that there is shortage of power nowadays in every where mostly in

    villages etc. 2o to overcome that we can provide street lights automatically with the

    centrali3ed intelligent systems. 2o in future we can design many more advanced technologies

    to save power.

    )#

  • 7/23/2019 Intelligent Street Light

    51/52

    CHAPTER 7

    REFERENCE"

    !< &. +. &evi and +. Sumar, &esign and Implementation of C%& based 2olar ower

    2aving 2ystem for 2treet %ights and +utomatic Traffic Controller, International ournal of

    2cientific and Besearch ublications, Kol. 6, Issue!!, @ovember 6#!6.

    6< . 1ohelnikova, Electric Energy 2avings and %ight >uides, Energy] Environment, 8rd

    I+21EA2E+2 International Conference on, Cambridge, (S, 'ebruary 6##9, pp.=?#=?=.

    8< 1. +. Aa3ed, @. @afis, 1. T. Islam and +. 2. 1. 2ayem, &esign and 'abrication of

    +utomatic 2treet %ight Control 2ystem, Engineering eTransaction, Kol. ), @o. !, une 6#!#,

    pp 6?8=.

    =< B. riyasree, B. Sauser, E. Kinitha and @. >angatharan, +utomatic 2treet %ight Intensity

    Control and Boad 2afety 1odule (sing Embedded 2ystem, International Conference on

    Computing and Control Engineering, +pril 6#!6.

    )< S. 2. 2udhakar, +. +. +nil, S. C. +shok and 2. 2. 4haskar, +utomatic 2treet %ight

    Control 2ystem, International ournal of Emerging Technology and +dvanced Engineering,

    Kol. 8, 1ay 6#!8, . !99!9".

    $< S.G. Baput, >. Shatav, 1. uari, . Gadav, Intelligent 2treet %ighting 2ystem (sing

    >sm, International ournal of Engineering 2cience Invention, Kol6, Issue 8, 1arch 6#!8, .

    $# $".

    ?< 1. opa, C. Cepi^c_, Energy Consumption 2aving 2olutions 4ased on Intelligent 2treet

    %ighting Control 2ystem. (..4. 2ci. 4ull., Kol. ?8, +pril 6#!!, . 6"?8#9.

    9< B. 1ohamaddoust, +. T. 5aghighat, 1. . 1. 2harif and @. Capanni, + @ovel &esign of

    an +utomatic %ighting Control 2ystem for a Aireless 2ensor @etwork with Increased 2ensor

    %ifetime and Beduced 2ensor @umbers, 2ensors, Kol. !!, . 9"889")6.

    "< %. asio, T. Ailmshurst, &. Ibrahim, . 1orton, 1. 4ates, . 2mith &. 2mith and C.

    5ellebuyck, IC 1icrocontrollersH know it all, ublishing Elsevier 2cience, 6##9.

    !#< A. 4olton. Instrumentation and Control 2ystems, Elsevier 2cience ] Technology

    4ooks, +ugust 6##=. !!< IC!$'9?N+ &ata 2heet. 6##8 1icrochip Technology.

    )!

  • 7/23/2019 Intelligent Street Light

    52/52