Parking Warning System

7
Copyright © 2008, Wimborne Publishing Ltd (Sequoia House, 398a Ringwood Road, Ferndown, Dorset BH22 9AU, UK) and TechBites Interactive Inc., (PO Box 857, Madison, Alabama 35758, USA) All rights reserved. The materials and works contained within EPE Online — which are made available by Wimborne Publishing Ltd and TechBites Interactive Inc — are copyrighted. TechBites Interactive Inc and Wimborne Publishing Ltd have used their best efforts in preparing these materials and works. However, TechBites Interactive Inc and Wimborne Publishing Ltd make no warranties of any kind, expressed or implied, with regard to the documentation or data contained herein, and specifically disclaim, without limitation, any implied warranties of merchantability and fitness for a particular purpose. Because of possible variances in the quality and condition of materials and workmanship used by readers, EPE Online, its publishers and agents disclaim any responsibility for the safe and proper functioning of readerconstructed projects based on or from information published in these materials and works. In no event shall TechBites Interactive Inc or Wimborne Publishing Ltd be responsible or liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or any other damages in connection with or arising out of furnishing, performance, or use of these materials and works. READERS’ TECHNICAL ENQUIRIES We are unable to offer any advice on the use, purchase, repair or modification of commercial equipment or the incorporation or modification of designs published in the magazine. We regret that we cannot provide data or answer queries on articles or projects that are more than five years’ old. We are not able to answer technical queries on the phone. PROJECTS AND CIRCUITS All reasonable precautions are taken to ensure that the advice and data given to readers is reliable. We cannot, however, guarantee it and we cannot accept legal responsibility for it. A number of projects and circuits published in EPE employ voltages that can be lethal. You should not build, test, modify or renovate any item of mainspowered equipment unless you fully understand the safety aspects involved and you use an RCD adaptor. COMPONENT SUPPLIES We do not supply electronic components or kits for building the projects featured; these can be supplied by advertisers in our publication Practical Everyday Electronics. Our web site is located at www.epemag.com We advise readers to check that all parts are still available before commencing any project. To order you copy for only $18.95 for 12 issues go to www.epemag.com www.epemag.com

description

Electronics Project

