0902- vinyl to cd preamplifier

11
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

Upload: innova

Post on 16-Nov-2015

14 views

Category:

Documents


1 download

DESCRIPTION

Epemag audio 902

TRANSCRIPT

  • 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

  • DO YOU have a collection of old vinylrecords? If so, you might wish totransfer them to CDs. By doing this,you will preserve their value because youwill only need to play them once.

    It may even be possible to enhance thesound by removing some of the back-ground noise and clicks which are foundon worn recordings. If you have a CDplayer in your car or own a portable unit,you will also be able to play your work onthe move.

    To transfer a recording to CD, you needa computer with a Compact Disc writerinstalled. Many new machines, of course,already have one of these. If yours is not soequipped, you will find that fitting aCD burner module is inexpensive andstraightforward.

    You do not even need a particularlymodern machine. A Pentium 133MHz PCmay suffice but a new up-to-date machinewill be much quicker (that is, produce aCD at the higher speeds allowed by thewriter). Before purchasing any hardware, itis important to check compatibility withthe supplier/manufacturer.

    To record sound files on to the harddrive before transferring them to a CD willrequire quite a lot of spare capacity. If yourdrive is almost full, you will need to backup files in order to clear sufficient space.To record stereo tracks in 16-bit resolutionat 441kHz (CD quality) you will needsome 600MB for one hour of work andyou could run into trouble if you do nothave at least 800MB available.

    It is not a good idea to link the record

    deck to the computer sound card direct byplugging it into the microphone input. Somepeople have done this thinking, quite cor-rectly, that a magnetic cartridge provides alow-level output comparable with that of adynamic microphone. Although this maywork, the results will be very disappointing.This is because no equalisation has beenapplied to the signal. It will be found that the

    copy recording is deficient in bass (low fre-quencies) but have excessive treble (highfrequency content). In other words, it willsound very tinny. More will be said aboutequalisation presently.

    A better method would be to use anexisting hi-fi amplifier. The record deckwould be plugged into its Phono inputand a Line (high level) output obtained atthe back (the one used for tape recording).This would be connected to the line inputon the sound card using a piece of twin-screened wire fitted with the appropriateconnectors. The phono connection wouldprovide the necessary equalisation.

    Unfortunately, many modern amplifiersmake no provision for playing old fash-ioned vinyl discs. You may therefore findthat it has no phono input. Even if you dohave a suitable amplifier, it may need along connecting lead to reach the comput-er station and this could result in hum pick-up and degraded performance.

    The circuit described here is a small bat-

    tery-operated stereo preamplifier whichprovides equalisation and boosts the output

    of a magnetic cartridge to line-level. Thereare also Scratch and Rumble filter push-button switches. These may be used toreduce the effects of surface clicks andlow-frequency motor or turntable noiserespectively.

    As well as being useful for making CDs,the preamplifier will be found handy byenthusiasts who simply wish to play theirvinyl records using a hi-fi amplifier thatdoes not have a phono input. Some readersmay even use it for tape or Mini Disc workor for making MP3 files to be sent over theInternet.

    In operation, the circuit requires some40mA and the four AA size cells housedinternally will provide up to fifty hours ofservice. A front panel mounted l.e.d. indi-cator requires some 15mA so, if the usercan be trusted to switch the unit off afteruse, the l.e.d. may be omitted. This wouldgive a significant increase in battery life.For extended periods of use, a larger bat-tery could be placed externally.

    This unit must not be powered using amains-derived low-voltage supply (suchas a plug-in adaptor).

    Returning to the topic of equalisation,this must be applied if analogue recordingsare to be reproduced with any degree of

    Everyday Practical Electronics, September 2002 665

    www.

    epem

    ag.co

    m

  • fidelity. To understand why this is neces-sary, you need to know something aboutthe recording process.

    Imagine the sound has three bandscomprising the low, intermediate and highfrequency content. When the groove wascut in the master disc, the low frequencypart was reduced in level (volume) whilethe high frequencies were increased. Onlythe intermediate band was left unchanged.

    Leaving the low frequencies as theywere in the original sound would haverequired more violent movements of thegroove cutter (that is, heavier modulation).This would have produced a wider grooveand a consequent reduction in availableplaying time. Also, the playing stylusmight have difficulty following such agroove and it may tend to jump out. Byreducing the level of the low-frequencysound, it is possible to obtain a uniformgroove width and a longer playing time.

    Equalisation is the process by which thehigh and low frequency content from thecartridge are restored to their original stateand, in theory, should be an exact mirror ofthat used during recording. Note that byrestoring the high frequencies, the surfacenoise present during playback (which ismade up chiefly of high frequencies) isreduced. It thus provides a simple meansof noise reduction.

    Unfortunately, different equalisationstandards have existed regarding the val-ues of the cut-off frequencies defining thelow, intermediate and high bands and alsothe degree of cut or boost. The samecircuit will therefore not provide perfectresults with all records.

    However, most vinyl discs producedsince the 60s have followed the RIAA(Recording IndustryAssociation ofAmerica) standard.In practice, anequaliser designedfor this standardwill also providegood results whenapplied to record-ings using a differ-ent one (AmericanStandard Recordand British Micro-groove format). Itshould also be suit-able for 78s.

    Practical equali-sation circuits canrange from the sim-ple (which provideonly a coarse cor-rection) to the verycomplex. This circuit lies somewhere nearthe middle of the range and provides goodresults without special adjustment.

    The graph shown in Fig.1 illustrates theideal (theoretical) RIAA equalisation com-pared with that provided by this circuit.Note that this is for illustration only and isnot drawn to scale.

    The section to the left-hand side labelledA provides a roll-off of frequenciesbelow some 10Hz. This reduces the rum-ble that is transmitted from the motor orturntable bearing to the cartridge through theturntable. This is much more pronounced

    It is, therefore, the higher-frequency sig-nals which develop a greater voltage atIC1a pin 3. In other words, the low fre-quencies tend to be filtered out.

    With the Rumble switch contactsclosed, the pair of capacitors C1 and C2give the same effect as a single unit havinga larger value. This decreases the overallimpedance and the circuit rolls off at alower frequency.

    The output of IC1a at pin 1 is connectedto its inverting input (pin 2) through theparallel arrangement of resistor R5 andcapacitor C4. This works in conjunctionwith resistor R4 to set the gain.

    The other end of R4 is connected to themid-point of a potential divider consistingof equal-value resistors R1 and R2. Thissets a d.c. voltage nominally equal to one-half that of the supply that is, 3V. Thisprovides a zero reference so that the a.c.input signal will rise and fall with respectto it.

    If the reference was a true 0V (the volt-age of the 0V supply line), the negativehalf-cycles of the wave would not beamplified. This is because the output volt-age cannot fall below 0V. As it is, the out-put signal will swing above and below the3V level.

    Ignoring the effect of capacitor C4 forthe moment, the gain of this section isapproximately eight times. However, withC4 in place, the impedance of the feedbackloop will fall as the frequency rises. Thisreduces the gain at higher frequencies andprovides the fall-off characteristicshown by Fig.1 section B.

    Section IC1b of the circuit is configuredas a unity-gain amplifier (buffer). The sig-nal from IC1a output, at pin 1, passesthrough resistor R7 (or R6 connected inparallel with it when Scratch switch con-tacts S2a are closed) to IC1bs non-invert-ing input at pin 5.

    High frequency signals now flow moreeasily through capacitor C5 (due to itsreduced impedance) and hence to a furtherfalse zero derived from the potentialdivider made up of resistors R8 and R9. Thevoltage appearing at IC1b pin 5 will there-fore be less than with higher frequencies.The higher frequencies therefore tend to befiltered out (shown by section C in Fig.1).

    With Scratch switch S2a contacts

    closed, resistors R6 and R7 are placed inparallel and provide near-RIAA high-fre-quency attenuation. With the switch con-tacts open, resistor R7 alone provides amore dramatic cut-off and provides thescratch reduction effect. These valuesmay be experimented with or a tone con-trol could be fitted to give a continuouslyvariable effect. More will be said aboutthis later.

    The output from IC1b, pin 7, is nowequalised but still at a low level. The nextsection, centred around IC3a, is an ampli-fier used in inverting mode. This boosts thesignal by a large factor making it suitableto drive the line input of a sound card orexternal power amplifier.

    Capacitor C7 allows the output signalfrom IC1b pin 7 to pass with little loss(due to its relatively low impedance at

    666 Everyday Practical Electronics, September 2002

    with a cheap unit and without such a cutwould be accentuated due to the low-fre-quency boost made during equalisation.

    Before proceeding to construct this cir-cuit, check that you have a good qualityrecord deck available. This must be fittedwith a magnetic cartridge (not a ceramicone). If you wish to transfer 78 r.p.m.records, make sure your turntable willoperate at this speed (many are designedfor 33/45 only) also that it is fitted with thecorrect type of stylus.

    The full circuit diagram for the

    Vinyl To CD Preamplifier is shown inFig.2. This is built around three identicaldual low-noise operational amplifiers(op.amps) IC1a/IC1b, IC2a/IC2b andIC3a/IC3b.

    Equalisation of left and right channels iscentred around IC1 and IC2 respectively,while IC3 is a straight amplifier whichboosts both channels to line level.

    It is only necessary to describe theaction of one channel (the left-hand one)since the other is the same. Note that thecomponent numbering for the right-handchannel is prefixed with a one hundred.Thus, R2 (left) corresponds with R102(right). Components which are common toboth channels, the i.c.s, switches andinput/output sockets are numbered as ifthey belonged to the left channel.

    The first section of the circuit is a non-inverting amplifier IC1a. The signalobtained from the input cartridge (left-hand channel) at SK1 is applied to the non-inverting input, pin 3, via capacitor C2 (orC1 and C2 in parallel if Rumble switchS1a contacts are closed).

    This, in conjunction with fixed resistorR3, determine the anti-rumble characteris-tics of the circuit (the roll-off below 10Hzlabelled A in Fig. 1). Resistor R3 alsosets the input impedance making it suit-able for a standard magnetic cartridge.

    Anti-rumble processing comes aboutbecause the impedance of capacitor C2rises as the frequency falls. High frequen-cy signals will then flow more easilythrough resistor R3 and hence throughcapacitor C3 (which has a relatively highvalue and therefore negligible impedanceat these frequencies) to 0V.

    Fig.1. Equalisation graph (not to scale): a) roll-off; b) fall-offand c) high frequency filtering.

    www.

    epem

    ag.co

    m

  • Everyday Practical Electronics, September 2002 667

    Approx. CostGuidance Only 2244

    excl. batts. & case

    ResistorsR1, R101,

    R2, R102, R8, R108, R9, R109 2k2 (8 off)

    R3, R103,R4, R104R10, R110,R11, R111 47k (8 off)

    R5, R105, R6, R106 330k (4 off)

    R7, R107 120k (2 off)R12, R112 15k (2 off)R13, R113 1M5 (2 off)R14 270

    All resistors 06W 1% metal film.

    PotentiometersVR1, VR101 1M min. enclosed carbon

    preset, vert. (2 off).

    CapacitorsC1, C101 470n polyester film (2 off)C2, C102 330n polyester film (2 off)C3, C103,

    C6, C106 22 min. radial elect. 16VC8, C108 (6 off)

    C4, C104 10n polyester film (2 off)C5, C105 2n2 polyester film (2 off)C7, C107 1 polyester film (2 off)C9, C109 10pF ceramic (2 off)C10, C110 10 min. radial elect. 16V

    (2 off)C11 220 min. radial elect.

    16V

    SemiconductorsD1 3mm red l.e.d.IC1 to IC3 NE5532AN dual low-

    noise op.amp (3 off)

    MiscellaneousS1 to S3 d.p.d.t. interlocking push-

    button switch see text(3 off)

    B1 6V battery pack (4 x AA alkaline cells)

    SK1 to SK4 phono socket, singlehole, panel mounting (see text) (4 off)

    Printed circuit board available from theEPE PCB Service, code 366; 8-pin d.i.l.i.c. socket (3 off); aluminium instrumentcase, size 150mm x 100mm x 75mm;battery holder and connector; 3mm l.e.d.clip; screened cable; multistrand con-necting wire; solder, etc.

    SeeSSHHOOPPTTAALLKKppaaggee

    Fig.1. Complete circuit diagram for the Vinyl To CD Preamplifier.

    VINYL TO CD PREAMPLIFIER

    www.

    epem

    ag.co

    m

    EPE OnlineNote that the circuit boards used in EPE Online projects are available from the EPE Online Store at www.epemag.com (also note that the codes for the boards in the online store are prefixed with 7000, so a board with a code of say 256 will appear as 7000256 in the online store).

  • audio frequencies) through resistor R12and hence to IC3a inverting input at pin 2.Ignoring capacitor C9 for the moment,fixed resistor R13 connected in series withpreset potentiometer VR1 provides nega-tive feedback and, in conjunction withR12, sets the gain.

    This will be some 170 times with VR1set to its maximum value and 100 times atminimum. Preset VR1 will be adjusted atthe end to provide a suitable output for theparticular cartridge being used.

    The value of resistor R13 could beincreased to provide a greater gain if this isshown to be necessary at the testing stage.By adjusting preset VR1 in conjunctionwith its opposite number in the other chan-nel (VR101), the circuit will also be bal-anced to provide equal outputs for bothchannels.

    Returning to capacitor C9 which appears

    in IC3a feedback loop, its small value pro-vides an extremely high impedance ataudio frequencies. It therefore normallyhas negligible effect.

    However, if radio-frequency signals hap-pen to be picked up by the circuit, theimpedance of C9 will be low. This willlower the impedance of the feedback loopand reduce the gain at these frequencies.This prevents instability.

    The output signal finally passes fromIC3a pin 1, via capacitor C10, to LineOutput socket, SK3 (Left channel).

    Construction of the Vinyl To CD

    Preamplifier is based on a single-sidedprinted circuit board. This board is avail-able from the EPE PCB Service, code 366.The topside component layout and actualsize underside copper foil master patternare shown in Fig.3.

    Commence construction by drilling thethree mounting holes as indicated. Solderthe spring-loaded, pushbutton switches inposition. If the specified type is notavailable, use toggle or slide units andhard-wire these to the appropriate pointson the p.c.b. at the end of construction.Next, solder in position the three i.c.sockets.

    Follow with all resistors, preset poten-tiometers and capacitors taking particularcare over the polarity of the electrolytics.Solder the battery connector to the +6Vand 0V points on the p.c.b., again, takingcare over their polarity. Adjust presets VR1and VR101 to approximately mid-trackposition to provide a medium degree ofgain for each channel.

    Note that this circuit must be housed in

    a METAL box to provide adequate screen-ing against hum pick-up.

    Decide on a suitable layout for the inter-nal components. Measure the positions ofthe switches and l.e.d. on the p.c.b. Markthese on the front panel of the box at thehalf-height level and drill them through.Mark and drill the p.c.b. mounting holesalso those for the battery holder and theinput and output sockets.

    Cut plastic stand-off insulators to thecorrect length so that, when the p.c.b. is inposition, the switch buttons will passthrough their holes with a little clearance.

    Secure the p.c.b. and make sure the switch-es operate freely.

    Attach the battery holder and the inputand output sockets. If these are of the spec-ified type, you will need to scrape away thepaint on the inside surface of the box toallow the outer (sleeve) connections tomake good metallic contact with the case.

    Attach one of the solder tags suppliedwith the sockets under the fixing nut of oneof them. This will be used to earth the0V wire leading from the circuit board.

    If you are using sockets of the fully-insu-lated type rather than the specified pattern,the sleeve connection of each must be con-nected to the case (0V) using a separatesolder tag.

    Referring to Fig.4 and photographs,complete the internal wiring. Take care thatleft and right inputs and outputs maintaintheir identity during the wiring process(that is, they do not become interchanged).Set all switches to the out position, insertthe batteries and attach the lid of the case.

    668 Everyday Practical Electronics, September 2002

    Fig.3. Printed circuit board component layout and full-size underside copper trackmaster pattern for the Vinyl To CD Preamplifier.

    www.

    epem

    ag.co

    m

  • Unless the stylus on the record deck is

    known to have given very little service,renew it. Styli cost very little comparedwith that of your record collection. Also, anew stylus will give better results. If youare going to transfer 78s you must have thecorrect stylus fitted do not use one madefor 33s/45s.

    It would be useful to have the turntablemanual available to help make optimumstylus pressure and anti-skid adjustments.Sometimes a slightly greater pressure thannormal will give better results. Althoughthis wears the record more quickly it maybe worthwhile since the record need onlybe played once.

    For initial testing, connect the output ofthe preamplifier to the line input of a hi-fiamplifier using twin-screened cable fittedwith the appropriate connectors. Do notconnect it to the computer sound card atthis stage.

    Connect the turntable to the preamplifierinput sockets. If possible, use a valuelessrecord to make initial tests. Turn theVolume control on the amplifier to mini-mum and switch on both units. Check thatthe front panel l.e.d. operates.

    It may be found convenient to use head-phones to monitor the sound. Start playingthe record and gradually increase theamplifiers volume control. The musicshould be clearly heard. Compare the vol-ume with that playing similar music from acommercial CD.

    If the levels are not similar, adjust VR1and VR101 so that they are. If one channelis quieter than the other, adjust presets VR1or VR101 as appropriate to bring the weak-er channel to the level of the stronger one.This procedure ensures that the output isat line level and balanced between thechannels.

    Check the effects of the Scratch andRumble switches. The rumble effect is verysubtle and may not be noticed. Note that, asdescribed, pressing the switches in pro-vides the anti-scratch and anti-rumbleeffects.

    The frequency balance and anti-scratcheffects could be altered by changing thevalue of resistors R6/R7 and R106/R107.By increasing the appropriate resistor val-ues slightly, the high-frequency responsewill be cut and vice versa. Beware small changes make a lot of difference!

    An alternative method would be toreplace resistors R7/R107 with a dual-ganged, panel-mounted, potentiometer(stereo). This would allow for continuousvariation and switch S2 could then beignored.

    When setting up the equipment to make

    CDs, the turntable should not be placed onthe same surface as the computer (other-wise you could introduce hum due tovibration being transferred to the cartridgefrom the computer). Check that theturntable is true using a spirit level.

    Connect the preamplifier output to theline input of the PC sound card using twin-screened wire. Check that Left and Rightchannels are connected correctly.

    Before making a recording, clean thesurface of the disc using a proprietary anti-static cleaner. If it is very dirty, it will needspecial treatment to remove the debriswhich will have become deeply embeddedin the groove. You could try playing it onceor twice in an attempt to allow the stylusitself to remove the contamination.

    Check the stylus after every playing for

    any build-up of fluff and dirt. Leaving thiswill spoil the high-frequency response andalso tend to cause the stylus to jump out ofthe groove. Use a proprietary stylus clean-ing kit (a fine brush and cleaning fluid).Styluses are easily damaged so follow theinstructions and work carefully.

    Refer to your CD recording software

    instructions to make optimum sound levelsettings and make some tests using the oldrecord. For your final recordings, you willprobably be able to observe the file oscillo-scope-style. It is then possible to removethe heaviest clicks by highlighting anddeleting them.

    However, this must be done with greatcare. Some CD recording software allowsfor sophisticated restoration work to beundertaken. Automatic click suppressioncan be a problem because many sections ofthe intended waveform are click-like.

    One final point do not use the scratch fil-ter unless the result sounds better. This isbecause it gives a markedly dull effect.

    Everyday Practical Electronics, September 2002 669

    Layout of components inside the metal case.

    Fig.4. Interwiring details from the printed circuit board to the rear panel mountedinput and output phono sockets.

    www.

    epem

    ag.co

    m

  • 24V STEREO POWER SUPPLY. Mullard. Order Ref:2P80.UP TO 90 MIN 25A SWITCH. Clockwork. Order Ref:2P90.POWERFUL MAINS MOTOR. 1in. stack, doublespindle. Order Ref: 2P55.SPEED CONTROL FOR MODELS. 6V-12V variablep.s.u., also reverse. Order Ref: 2P3.MAINS TIME AND SET SWITCH. 25A, up to 6 hoursdelay. Order Ref: 2P9.MOTORISED 6 MICROSWITCHES but motor 50VA.C. Order Ref: 2P19.TWIN EXTENSION LEAD. Ideal lead lamp, Black &Decker tools, etc., 20m. Order Ref: 2P20.MAINS COUNTER. Resettable, 3 digit. Order Ref:2P26.ILLUMINOUS PANEL, 16 x 16V bulbs to light coaleffect heater, etc. Order Ref: 2P317.TIME AND SET SWITCH. 15A mains. Order Ref:2P104.D.C. VOLT REDUCER. 12V-6V, fits into car lightersocket. Order Ref: 2P318.CAPACITOR, VARIABLE. For tuning AM/FM with in.spindle. Order Ref: 2P269.CAPACITOR, VARIABLE. 00005 solid dia. in.spindle. Order Ref: 2P268.COPPER CLAD BOARD. 15 x 10 x 1/16 for p.c.b.Order Ref: 2P409.25V-0V-25V MAINS TRANSFORMER. 1A. OrderRef: 2P410.20V-0V-20V DITTO. Order Ref: 2P411.80mm x 46mm x 65mm METAL PROJECT BOX withrubber feet, supplied as flat pack. Order Ref: 2P412.24V 1A MAINS TRANSFORMER. Order Ref: 2P413.12V 2A MAINS TRANSFORMER. Order Ref: 2P414.80 OHM COAX. Extra thin, 15m. Order Ref: 2P417.

    FOR A LONG LIST OF 1 BARGAINPACKS SEE AUGUST ISSUE OR

    RING US FOR THE LIST

    ROTARY SWITCH. 40A with porcelain pointer controlknob. Order Ref: 2P419.AIR-SPACED TUNING CAP with one section 350pF,the other 250pF, with in. spindle and slow motiondrive. Order Ref: 2P422.DITTO but 150pF and 300pF. Order Ref: 2P423.TRANSMITTER TUNER. 2-gang, wide spaced. OrderRef: 2P425.A.C. 250V CAPACITOR. 20F. Order Ref: 2P427.12V P.S.U. 800mA D.C. with pins for shaver socket.Order Ref: 2P428.MAINS MOTOR WITH GEARBOX giving 6 revs perhour. Order Ref: 2P430.CLOCKWORK TIMESWITCH with scale settable upto 6 hours. Order Ref: 2P432.OLD TIME RADIO CASE for the Good Companion.Order Ref: 2P436.4 OHM TWEETER. 20W, by Goodmans. Order Ref:2P437.OLD TYPE 15A ROUND PIN PLUGS. Order Ref:2P438.BT ENGINEERS PHONE. Unused but missing someparts, ideal for stripping. Order Ref: 2P439.FLUORESCENT TUBE CHOKE. 65W or 80W. OrderRef: 2P440.MINI MOTOR WITH GEARBOX, giving 16 r.p.m. OrderRef: 2P442.ICESTAT. Cuts in just above freezing. Order Ref:2P443.BALANCE KIT with gram weights for chemical exper-iments etc. Order Ref: 2P444.Vu METER. 40mm square. Order Ref: 2P445.SLYDLOK FUSE. 30A. Order Ref: 2P447.KV CAP. 1F 1500V. Order Ref: 2P448.9V P.S.U. 1A D.C., plugs into 13A socket.. Order Ref:2P450.6-CORE 3A FLEX. 15m. Order Ref: 2P451.

    TERMSSend cash, uncrossed PO, cheque or quote creditcard number. If order is 25 or over deduct 10% butadd postage, 3.50 if under 2 kilo, 6 if under 4 kilo.

    SELLING WELL BUT STILL AVAILABLEIT IS A DIGITAL MUL-TITESTER, completewith backrest to stand itand hands-free testprod holder. This testermeasures d.c. volts upto 1,000 and a.c. voltsup to 750; d.c. currentup to 10A and resist-ance up to 2 megs. Alsotests transistors anddiodes and has aninternal buzzer for con-tinuity tests. Comescomplete with test prods, battery and instructions. Price6.99. Order Ref: 7P29.INSULATION TESTER WITH MULTIMETER. Internally gener-ates voltages which enable you to read insulation directly inmegohms. The multimeter has four ranges: AC/DC volts, 3ranges DC milliamps, 3 ranges resistance and 5 amp range.These instruments are ex-British Telecom but in very good con-dition, tested and guaranteed OK, probably cost at least 50each, yours for only 7.50 with leads, carrying case 2 extra.Order Ref: 7.5P4.REPAIRABLE METERS. We have some of the above testersbut slightly faulty, not working on all ranges, should berepairable, we supply diagram, 3. Order Ref: 3P176.BT TELEPHONE EXTENSION WIRE. This is proper heavyduty cable for running around the skirting board when youwant to make a permanent extension. Four cores properlycolour coded, 25m length only 1. Order Ref: 1067.HEAVY DUTY POT. Rated at 25W, this is 20 ohm resistanceso it could be just right for speed controlling a d.c. motor ordevice or to control the output of a high current. Price 1.Order Ref: 1/33L1.1mA PANEL METER. Approximately 80mm 55mm, frontengraved 0-100. Price 1.50 each. Order Ref: 1/16R2.D.C. MOTOR WITH GEARBOX. Size 60mm long, 30mmdiameter.Very powerful, operates off any voltage between 6Vand 24V D.C. Speed at 6V is 200 rpm, speed controller avail-able. Special price 3 each. Order Ref: 3P108.FLASHING BEACON. Ideal for putting on a van, a tractor orany vehicle that should always be seen. Uses a Xenon tubeand has an amber coloured dome. Separate fixing base isincluded so unit can be put away if desirable. Price 5. OrderRef: 5P267.MOST USEFUL POWER SUPPLY. Rated at 9V 1A, thisplugs into a 13A socket, is really nicely boxed. 2. Order Ref:2P733.MOTOR SPEED CONTROLLER. These are suitable for D.C.motors for voltages up to 12V and any power up to 1/6h.p.They reduce the speed by intermittent full voltage pulses sothere should be no loss of power. Made up and tested, 18.Order Ref: 20P39.BALANCE ASSEMBLY KITS. Japanese made, whenassembled ideal for chemical experiments, complete withtweezers and 6 weights 05 to 5 grams. Price 2. Order Ref:2P44.CYCLE LAMP BARGAIN. You can have 100 6V 02A MESbulbs for just 2.50 or 1,000 for 20. They are beautifullymade, slightly larger than the standard 63V pilot bulb sothey would be ideal for making displays for night lights andsimilar applications.SOLDERING IRON, super mains powered with long-lifeceramic element, heavy duty 40W for the extra special job,complete with plated wire stand and 245mm lead, 3. OrderRef: 3P221.

    THIS MONTH IF YOUR ORDER IS 25 OR OVERYOU WILL GET A BRAND NEW 16 RANGE

    MULTITESTER FREE OF CHARGE.

    RELAYSWe have thousands of relaysof various sorts in stock, so ifyou need anything specialgive us a ring. A few newones that have just arrivedare special in that they areplug-in and come completewith a special base whichenables you to check volt-ages of connections of itwithout having to go under-neath. We have 6 differenttypes with varying coil volt-ages and contact arrangements.Coil Voltage Contacts Price Order Ref:12V DC 4-pole changeover 2.00 FR1024V DC 2-pole changeover 1.50 FR1224V DC 4-pole changeover 2.00 FR13Prices include baseMINI POWER RELAYS. For p.c.b. mounting, size 28mm x25mm x 12mm, all have 16A changeover contacts for up to250V. Four versions available, they all look the same but havedifferent coils:

    6V Order Ref: FR17 24V Order Ref: FR1912V Order Ref: FR18 48V Order Ref: FR20Price 1 each less 10% if ordered in quantities of 10, sameor mixed values.RECHARGEABLE NICAD BATTERIES. AA size, 25peach, which is a real bargain considering many firmscharge as much as 2 each. These are in packs of 10,coupled together with an output lead so are a 12V unitbut easily divideable into 2 6V or 10 12V. 2.50 perpack, 10 packs for 25 including carriage. Order Ref:2.5P34.4 CIRCUIT 12V RELAY. Quite small, clear plastic enclosedand with plug-in tags, 1. Order Ref: 205N.NOT MUCH BIGGER THAN AN OXO CUBE. Another relayjust arrived is extra small with a 12V coil and 6A changeovercontacts. It is sealed so it can be mounted in any position oron a p.c.b. Price 75p each, 10 for 6 or 100 for 50. OrderRef: FR16.15V-6V MOTOR WITHGEARBOX. Motor is mountedon the gearbox which hasinterchangeable gears givinga range of speeds and motortorques. Comes with fullinstructions for changinggears and calculating speeds,7. Order Ref: 7P26.

    30A 600V BRIDGE RECTIFIER. Order Ref:2P474.10 HOOK-UP LEADS. Assorted colours terminat-ing with insulated crocodile clips each end, eachlead length 36cm. Order Ref: 2P459.PHILIPS STEPPER MOTOR. 12V 75 degrees.Order Ref: 2P457.32F 250V A.C. CAPACITOR. Order Ref: 2P452.4F 440V A.C. CAPACITOR. Order Ref: 2P454.VERY POWERFUL MOTOR. Operates off 6, 9 or12V D.C. 2in. long, 1in. diameter. Order Ref:2P456.HIGH VOLTAGE STRIPPER. Contains manyitems for 10kV working. Order Ref: 2P388.GALVANISED EQUIPMENT BOX. 150mm squarewithout lid. Order Ref: 2P391.4 r.p.m. GEARED MAINS MOTOR. 115V but sup-plied with mains adaptor. Order Ref: 2P393.TWIN 50pF AIR-SPACED TUNING CAPACITOR,the veins wide spaced so suitable for transmitting.Order Ref: 2P394.20 R.P.M. GEARED MAINS MOTOR. 115V butsupplied with mains adaptor. Order Ref: 2P396.20F 375V CAPACITOR. Aluminium cased. OrderRef: 2P406.9V-0V-9V MAINS TRANSFORMER. 25VA, uprightmounting with fixings. Order Ref: 2P408.COPPER CLAD BOARD. Size 15in. x 10in. x1/16in. thick for making p.c.b.s etc. Order Ref:2P409.20W TWEETER. 4in. x 4in. 8 ohm by Goodmans.Order Ref: 2P403.BATTERY CHARGER METER. 0A-3A. Order Ref:2P366.W-SHAPED 30W FLUORESCENT. Philips, idealname plate illluminator. Order Ref: 2P372.

    FOR A LONG LIST OF 1 BARGAINPACKS SEE AUGUST ISSUE OR

    RING US FOR THE LIST

    DIMMER SWITCH. Standard size flush place,state colour red, yellow, green or blue. Order Ref:2P380.TELEPHONE EXTENSION LEAD. 12m with plugend, socket ends. Order Ref: 2P338.FIGURE-8 FLEX. Mains voltage, 50m. Order Ref:2P345.INFRA-RED UNIT. As fitted TV receiver. OrderRef: 2P304.L.C.D. CLOCK MODULE with details of otheruses. Order Ref: 2P307.AM/FM RADIO RECEIVER with speaker but notcased. Order Ref: 2P308.2A MAINS FILTER AND PEAK SUPPRESSOR.Order Ref: 2P315.45A DP 250V SWITCH on 6in. x 3in. gold plate.Order Ref: 2P316.SOLAR CELL. 3V 200mA, 5 of these in serieswould make you a 12V battery charger, 2 each.Order Ref: 2P374.PERMANENT MAGNET SOLENOID. Oppositeaction, core is released when voltage is applied.Order Ref: 2P327.HEATER PAD. Not waterproof. Order Ref: 2P329.DISK DRIVE. Complete less stepper motor, has allthe electronics to control stepper motor. Order Ref:2P280.15V 320mA A.C. POWER SUPPLY. In case with13A base, ideal for bell or chime controller. OrderRef: 2P281.POWERFUL MAINS MOTOR with 4in. spindle.Order Ref: 2P262.20M 80 OHM TV COAX. Order Ref: 2P270.LOCTITE METAL ADHESIVE. Tube and someaccessories. Order Ref: 2P215.6-DIGIT COUNTER. Mains operated. Order Ref:2P235.13A ADAPTORS. Take two 13A plugs, pack of 5,2. Order Ref: 2P187.3-CORE 5A PVC FLEX. 15m. Order Ref: 2P189.MAINS TRANSFORMER. 15V, 1A. Order Ref:2P198.7-SEGMENT NEON DISPLAYS. Pack of 8. OrderRef: 2P126.MODERN TELEPHONE HANDSET. Ideal officeextension. Order Ref: 2P94.13A SWITCH SOCKET on satin chrome plate.Order Ref: 2P95.500 STAPLES. Hardened pin, suit burglar alarm ortelephone wire. Order Ref: 2P99.PAD SWITCH for under carpets, doormats etc.Order Ref: 2P119.

    JJ && NN FFAACCTTOORRSSPPiillggrriimm WWoorrkkss ((DDeepptt..EE..EE..))SSttaaiirrbbrriiddggee LLaannee,, BBoollnneeyy

    SSuusssseexx RRHH1177 55PPAATTeelleepphhoonnee:: 0011444444 888811996655EE--mmaaiill:: jjnnffaaccttoorrss@@aaooll..ccoomm

    22 BBAARRGGAAIINN PPAACCKKSS 22 BBAARRGGAAIINN PPAACCKKSS

    670 Everyday Practical Electronics, September 2002

    www.

    epem

    ag.co

    m

  • PIC ALARMDear EPE,Ive been building your PIC Controlled

    Intruder Alarm (Apr 02) great application! Itseems, though, that you can only arm the alarmwhen the entry zone is set-up to be normally-open, is this so?

    In your article you suggest feedback would bewelcome on the use of the RB4 interrupt for thepanic switch. I have linked pins of the S3 con-nector but can still trigger the panic event bygenerating mains noise, even pulling the plug outand switching to battery power sometimes gen-erates the event. Im planning to add mains sup-pression etc.

    Mark Jones,via email

    Feedback is always welcome Mark, thanks.The entry zone restriction was not intentional,

    but in practice I have never encountered a situa-tion where entering the main door zone couldrequire a choice between normally-open andnormally-closed contacts.

    HOME SECURITYDear EPE,I am currently doing my final year project on

    a home security system which involves a 4 3matrix keypad, PIR sensor, magnetic switch andglass break detector. Im using a PIC16F84 andPICBasic to write the software. Can you pleasegive me some advice?

    Brendon, Malaysia, by email

    Sorry to disappoint you Brendon, but we can-not give specific advice for readers own designs,but you might find my PIC Controlled IntruderAlarm of April 02 of interest. That uses amatrixed keypad.

    8051 FREEWAREDear EPE,I know that most of your projects that use

    microcontrollers are based around PIC devices,but I just want to let any of your readers who usethe 8051 microcontroller, or its many derivatives,know about a very good freeware open sourceANSI compliant optimising C compiler which Ihave been using for a few months, now calledSDCC. Its available for download fromsdcc.sourceforge.net.

    There are several discussion forums for itsusers also on the same site. It can also be target-ed at Z80, Gameboy Z80, AVR and PIC14xmicrocontrollers, and comes with a freeware8051 software simulator.

    Keep up the good work on your magazine, Ihave been a reader since I was a schoolboyhobbyist.

    Jez Smith, by email

    Thanks Jez, undoubtedly we have some read-ers who are 8051 users as well as PIC addicts.And thanks too for your continued interest inEPE!

    BASIC STAMPI have taught myself PICBasic and have a

    great interest in microcontrollers. What I wouldlike to know is what industries use BasicControllers and is it hard to start a career usingand programming them? Any advice would begreatly appreciated.

    Alex, via email

    I suspect that in general industry does not usePICBasic types of program, preferring the moreuniversally used assembler codings in variousforms. Readers what are your opinions?

    SMOKE DETECTIONDear EPE,I am from Les Quennevais school in Jersey.

    For my business GCSE project I am going tomake a photoelectric smoke detector, carbonmonoxide detector and heat detector for the deaf.I am wondering if you could send me some cir-cuit diagrams or tell me your suppliers as itwould largely help me in my project. Any infor-mation that you could give would be very helpful

    Alan Morris,via email

    Our Teach In 2002 series looked at smokedetection in the June 02 issue, back issues canbe ordered via our Online site, or according tothe information published in each EPE issue. Wehave not done other smoke detectors in recentyears.

    STYLOPIC OP.AMPDear EPEI am having problems finding the LM13600

    transconductance op.amp for the StyloPIC ofJuly 2002, the RS 304-453 is now listed as nolonger stocked. Do you know what other devicecould be used as an alternative please?

    Mike Mackellow,via email

    You can use the LM13700 instead as a directreplacement no mods needed.

    RREEAADDOOUUTTJJoohhnn BBeecckkeerr aaddddrreesssseess ssoommeeooff tthhee ggeenneerraall ppooiinnttss rreeaaddeerrss

    hhaavvee rraaiisseedd.. HHaavvee yyoouu aannyytthhiinnggiinntteerreessttiinngg ttoo ssaayy??

    DDrroopp uuss aa lliinnee!!

    WIN A DIGITALMULTIMETER

    A 31/2 digit pocket-sized l.c.d. multime-ter which measures a.c. and d.c. volt-age, d.c. current and resistance. It canalso test diodes and bipolar transistors.

    Every month we will give a DigitalMultimeter to the author of the best

    Readout letter.

    LETTER OF THE MONTH SHOCK HORROR TALE!

    Dear EPE,I was re-reading some old EPE issues while

    waiting for the latest to turn up here in NewZealand (I dont suppose you could print EPEevery week, could you?), and something AlanWinstanley wrote in Circuit Surgery of Sept00 made me laugh out loud. I hasten to say Ihave the greatest respect for Alans intellectwhich shines through everything he does, but Iwas reminded that there is sometimes a sec-ond, more amusing explanation for a set ofsymptoms.

    A reader had queried Alan about worryingelectric shocks from his dishwasher, and yethis RCD (residual current device) had nottripped the power off, and the RCD checkedout OK. Alan theorized a possible insulationfault but gave the excellent advice to get thedishwasher looked at by a professional.

    The following story from my time as anelectronic repairman shows how a workingRCD might not trip even though the machine itis attached to is giving you electric shocks.

    Some years ago I quickly attended a similarfault in an old, all-metal franking machine(stamps postage on envelopes) which had beenrelocated in an old office building and, while itwas running well, had been giving electric shocksto everybody since the relocation even when itwas switched off. I believe the NZ power distri-bution system is the same as UK, 230V a.c.,50Hz, multiple earthed neutral, so on the way tothe fault I was mentally going over things likeearth wire broken off in the old machine, wiringfaults and errors in the building, etc.

    The ladies who used the machine were insome fear of their lives, and I had firmlyadvised them over the phone that this fear waswell-grounded (is that a pun?). When I arrivedonsite they were at first rather put out whenthey saw me dash in, wave my meter about themachine, glance around the room and burst outlaughing.

    What I really did was to check the machinecompetently, and drew the conclusion that

    when they walked over the nice new carpet intheir nice refurbished office in their prettyfeminine artificial leather shoes to themachine, all those thousands of volts of staticelectricity they had built up found a ready pathto ground through the well-earthed machine!And that was it.

    After my careful and sympathetic explana-tion to the ladies about how to minimise sta-tic buildup, and how it wasnt endangeringtheir lives anyway, they ruefully saw the rea-son for my amusement, but still didnt wantto touch the machine. In the end I suggestedthey leave the office scissors (metal) near themachine, they could pick up the scissors and,holding them firmly, touch the machine withthe scissors first, thereby discharging them-selves with a mighty crack! of spark and notfeel a thing.

    And that would be one way that EPE read-ers could get even severely-felt electric shocksfrom a machine and yet the machines fullyoperational RCD wouldnt trip. Having saidthat, I very strongly advise people not toassume that electric shocks from machineryare just harmless static. Get it checked orplan your funeral, electricity is a good servantbut a bad master!

    Stan Hood,Christchurch, New Zealand

    Reminds me of a situation in my late schoolyears. While showering in the sports changingroom, I frequently felt tingles in my hand whenlightly coming into contact with the metalshower tap. For weeks the school authoritieswould not believe me when I said that the tin-gling was due to electricity being present onthe water piping.

    Eventually the Electricity Board was calledin yes indeed, there was an electrical prob-lem, affecting the adequate earthing of thatpart of the building. A lot of digging in theroad outside was required before the fault wasfound and cured! I would not be telling the talehad the current flow been more severe.

    E-mail: [email protected]

    Everyday Practical Electronics, September 2002 671

    www.

    epem

    ag.co

    m

  • STYLOPICDear EPE,Following on from your StyloPIC in July

    02, you might be interested in some info onthe original. There were three variations of thepocket model standard, treble and bass. Thetreble and bass models being respectively anoctave higher or lower (mine is the standardmodel). Its big brother, the 350S, had manyextra features such as short or long envelope,staccato, two speed vibrato, wah-wah, andeight voices.

    An innovative feature is a light sensor (l.d.r.)for hand control of vibrato or wah-wah. It alsohas two styluses (for playing chopsticks?). Anexternal amplifier was also available for eitherinstrument, with tone and tremolo controls. Onthe technical side, the circuit diagram for thepocket version is in the back of the instructionbook.

    Tone generation is by a programmable uni-junction transistor so the waveform would bepulsed, however it is modified by what looks likea diode pump monostable so the mark-spaceratio would vary depending on the note frequen-cy (and presumably the harmonics generated).So the output waveform would be something likea square wave with slow rise and fall times.Vibrato is generated by a low frequency phaseshift oscillator to vary the programming voltageof the unijunction transistor.

    I know John Becker likes to recycle his soft-ware so here is something to consider in a futureincarnation. It gives greater flexibility of the out-put waveform. And, of course, you can havemultiple waveform tables. This is only an exam-ple, other changes may be needed for it to workcorrectly.

    OUTIT: call WAVFORMmovwf PORTAgoto MAIN

    WAVFORM: andlw $7F ; Sinewave + 2nd harmonicmovwf PCL; 128 entries, amplitude

    0 to 63

    DT 00,00,00,00,00,01,02,04,06,08,11,13,16,19,22,26DT 29,32,35,39,42,44,47,49,52,54,55,57,58,59,59,59DT 60,60,60,60,60,59,59,59,58,59,59,57,57,57,57,57DT 58,58,59,59,60,60,61,61,62,62,63,63,63,63,63,63DT 62,61,60,59,58,56,55,53,51,49,47,45,43,41,39,37DT 35,33,32,31,30,29,29,28,28,29,29,30,31,32,33,34DT 35,36,38,39,40,41,42,43,43,43,43,42,42,41,39,38DT 36,34,32,29,27,24,21,19,16,13,11,08,06,04,03,01; (DT is Define Table of retlws in MPASM)

    Peter Hemsley,via email

    Thanks Peter. The technical stuff I did not findon the web. The table concept looks interesting. Idont know that Ill ever upgrade StyloPIC butwho knows?!

    FLOW CHARTSDear EPE,PICs are not my strong point! However, Ive

    started to look at the code for your PICControlled Intruder Alarm (Apr 02) with a viewto modifying it to suit my own purposes. Do youhave a flow chart that you could send me?

    Trevor Brearley,via email

    No, sorry Trevor, I dont do flow charts for mysoftware I keep concepts in my head and workto those!

    Readers who do like to work with flowcharts will probably be interested in the FlowCode for PICmicro CD-ROM thats availablevia our CD-ROM pages in this issue, and inTerry de Vaux Balbirnies review of it, also inthis issue.

    BIOPIC LEADSDear EPE,I am building the BioPIC Heartbeat Monitor

    (Jun 02) and need to know the order code forBoots lead pack, together with the information

    where to order from abroad. The TENS replace-ment electrode pads you specify are easy to findat almost any Boots shop, but the staff thereknow nothing about leads, nor how to order. Ivetried at several Boots shops on my last trip toLondon.

    Cristian, via email

    Mine came from Boots in Wimborne. I dontknow the order code, they were being supplied asnormal stock items. If you cant get any, use flex-ible wire with crocodile clips to clip onto thechest pads. They dont need screening. You couldtry asking Boots HQ via email (www.google.comwill provide a web address).

    SERIAL ADC PIC TRICKDear EPE,Readers might be interested in my PIC pro-

    gram for use with the TLC548/9 8-bit serial ana-logue-to-digital converter. I use file registersCOUNT and TEMP as sort of standard regis-ters, COUNT for timing etc and TEMP as a sortof second W. It helps me get a mental view of myprogs.

    In the program this routine comes from,COUNT has previously been reset throughDECFSZ, so I can get away with BSFCOUNT,3. I have run this at 6MHz withoutproblem, and it should go faster. The A-D valueis stored in file UNIT.

    A2DIN: BCF PORTB,7 ; clear CS line tohold value tosend

    BSF COUNT,3 ; set count to shift8 bits (makesure thatCOUNT clearedbefore this sec-tion or useMOVLW etc)

    FETCH: RLF UNIT,F ; move bits oneplace left &store new valuein UNIT

    BCF UNIT,0 ; set 0 valuebefore Portb,0bit test

    BSF PORTB,6 ; set A2D clockpin high, releasebit for transfer

    BTFSS PORTB,5 ; is bit 0 (DOUT)set ?

    GOTO NEXT1 ; no, then leaveUNIT bit 0 valueas is

    BSF UNIT,0 ; yes, set bit 0 ofUNIT

    NEXT1: BCF PORTB,6 ; clear clock pinDECFSZ COUNT,F; is COUNT zero?GOTO FETCH ; no, get another

    bit!BSF PORTB,7 ; yes, 8 bits

    clocked out &held in UNIT,set CS line toget new value

    RETURNGraham Card,

    via email

    Useful, Graham, thank you Ive put it in thePIC Tricks folder on our ftp site.

    FREEZER ALARMDear EPE,Ive been reading Humphrey Berridges

    Freezer Alarm in the May 02 issue, and Imextremely impressed with the low componentcount for the functionality achieved, but Id liketo make a suggestion:

    The piezo sounder needs to be as loud as pos-sible, but its only being fed with 5V pk-pk frompin GP4 to ground. If you connect the sounderbetween GP4 and GP5, and feed GP5 with aninverted signal, you will get 10V p-p drive in abridge configuration twice the voltage, at noextra cost!

    The only changes required are to the sweep2and sweep3 routines:

    sweep2 bsf output ; output highbcf output2 ; output2 low addeddecfsz freq,fgoto sweep2movfw nfreqmovwf freq

    sweep3 bcf output ; output lowbsf output2 ; output2 high addeddecfsz freq,fgoto sweep3

    Plus an extra define line:#define output2 gpio,5 ; inverted o/p to piezo

    sounderNigel Goodwin, via email

    Thanks Nigel!

    LOTTERY PREDICTORDear EPE,I am studying GCSE Electronics. My father

    has been purchasing EPE since 1994 and is stillenjoying each new edition. In the April 95 issueI came across the National Lottery Predictorproject and am wondering if you could pleasesend me as much information on that topic aspossible to further my knowledge and passion.

    Gopyr, via email

    So sorry, but we cannot provide additionalmaterial for any published design. Regardingbuilding a circuit from 1995, we normally adviseagainst attempting to build a design that is overfive years old since parts could well havebecome obsolete during that time.

    In this particular case, the p.c.b. is no longeravailable, nor will you be able to obtain the pro-grammed PIC as we are no longer in touch withthe authors, and they did not sell us the copyrightto their software (that was before we began toinsist that all project software must be madefreely available to readers).

    EARTH RESISTIVITY LOGGERI am designing an Earth Resistivity Logger

    for archeological use, inspired by Robert BecksEarth Resistivity Meter of Jan/Feb 97. Mine isPIC controlled and will have its own non-volatilememory (data stays held even after switch off);possibly a graphics l.c.d. may show rough detailsof reading values as grey scale; serial interfacefor connection to PC for deeper analysis.

    I am not an archeologist and am approachingthe design purely as an electronic problem to besolved send an output signal, retrieve it from adistance and store the value. I am in communi-cation with a local archeological society, but Iwould be pleased to hear from any EPE readersinvolved in this field, with special regard to thefollowing: How many reading samples do you normally

    take on a site in one main session? How many samples would you like the logger

    to store before download to PC? Is powering it from a 12V car battery ade-

    quate, or do I need 18V as Robert had? What probing techniques do you use? Im

    assuming the twin-probe technique is best, asdescribed by Robert.

    What maximum probe separation distance doyou use?

    How deep do you insert the probes? Is a signal frequency of 137Hz as used by

    Robert the best to use? In your experience, how likely is it that 50Hz

    mains frequency is likely to occur on a sitebeing surveyed, and would thus need to be fil-tered out in some way?

    Do you always plot the site squares in thesame regular order, or would you prefer tosample in random order, telling the logger thesquare number being sampled?Any answers would be appreciated, my email

    is [email protected].

    672 Everyday Practical Electronics, September 2002

    www.

    epem

    ag.co

    m

  • CONCERNS about finished projectsfailing to work are probably themain reason for would-be constructorsfailing to take the plunge. It is not amajor concern for those with years ofproject building experience becausethey have the technical knowledge,equipment, and know-how to deal withpractically any problem. The opposite istrue for beginners who, on the face of it,have little chance of dealing with pro-jects that refuse to work.

    Keep it SimpleIn reality the situation for beginners is

    better than it might seem. Provided youstart with something reasonably simpleand follow the instructions carefullythere is a good chance of success. Pre-publication checking for both books andarticles containing electronic projectshas increased over the years, and thishas greatly reduced the chances ofbeing led astray by printing errors. Onthe rare occasions that an error doescreep in to an EPE article it is usuallyspotted quite early and corrected oneor two issues later.

    In general, the complexity of modernprojects is greater, but your chances offailure if the instructions are followed tothe letter are much less than theywere. Like any creative skill, electronicproject construction would not be aworthwhile hobby if perfect results wereguaranteed every time with no skillsrequired. You have to be prepared toput in some effort and try to go aboutthings the right way.

    It is worth repeating the importanceof choosing a project that is within yourcapabilities. It is tempting to divestraight in with a project that willimpress your friends, but the morecomplex the project the greater the riskthat you will make a mistake. In the pastit was not unusual to receive lettersfrom readers having problems withprojects that they clearly did not under-stand at all.

    You do not need to know how aproject works in order to build it suc-cessfully, but you do need to have aproper understanding of what it is sup-posed to do and how it is used.Something like a household gadget is amore appropriate starting point than anadvanced piece of test equipmentwhere you need a degree in physics inorder to switch it on!

    Fortunately, letters from readers whohave bitten off more than they canchew are relatively rare these days,but it is still a problem to take seriously.

    Mains PointThe mains supply is potentially

    lethal, as are projects that connect toit. Mains power projects are only suit-able for those with a reasonableamount of experience at project con-struction. Even if a project is very

    simple, if it connects to the mains sup-ply it is certainly not suitable for abeginner.

    Start with projects that are batterypowered. If you should make a seriousblunder it is possible that one or two ofthe components will be damaged, butyou should be perfectly safe. In mostcases all the components will survivethe experience as well.

    The two main construction methodsused in modern projects are stripboardand custom printed circuit boards(p.c.b.s). While both types of board arepretty straightforward to use, customprinted circuit boards represent themore foolproof option. Stripboard is amulti-purpose circuit board that has aregular matrix of holes, and in mostprojects only a few percent of these areactually used.

    As its name suggests, a customprinted circuit board is specificallydesigned for a particular circuit andnormally has just one hole per leadoutwire or pin. With a custom board thereis relatively little risk of making a mis-take in the first place, and any errorsthat should creep in are likely to bespotted almost immediately. With strip-board there are hundreds of unusedholes that are good at disguising mis-takes, and some very careful checkingis needed to detect them.

    Bridging the GapHaving chosen a suitable project and

    put it together with due diligence, whatdo you do if the finished unit fails towork? When a newly constructed pro-ject is clearly failing to work properly itis not a good idea to leave it switchedon.

    Leaving a faulty project switched oncould result in damage to some of thecomponents, and the semiconductorsare particularly vulnerable. Alwaysswitch off faulty projects immediatelyand then recheck the component lay-out, wiring, etc.

    The prudent project builder checksall this sort of thing very carefully dur-ing construction, and spotting errorsearly can save a lot of hassle latter. Inorder to properly check the unit youmay have to partially dismantle it inorder to get proper access to the circuitboard.

    Years of practical experience sug-gest that the vast majority of problemsare due to short-circuits between cop-per tracks on the underside of the cir-cuit board. This is not exactly a newproblem, but the intricacies of modernboards make it even more problematicthan in the past.

    Unless the board is coated with asolder resist that is designed to dis-courage solder bridges, it is likely thatseveral will be produced per circuitboard. Most of these bridges will bespotted while you are constructing the

    board, and in most cases they are eas-ily removed using the bit of the solder-ing iron. If there is a lot of excess solderit is better to use a desoldering tool,and an inexpensive desoldering pumpis ideal for this application. It is advis-able to remove as much solder as pos-sible and then redo any joints that havebeen desoldered.

    Hidden from ViewThe more difficult problem is minute

    trails of solder that are often difficult orimpossible to see with the naked eye.The situation can be made more diffi-cult by the trails being hidden underexcess flux from the solder. This tendsto get liberally splattered across theunderside of circuit boards during con-struction. There are various productsthat can be used to thoroughly cleanthe flux from boards, but vigorousbrushing with a small brush such as anold toothbrush seems to do the job wellenough.

    Good eyesight is not sufficient toguarantee that any solder bridges willbe spotted. Some form of magnifiernow has to be considered part of thestandard toolkit for electronic projectconstruction, and even a small magni-fying glass will greatly increase thechances of detection.

    An 8x or 10x loupe (also sold aslupes) is better though. The inexpen-sive types sold as photographic acces-sories for viewing slides and negativesare perfectly adequate for the presentapplication.

    Provided the board is thoroughlycleaned first, a careful visual checkusing a magnifier should reveal any sol-der bridges. As solder bridges occur sooften it is a good idea to clean and visu-ally inspect all completed circuit boardsprior to installing them in the case.

    Hot SpotsDubious soldering is a common

    cause of problems, particularlyamongst beginners. Soldering is likeany skill, and it is a case of practicemakes perfect. The more projects youbuild the more proficient you willbecome at completing soldered con-nections. There is insufficient spacehere for a soldering tutorial, but a

    PRACTICALLY SPEAKINGRobert Penfold looks at the Techniques of Actually Doing It!

    674 Everyday Practical Electronics, September 2002

    A dry joint.Solder failed toflow.

    A good joint,nice and shiny.

    Photos courtesy Alan Winstanleys Basic Soldering Guide

    www.

    epem

    ag.co

    m

  • good one is available at the EPE website. Some soldering irons and solder-ing kits are supplied with detailedinstructions, and it is well worthwhilestudying these.

    Probably the most common cause ofso-called dry joints is the solderingiron being left unused for a few minutesbefore starting a new batch of connec-tions. If there is a substantial amount ofsolder left on the bit, any flux in it willburn away and it will probably start tooxidise. If you produce the next jointwithout cleaning the end of the bit first,the joint will contain a significant pro-portion of old solder, which may notflow over the joint properly.

    The resultant joint might look plausi-ble and could seem to have goodmechanical strength as well. However,joints of this type usually provide onlyintermittent electrical contact or no con-tact at all, and are relatively weakmechanically.

    Shining ExampleAlways make sure that the bit is tinned

    with fresh solder prior to making joints.Practice soldering with some bits of wire,a few resistors, and a scrap of stripboardbefore you start building projects. Thiswill cost very little and will greatlyenhance your chances of success.

    Checks with a continuity tester or thecontinuity function of a multimetershould locate dry joints, but thoroughlychecking even a small circuit board canbe quite time consuming. Largeamounts of excess flux are sometimesindicative of a bad joint, but this is of nohelp once the board has been cleaned.

    Good joints normally have a char-acteristic mountain shape and thesurface of the solder is very shiny.Dry joints are often more sphericalin shape and the solder tends to havea relatively dull surface, possibly withsome crazing.

    Clean BreakIf any joints look suspicious it is prob-

    ably worthwhile desoldering them andthen re-soldering them. Before tryingagain it is a good idea to have a closelook at the two surfaces. These days itis unusual for dirt or corrosion on one ofthe surfaces to cause problems.Modern components are less vulnera-ble to corrosion on the leadout wiresand tags, and the flux in electrical sol-ders is very efficient at dealing withcontaminants.

    However, there can still be occasion-al problems though, and if there is anysign of contamination it is a good ideato clean both surfaces before redoingthe joint. The best way to clean the sur-faces is to gently scrape them with thesmall blade or a penknife, a miniaturefile, or something of this type.

    The driest joint of all is the one youforget to do! Missing joints are usuallyfairly obvious with custom printed cir-cuit boards, but can be difficult to seewith stripboard where there are numer-ous unused holes and no pads assuch. Firmly pulling on resistors, capac-itors, diodes, etc., will reveal any miss-ing joints, or ineffective joints that lookplausible.

    Heat of the MomentApart from semiconductors, modern

    components are reasonably tolerant ofheat. However, it is still possible thatdamage will occur if you take too longto complete joints. Heat damaged com-ponents usually show some obvioussigns of damage, such as a darkeningin colour or being slightly misshapen.Always replace any off colour ordeformed components, or any compo-nents that show significant signs ofphysical damage.

    Integrated circuits (i.c.s) are mostlyfitted in holders, but transistors anddiodes are often connected directly tothe circuit board. Always take extracare when fitting these in place. Aspointed out previously, it is a matter ofpractice makes perfect, and you canavoid a lot of problems by learning tosolder quickly and neatly before dealingwith transistors and diodes.

    Try and Try AgainHaving thoroughly checked both

    sides of the board and made any nec-essary repairs it is time to reassemblethe project and test it again. Thoroughlycheck the hard wiring against the wiringdiagram, as it is relatively easy to makemistakes here. If the project still doesnot work, the most likely explanation isthat you have missed an error in thewiring or on the circuit board.

    With this type of thing there is a ten-dency to blame others and not acceptthat you could have made a mistake. Inreality it is easy to make the odd mis-take here and there, and even oldhands make the occasional error.

    Start by checking that every compo-nent on the circuit board is in the rightplace and has the correct value. Workthrough the components methodicallymaking sure that none of them areoverlooked. If you have managed tomiss out a component, this error shouldthen come to light. With stripboard con-struction make sure that any link wiresare present and correct.

    Ideally you should get someone elseto check the unit against the construc-tion diagrams. A fresh pair of eyesmight spot something that you haveconsistently overlooked.

    Wrong ConnectionThe components that must be fitted

    the right way round are the most likelyto give problems. Layout diagrams and

    the markings on components such asdiodes and electrolytic capacitors areusually quite explicit, so any errorsshould be easily spotted.

    One exception is the type of diodethat has several bands rather than oneat the cathode (k or +) end of thecomponent. These have had somethingof a renaissance in recent times, so youmay well encounter them. The bandsindicate the type number using a varia-tion on the resistor colour code. A widerband at that end of the body (Fig.1)indicates the cathode (k) lead.

    Light emitting diodes (l.e.d.s) canalso be problematic. If a project worksapart from a l.e.d. indicator, it is odds-on that the l.e.d. is simply connectedthe wrong way round.

    A Pressing ConnectionBefore too long practically everyone

    makes the classic mistake of forgettingto switch on the project or omitting thatall-important component the battery.Battery connectors have always beennotoriously unreliable. Try pressing theconnector firmly onto the battery to seeif it makes the project burst into action.Slightly compressing the female con-nectors with pliers usually gets a looseclip to work reliably.

    Battery holders for 15V cells arealso something less than totally reli-able. Ensure that the terminals of thebatteries and the holder are clean bygently removing any contamination withfine sandpaper.

    Multi-checksA cheap multimeter is useful for

    checking that the battery voltage isactually getting through to the circuitboard. It can also be used to check thatthe battery is in a usable state.

    Even if you do not have much techni-cal knowledge, a multimeter can still beuseful for numerous basic checks. Forexample, it can be used for makingcontinuity checks on switches, whichmay not operate in quite the way youthink they do?

    Have you confused the on and offsettings? Often when a project seemsto be working irrationally it is just thatone of the switches does not functionas expected. The high and low rangesare transposed, or something of thistype.

    A multimeter is also useful for check-ing cables for short-circuits or brokenleads, checking that that plugs andsockets connect together properly, etc.Even some of the cheaper digital typesnow have the ability to check resistors,transistors, diodes, and capacitors,which is clearly more than a little use-ful. A multimeter is a piece of equip-ment that no project builder should bewithout.

    Because modern components arevery reliable you are unlikely to havea failure caused by a dud component.If you get everything connectedtogether properly your projects willwork, and it helps to keep this inmind. Of course, the projects willnever work if you do not pluck up thecourage to take the plunge andactually build them.

    Everyday Practical Electronics, September 2002 675

    Fig.1. The wide band indicates thecathode (k) leadout of multi-banddiodes.

    www.

    epem

    ag.co

    m