Transcript of Parking Warning System

  • Copyright 2008, Wimborne Publishing Ltd (Sequoia House, 398a Ringwood Road, Ferndown, Dorset BH22 9AU, UK)

    and TechBites Interactive Inc., (PO Box 857, Madison, Alabama 35758, USA)

    All rights reserved.

    ThematerialsandworkscontainedwithinEPEOnlinewhicharemadeavailableby

    WimbornePublishingLtdandTechBitesInteractiveIncarecopyrighted. TechBitesInteractiveIncandWimbornePublishingLtdhaveusedtheirbesteffortsinpreparingthesematerialsandworks.However,TechBitesInteractiveIncandWimbornePublishingLtdmakenowarrantiesofanykind,expressedorimplied,withregardtothedocumentationordatacontainedherein,andspecificallydisclaim,withoutlimitation,anyimpliedwarrantiesofmerchantabilityandfitnessforaparticularpurpose.Becauseofpossiblevariancesinthequalityandconditionofmaterialsandworkmanshipusedbyreaders,EPEOnline,itspublishersandagentsdisclaimanyresponsibilityforthesafeandproperfunctioningofreaderconstructedprojectsbasedonorfrominformationpublishedinthesematerialsandworks.InnoeventshallTechBitesInteractiveIncorWimbornePublishingLtdberesponsibleorliableforanylossofprofitoranyothercommercialdamages,includingbutnotlimitedtospecial,incidental,consequential,oranyotherdamagesinconnectionwithorarisingoutoffurnishing,performance,oruseofthesematerialsandworks.READERSTECHNICALENQUIRIES

    Weareunabletoofferanyadviceontheuse,purchase,repairormodificationofcommercialequipmentortheincorporationormodificationofdesignspublishedinthemagazine.Weregretthatwecannotprovidedataoranswerqueriesonarticlesorprojectsthataremorethanfiveyearsold.Wearenotabletoanswertechnicalqueriesonthephone.

    PROJECTSANDCIRCUITS

    Allreasonableprecautionsaretakentoensurethattheadviceanddatagiventoreadersisreliable.Wecannot,however,guaranteeitandwecannotacceptlegalresponsibilityforit.AnumberofprojectsandcircuitspublishedinEPEemployvoltagesthatcanbelethal.Youshouldnotbuild,test,modifyorrenovateanyitemofmainspoweredequipmentunlessyoufullyunderstandthesafetyaspectsinvolvedandyouuseanRCDadaptor.

    COMPONENTSUPPLIES

    Wedonotsupplyelectroniccomponentsorkitsforbuildingtheprojectsfeatured;thesecanbesuppliedbyadvertisersinourpublicationPracticalEverydayElectronics.Ourwebsiteislocatedatwww.epemag.com

    Weadvisereaderstocheckthatallpartsarestillavailablebeforecommencinganyproject.

    Toorderyoucopyforonly$18.95for12issuesgotowww.epemag.com

    www.

    epem

    ag.co

    m

    www.epemag.com

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 167

    This is a device to aid you inparkiar in a garage by providing avisual and audible warning. It iseasily set up by mounting it ontothe wall at the end of the garage.

    The device produces a codedinfrared (IR) beam which detectsthe proximity of the vehicle bybouncing IR off it as itapproaches, without beingconfused by other IR sources.When the vehicle is within thepreset range, an audible warningis given and a group of lightemitting diodes (LEDs) are turnedon.

    The block diagram in Fig.1shows how the circuit is split upinto separate sections.

    INFRARED CODINGA system based on a

    continuous IR signal would fail inthis type of application, since thereceiving circuit would be heavily

    removed. An HT12D decoderthen decodes the signal to givea steady output.

    CODEDTRANSMITTER

    Either the HT12A or HT12Btransmitter devices may beused in the coded transmissioncircuit. They work in exactly thesame way except the four dataoutputs of the HT12A areinverted as compared with theHT12B. However, since theseoutputs are not used in thiscircuit, this is of no importance.

    Referring to the full circuitdiagram in Fig.2, pins A0 to A7of the transmitter IC2 set thecoded signal for the IRtransmission, which can only beaccepted by a decoder chip(IC3 in Fig.2) with the samesettings. The printed circuitboard is designed so that pinsA0 and A1 are connected to the0V supply line, pins A2 to A7being left unconnected.

    Pin 9 of IC2 is connected to0V and pin 18 connected to the

    How to avoid having an unwanted rear entrance to your garage!

    PARKING WARNING SYSTEMby TOM WEBB

    influenced by stray backgroundIR emission from lights etc. Acoded IR signal is better sincethe receiver can be set up toonly accept a specific code.

    There are a number ofencoding and decoding ICsavailable, but two from Holtekare used for this circuit. TheHT12B transmitter encodes thesignal and adds a 38kHz carriersignal for greater reliability. Aseparate demodulating sensordetects the coded signal andprovides a clean outputwaveform with the 38kHz carrier

    Fig.1. Parking Warning System block diagram.

    MONOSTABLEINFRA-REDENCODER &TRANSMITTER

    INFRA-REDRECEIVER &DECODER

    BUZZERAND/ORL.E.D.s

    CAR

    Fig.1. Parking Warning System block diagram.

    www.

    epem

    ag.co

    m

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 168

    positive supply, which shouldnot exceed +5V. IC2 pins 11 to14 are not used. The pinslabeled X1 and X2 are theoscillator control pins, andrequire a 455kHz ceramicresonator (component X1) alongwith resistor R6 and twocapacitors, C2 and C3.

    The Dout pin provides acoded output superimposed ona carrier signal of 38kHz which,with the aid of Darlingtontransistor amplifier TR2,operates the IR light emittingdiode D1.

    Potentiometer VR1 allowsthe transmission power to bevaried. Ballast resistor R8prevents a power supply shortcircuit through D1 and TR2when VR1 is set to minimumresistance.

    IC2 pin 10 is connected toground to hold the transmitterperpetually triggered.

    INFRAREDRECEIVER

    The IR sensor/amplifier/demodulator, IC1, is housed ina package resembling a smallpower transistor. The receiverrejects all IR transmissionsexcept the required 38kHzsignal, and provides a cleanoutput (easily viewed on anoscilloscope). There are threepossible receivers that performthe functions required, but intests the best performer for thiscircuit was the PIC26043S (nota PIC microcontroller!).

    When the detector detects asignal having a frequency of38kHz, its output goes high.Transistor TR1 inverts this leveland supplies it to the decoderIC3 at DIN (pin 14).

    The code to which IC3responds is set by its pins A0 to

    A7. Since pins A0 and A1 ontransmitter IC2 are connected to0V, the same pins on IC3 are alsoconnected to 0V.

    Resistor R4 sets theoscillation frequency for IC3 tothe required 150kHz. The value ischosen to suit a power supply ofbetween 45V and 5V. When IC3receives a correctly coded signal,its pin 17 (VT) goes high. Thistriggers the monostable formedby IC5a and IC5b. When the VTpin of IC3 is open circuit (nosignal being received), resistorR7 draws the input pin of themonostable to 0V. Oncetriggered, the monostablesoutput remains high for a periodset by the values of C4 and VR2.

    The formula used to calculatethis period is T = 07 x R x C.With VR2 set to 100k, theperiod will be 07 x 01M x 47uF= 329 seconds.

    Constructional Project

    bc

    e

    a

    a

    a

    a

    a

    k

    k

    k

    k

    k

    D3

    D4

    D5

    D1IR

    bc

    e

    bc

    e

    IC3HT12D

    IC5a4001

    IC5b4001

    IC5c4001

    IC5d4001

    IC1PIC-26043S

    TR1BC184L

    TR3BC184L

    TR2TIP122 ORTIP121

    1

    2

    3

    4

    5

    6

    7

    8

    9

    18

    17

    16

    15

    14

    13

    12

    11

    10

    A0

    A1

    A2

    A3

    A4

    A5

    A6

    A7

    VSS

    V

    VT

    OSC1

    OSC2

    DIN

    D11

    D10

    D9

    D8

    DD

    R247k

    R447k

    R54k7

    R94k7

    R310k

    R7100k

    R610M

    R8100

    R10330

    R1100

    VR21M

    VR1470

    GND

    +VE

    C1100

    C61000

    C4472

    13

    6

    9 13

    5

    8 12

    4

    10 11

    14

    7

    N.C. N.C.

    WD112V

    D21N4001

    C5100n

    C2100p

    C3100p

    S1

    +12V D.C.

    +

    0V

    POWERINPUT

    (SEE TEXT)

    IC2HT12B

    1

    2

    3

    4

    5

    6

    7

    8

    9

    18

    17

    16

    15

    14

    13

    12

    11

    10

    A0

    A1

    A2

    A3

    A4

    A5

    A6

    A7

    VSS

    V

    DOUT

    X1

    X2

    L/MB

    D11

    D10

    D9

    D8

    DD

    X1455kHZ

    OUT

    IC47805

    INOUT

    COM

    Fig.2. Complete circuit diagram forthe Parking Warning System. The

    transmitter is the lower section(IC2/TR2) of the circuit.

    www.

    epem

    ag.co

    m

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 169

    The output from themonostable, at IC5b pin 4, isfed to transistor TR3 via resistorR9. When the output level ishigh, TR3 is turned on anddrives the warning buzzer WD1and turns on LEDs D3 to D5.Diode D2 prevents back EMF

    from the buzzer which mightotherwise damage the circuit.R10 is a ballast resistor to limitthe current through the LEDs.

    POWER SUPPLYPower to the circuit is

    intended to be from a 12V mainsadapter as the circuit will need tobe left switched on for longperiods of time. A supply of 12Vis required in order to power thebuzzer. The power supply isregulated down to 5V by IC4 tosuit the rest of the circuit.

    If a buzzer is not being used,then diode D2 can be omitted anda supply of 5V (or 45V) could beused by inserting a wire link in theplace of regulator IC4 (betweenits In and Out pins). However, inthis case, the value of LEDballast resistor R10 should bereduced to about 180 ohms. Thisalso means that batteries couldbe used as the standby current isless than 10mA.

    Capacitors C5 and C6decouple the power fed to IC4.Capacitor C1 and resistor R1smooth out the voltage suppliedto the receiver device, IC1.

    CONSTRUCTIONApart from the buzzer and

    LEDs, all the components arecontained on a single printedcircuit board (PCB). The topsidecomponent layout and full sizeunderside copper foil master areshown in Fig.3. This board isavailable from the EPE OnlineStore (code 7000258) atwww.epemag.com

    Begin construction bysoldering in the resistors and thefour wire links. Ensure the correctorientation in the PCB forcomponents C1, C4, C6, TR1 toTR3, D1 and D2. Capacitors C2,C3 and C5 may be connectedeither way round.

    Note that on the IR diode,D1, the long leg is likely to bethe cathode (k), but check thiswith the component supplierscatalog.

    Infrared receiver IC1 has adome on its sensitive side,which should face outwardsfrom the PCB. Once solderedin, IC1 should be bent back toso that the dome is facingupwards.

    Use IC sockets for IC2, IC3and IC5. Do not insert the dual-in-line (DIL) ICs untilconstruction has beencompleted and fully checked.

    CASINGTwo plastic cases will be

    needed as the LEDs need theirown separate case in order tobe seen through the rearwindscreen of the car.

    The circuit board ismounted in its own case onsmall PCB supports which firmlysecure it in place, see Fig.4.Drill holes in the case to suit thepositions of the IR receiver andIR diode, see photographs. Thehole for the IR receiver shouldnot be too small otherwise therange will be reduced. Ifmaximum range is requiredthen the IR receiver should bepositioned right by the hole.

    If you prefer to haveplugged connections for thepower supply input and for theoutput to the LEDs, suitableholes should also be drilled fortheir sockets. You also need ahole for the power on/off switchif you decide to use one,although one was not used onthe prototype.

    Additionally, two holes arerequired to allow adjustmentaccess to the two presetpotentiometers, using a smallscrewdriver. All holes should bedrilled accurately to correspond

    Constructional Project

    COMPONENTSResistors

    R1, R8 100 ohms (2 off)R2, R4 47k (2 off)R3 10kR5, R9 4k7 (2 off)R6 10MR7 100kR10 330 ohms

    See also theSHOP TALK Page!

    CapacitorsC1 100u radial electrolytic, 25VC2, C3 100p (2 off)C4 47u radial electrolytic, 25VC5 100n ceramicC6 1000u radial electrolytic, 25V

    SemiconductorsD1 IR diodeD2 1N4001 rectifier diodeD3 to D5 red LEDs (3mm or 5mm)TR1, TR3 BC184L npn transistors (2 off)TR2 TOP122 (or TIP121) npn Darlington transistorIC1 PIC26043S IR receiverIC2 HT12B (or HT12A) encoderIC3 HT12D decoderIC4 78L05 +5V 100mA regulatorIC5 4001B quad NOR gate

    MiscellaneousS1 s.p.s.t. toggle switch (optional)WD1 buzzer, 12VX1 455kHz resonator

    Printed circuit board availablefrom the EPE Online Store, code7000258 (www.epemag.com);plastic case to suit (2 off, see text);14-pin DIL socket; 18-pin DILsocket (2 off); connectors forpower and LED cables (see text);PCB pillars (4 off); connectingwire, solder, etc.

    $29Approx. CostGuidance Only

    PotentiometersVR1 470 ohm miniature horizontal skeleton presetVR2 1M miniature horizontal skeleton preset

    www.

    epem

    ag.co

    m

    www.epemag.comwww.epemag.com

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 170

    with their respectivecomponents.

    The LEDs mounted in theirseparate case can be connectedto the circuit using singlescreened wire, as shown in

    Constructional Project

    Fig.5.

    TESTINGThe first check

    is to make sure the voltageregulator IC4 is the correct wayaround. Connect the circuit tothe 12V power supply and thencheck that 5V is present on theoutput pin of IC4. If it is, thendisconnect the power and insert

    the remaining chips, correctlyorientated.

    Testing of the IR modulespresents a problem as if onedoesnt work then the other willseem not to be working as well.If in doubt use a voltmeter oroscilloscope as follows:

    Test the voltage on the VTpin (pin 17) on IC3 of thereceiver module. It should

    ak

    R9

    R3 R

    2

    R1

    R7

    R8

    R6

    C1

    D1

    C4

    C6

    TR3

    TR2

    TR1 IC4

    IC1bce

    +

    +

    +

    R10

    R4

    R5

    C5

    C2

    C3

    a

    kX1

    D5(k)

    D3(a)

    WD1

    WD1+

    V++

    0V0VVR1

    VR2

    e

    c

    b

    b

    c

    e

    OUTCOM

    IN

    +VEGND OUT

    258

    D2

    VIA S1

    Fig.3. Printed circuit board topside compo-nent layout and (top right) approximately

    full-size underside copper foil master.

    D4 D5D3a aa k kk

    L.E.D.S CONNECTEDIN SERIES

    OPTIONALJACK PLUG

    SCREENEDCABLE

    Fig.4 (below). Wiring from the circuitboard to the optional LED jacksocket and power connector.

    HOLE TO ADJUSTTIME BUZZER ORL.E.D.S ARE ON

    INSIDE VIEW

    +

    +

    +

    POWER

    BUZZER

    OPTIONAL JACKSOCKET TO CONNECTTO L.E.D. BOX

    OPTIONALPOWERCONNECTOR

    HOLE TOADJUSTRANGEOF IR

    Fig.5 (above). The LEDs mounted ina separate case and connected viascreened cable and jack plug to theww

    w.ep

    emag

    .com

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 171

    normally be at 0V but change toabout 5V when a signal isreceived. Now check thevoltage on the pins of IC1. Pin 3should be at 5V and pin 2 at 0V.When a signal is not beingreceived, pin 1 (the output pin)should be at just under 4V.When a signal is received thisvoltage should fall by about 1V.

    Note that as the signal is

    oscillating, a voltmeter providesa rather approximate guide tovoltage. If an oscilloscope isavailable it should be possibleto view the encoded signal, inwhich case the trace will riseand fall between 4V and 0V. Ifthis test fails then try sending asignal from a TV remote controlunit. The signal will not bedecoded, but you will at least

    know if the receiver IC isworking, and hence determine ifthe fault lies in the transmitter orreceiver or both.

    If the output from IC1 isworking, test the signal at pin 14(Din) of IC3 on the receivermodule. It should be at about0V when no signal is received,rising to about 13V (as seen ona voltmeter) when a signal isreceived. Again, an oscilloscopewill show that the signal actuallypulses to about 5V.

    If the VT pin on the receiveris working then simple voltmetertests should establish theposition of any other faults.

    If the circuit is triggeredstraight away then IC1 may bereceiving IR straight from the IRdiode D1, through strayreflection inside the case. If thishappens the transmitter shouldbe surrounded by a rolled pieceof black card.

    SETTING UPThe presets VR1 and VR2

    can be adjusted to suit theusers own particular needs. Thefollowing is a summary of theirfunctions:

    VR1: Adjusts the range ofthe IR beam by decreasing orincreasing the power goingthrough IR diode D1. Reducingthe resistance extends therange.

    VR2: Sets the time thebuzzer and LEDs stay on bycontrolling how muchrecharging current is input to themonostable. Reducing theresistance reduces the time.

    COMMONPROBLEMS

    Typical mistakes include dryjoints and bridged pads, i.e.adjacent pads accidentally

    Constructional Project

    Completed circuit board mounted inside its box.

    The transmitter/receiver case and the smaller LEDbox with their lids removed. Note the tube of blackcard to stop stray reflections from reaching the IR

    receiver chip.

    www.

    epem

    ag.co

    m

  • Copyright 2000 Wimborne Publishing Ltd andMaxfield & Montrose Interactive Inc

    EPE Online, March 2000 - www.epemag.com - 172

    joined together with solder.Other problems include failureto insert wire links. Also checkthat the components arecorrectly placed, and the correctway round. Note again thatsome IR LEDs are unusual inthat the longer lead denotescathode (k).

    IN USE

    This Parking WarningSystem should be set up withthe IR sensors lining up with theextremity of the car, e.g.bumper. The LED box shouldbe positioned so as to be seenthrough the rear windscreen.The time the LEDs and buzzerare on, and the range of the IRcan easily be changed using ascrewdriver to adjust the presetsVR1 and VR2.

    Constructional Project

    Completed remote LEDwarning box.

    www.

    epem

    ag.co

    m