13.07.2015 Views

Nuts & Volts

Nuts & Volts

Nuts & Volts

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

08529261PROJECTSand FEATURES42 CHIP MUSIC COMPOSINGSIMPLIFIEDMake your own musicalmicrocontrollers.■ By G.Y. XuON THE COVER ...38 A SIMPLE DIGITALTACHOMETERBuild this “speedy” device toassess work you do to yourvehicle’s engine.■ By Dan GravattMAY 200646 A DIGITAL CAPACITANCEMETERAdd a capacitance meter to yourtest bench without blowing outyour wallet.■ By Robert Reed52 CONSTANT CURRENTSOURCES — PART 2This tutorial concludeswith semiconductor, electricalcomponent, and electrochemicalapplications.■ By Vaughn D. Martin61 THE BRAIN-COMPUTERINTERFACEBrain interfacing technology hasgone from science fiction to thereal world.■ By James L. Antonakos67 BIOLOGICAL ORGANISMSAND ELECTRONICSThis fusion may save the world!■ By Christopher T. HoltCOLUMNS08 TECKNOWLEDGEY 2006Events, advances, and newsfrom the electronics world.12 GETTING STARTED WITH PICsUsing PIC timers.22 Q&AEverything you wanted to knowabout MOSFETS. Practical appsand lots of theory.74 STAMP APPLICATIONSThe object of the machine.78 PERSONAL ROBOTICSZen and the art of Zigbee: Part 2.86 THE DESIGN CYCLEFlight testing the ARM.92 NEAR SPACEGeiger Counter Telescope: Part 1.DEPARTMENTS06 READER FEEDBACK34 NEW PRODUCTS51 ELECTRO-NET60 SHOWCASE70 NEWS BYTES98 CLASSIFIEDS108 NV BOOKSTORE110 TECH FORUM113 ADVERTISERS INDEX<strong>Nuts</strong> & <strong>Volts</strong> (ISSN 1528-9885/CDN Pub Agree#40702530) is published monthly for $24.95 per yearby T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID ATCORONA, CA AND AT ADDITIONAL MAILING OFFICES. POSTMASTER: Send address changesto <strong>Nuts</strong> & <strong>Volts</strong>, P.O. Box 15277, North Hollywood, CA 91615 or Station A, P.O. Box 54,WindsorON N9A 6J5; cpcreturns@nutsvolts.com4 May 2006


Link InstrumentsPC-Based Test EquipmentLogic AnalyzersNew LA-5000 Series• 40 to 160 channels• up to 500 MSa/s• Variable Threshold• 8 External Clocks• 16 Level Triggering• up to 512K samples/ch• USB 2.0 and Parallel Interface• Pattern Generator optionLA5240 (200MHz, 40CH)LA5280 (200MHz, 80CH)LA5540 (500MHz, 40CH)LA5580 (500MHz, 80CH)LA55160 (500MHz, 160CH)$1700 USB 2.0/Parallel$2350 USB 2.0/Parallel$2500 USB 2.0/Parallel$3500 USB 2.0/Parallel$7500 USB 2.0/Parallel• Small, Lightweight and Portable• Only 4 oz and 4.75” x 2.75” x 1”• Parallel Port Interface to PC• Trigger OutSmall and portable LA-2124• 24 Channel Logic Analyzer• 100MSa/S max sample rate• Variable Threshold Voltage• Large 128k Buffer$800Digital Oscilloscopes• 2 Channel Digital Oscilloscope• 100 MSa/s max single shot rate• 32K samples per channel• Advanced Triggering• Only 9 oz and 6.3” x 3.75” x 1.25”• Small, Lightweight, and Portable• USB or Parallel Port interface• Advanced Math• FFT Spectrum Analyzer (option)DSO-2102S $525DSO-2102M $650DSO-2102S(USB) $600DSO-2102M(USB) $725Link Instruments (973) 808-899017A Daniel Road East · Fairfield, NJ 07004 · Fax (973) 808-8786www.Link-instruments.comMay 2006 5


PART HAS DEPARTEDUnfortunately between thewriting and publishing of my OctalLogic Probe article in the April issue,Jameco has discontinued part#176532. If anyone can recommend analternate source for MV50G or asuitable replacement LED withsimilar specifications (Green, T3/4, 300mcd @ 20 mA, Radial leads) it wouldbe appreciated.Jim BrannanShop@ImpossibleEnterprises.comMONEY MATTERSI read the February Design Cycleon the 68HC908. Do I have to buy aCyclone to see if I like using the68HC908? The price of approx. $500seems steep to see if I like a processoror not being just a hobbyist. Isthere another way to go with the projectthat I could maybe afford? Thanks!Dan StarkeyResponse: There are other lessexpensive ways to deal with a68HC908. The minimum you can getaway with commercially is about $200.by J. ShumanREADER FEEDBACKYou can use serial bootloaderprograms to load the 68HC908’s Flash.However, you still need a hardwareprogrammer to put the bootloadercode into the device initially.The Cyclone PRO is a multipurposeprofessional tool, which isreflected by the price. The $18068HC908 MONO8 programming/debugging adapter you can get fromDigi-Key is a barebones platform.I did some walking around theweb for you and found that the $180-$200 mark is about standard for anyminimal MONO8 setup from variousmanufacturers. That’s comparablewith the Microchip MPLAB ICD 2 package,which goes for $149 bare. I alsolooked for some do-it-yourselfMONO8 projects but found none.That’s typical of Freescale stuff asmost of the supporting hardware ismore easily purchased than fabricatedfrom scratch. Remember, Freescalecame from Motorola and Motoroladidn’t care much about us hobbyistsas most of their stuff was bought upby corporations like GM, Ford MotorCompany, and Uncle Sam. Freescaleis turning that around but the thirdparty hardware support guys haven’tquite caught up with the idea yet.Continued on page 100EVERYTHING FOR ELECTRONICSPublished Monthly ByT & L Publications, Inc.430 Princeland Ct.Corona, CA 92879-1300(951) 371-8497FAX (951) 371-3052Product Order Line 1-800-783-4624www.nutsvolts.comSubscriptionsInside US 1-877-525-2539Outside US 1-818-487-4545P.O. Box 15277North Hollywood, CA 91615FOUNDER/ASSOCIATE PUBLISHERJack LemieuxPUBLISHERLarry Lemieuxpublisher@nutsvolts.comASSOCIATE PUBLISHER/VP OF SALES/MARKETINGRobin Lemieuxdisplay@nutsvolts.comCONTRIBUTING EDITORSChuck Hellebuyck TJ ByersJeff EckertJon WilliamsPeter BestPhil DavisJames Antonakos Vaughn MartinG.Y. XuJoe StramagliaRobert Reed Dan GravattDave Prochnow Paul VerhageCIRCULATION DIRECTORTracy Kerleysubscribe@nutsvolts.comSHOW COORDINATORAudrey LemieuxWEB CONTENT/NV STOREMichael Kaudzesales@nutsvolts.comPRODUCTION/GRAPHICSShannon LemieuxCopyright © 2006 by T & L Publications, Inc.All Rights Reserved6 May 2006All advertising is subject to publisher's approval. We are notresponsible for mistakes, misprints, or typographical errors.<strong>Nuts</strong> & <strong>Volts</strong> Magazine assumes no responsibility for theavailability or condition of advertised items or for the honestyof the advertiser. The publisher makes no claims for the legalityof any item advertised in <strong>Nuts</strong> & <strong>Volts</strong>. This is the soleresponsibility of the advertiser. Advertisers and their agenciesagree to indemnify and protect the publisher from any and allclaims, action, or expense arising from advertising placed in<strong>Nuts</strong> & <strong>Volts</strong>. Please send all editorial correspondence, UPS,overnight mail, and artwork to: 430 Princeland Court, Corona,CA 92879.


■ BY JEFF ECKERTADVANCED TECHNOLOGYNEW CIRCUITRY BASEDON GRAPHITEPHOTO BY GARY MEEK,COURTESY OF GEORGIA TECH.■ Professor Walt de Heer holds a proofof-principledevice constructed ofgraphene.If some researchers at the GeorgiaInstitute of Technology (www.gatech.edu) and the Centre Nationalde la Recherche Scientifique(www.cnrs.fr) in France have it right,we could someday be buildingelectronic devices that are basedon common graphite rather thansilicon. Using thin layers of graphite(known as graphene), Prof. Waltde Heer and associates havedemonstrated some proof-ofprincipletransistors, loop devices,and other circuitry.Ultimately, they hope to usegraphene layers less than 10 atomsthick as the basis for electronic systemsthat would manipulate electronsas waves rather than as particles,much like photonic systems controllight waves. The technology is derivedfrom that of carbon nanotubes, whichhave attracted a great deal of interestbecause they conduct electricitywith virtually no resistance. Thisnew material is simply a form ofnanotubes consisting of graphenethat has been rolled into a cylindricalshape.“We expect to make devices of akind that don’t really have an analog8 May 2006TECH KNOWLEDGEYEVENTS, ADVANCES, AND NEWSin silicon-based electronics, so this isan entirely different way of looking atelectronics,” said Prof. deHeer. “Our ultimate goal isintegrated electronic structuresthat work on diffractionof electrons rather thandiffusion of electrons. Thiswill allow the production ofvery small devices with veryhigh efficiencies and lowpower consumption.”So far, they have built anall graphene planar fieldeffecttransistor. The sidegateddevice produces a change inresistance through its channel whenvoltage is applied to the gate.However, this first device has asubstantial current leak, which theteam expects to eliminate with minorprocessing adjustments.They have also built a workingquantum interference device — aring-shaped structure that would beuseful in manipulating electronicwaves. But don’t expect large-scalemanufacturing in the near future.According to the professor, “Buildinga new class of electronics based ongraphene is going to be very difficultand require the efforts of manypeople.”METHOD MAY OPTIMIZELIGHT-EMITTING SEMISPhysicists at JILA (jilawww.colorado.edu) — a joint institute ofthe National Institute of Standardsand Technology (www.nist.gov) —have demonstrated an ultrafast lasertechnique for displaying previouslyhidden behavior in semiconductors.(In case you were wondering, JILAoriginally stood for “Joint Institute forLaboratory Astrophysics,” but theinstitute now encompasses a muchwider range of scientific endeavors, so2006PHOTO COURTESY OF JILA.■ This Rorschach-blot-like imageshows the once-hidden behavior ofsemiconductors.JILA now officially doesn’t stand foranything.)In the JILA technique, a samplemade of thin layers of galliumarsenide is hit with a continuousseries of three near-infrared laserpulses lasting just 100 femtosecondseach. Trillions of excitons are therebyformed, which consist of “excited”electrons and the “holes” they leavebehind as they jump to higher energyvibration patterns. By changing thetiming of the laser pulses and analyzingthe wave patterns of the lightand exciton oscillations, the JILAscientists figured out how to produceand identify correlations betweenabsorption and emission of light fromthe material.As shown in the illustration,computer plots show how energyintensity (ranging from low in blue tohigh in red) varies as the excitonsabsorb laser light and emit energy atvarious frequencies. The pair ofsimilar “butterflies” indicates that anexciton is absorbing and emittingenergy in a predictable pattern. Themethod was originally developedby other researchers long ago for


TECHKNOWLEDGEY 2006probing couplings between spinningnuclei as an indicator of molecularstructure, and it led to a Nobel prize;more recently, scientists have beentrying to use it to study vibrations inchemical bonds.This new application is aimed atproducing more predictable designsof optoelectronic devices, includingsemiconductor lasers and white lightemittingdiodes.COMPUTERS ANDNETWORKINGCOMPUTERS NOW 60YEARS OLDPHOTO COURTESY OF THE US ARMY RESEARCH LAB.■ The original ENIAC.In case you didn’t notice, 2006marks the 60th anniversary of thefirst electronic computer, the ENIAC(electronic numerical integrator andcomputer), invented by Dr. J. W.Mauchly and my favorite uncle, J.Presper Eckert, Jr., both of the MooreSchool of Electrical Engineering ofthe University of Pennsylvania(www.upenn.edu). (Just kidding —we’re not related, as far as I know.)It was officially introduced inFebruary 1946. Built at a cost of about$400,000, ENIAC used nearly 18,000vacuum tubes, weighed 30 tons, drewabout 150 kW of power, and filled a30-by-50 ft room. Its performance wasoriginally described as “phenomenal,”as it could perform a simpleaddition in only 1/5,000 of a second.But it could actually perform threedimensional,second-order differentialequations, not just simplearithmetic. And, contrary to popularmythology, it blew a tube only everytwo days or so.The machine operated at a clockrate between 60 and 125 kHz, whichwas pretty impressive at the time,although its descendent, the UNIVAC,was considerably faster, at 2.25 MHz.For more information, you can visit theENIAC Museum Online at www.seas.upenn.edu/~museum And if you wantto take a look at the original pressrelease from the War Department, justaim your browser at americanhistory.si.edu/collections/comphist/pr1.pdf and you can download it.CPU COOLER ALLOWSOVERCLOCKINGPHOTO COURTESY OF ASETEK, INC.■ The VapoChill® cooling systemallows CPUs to run up to 50% faster.If you are something of a fanaticabout getting the highest possibleperformance for your machine, youmight want to consider installing a kitfrom Asetek, Inc. (www.asetek.com).This Danish company specializes incooling systems, and it recentlydemonstrated a PC — which it callsthe Dream Machine — that is basedon a 3.8 GHz Pentium 4 chip, butactually runs at 5.46 GHz.This overclocking is achieved viathe company’s VapoChill LightSpeedsystem, which keeps the processorrunning at a cool -33°C. It uses a compressorto accomplish the task, whichis said to be 10 times as efficient aswater cooling and 50 times betterthan air cooling. The CPU mountingkit is said to be easy to install (with“easy” appearing to be a relativeterm), and it supports both AMD K8and Intel P4 chips. The unit will setyou back about $820, though, so itisn’t for the faint of heart.FREE LAPTOPREPAIR GUIDESStarted a year ago as a site combiningthe do-it-yourself ethic withcomputing, Repair4Laptop (repair4laptop.org) recently announced that itscollection of user-submitted manualshas grown beyond 600, rangingfrom step-by-step instructions forpopular repairs to more exotic laptopmodifications.Since notebook computers aredifficult, expensive, and timeconsumingto repair, the site fills aniche as both a knowledge-base and acommunity. It provides free access toa variety of resources for repairing,upgrading, modifying, and servicinglaptops and notebook computers,arranged by manufacturer and part,including keyboards, hard drives,optical drives, displays, RAM, CPUs,batteries, and others.PERSONAL NAVIGATIONSYSTEM IS FREE (Almost)Earthcomber, touted as the “ultimatepersonal navigator,” has■ The Earthcomber navigation systemis now available for Windows Mobilebasedhandhelds.Photo courtesy ofEARTHCOMBER LLC.May 2006 9


■ BY CHUCK HELLEBUYCKFor this article, I’ll explain timersand then use the Timer 1 peripheralto form an accurate one-secondtime base. This could be consideredan advanced project so don’t be toohard on yourself if it takes a while tocompletely understand it.WHAT IS A TIMER?Inside almost every MicrochipPIC is a timer peripheral. In somePICs, such as the PIC16F876A I’veused in previous articles, there arethree timers. But what is a timer, whatdoes it do, and how do we use in withPICBasic Pro?The so-called “Timer” inside aMicrochip PIC is just a binary countercircuit fed by a controlled-frequencyclock source. For all you formerTTL/CMOS users out there, think of itas an eight- or 16-bit binary ripplePICsTHE LATEST IN PROGRAMMING MICROCONTROLLERSUSING THE MICROCHIP PIC TIMERSONE OF THE MORE POPULAR REQUESTS I’ve received from <strong>Nuts</strong> & <strong>Volts</strong> readersis to demonstrate how to use the Microchip PIC timers. I know when I startedwith PICs it was one of the areas I wanted to learn, and it was also one ofthe more confusing peripherals to get working properly. They’re not difficult tounderstand, but they have so many options that the beginner gets overwhelmed.12 May 2006GETTING STARTED WITHcounter chip built into the PIC. Inother words, it’s not a stop watch orclock outputting minutes, seconds, ortenths of seconds to display somewhere.It’s just a binary counter with atime base supplied from the internalPIC clock and driven by the externalresonator or crystal (see Figure 1).Therefore, we can use the valueobtained from the timer peripheralsin the PIC to calculate variousfunctions, such as a time base, todetermine when to change an outputfrom a high state to low or low stateto high.Timers can do more than serve asa time base; they can also be used asan asynchronous counter controlledfrom an external signal that has noconnection to the internal clock. I’llcover this later, but these sorts ofadded capabilities the timers haveare what create confusion for thebeginner. I just want you to understandthat a PIC timer is a binarycounter that runs by itself in parallelwith your main program. They canalso interrupt your main program (ifyou set that up), and they can be reador reset at anytime from your mainprogram.One more very important pointthe beginner needs to know: theinternal clock that feeds the timersand your main program is the externalresonator or crystal frequencydivided by four. For example, if youhave your PIC running with a 4 MHzresonator, the internal clock feedingthe program counter and timers isrunning at 1 MHz. You need tounderstand this to properly set upthe internal timers.TIMER CHOICESThere are three different typesof PIC timers with three differentnames: TMR0, TMR1, and TMR2.Two are eight-bit wide (TMR0 andTMR2), and one is 16-bit wide(TMR1). Because timers are binarycounters, the eight-bit timers cancount from 0 to 255 (binary 0 tobinary 11111111), and the 16-bit timercan count from 0 to 65535 (binary 0 tobinary 1111111111111111).The three timers have differentfeatures that make them unique anduseful for different applications.■ FIGURE 1. The PIC timers are binarycounters driven by the PIC’s internal clock.


TMR0• Eight-bit timer• Readable and writeable as one byte• Can be fed from internal clock orexternal input pin (A4)• Can be set to create a hardwareinterrupt at overflow (255 > 0)• Can use an eight-bit prescaler 1:2 to1:256• Is rising- or falling-edge selectable forexternal inputTMR1• 16-bit timer• Readable and writeable as twobytes• Can be fed from internal clock orexternal clock crystal• Can be set to create a hardwareinterrupt at overflow (65535 > 0)• Can use a four-bit prescaler 1:2to 1:8TMR2• Eight-bit timer• Readable and writeable as onebyte• Writeable comparison byte sizeregister• Only fed from internal clock• Constantly compared to secondarypresettable binary value• Can have 1:1, 1:4, 1:16 prescaleror 1:1, 1:2, 1:3 to 1:16 postscaler• Output can drive synchronousport• Can be set to trigger a hardwareinterrupt each time it matchesa preset valueAll three can be fed fromthe internal PIC clock, but TMR0can also be fed from an externalinput pin. This allows TMR0 toact as either an event counter ora timer. The 16-bit TMR1 can becontrolled by an external crystalseparate from the internal PICclock or from an external input,making it a 16-bit counter.This offers the opportunity tocontrol TMR1 externally from aslower clock source such asa digital-watch crystal or adigital-counter source. TMR2can only run from the internal■ FIGURE 2. Timer features andtheir control bits.PIC clock but, like a time-elapsetimer, can be automatically set toconstantly check whether it matchesa preset value.Figure 2 shows the features of thethree timers along with the controlbits to set up these features.Each of the timers has a registerfor its count value. These valuescan be read or modified from withinyour code. TMR1, which is 16-bitswide, has two registers, TMR1H andTMR1L, because the PIC has aneight-bit data bus. These are theGETTING STARTED WITH PICshigh-byte and low-byte valuesand, combined, they form a word.To access this timer’s value you haveto read each register separatelyand then combine them into a wordvariable.PICBasic Pro makes it easy toread from and write to theseregisters directly because it hasreserved the register names askeywords in its syntax. For example,to preset TMR0 to 56 so itwill overflow on the 200th pulserather than 256, you just add theFEATURES TMR0 TMR1 TMR2Size Eight-Bit 16-Bit Eight-BitPrescalerOPTION_REG.3 - 0%1xxx = 1:1%0000 = 1:2%0001 = 1:4:%0111 = 1:256T1CON.5 -T1CON.4%00 = 1:1%01 = 1:2%10 = 1:4%11 = 1:16Postscaler Not Available Not AvailableInterruptEnable BitINTCON.5PIE1.0andINTCON.6T2CON.1 -T2CON.0%00 = 1%01 = 4%1x = 16T2CON.6 - 3%0000 = 1:1:%1111 = 1:16PIE1.1andINTCON.6Interrupt Flag INTCON.2 PIR.0 PIR.1Internal ClockExternalCrystal/ResonatorCounter Modeor External ClockModeOn/Off ControlTimer RegisterName(s)Fosc/4Selected byOPTION_REG.5 = 0Not AvailablePulse signalconnected to TOCKIPinSelected byOPTION_REG.5 = 1Edge Select Bit forIncrementing:OPTION_REG.40 = Low to High1 = High to LowNot Available(Always on)TMR0Fosc/4Selected byT1CON.1 = 0Crystal or Resonatorconnected between C0and C1 pinsSelected byT1CON.1 = 1and T1CON.3 = 1Sync external withinternal clockselected by T1CON.20 = Synchronize1 = Do Not SyncPulse signalconnected to C0 pinSelected byT1CON.1 = 1and T1CON.3 = 1Sync external withinternal clockselected by T1CON.20 = Synchronize1 = Do Not SyncT1CON.00 = Off1 = ONTMR1H - High ByteTMR1L - Low ByteFosc/4(Only Option)Not AvailableNot AvailableT2CON.20 = Off1 = ONTMR2May 2006 13


GETTING STARTED WITH PICs■ FIGURE 5. Schematicfor this month’s project.built in, including thebasics such as resonatorsocket, resetswitch, MCLR resistor,five-volt regulator,and On/Off switch. Italso has a power portand RS232 connectionfor serial communicationand bootloaderprogrammingcapability (which Iwill discuss in alater article). Youdon’t need this moduleto do the project,but it does makedevelopment easier. Iuse it in all my projectsand I designed itto work with theprojects in my bookProgramming PICMicrocontrollers withPICBasic. It alsoconverts to an Atommodule with just achip change, which makes it easy to write Atom andPICBasic Pro code for the same hardware setup. Thehardware for this month’s project is shown in Figure 4.TMR1 SETUPThe 16-bit Timer1 counts from 0 to 65535, incrementingonce on every internal clock pulse. It then overflowsand resets back to 0 on the next pulse. When it overflows,it sets the TMR1IF (Timer1 Interrupt Overflow Flag) bit onthe PIR1 register of the PIC. When this bit is set, it triggersan interrupt if you have interrupts turned on in software.The software section will describe how to set upinterrupts.For this project, I’ll be running the PIC with a 20 MHz(20,000,000 pulses/second) resonator clock signal ratherthan the typical 4 MHz. I did this to show how to use theprescaler. The external clock signal gets divided by fourinside the PIC chip to form the internal clock pulse thatdrives the timers. The project will further divide that signalby eight using the Timer1 prescaler. If you were to calculatethis out, you would see that the Timer1 overflows every0.104856 seconds:65535–––––––––––––––––––––––––––––––––– = 0.104856 seconds20,000,000 Pulses/Second (1/4) (1/8)We want it to overflow on an even number such as0.10 seconds (100 ms). If the Timer1 overflowed every62500 pulses, it would be a perfect 100 ms time base. Wecan make this happen by presetting the Timer1 to 3035(65535 – 62500 = 3035) or $0BDB hex. Then we can trackthe number of overflows, and when 10 have occurred,we know that one second has passed. With thatinformation, the program can change the state ofan LED from OFF to ON or ON to OFF at an accurate rateof once per second (1 Hz). The adjusted calculation isshown below.62500–––––––––––––––––––––––––––––––––– = 0.10 seconds20,000,000 Pulses/Second (1/4) (1/8)HARDWARE SETUPThe hardware schematic is shown in Figure 5. Eventhough I used my Ultimate OEM module, I show theschematic as raw PIC so you can build this yourself withoutthe Ultimate. The PIC used is the PIC16F876A, which is I/Ooverkill for flashing an LED, but a lot of readers have thischip already, and many of the smaller I/O PICs don’t have aTMR1 on-board.The schematic shows the PIC16F876A with a 20 MHzresonator and MCLR resistor connected. I show the LEDanode connected to the B0 pin through a 220 ohm resistorand the cathode tied to ground. The PIC gets its 5V from a7805 regulator circuit.May 2006 15


SOFTWAREThe code shown in Listing 1 is not that long orcomplicated once you break it down. Remember, we aredoing two advanced functions here: using the Timer1 andusing interrupts.HOW IT WORKSThe program starts off with the specific DEFINEsrequired. This defines the bootloader self programmingsetup that the Ultimate OEM module has built in. I know afew readers are using bootloader modules so this is therefor them. Since most readers are programming it into ablank PIC using a PIC programmer, you don’t need this lineso I commented it out by putting an apostrophe in front ofit. PICBasic Pro will treat it as a comment line and ignore itduring compile time.‘ DEFINE LOADER_USED 1 ‘ This command line for Ultimate‘ OEM onlyThe next DEFINE establishes the oscillator frequency.PICBasic Pro defaults to 4 MHz. Therefore, we must adjustthe time-based commands for the higher frequency.PICBasic Pro automatically adjusts for the higher speedwhen we add this DEFINE:DEFINE OSC 20We establish only one variable for this simple program.It’s called “counter.” It will store how many times theprogram interrupted so we can see when we have reached10 interrupts (one second).counter var byte‘Establish a byte size variableThe program has to initialize Timer1 to 3035 decimal,and we do that by writing directly to the Timer1 registers,TMR1H and TMR1L. You could use decimal numbers forthis, but that would be confusing because TMR1H wouldhave to be set to 11 and TMR1L to 219, and it’s not obviousthat these combine to form the word value 3035. You coulduse binary, setting all eight 1s or 0s in their proper order,but that’s a lot of typing. This is where hexadecimalnumbers are handy. You can use the Windows scientificcalculator to easily convert 3035 decimal to $0BDBhexadecimal and then make TMR1H equal to the first twodigits and TMR1L equal to the second two. That’s what I didhere. The dollar sign tells PICBasic Pro that the number isa hex value.TMR1H = $0B ‘Preset Timer 1 to 3035TMR1L = $DB‘ using $0BDB hexLISTING 1‘ DEFINE LOADER_USED 1 ‘ This command line for Ultimate OEM onlyDEFINE OSC 20‘Set oscillator to 20 MHzcounter var byte‘Establish a byte size variableTMR1H = $0B ‘Preset Timer 1 to 3035TMR1L = $DB‘ using $0BDB hexT1CON = %00110001‘Timer1 on with 1:8 prescalerPIE1 = %00000001‘Enable Timer1 InterruptINTCON = %11000000‘Enable interruptsON INTERRUPT GOTO mytimer ‘Define interrupt handlerhigh 2‘Initialize B2 LED to oncounter =0‘Initialize counter to zeromainif counter = 10 then‘Test for 10 interruptstoggle 2‘10 interrupts occurred so flip LED statecounter = 0‘Reset counter variableendif‘End the If-Then commandgoto main‘Loop back to the Beginning‘*** This is where we go on and interrupt ***Next, we enter the special registersetup commands. As mentioned,the PIC automatically divides the20 MHz clock by four, but we needto set up the divide-by-eightprescaler. We do that by setting theproper bits in the T1CON register.Setting the fifth and sixth bits to “1”establishes the prescaler as 1:8. Thefirst bit (bit 0 in the data sheet)turns the timer on (set to “1”) or off(set to “0”). We turn it on here. Asyou can see, in this case, I usedbinary rather than decimal or hex(the “%” symbol indicates it’s a binarynumber). Using binary makes iteasy to check which bits are set andwhich are cleared. Each numbersystem has its proper place inprogramming.T1CON = %00110001‘Timer1 on with‘ 1:8 prescalerdisablemytimer:TMR1H = $0BTMR1L = $DBcounter = counter +1PIR1.0 = 0resume16 May 2006‘Prevent interrupts from occurring‘Interrupt handler routine label‘Preset Timer 1 to 3035 decimal‘ using $0BDB hex‘Increment the timer overflow count‘Clear Timer1 overflow interrupt flag‘This is how we exit an interruptAnother register that needs tobe set up is the PIE1 register. Itcontrols peripherals such as Timer1and Timer2. The first bit (bit 0) is theTimer1 interrupt enable bit. We needto set this to “1” to allow or enablethe Timer1 overflow to cause an


GETTING STARTED WITH PICsinterrupt to the main program loop. I use binary againhere.PIE1 = %00000001‘Enable Timer1 InterruptInterrupts in the PIC are controlled from a key registercalled the INTCON register. There are two bits in theINTCON that enable the Timer1 interrupt. The seventh bit(bit 6) is the PEIE bit that enables any interrupts set inthe PIE1 register. The eighth bit (bit 7) is the GIE orGlobal Interrupt Enable bit that enables all interrupts.This is like a pecking order. All bits of these variousregisters have to be set for the Timer1 interrupt, but noneof them work until the top bit (GIE) is set. This is thecentral control bit that makes it easy to turn on or turn offall interrupts. You’ll see how PICBasic Pro also enables ordisables interrupts in sections of code using a PICBasicPro command. The bits are set, and easily seen, using abinary number.INTCON = %11000000‘Enable interruptsFinally, the label of where to jump to when theinterrupt or overflow occurs is defined as “mytimer.” Later,I’ll explain what we do when the interrupt actually occurs atthe “mytimer” label.ON INTERRUPT GOTO mytimer‘Define interrupt handlerBefore we get to the main loop, we start the LED inthe ON state by setting PortB’s bit 2 to a high value usingthe HIGH command. We also reset the “counter” variableto “0.”high 2counter =0‘Initialize B2 LED to on‘Initialize counter to zeroThe main section of code starts with the label“main.” This section is really simple. It checks whetherthe variable “counter” is equal to 10 yet. If it isn’t, theprogram just loops back and does it again. If, however,the value is equal to 10, then we want to change the stateof the LED, and we use the TOGGLE command to dothat. TOGGLE just switches it from OFF to ON orfrom ON to OFF. Then we reset the “counter” variableto “0” and end the IF-THEN statement with the ENDIFcommand.From there, we loop back to “main” to test “counter”again.The last section of code is the interrupt code andis separate from the main loop of code. When theinterrupt occurs, the program will finish whatevercommand was being executed, then jump to the definedinterrupt label, which is “mytimer” in this example. Notethat I said the program will finish its command beforejumping to the interrupt label. PICBasic Pro doesn’timplement true hardware interrupts unless you writethe interrupt routine in assembly and do someother advanced setup functions. Therefore, it offers twoforms of interrupt: simple and complex. Simple worksfor most examples, and it works here. That’s why I’musing it.The simple interrupt method has one drawback andthat is delay time of the commands. If you have acommand such as PAUSE 5000 in your main loop and itreceives an interrupt, the program will not jump to theinterrupt service routine until the full five seconds ofpause have occurred. Therefore, all commands should beshort when you use interrupts. A FOR-NEXT loop of 5000loops of PAUSE 1 would be a better way to achieve thesame result because it allows quicker interrupt response.This time delay before the interrupt code starts running isknown as interrupt latency. Interrupt latency is onedrawback of programming in Basic vs. programming inassembly.Before the “mytimer” label is the DISABLE command.This shuts off the Timer1 interrupt for any code belowthat command. This is necessary so the interrupt cannotoccur while we are running the interrupt routine. If weallowed that, we could end up in a continuous loop ofinterrupts and never leave the interrupt routine. Thisis also why it is very important to make your interruptroutines short so we don’t miss an interrupt whileprocessing one.disable‘Prevent interrupts from‘ occurringIn the interrupt service routine (or handler), we do twothings: reset Timer1 to 3035 and increment the “counter”variable. Remember, we check this variable to see ifit equals 10 in the main loop, but we increment it in theinterrupt service routine.mytimer:TMR1H = $0BTMR1L = $DBcounter = counter +1‘Interrupt handler routine label‘Preset Timer 1 to 3035 decimal‘ using $0BDB hex‘Increment the timer overflow‘ countmainif counter = 10 thentoggle 2counter = 0endifgoto main‘Test for 10 interrupts‘10 interrupts occurred so flip‘ LED state‘Reset counter variable‘End the If-Then command‘Loop back to the BeginningAt the end of the interrupt routine, we need to resetthe Timer1 overflow interrupt flag (TMR1IF) so we don’tinstantly jump back into an interrupt condition. We dothat by directly setting the PIR1 bit 0 to “0.” We follow thiswith the RESUME command, which is required byPICBasic Pro. This jumps the program back to the mainloop where it was interrupted. A GOTO command orRETURN command won’t work here. Interrupts require theMay 2006 17


RESUME command.PIR1.0 = 0resume‘Clear Timer1 overflow interrupt‘ flag‘This is how we exit an‘ interruptAlthough this program isn’t very long, it does demonstrateTimers and Interrupts quite well.NEXT STEPSYou can easily change the IF-THEN test of “counter”18 May 2006to a larger or smaller value to make the LED flash fasteror slower. Another option is to change the presetvalues for TMR1H and TMR1L and prescaler to seeif you can get it to flash the LED faster or slowerwithout changing the “counter” test value. If you put anoscilloscope probe on the LED, you can see howaccurate your calculations are.You can take this same setup and modify itto work with the Timer0, which overflows after 255clock pulses and uses a few other specialfunction registers. That will help you prove toyourself that you understand how this program worksand at the same time develop aTimer0 sample program to use inthe future.For Atom users, this sameexample is in my book Programmingthe Basic Atom Microcontroller.Atom makes it a little easierthan PICBasic Pro since it automaticallysets and clears the properregister bits through the Basiccommands for timers. You can stillwrite directly to the registers inAtom if you want, you just don’thave to. That’s one reason theAtom is easier for the beginnerthan the PICBasic Pro compiler,but Atom doesn’t allow assemblylanguage interrupts and doesn’tlet you program any off-the-shelfPIC. PICBasic Pro is more of aprofessional compiler whereas theAtom is more of a hobbyistcompiler. In either case, being ableto access the Microchip PIC’sinternal features with simple Basiccommands is really a treat. It alsogradually introduces you to theinner workings of a PIC so moving toassembly language isn’t such a bigleap.If you have any questions,comments, or project ideas, passthem on to me at chuck@elproducts.com. If you have developedanything using the informationpresented in my columns, sendme a picture and a brief descriptionof it. I’ve already received a few,and I’m really surprised howfast readers have moved fromknowing very little about programmingPICs to being able to do somevery interesting projects. I hopeto find time to post them on mywebsite, so keep an eye out forthat. NV


16-BIT MICROCONTROLLERSEnvision...16-bit Microcontrollerswith 32-bit Performance and 8-bit Simplicity16-bit PIC24 MCUs anddsPIC® Digital Signal ControllersThe Microchip name and logo, the Microchip logo, PIC and dsPIC are registered trademarks of Microchip Technology Incorporated in the USA and in other countries. ©2006 Microchip Technology Incorporated.Unified 16-bit Architecture• PIC24F, low-cost entry• PIC24H, 40 MIPS high performance• dsPIC30F/33F for seamless DSP integrationLow-Risk Design• Easy step up from 8-bit MCUs• Peripheral and Pin compatible families• One development tool platform for all 8-bitand 16-bit MCUs and DSCsOver 50 PIC24 Microcontrollers and dsPIC Digital SignalControllers sampling today. For data sheets, samples and pricinggo to www.microchip.com/16bitSEMINARS–16-bit MCU & DSCComing to over 100 cities worldwidewww.microchip.com/seminarsmicrochipDIRECTwww.microchipdirect.comwww.microchip.com/16bit


Mini-Kits...The Building Blocks!Laser Light ShowTrue laser beam patterns!Produce stunning laser lightshows just like the big boys do!Variable pattern and speed controlsand audio input to modulatethe pattern to your music! Usestwo standard laser pointers.Needs 12VDC or our AC125 PS.LLS1 Laser Light Kit $44.95ECG Heart MonitorCheck your own heart!Provides a visible and audible displayof your heart rhythm!Variable gain, bright “beat” LED,and monitor output for display onyour scope. Just like the lab! Reusablesensors are included.Runs on a safe 9VDC battery.ECG1C ECG/EKG Kit $44.9520W SubMini Audio Amp20 watts and no heat!Delivers a super clean 20W outputfrom one SMT package! Ultraefficient class D design producesno heat. PCB can be snappedinto a small circle for specialapplications. Runs on 18VDC forrated output, use our SPS18 PS.UAM2 20W Amp Kit $34.95Doppler Direction FinderFind that transmitter quick!Track down jammers and hiddentransmitters with ease! 22.5degree bearing indicator withadjustable damping, phase inversion,scan and more. Includes 5piece antenna kit. Runs on12VDC vehicle or battery power.DDF1 Dir. Finder Kit $169.95Did You Know...The Solution!High Power LED StrobeSuper bright LED’s!The fragile glass Xenon tube isgone, replaced with high intensityLED’s! Variable flash rate andbuilt-in audio trigger input to syncto your audio. Optional displayboards available. Runs on 12VDCor use our AC125 PS.LEDS1C LED Strobe Kit $44.95Plasma GeneratorGenerate 2” sparks!Produces a stunning and shocking25kV at 20kHz from a solid statecircuit! Build your own plasmabulbs, light fluorescent tubeswithout wires and more! A greatlearning kit. Runs on 16VAC,order our PS21 power supply.PG13 Plasma Gen Kit $64.95Digital Voice StorageMultiple message storage!The Bullshooter-II provides up to8 minutes of digital voice storagethat can be broken down into 8separate stored messages! Greatfor announcements, etc. Built-inmic plus external input. Runs on12VDC or our AC125 PS.BS2C Bullshooter-II Kit $69.95Touch-Tone ReaderRead the number dialed!The Tone Grabber captures dialedphone numbers, repeater codes,control codes, or anything thatuses touch-tone signaling. Flashmicro stores 640 digits! Phoneline and audio inputs. Runs on12VDC or our AC125 PS.TG2C Tone Grabber Kit $69.95Rat Blaster RepellerEliminate without harm!Covers over 3,000 sq. feet to keepthose pesty varmints away! Springis the time to let them knowthey’re not wanted! Build it intoyour wall or barn or get thematching custom case separately.RB1 Rat Blaster Kit $59.95CRB Custom Case Kit $29.95HV Ion GeneratorMake a blast of fresh air!Generates a steady state DC voltageat constant non-pulsed currentat 7.5kV DC negative, 400uA.That’s a LOT of ions! Learn howmodern spacecraft use ions toaccelerate through space. Runson 12VDC or our AC125 PS.IG7 Ion Gen Kit $64.95Speed Radar GunNow YOU can be the cop!Our famous Speedy radar gunteaches you doppler effect thefun way! Digital readout displaysin MPH, KPH, or FPS. 1/8th milerange is typical. You supply twocoffee cans! Runs on 12VDC orour AC125 power supply.SG7 Speedy Radar Kit $59.95Signal Magnet AntennaPulls in distant stations!Super Hi-Q ferrite rod antennawith Faraday shield eliminatesnoise from power lines, dimmers,static and more! Great resultsfrom 500kHz to 15MHz. Superfor AM broadcast band! Includespower supply.SM100 Sig Magnet Kit $89.95✔ It’s impossible to give you full specs on these productsin a 1” space!✔ A lot of our kits are also available “factory assembledand tested”, if you don’t want to build them!✔ We have over 350 products currently available, andall those don’t fit here!Visit www.ramseykits.comFree Giveaways and ALL theinformation you ever needed!Tickle-StickThe kit has a pulsing 80 volttickle output and a mischievousblinking LED. And whocan resist a blinking light! Greatfun for your desk, “Hey, I told you not to touch!”Runs on 3-6 VDCTS4 Tickle Stick Kit $12.95Super Snoop AmplifierSuper sensitive amplifier that willpick up a pin drop at 15 feet! Full2 watts output. Makes a great “bigear” microphone. Runs on 6-15 VDCBN9 Super Snoop Amp Kit $9.95Dripping FaucetProduces a very pleasant, butobnoxious, repetitive “plink, plink”sound! Learn how a simple transistoroscillator and a 555 timer can make sucha sound! Runs on 4-9 VDC.EDF1 Dripping Faucet Kit $9.95LED BlinkyOur #1 Mini-Kit for 31 years!Alternately flashes two jumbo redLED’s. Great for signs, name badges,model railroading, and more. Runs on 3-15 VDC.BL1 LED Blinky Kit $7.95Cricket SensorSenses temperature andchanges the chirp accordingly.Can actually determinetemp by chirps! Runs on9VDC battery. Speaker included.ECS1 Cricket Sensor Kit $24.95Electronic SirenProduces the upward and downwardwail of a police siren.Produces 5W output, and will driveany speaker! Runs on 6-12 VDC.SM3 Electronic Siren Kit $7.95Universal TimerBuild anything from a time delayto an audio oscillator using theversatile 555 timer chip! Comeswith lots of application ideas. Runs on5-15 VDC.UT5 Universal Timer Kit $9.95Voice SwitchVoice activated (VOX) provides aswitched output when it hears asound. Great for a hands free PTTswitch, or to turn on a recorder or light! Runs on6-12 VDC and drives a 100 mA load.VS1 Voice Switch Kit $9.95Tone Encoder/DecoderEncodes OR decodes any tone 40Hz to 5KHz! Add a small cap and itwill go as low as 10 Hz! Tunable witha precision 20 turn pot. Runs on 5-12 VDC andwill drive any load up to100 mA.TD1 Encoder/Decoder Kit $9.95RF PreamplifierSuper broadband preamp from100 KHz to 1000 MHz! Gain isgreater than 20dB while noise is lessthan 4dB! 50-75 ohm input. Runs on 12-15 VDC.SA7 RF Preamp Kit $19.95Touch SwitchTouch on, touch off, or momentarytouch hold, your choice! Uses CMOStechnology. Runs on 6-12 VDC and drives anyload up to 100 mA.TS1 Touch Switch Kit $9.95


What’s New For 2006!The Newest And Neatest GoodiesWhat Other Incredible New Products Are Coming Soon? That Would Be Telling!Super StereoHeadphone AmplifierPassive Air BandAircraft MonitorNew For2006✔ The next generation of our famous SHA1!✔ Separate volume, treble, bass, balance,and loudness controls!✔ Stereo loop through!✔ Audio clipping LED indicator!How could we take the highly popular SHA1line level to headphone level amplifier andmake it better? Consider it done with the SHA2!Standard 3.5mm stereo headphone connectors are used throughout for today’s“walkman” style headphones. Dual LM386’s and LM1036’s are used to providenearly 1W output for the normal 4-40 ohm headphones or speakers. Customizeyour sound with separate volume, treble, bass, balance, and loudness controls.Dual outputs are provided for multiple listeners. Plus a loop through input is providedand properly isolated to prevent hum and ground loops. Runs on a standard9V battery plus has an external 12-20VDC input. Available kit or assembled.SHA2 Super Stereo Headphone Amplifier Kit $44.95SHA2WT SHA2 Amplifier Kit, Factory Assembled & Tested $79.95New For2006✔ Monitors the entire aircraft band without tuning!✔ Passive design, can be used on aircraft, no localoscillator, generates and creates no interference!✔ Great for air shows✔ Patented circuit and design!For decades we have been known for our novel andcreative product designs. Well, check this one out! Anaircraft receiver that receives all nearby traffic withoutany tuning. It gets better... there is no local oscillatorso it doesn't produce, and can't produce, any interferenceassociated with all other receivers with an LO.That means you can use it onboard aircraft as a passivedevice! And what will you hear? The closest andstrongest traffic, mainly, the one you're sitting in! Howunique is this? We have a patent on it, and that says itall!This broadband radio monitors transmissions overthe entire aircraft band of 118-136 MHz. The wayit works is simple. Strongest man wins! Thestrongest signal within the pass band of the radio willbe heard. And unlike the FM capture effect, multiple aircraftsignals will be heard simultaneously with the strongestone the loudest! And that means the aircraft closest to you,and the towers closest to you! All without any tuning or looking up frequencies!So, where would this come in handy?1. At an air show! Just imagine listening to all the traffic as it happens2. Onboard aircraft to listen to that aircraft and associated control towers3. Private pilots to monitor ATIS and other field traffic during preflightactivities (saves Hobbs time!)4. Commercial pilots to monitor ATIS and other field traffic as needed attheir convenience5. General aircraft monitoring enthusiastsWait, you can't use a radioSPECIFICATIONSreceiver onboard aircraftFrequency Range:118 MHz to 136 MHzbecause they contain aReceiver Type:Patented Passive Detectorlocal oscillator that couldgenerate interfering signals.Receiver Sensitivity:Less than 2 uV for detectableIF Frequencies:None!audioWe have you covered on Audio Output:700mW, 8-24 ohmsthat one. The ABM1 has Headphone Jack:3.5mm stereo phoneno local oscillator, it doesn't,can't, and won't gen-Power Requirement:9VDC batteryExternal Antenna:Headphone cord couplederate any RF whatsoever! Dimensions:2.25” x 2.8” PC BoardThat's why our patent2.5” x 4.6” x .9” Caseabstract is titled "Aircraft Weight:4 oz. with batteryband radio receiver whichdoes not radiate interfering signals". It doesn't get any plainer than that!Available as a through-hole hobby kit or a factory assembled & tested SMT version.ABM1 Passive Air Band Monitor Kit $89.95ABM1WT Passive Air Band Monitor, Factory Assembled & Tested $159.95Just Off The Press!Get the 2006 Ramsey Hobby Catalog!104 value packed pages of the neatestgoodies around with over 150 newitems! Order yours today on line orgive us a call. Or download the PDF!High Resolution AirPressure/Elevation Sensor✔ Pressure resolution greater than0.0001kPa!✔ 128 x 64 pixel graphical display!✔ Shows realtime elevation & pressurechanges!✔ USB computer interface for easydata transfer!✔ 13,824 samples of FLASH storageavailable!✔ Special pilots menu✔ Multiple built-in alarms“The Most Advanced And AccurateRamsey Kit To Date!”We really did it this time! The UP24 is one of our most advanced kits to date, andan absolute MUST for anyone serious about the environment around us! But theapplications only begin there.The unique design allows unprecedented super high resolution measurementsand display of absolute atmospheric air pressure. The UP24 senses ambient airpressure and critically calculates elevation with unheard of precision! Using ahighly sensitive sensor and 24-bit A/D converter in a special noise-immunedesign, less than 1/3" of an inch of elevation resolution is achieved! YES, we said1/3 of an inch! This high accuracy and resolution opens the door to a host ofsophisticated environmental air pressure monitoring applications.Unlike your normal run-of-the-mill barometer, air pressure is sensed in Pa's orkPa's. What are those you may ask? Pascals or KiloPascals. However, don't beafraid, for your convenience, and to fit any application you may have, it is also displayedin millibars, bars, PSI, atmospheres, millimeters of mercury, inches of mercury,and feet of water! Take your pick! The range of the UP24 is 15kPa to155kPa.We've talked about air pressure, now let's talk about elevation! The incrediblyprecise 24 bit A/D converter in the UP24 looks at the air pressure and converts itto elevation above sea level. In both graph and text, the elevation is displayed toa resolution of 1/3”! Yes, I said 1/3 of an inch! The applications for the superaccurate elevation meter are endless. From watching and recording elevationsduring hiking trips to measuring and recording the wave heights on boats! Letyour imagination take over from there!What if you're in the field and you want to save data captured in your UP24? Thebuilt-in FLASH storage provides 13,824 samples of storage. Then you can transferyour data to your PC with a standard USB interface.While the UP24 is small enough to be kept in your coat pocket it boasts a large2.78" x 1.53" 128x64 pixel LCD display screen making viewing easy. Displaymodes include both realtime pressure and elevation graphs as well as pressureand elevation statistics. There are 12 user selectable sample rates from 1/10th ofa second all the way up to every 15 minutes.Needless to say, you cannot put all the specs and screen shots in the limitedspace of this ad! Visit our website at www.ramseykits.com for full specs andinformation.If you're looking for the finest air pressure and elevation sensor, check out theUP24, truly a marvel in the industry! Available in a ready-to-build kit or a factoryassembled and tested version. Check our website at www.ramseykits.com formore information!UP24 High Resolution Air Pressure/Elevation Sensor Kit $239.95UP24WT Factory Assembled and Tested UP24 $299.95AC125 110VAC Power Adapter/Charger $9.95MORE than just friendly on-line ordering!Clearance Specials, Ramsey Museum, User Forums, Dealer Information, FAQ’s, FCCInfo, Kit Building Guides, Downloads, Live Weather, Live Webcams, and much more!www.ramseykits.com590 Fishers Station DriveVictor, NY 14564(800) 446-2295(585) 924-4560800-446-2295WhereElectronicsIs AlwaysFun!New For2006✦ Build It!✦ Learn It!✦ Achieve It!✦ Enjoy It!Prices, availability, and specifications are subject to change. Not responsible for typos, stupids,printer’s bleed, or migraine headaches. Possession of this Springtime ad will not make you stoptalking about FCC Fines...Nothing will. Robin continues to rock! Visit www.ramseykits.com for thelatest pricing, specials, terms and conditions. Copyright 2006 Ramsey Electronics, Inc...so there!


■ WITH TJ BYERSQ & AIn this column, I answer questions about allaspects of electronics, including computerhardware, software, circuits, electronic theory,troubleshooting, and anything else of interestto the hobbyist.Feel free to participate with your questions,comments, or suggestions.You can reach me at: TJBYERS@aol.com✓✓✓✓WHAT’S UP:● IGBT photoflash circuit.● Switching on the high-side.● TV to PC.APPLICATIONSMOSFETs! Everything youwanted to know and aren’t yousorry you asked! Practical appsfor them and lots of theory.● Free PDF software printer.MOSFET BASICSQThanks a lot for the “HeaterFan Controller “ circuit in theDecember ‘05 issue. Looksinteresting! I have a fewdifferent types of DC motors to try thiscircuit on. While looking over the controller,a question came to mind. I don’tknow that much about MOSFETs orFETs in general. What makes them tick?— Bob J.ARay Marston did a very goodjob of describing FETs andMOSFETs in his May, June,July 2000 series in <strong>Nuts</strong> &<strong>Volts</strong>. But it focuses mostly on lowpower devices, which behave differentlythan high-power FETs. Let me try toexplain.The original transistor — inventedin 1947 by a team of John Bardeen,William Shockley, and Walter BrattainMOSFETEquivalentGate■ FIGURE 1RgCgdCgs22 May 2006DrainSourceCdsat Bell Telephone Labs — was abipolar device that amplified a smallinput current into a higher outputcurrent, as opposed to amplifying asmall input voltage into a higheroutput voltage. Let me tell you, for usvacuum tube (valve) guys, it was aquantum leap in thinking aboutcircuit design. I can’t count thenumber of CK722 transistors I fried bytrying to apply voltage rules to acurrent device.Somewhere between 1960 and1963 the epitaxial deposition transistorevolved into the junction fieldeffecttransistor — JFET. Like thevacuum tube, the JFET is a voltagecontrolled device where a negativevoltage is needed to “pinch” off theflow of electrons from source (cathode)to drain (plate). Cool for us tubeguys, but hardly a tube substitute.At about the same time, themetal-oxide semiconductor fieldeffecttransistor — MOSFET — cameinto being and allowed us to combinetube technology with transistor. Thatis, an increase in voltage prompts anincrease in current flow. Most “FETs”today are of this enhanced-modetype.While MOSFETs can be operatedin the linear region, most are used asswitches — where they are either ON(conducting) or OFF (not conducting).In this mode, there are two importantparameters to consider: switchingtime and saturation voltage. The firstis the time it takes for the transistorto go from OFF to ON, and vice versa.The more time the transistor spendsbetween the two states, the morepower it dissipates. The switchingtimes are determined by the capacitanceof the gate junction. Becausethe gate is insulated from the rest ofthe semiconductor bulk, a capacitor isformed between the gate and source,and the gate to drain, as shown inFigure 1. These capacitors have to becharged before the gate voltagereaches a high enough potential toturn the MOSFET on.Although the gate-to-sourcecapacitance is important, the gate-todraincapacitance is actually moresignificant. And more difficult to dealwith because it’s a non-linear capacitanceaffected as a function of voltage.This capacitance is similar to thatfound in vacuum tube amplifiers — aphenomenon known as the “Miller”effect, a function by which feedbackbetween the input and output of anelectronic device is provided by theinterelectrode capacitance. Thoughsmaller than gate-to-source capacitance,the gate-to-drain capacitancegoes through a voltage excursionthat is often more than 20 timesthat of the gate-to-source capacity.Therefore, the gate-to-drain orMiller capacitance typically requiresmore actual charge than the inputcapacitance.The MOSFET switching time is


QUESTIONS & ANSWERSdivided into four sections as shown inFigure 2.1) During this period, the gate voltage(V GS ) is charging the input capacitor— which is dominated by the gate-todraincapacitance (V gd ).2) At V th , drain current begins to flow.During this time, the drain voltage(V DS ) is typically constant at thesource voltage (V CC ).3) This is the stage where the Millerplateau (V plt ) is reached, at whichtime the drain voltage — ON resistance— begins to linearly decreaseuntil the end of the third period. Thisoccurs when V DS reaches 10% of itsOFF value. It’s during this period thatthe MOSFET dissipates most powerand heat.4) In region 4, the MOSFET is fullysaturated, and the ON resistance is atits minimum. V GS continues toincrease to its full driving value —typically 15 V.By increasing the gate voltage,the Miller capacitor can be forced tocharge faster, and that decreases theswitching time. The discharge time ofthe MOSFET is a mirror image ofthis profile, with the Miller plateaudischarge time governed by the resistanceof R G — the gate input resistor.Want more MOSFET stuff? Checkout “IGBT Basics” below.FREE PDF PRINTERAWhat is the best digitalformat to send schematicdiagrams to you?— TylerQPDF! The reason is becauseyour computer may have avirus that you don’t knowabout, and I don’t want tocatch it. Therefore, I don’t open attacheddocuments in any format exceptPDF. While not perfect, the likelihoodof catching a virus from a PDF file is alot less than from a Word document.Don’t have a PDF printer? There areplenty of them out there,including PrimoPDF —which you can download forfree from the <strong>Nuts</strong> & <strong>Volts</strong>website (www.nutsvolts.com) under the nameFreePrimoSetup.exe. Simplyrun the program and itwill install the software asa PDF printer, which youcan select from the Settingsoption of the Start menu.Now, any application thatsupports a printer cancreate a PDF file.BTW, if you have acircuit you’d like to share with ourreaders, send it to me in PDF format.If we publish it, you will receive aone-year subscription/extension to<strong>Nuts</strong> & <strong>Volts</strong>.ESCAPE FROM L.A.QWhere I live, power outagesare frequent. So when thelights go out, I have anemergency backup systemthat provides lighting from a 12-Vgel-cell. However, the blackouts oftenlast for several hours, sometimes days— but my backup battery is only goodfor a few hours. And if the power goesoff in the middle of the day, thebattery is often dead by the time thesun sets.I’m looking for a timer that wouldturn on the emergency lamp for aboutfive minutes, then go off to conservepower. I want to connect a motionPIREmergency Light TimerNC+10 uF100K4001+12V R1MC330 uF+■ FIGURE 2detector to the lamp so that it turns ononly when motion is detected, and thenonly for the time specified. The circuitshould have a low parts count (I wantto assemble more than one) and havenearly zero current drain in the off state.A circuit without relays — one that canbe modified to run 1-30 seconds, 1-30minutes, etc., by substituting differentRC values — would be ideal. I haveconstructed everything, including theLED light heads and constant-currentregulators, except for the timer. Haveany ideas?— DusanLos Angeles, CAAThe best way to keep thequiescent current low is touse CMOS logic for the timer,like the 4001 NOR gate.When configured as a one-shot multivibrator(Figure 3), the 4001 draws lessthan 1 μA in the OFF state — in fact,t = 1.1RC~ 6 Min0.14001ZTX5491K4001ToEmergencyLights■ FIGURE 3May 2006 23


IGBT EquivalentCollectorPNPCgcRsNPNBaseCge■ FIGURE 4EmitterCceParameter BJT MOSFET IGBTBreakdown voltage > 1,000V < 1,000V > 1,000VInput impedance Low High HighDrive method Current Voltage VoltageDrive current (leakage) 1 A 100 nA 100 nASaturation voltage Low High LowR on ohms (typical) 0.13 0.27 0.084Operating frequency 100 kHz 1 MHz 150 kHzt on time 4.5 μs 39 ns 48 nst off time 9.0 μs 39 ns 340 nsTotal time 11.5 μs 78 ns 388 ns■ TABLE 1. Power Device Comparison.■ FIGURE 524 May 2006the 100 kΩ pull-up resistor draws 100times more current at 0.1 mA. Whenyour motion detector (PIR) goes off, theNC (normally-closed) switch goes openand triggers the timer. This causescapacitor C to start charging throughresistor R — and turns on the PNP transistor.The ZTX549 is unique in that ithas very low voltage drop across it —somewhere in the order of 100 mVat 100 mA — further saving batterypower. If you don’t have a ZTX549(available from Digi-Key) lying around,a 2N4402 or equivalent will do.After a time of t = 1.1(RC), thepass transistor turns OFF and staysOFF until the PIR cycles by closing itsinternal switch (no motion) and thenopening it again (motion). To preventtriggering of the emergency lampwhen the sun is up, a phototransistorclamps the timer’s input low. Afterdark, the phototransistor turns offand allows the PIR to control timeroperation. Don’t be tempted to eliminatethe 10 μF and 0.1 μF bypass caps.They are critical to the stability of thecircuit; place the 0.1 μF as close to pin14 of the 4001 as possible.IGBT BASICSQThirty years ago, whileattending the University ofIllinois, I ran a photo servicetaking fraternity/sororitydance pictures and portraits to makespending money. After graduating, Igave up photography but held on to myold Grafles Stroboflash equipment.Now with more time on my hands, Idecided to take up photography again.My wife bought me a new Nikon D70for Christmas and I was off ... ’til Idiscovered that the 225 V batteries foreach strobe unit (I have six) cost $200each! Being the “evil genius” that Ifancy myself, I decided to build my ownstrobes running off AC mains using theold flashtubes.After researching the new technologies,I decided to go with IGBTtransistors instead of SCRs becausethey allow me the most control, lettingme operate them from a PIC orStamp microcontroller. Here is myproblem: There’s not a whole lot ofinfo on IGBTs. And what is out thereis Greek to a person with a degree inME not EE. Can you explain them interms I can understand?— Albert J SanowskisReddick, FLAThe IGBT (insulated-gatebipolar transistor) isbasically the marriagebetween a MOSFET(metal-oxide field-effect transistor)and a bipolar transistor. It has theoutput switching and conduction characteristicsof a bipolar transistor, butis voltage-controlled like aMOSFET. Generally, this means itcombines the high-current-handlingcapability of a bipolar part with theease of control of a MOSFET.The structure of an IGBT die issimilar to an N-channel MOSFET, withone added junction. This added junctioneffectively becomes the collectorof the PNP bipolar transistor, which isdriven by the N-channel MOSFET.Besides the PNP transistor, there is anNPN transistor that forms aDarlington pair (Figure 4), therebygiving the IGBT its bipolar outputcharacteristics.This variation between MOSFETand IGBT is enough to produce someclear distinctions as to which deviceserves which applications better.Clearly, the IGBT is the choice forbreakdown voltages above 1,000 V,while the MOSFET is better for breakdownvoltages below 250 V. When thebreakdown voltage is from 250-1,000V, choosing between them is a veryapplication-specific task in whichcost, size, and speed must be takeninto account.IGBTs have been the preferreddevice under the conditions of lowduty cycle, low frequency (less than20 kHz), and high output power inexcess of 5 kW. Typical IGBT applicationsinclude motor control, UPSpower supplies, high-current welding,and low-power lighting with operationfrequencies below 100 kHz.MOSFETs are preferred in appli-


QUESTIONS & ANSWERScations where high-frequency operationabove 200 kHz is required, withwide line or load variations, long dutycycles, low-voltage applications (lessthan 250 V), and low output power(under 500 W). Typical MOSFETapplications include switching powersupplies and battery charging. Ofcourse, nothing is as easy as it seems.Tradeoffs and overlaps occur. SeeTable 1 for a direct comparison ofbipolar, MOSFET, and IGBT.The front end of the IGBT isessentially identical to that of theMOSFET, and should be treatedaccordingly. That is, you have torespect the Miller charge effect andthe plateau that the transistor mustgo through to become fully saturated(see “MOSFET Basics” above). Figure5 shows the gate characteristics for atypical IGBT device in the switch-onmode. Notice that the charge is measuredin coulombs (Q G ). Doing themath — C = Q G / E — we calculatethat C g is 0.01 μF.Enter Rs — the gate series resistor.This resistor determines thetime it takes for the transistor to gofrom full OFF to full ON by restrictingthe flow of current to the inputcapacitance using the formula t =5(RC). The smaller Rs is, the fasterthe transistor will switch on. It alsoreduces external noise that canfalsely trigger the transistor. On theother hand, large inrush currentscan stress the gate junction bymomentarily causing the gate voltageto exceed V GE thresholds. But asRs increases, so does the turn-offtime. This is great if you want softturn-off, but not good for flybackapplications. As you can see, a propergate driver and Rs value is criticalto the success of your design. Mostdatasheets show the value of Rsthey used to generate the parametersand test results listed. This is agood place to start.Back to your specific applicationof building a flashtube controller, Isuggest the circuit in Figure 6. For thedriver, I chose the IR4427 (Figure 7)because it can sink and source upto 1.5 A — and is ideally suited fordriving MOSFET and IGBTtransistors. Taking the value of Rgfrom the+320VIRG4BC40Fdatasheet, andusing conventionalIGBTinput design, Icame up withthe 10-Ω seriesand 20-kΩparallel resistor+15Vinput combination.When apositive pulse8Vsis applied tothe input of To PIC InAIR4427the IR4427, itGNDtriggers the3IGBT — which,in turn, dischargesthe■ FIGURE 60.22 μF cap through the trigger coiland fires the flashtube. Notice thatthe IR4427 has two drivers in itspackage, which means it can drive twoflashtubes or be paralleled for moredrive current. Providing the 320-Vcharging voltage and programmingthe PIC is up to you.Can’t get enough MOSFET stuff?Continue this thread with “You TakeThe High Road ...”PC TV BASICSPIC ControlledPhotoflash2 7OutAQI have been using an ATI TVWonder (external USB 2.0version) for transferringhome video onto my laptopfor editingwith great success.I’m nowgoing on aroad trip thissummer andwould like totake along theATI TV Wonderfor watchingTV on my journey.While itpicks up a lotof channels,they’re allfuzzy. I havetried every antennain ourhouse, but thereception is ■ FIGURE 71M0.22600V10 ohmsTriggerCoil20KFlashTubeIRG4BC40Fstill horrible. Is there anything — tips,circuits, etc. — to improve this?— Ian RabALike all PC TV video cards,the input expects an inputvoltage of about onemillivolt — like that fromcable TV — not the microvolts the TVantenna outputs. The solution is toamplify the signal from the antennausing a TV antenna preamp, like thosesold by Winegard, Blonder,RadioShack, and others. Simply placethe preamp between the antenna andATI TV Wonder (Figure 8) — orwhatever PC TV adapter you have —and that’s it. The preamp requires aMay 2006 25


■ FIGURE 8separate wall-wart power supply, soexpect to be near an outlet whenwatching TV. If you plan on spendinga lot of time on the road, considerthe Audiovox AN300 Amplified TVAntenna, which works off the cigarlighter and is available from most RVsuppliers for under $40.YOU TAKE THEHIGH ROAD ...QI’ve been a relay man all mylife and I’m used to beingable to switch a load in andout of a circuit in anycombination I wish from any source+LOADLow-SideSwitching+LOADHigh-SideSwitchingI wish. Today, most relays have beenreplaced by semiconductor switches,like MOSFETs. But most designsrequire you connect the load to theVcc and the MOSFET turns on theload by grounding it. Can the bottomside of the load be placed at groundinstead, with the MOSFET switchingthe Vcc?— James T. KirkACute handle; is it your realname? What you are askingfor is called high-sideswitching. You are correctthat most circuits use low-side switchingwhere the load is either groundedor floating. In many applications thisis not desirable for many reasons:shock hazard, sensitivity to staticdischarge, physically not possible(especially in auto applications),and more. Figure 9 shows thedifference between low- and highsideswitching.In this figure, both themechanical and semiconductorversions of low-side and high-sideswitching are shown. Flipping themechanical switches is a no brainer,but not computer friendly. Forthat you need a relay — or a semiconductorswitch, like the enhancedmode MOSFET or IGBT. Switching thelow side is very easy, and the reasonit’s the most prevalent. For details,refer to the other sections “MOSFETBasics” and “IGBT Basics.”Switching on the high-side, onthe other hand, requires the driver toride atop ground, making reference tothe MOSFET’s source terminalinstead. There are several schemesused to do this, but the typical solutionis to use a high-voltage driverlike that shown in Figure 10. A typicalIC for this application is the IR2117.Here’s how it works. The MOSFETdoesn’t care where the 15 V it needsto saturate the switch comes from.For all it cares, you can slap a 15-Vbattery across the gate-to-sourceconnection and it will be a happycamper.The circuit itself is less forgiving.That is, ideally the top of the loadwould be at Vcc — which means thatthe gate voltage has to be Vcc plus+15 V before it will switch on. This iswhere the high-side driver voodoocomes into play. It separates the Vccto the load from the driver circuit. Thecircuitry needed to do this is rathercomplex and must be able to withstandthe voltage differentialbetween Vcc and ground. Which iswhy we have high-voltage ICs like theIR2117.If you’re working with low-powerhigh-side switching — something onthe order of three amperes or less —then the circuit in Figure 11 may suityour needs. Here the isolationbetween the TTL logic and Vcc highvoltage is via a 4N25 optoisolator.DriveLVs + 15VO+ A +DDriveGnd +15VLOAD■ FIGURE 926 May 2006■ FIGURE 10


When the 4N25 LED goes on, itsinternal transistor turns on andprovides bias current to the PNP passtransistor and turns it on.DVD BLUESQI was interested in getting aCD recorder (not hooked tomy PC) to record the audiooff some of my concertvideo tapes so that I could hear themon my PC. Unfortunately, I can onlyfind DVD recorders, and I’ve heard youcan’t make an audio CD on them.Can you clarify these differentrecording methods, and maybeprovide a solution?— PaulAThe difference is in theformat, of which there aremany. The first CDs wereaudio Compact Disk, whichcan store 650 MB of music — about 74minutes’ worth. The format of theaudio disc, known as the “Red Book,”was laid out by Sonyand Philips in 1981.In broad terms, theformat is a twochannelstereo 16-bit PCM (pulse-codemodulation) encodingat a 44.1 kHzsampling rate.DVD is anoptical disc storagemedia format thatcan be used forall sorts of datastorage, includingvideo and sound.Although DVDsphysically resembleCompact Discs,they are encoded ina different formatand at a muchhigher density. Atypical DVD canstore 4.7 GB, abouttwo hours of moviequalityvideo.Commercial DVDmovies are encodedusing a combinationof MPEG-2SequentialTail Lights40111Mt = 1 / 2.2RC■ FIGURE 12R100Kcompressed video andaudio of varying formats(often multi-channel formats).Typical data ratesfor DVD movies range 5Vfrom 3-10 Mb/s, with avideo resolution of 720 × 0480 (NTSC) and 720 ×576 (PAL). A highnumber of audio tracksand/or lots of extramaterial on the disc willoften result in a lower bitrate (and lesser imagequality) for the mainfeature. There are twoDVD audio formats:DVD-Audio and SADC, neither ofwhich is supported by today’s DVDplayers (well, almost none). Formore details, check out www.webopedia.com/DidYouKnow/Hardware_S o f t w a r e / 2 0 0 3 / D V D F o r m a t sExplained.aspA DVD recorder won’t recordunless there is a video signalpresent. If you wish, you can record4011C5 uFCPCP+12VD4015Q2RR4015D1K1kQ1Q3Q4Q4Q3Q2Q11K1K1K10K10K1K1K1K■ FIGURE 11LED1LED2LED3LED3LED2LED1QUESTIONS & ANSWERSHigh-Side SwitchMAILBAGDear TJ,In the March issue — page 23, Figure5 (“Sequential Tail Lights”) — I think thecorrect formula is f = 1 / 2.2(RC).— Craig Kendrick SellenCarbondale, PAResponse: Actually there were twoerrors in that drawing. The correctedversion is shown inFigure 12. For thosereaders who didn’tunderstand that thiscircuit was for a modelcar and not the real thing,find a grown-up versionLeft in the April 2006 issue.TurnLeftRight330RightTurn4N251KVccTIP31LOADDear TJ,One possible solutionfor Alex Curiel’s search foran IR repeater (Feb. 2006,page 13) is RamseyElectronics’ (www.ramseykits.com) IR Repeaterkit #RR1C. I assembledthe kit about three weeksago and am very pleasedwith the results. I use therepeater to activate myDVD recorder which I hadplaced in a cabinet. TheDVD’s IR receiver washidden behind the woodframe of a glass door andcould not see its remotetransmitter. I placed theRR1C’s remote IR transmitterLED next to theDVD recorder and noweverything works great.— Rich Van WorkumMay 2006 27


a low-grade video alongside youraudio — record it in the eight-hourmode — then just turn the TV offwhen you play it back. But, that kindadefeats the purpose of playing yourtunes on the PC and working on themonitor at the same time. While youcan’t buy audio CD recorders fromBest Buy, you can find them on eBayfor under $100. I prefer Pioneerrecorders; I’ve had good luck withthem.SMART SWITCHERSQYour excellent answers in theDec. 2005 and Feb. 2006issues made me aware ofInternational Rectifier’sIntelligent Power Switches (IPS) seriesof power FETs for the first time. Arethose special OEM parts for automotiveuse and are there more types thanthe IPS021 and IPS031 in this series?Please suggest a supplier where IDownload a wholeMachine ShopRight now - Free!Easy Online Machiningat eMachineShop.comDownload our FREE CAD software Design your custom part Review the instant price quote Click to orderEasy as that - your parts will be made and shipped toyou. Use our metals, plastics, composites and more. Trylaser cutting, water jet cutting, milling, lathes, brakes orany of 23 machines. Apply plating, powdercoat, brushingor leave your part raw. All online 24/7 - with a free virtualmachinist to guide you. Quantity 1 to 1-million.The Industrial Revolution is now a click away.eMachineShop.com666 Godwin Ave.Midland Park, NJ 07432can obtain some because my localdistributors couldn’t cross-referencethem in their catalogs.— Ted RossSanta Barbara, CAAA good selection of IPSswitchers are available fromDigi-Key (800-344-4539;www.digikey.com). Theycome in both low-side and high-sideversions (see above) and have builtinMOSFET drivers that switch at5-V logic. All are designed to workin the harsh environment of theautomobile where voltage surges canget up to 50 V. Most switch in the 5-12A range — although select devices canswitch up to 75 A — and the switchingspeed is under 20 kHz, which ispretty much in keeping with thediscussions above. I don’t have spacefor a full chart of these devices, solook it up at: www.irf.com/productinfo/ipsNVCOOL WEBSITESIf you don’t mind getting on everymailing list in the world (well,almost every), participate in thispromotion and receive a freePolaris 60mm AZ-D Telescope —a $130 value:http://computer-offer.com/rd_p?p=113082&t=1069&gift=797&a=797-telescopeDitto for a free copy of Starry NightComplete Space & Astronomy Packsoftware:www.freegiftworld.com/gift.html?nopop=1&ADTGID=2512&xid=0&CID=47024&KWID=astronomy%20software&SID=KE1613569Hubble’s largest portrait ever offersa high-definition view of the M101spiral galaxy — nicknamed thePinwheel Galaxy. A compositeimage measuring 16,000 by 12,000pixels is downloadable as a JPGfile, PC wallpaper, and PDFprintable:http://hubblesite.org/newscenter/newsdesk/archive/releases/2006/10/image/a28 May 2006


TUNG-SOL IS BACK!6V6GT 12AX7 12AX7/ECC803S (GOLD PIN) 5881 6550 EF806S KT66Electro-Harmonix has acquired the trademark of this legendary brand — a benchmark ofperformance and listening quality for serious musicians and audiophiles. Our vacuum tube engineersspared no detail in ensuring perfect replication and performance. Expect creamy, smooth resonanceand well-defined character that will fully enhance every aspect of your sound.NOW AVAILABLE AT LEADING MUSIC STORES, HI-FI DEALERS AND SERVICE SHOPS.TEL: 800.633.5477 FAX: 718.937.9111 tungsol@newsensor.com www.newsensor.com


30 May 2006


Easy Ordering in NanosecondsWith the ONLY 1,700+ page catalogof the NEWEST information 4 timesa year, and daily updates to over630,000 products on-line, you candepend on Mouser for easy orderingin nanoseconds!mouser.com (800) 346-6873NEW ProductsNEW TechnologiesNEW SuppliersThe NEWEST Semiconductors | Passives | Interconnects | Power | Electromechanical | Test, Tools & SuppliesMouser and Mouser Electronics are registered trademarks of Mouser Electronics, Inc. Other products, logos, andcompany names mentioned herein, may be trademarks of their respective owners.May 2006 31


ALLELECTRONICSC O R P O R A T I O NQUALITY PartsFAST ShippingDISCOUNT PricingCALL, WRITE, FAX or E-MAILfor a FREE 96 page catalog.Outside the U.S.A. send $3.00 postage.ULTRABRIGHT WHITE LEDSPECIAL LOW-LOW PRICINGUltra bright white 5mm dia.LED. Brighter than mostsmall incandescent lamps, more efficient, andnow less expensive, it's time to start usingwhite LEDs for all of the lighting projects thatused to be the exclusive domain of incandescentlamps. We've got a great deal on thesewater-clear LEDs. Slightly less bright than ourstandard ultra-bright white led (CAT# LED-75),but still quite bright. They operate on 3.0-3.5Vdc, 20mA. 15-25 degree viewing angle.CAT# LED-121100 for 50¢ each¢500 for 45¢ eacheach 1000 for 35¢ each655VDC 3.7AMP SWITCHINGPOWER SUPPLYYHi Model:912-053700-E05.Input: 100-240 Vac,47-63 Hz, 40 Va.Output: 5V, 3.7A.5' output cord with 2.5mm coaxpower plug, center positive.Ferrite RFI/EMI filter on cord. Detachabletwo-prong input power cord included. UL, CE.CAT# PS-5372$5 75eachNEW REDUCED PRICING1N914 SWITCHING DIODEWe are able to offer these 1N914 diodes at agreat price because we have a large quantityon 10,000 piece reels. We will cut the reels into100 piece units (100 piece minimum order).CAT# 1N914TR100 for500 for $5.00 • 1,000 for $7.005,000 for $30.00 • 10,000 for $40.00Shop ON-LINE$2 00ORDER TOLL FREE 1-800-826-5432MAIL ORDERS TO:ALL ELECTRONICS CORP.14928 OXNARD ST., VAN NUYS, CA 91411-261012 VDC 500 MA 2-STAGECHARGER FOR LEAD-ACIDBATTERIESDesigned to maintainmaximum performancefrom your sealed leadacid batteries. Dual stageoutput and regulated currentcontrol to insure that no damageoccurs while battery remains on charger."Fast-charge" cycle of 15Vdc, 500mAbrings battery to fully charged state atwhich point the float-charge takes over,maintaining the battery at a constant 13.8Vdc. LED indicators; red indicates fastcharge,green indicates power-on and floatcharge.Screw terminals allow user toattach desired cable and connector. UL.CAT# BC-21250 MM PIEZO ELEMENTMurata 7BB-50-1A10Larger than usual, 50mm(2”) diameter, piezo element.6” color-coded leads.CAT# PE-5075 ¢ 10 for 65¢ each300 for 45¢ eacheachSCR 2N5062$1 00$12 75eachRECHARGEABLE NICDBATTERY PACK, 3.6V 850MAThree flat-top 1.2 Volt,850 mA cells in a series.Because cells are connected bysolder tabs they are easy to usein other applications. Removethe shrink wrap outer cover toexpose the individual cells withsolder tabs. 1.93" x 1.67" x0.59." 2003 date code.CAT# NCB-3AA$3 20each0.8A 100V CAT# 2N50624 for100 for 15¢ each1000 for 10¢ eachWINDOWS COMPATIBLE USBKEYBOARDCherry G81-3000.Standard 104 keyPC keyboard.Durable,reliable, highquality andeasy to use.USB Interface.Beige.Individually boxed.CAT# KBD-22TELEPHONE NETWORKJUNCTION BOXHeavy-duty plastic, surfacemountbox provides an RJ-11,4-conductor jack for testing ofphone line. Also provides away to disconnect whileworking on circuit.CAT# MT-640 $1 50each4-15 VDC PIEZOELECTRIC BUZZERTDK # PB2130UP002A. Soft tomedium-loud high-pitched tone.0.82" diameter x 0.63" high plasticcase with mounting ears. Holes on1" centers. PC pins on 0.5" centers. Resonantfrequency: 3.3 kHz. Operating voltage: 4-15Vdc. Current: 20mA. Sound pressure: 75 min.dB(A)/100cm.CAT# SBZ-21324 X 1 LCD$1 35eachwww.allelectronics.comFAX (818) 781-2653 • INFO (818) 904-0524E-MAIL allcorp@allcorp.comNO MINIMUM ORDER • All Orders Can Be Charged to Visa, Mastercard, American Express or Discover • Checks and Money Orders Accepted by Mail •Orders Delivered in the State of California must include California State Sales Tax • NO C.O.D • Shipping and Handling $7.00 for the 48 Continental UnitedStates - ALL OTHERS including Alaska, Hawaii, P.R. and Canada Must Pay Full Shipping • Quantities Limited • Prices Subject to change without notice.100 for 85¢ ea.600 for 75¢ ea.Wintek# WDC2401P-1GNNA.Module size:4.25" x 0.79" x 0.3"Display size:3.5" x 0.4"Built-in driver.14 pin male header, pins on 0.05" centers.Includes hook-up diagram.CAT# LCD-11110 for $1.50 each$1 85each$7 50eachMANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.32 May 2006


Amazing Deviceswww.amazing1.comLaser ModulesAll laser modules operate from 3 volts and include built in opticsproviding a parallel beam of 1mr or less. Includes instructions onsafety requirements for FDA full complianceRed - Class IIIaLM650P3 - 3mw 650 nm12 x 45 mm ........ $14.95LM650P5 - 5mw 650 nm 12 x 45 mm ....... $24.95LM630P3 - 3mw 630 nm 10.5 x 45 mm .... $34.95Red - Class IIIbLM650P10 - 10mw 650 nm 12 x 51 mm ... $99.95LM650P30 - 30mw 650 nm 12 x 51 mm . $249.95Green - Class IIIaLM532P5 - 5mw 532 nm 12X45 mm ........ $49.95Infrared - Class IIIbLM980P30 - 30mw 980 nm 12X30 mm ..... $49.95Laser Diode Visible Red - Class IIIbLD630-P10 - 10mw 635 nm 5 mm diode .... $29.95High Voltage CapacitorsCeramic capacitors for voltage multipliers, etc.22/6KV - 22 pfd 6kv .28” x .17” ................. $.3550/6KV - 50 pfd 6kv .325” x .18” ................ $.45100/6KV - 100 pfd 6kv .46” x .17” .............. $.65200/3KV - 200 pfd 3kv .3” x .25” ................ $.45270/3KV - 270 pfd 3kv .3”d x .25” .............. $.45470/10KV - 470 pfd 10kv .35”d x .25” ......... $.751000/20KV - 1000 pfd 20kv .5”d x .37” ..... $2.25.01/2KV - .01mfd 2kv .63” x .13” ............... $.50Energy Storage CapacitorsElectro-kinetics,wire exploding, can crushing, emp, etc.25M/5KV - 25 mfd 5 kv 312J 10 x 4 x 3 can ...... $100.0032M/4.5KV - 32 mfd 4.5 kv 324J 9 x 4 x 2 can ... $170.0010002M/2KV - 1000 mfd 2 kv 2K J 4 x 8 x 7 can $299.001.3M/100KV - 1.3 mfd 100 kv 6500J case ........ $750.00High Voltage TransformersIncludes circuit schematics on how to use.28K089 - 7kv 10ma 30 khz 9-14v 1”cube . $19.9528K074 - 4kv 15ma 30 khz 9-14v 1”cube . $17.9528K077 - 2kv 10ma 30 khz 7-9v .7x 1.25 .... $9.95CD25B - 20 kv trigger pulse 1 x 1.25 ...... $16.95CD45 - 40 kv trigger pulse 1.25 x 1.25 .... $18.95TRAN1035 - 10 kv 35 ma bal output ........ $39.95FLYLABURN - 10 kv 60 ma end grd ...... $49.95FLYEXP - 4 misc flybacks ................... $24.95FLYHP - High power large flyback ........ $34.95High Volt/Freq Modules12 vdc with instructions on how to use.MINIMAX1 - 1kv 15 ma 35 khz ................ $17.95MINIMAX2 - 2kv 10 ma 50 khz ................ $17.95MINIMAX3 - 3kv 10 ma 35 khz ............... $19.95MINIMAX7 - 7kv 10 ma 35 khz ................ $34.95SS01S - 1 to 7kvac for ozone .............. $24.95GRADRIV10 - 7.5 kv 15 ma 35 khz adj .... $79.50PVM300 - 20kv 25ma 115vac input ......... $179.95High Volt DC Modules12 vdc with instructions on how to use.PBK40 - 10 kv 100ua 9 vdc in .................. $34.95CHARGE10 - 10kv 2.5 ma ....................... $59.95SHK10 - 2kv 10 ma shocker .................... $39.95TRIG10 - 20 kv trigger/shock pulses ........ $54.95SS016S - +20kv 100ua ............................ $29.95SS010S - -20kv for neg ions .................... $24.95Parts for Tesla CoilsIncludes plans for two of our coils. Parallel for 60&120ma.4KV/.03 - 4kv 30ma60hz floating output ........ $59.956.KV/.02 - 6.5kv 20ma60hz float output ......... $59.959KV/.03 - 9kv 30ma60hz midgrd output ..... $79.9512KV/.03 - 12kv 30ma60hz midgrd output .... $109.9515KV/.03 - 15kv 30ma60hz midgrd output .... $139.9514.4KV/.5A - 14.4kv .5amp pole pig ............ $699.95Spark Gaps and ElectrodesSPARK1 - Fan cooled dual gap 3/8” tungsten $149.95SPARK05 - Single gap 1/4” tungsten ............ $49.95TUNG141B - 1/4” x1” pair electrodes with holders tungsten $14.95TUNG38 - 3/8” x 2” pair electrodeswith holders tungsten .... $59.95Toroidal TerminalsTO8 - 8 x 2” Spun Aluminum Toroid .... $59.95TO12 - 12 x 3” Spun Aluminum Toroid . $79.95TO24 - 24 x 6” Spun Aluminum Toroid $399.95TO30 - 30 x 7”’ Spun Aluminum Toroid$525.95See website for more data on above itemsMinimum order is $25.00. Volume pricing availableInformation Unlimited, Box 716, Amherst, NH 03031 USAOrders: 800-221-1705 Info: 603- 673-6493 Fax: 603-672-5406Email: riannini@metro2000.netOVER 5000 UNIQUE OPTICAL PRODUCTSWITH 5,000,000 IN STOCK!COMMERCIAL &EXPERIMENTALGRADE LENSES• Start Up• Prototype • Research• Single Unit Applications• Educational Applications• Initial Run RequirementsANCHOROPTICSa division of Edmund OpticsA Catalog Devoted to Optics... New 84 page color catalog!ANCHOR OPTICSwww.AnchorOptics.com/nvDept. B061-X916, 101 E. Gloucester Pike, Barrington, NJ 08007-1380Tel: 1-856-573-6865 • Fax: 1-856-546-1965 • E-mail: nv@AnchorOptical.comMay 2006 33


NEW■P R O D U C T SHARDWARE■ SOFTWARE■ GADGETS■ TOOLSULTRASONICRANGE FINDERBREAKS NEW GROUNDThe MaxSonar-EZ1 from Maxbotixis a high-performance ultrasonicrange finder. The sensor is a completelynew design, yielding many improvementsover traditional ultrasonic rangefinders.The MaxSonar-EZ1 detectsobjects from 0 to 255 inches (0 to 6.45m) with no dead zone and providesvery stable range readings from six to255 inches in one-inch increments.Objects closer than the six-inch rangeshow as six inches. The sensor utilizesa single 42 kHz ultrasonic transducercoupled with a continuously-variablehigh gain amplifier to yield acontrolled narrow ultrasonic beam.Filling a volume of less than onecubic inch, the MaxSonar-EZ1 is halfthe size of competing sensors, whilethe 2 mA nominal current draw is thelowest of any range sensor.For ease-of-use, the MaxSonar-EZ1 has holes for mounting, andprovides the range directly, usingthree user interfaces. The pulse widthoutput provides 147 uS per inch. Theanalog voltage output provides 10 mVper inch output and always holds thelatest range reading. In addition, the9,600-baud serial output sendsinformation after each range event.Superior beam quality is demonstrated.Large objects such as a wallare detected to 254 inches and detectionpatterns for selected objects areshown in the figure. The backgroundis a 12-inch grid. Small objects suchas a 0.25-inch diameter dowel (A) aredetected in a very narrow zone toalmost three feet. Larger objects suchas a one-inch diameter rod (B) have along narrow detection pattern. Fairlylarge objects such as a 3.25-inchdiameter rod (C) have a longcontrolled detection pattern.The MaxSonar-EZ1 is a low-costsonar sensor priced at $29.95 (MSRP),with significantly lower prices to distributors,OEM users, and educators.For more information, contact:MaxbotixEmail: bob@maxbotix.comWeb: www.maxbotix.comHEAT SHRINKTUBING DISPENSERHOLDS FIVEPOPULAR SIZESAnew benchtopor wallmount,seethroughdispenserthat holds fivepopular sizes ofPVC heat shrinktubing for design,assembly, service,and repair applications is being introducedby Insultab of Woburn, MA.The Insultab PULL-PAK®Dispenser holds five mini-spools ofhighly flame retardant, low shrinktemperature 1/16”, 1/8”, 3/16”, 1/4”,and 3/8” PVC heat shrink tubing; inblack or bright colors. The dispenerlets users easily see what they need,pull out the exact length, and cut it.Most importantly, the tubing stays inplace and won’t unravel or pull back.Featuring a clear canister andsturdy stand, the Insultab PULL-PAK® Dispenser holds 100’ of the1/16” dia. tubing and 25’ each of the1/8”, 3/16”, 1/4”, and 3/8”. The PVCheat shrink tubing has a 2:1 shrinkratio, meets UL-, CSA-, and MILspecifications,and is RoHS compliant.The dispenser is supplied withblack tubing, but a wide variety ofbright colors are offered.The Insultab PULL-PAK®Dispenser is priced from $129.95(suggested retail). Literature is availableupon request.For more information, contact:Insultab45 Industrial Pkwy.Woburn, MA 01801Tel: 781-935-0800Fax: 781-935-0879Email: rsouza@insultab.comWeb: www.insultab.comNEW OPTICALRPM AND MICROTEMP SENSORSEagle Tree Systems announces theavailability of Optical RPM andMicro Temperature sensors, based oncustomer feedback.The Optical RPM Sensor measuresRPM of yourvehicle withoutthe need forinstalling magnets,making itideal for quick ortemporary installations.There are34 May 2006


■ H A R D W A R E ■ S O F T W A R E ■ G A D G E T S ■ T O O L Stwo types of Optical sensors available:• Three Wire Optical RPM sensor forFlight, Boat, and Car Seagull and DataRecorder Products.• Four Wire Optical RPM sensor forMicroPower e-Logger Products.All MicroPower units will supportthe Optical RPM Sensor without ahardware upgrade (make sure youorder the four wire version, found onthe MicroPower page). However,Recorder firmware version 4.XX isrequired for Flight, Car, or BoatSeagull/Recorder owners.The Micro Temperature Sensoris perfect formeasuringtemperaturesof batterypacks or ESCs.Its small sizelets it slip easilyinto hard-to-reach places, such asbetween cells of a LiPo pack, underheat shrink, etc. The Micro TempSensor is fully compatible with all ofEagle Tree’s Seagull, Recorder andMicroPower products.For more information, contact:Eagle Tree SystemsEmail: sales@eagletreesystems.comWeb: www.eagletreesystems.comRAPID-PiMAKES EDITINGMATHEMATICALEQUATIONS FASTERTrident Software Pty Ltd. nowoffers Rapid-Pi, an equationediting add-on for Microsoft Word.Rapid-Pi provides a new, faster wayof creating and editing mathematicalformulas and equations indocuments.Microsoft Equation Editor (oftenreferred to simply as “the EquationEditor”) is an equation editing programthat comes with Microsoft Word.Equation Editor supports a variety ofmathematical symbols and is veryeasy to use. Unfortunately, editingmath with the Equation Editor canbecome a highly time-consumingprocess for regular users.Equation Editor requires users togo through toolbars and menus toinsert symbols one by one, like beadson a string. Math teachers, students,and others who frequently createdocuments containing mathematicalexpressions often find that writingmath using the Equation Editor canbe unacceptably slow.Rapid-Pi provides a faster way toinput equations and formulas.Mathematical expressions can beentered as easy-to-understand text.For example, the user can type“(y+2)/x^2” to create a fractioncontaining “y + 2” in the numeratorand x-squared in the denominator.Rapid-Pi’s text-based input issimilar to that used by graphing calculatorsand so will be instantly familiarto most math students and teachers.While Rapid-Pi’s input methoddoes require some initial learning,this investment is soon paid off withongoing time savings.Few people have time to read aUser Manual. That’s why Rapid-Picomes with a short “Getting StartedGuide” that covers the most commonexpressions and symbols and allowsthe user to start editing math withRapid-Pi in as little as five minutes.Rapid-Pi also has a symbols toolbarcontaining all symbols and expressionssupported by Rapid-Pi. If a userneeds to enter a particularsymbol forthe first time, theuser can just click onthe correspondingtoolbar button andRapid-Pi will insertthe correct textualkeyword for the symbol(for example, “.a”for lower-case alpha,“.int” for integral).After usingRapid-Pi for a fewhours, most userswill find that theyremember the keywordsfor commonly-usedsymbols and rarely need to relyon the toolbar. However, the toolbarremains available as a fallback optionfor occasions where the user forgets akeyword or needs to enter a symbol heor she has never used before.Rapid-Pi also includes a comprehensiveUser Guide and a SymbolsReference, providing detailedinformation about all features andsymbols supported by Raid-Pi.Rapid-Pi supports a wide range ofmathematical symbols and expressions,including all symbols supportedby the Equation Editor.Rapid-Pi integrates withMicrosoft Word (version 2000 orlater), allowing users to insert aRapid-Pi object into a Word documentwith one click.Rapid-Pi also has anAutoSuggest facility which allowsthe user to quickly correct misspelledkeywords. When a keyword ismisspelled, Rapid-Pi underlines itwith a red squiggly line. Right-clickingon the keyword displays a list ofsuggestions.Rapid-Pi requires MicrosoftWindows 2000 or Windows XP andintegrates with Microsoft Word 2000and later. Rapid-Pi can also be usedwith other word processing and editingapplications.Rapid-Pi is available in a numberof license types to suit the needs andthe budget of different users. Alllicenses include free technical supportvia email and 12 months ofupgrades. Prices start at $20 (US) for aMay 2006 35


■ H A R D W A R E ■ S O F T W A R E ■ G A D G E T S ■ T O O L SStudent License, while the Home/Small Office license is priced at $50(US). A 30% Academic Discountis also available. More detailed informationis provided at www.rapid-pi.com/pricing.aspxA fully-functional 60-day evaluationversion of Rapid-Pi can be downloadedfrom www.rapid-pi.com/download.aspxFor more information, contact:Trident Software Pty Ltd.Web: www.rapid-pi.comALPHA EF-6100LOW-SOLIDS WAVESOLDER FLUXCookson ElectronicsAssemblyMaterials(CEAM) announcesthe global launchof ALPHA EF-6100low-solids wavesolder flux, the latestaddition to itssteadily expandingline of EF-Series environmentally-friendlyfluxes designedfor new lead-free processes, as well astin-lead processes. This no-clean, alcohol-basedflux provides best-in-classreliability, passing all international reliabilitystandards including IPC, Bellcore,and JIS.“ALPHA EF-6100 offers lowresidue for excellent board cosmeticsand pin-testability for lead-free andtin-lead applications,” said SteveBrown, Global Product Manager atCEAM. “Additionally, EF-6100 meetsall IPC, Bellcore, and JIS electromigrationand surface insulation resistancestandards — confirming its exceptionalelectrical reliability.”Fully lead-free capable ORL0,ALPHA EF-6100 leaves minimal colorless,non-tacky, clear flux residue thatspreads uniformly over the surface ofprinted circuit boards. It providesexcellent resistance to connectorbridging across a broad range ofprocess conditions. It is compatiblewith all common pad finish types andimproves yield by reducing defects,minimizing rework, and increasingthroughput.For more information, contact:Cookson ElectronicsAssembly Materials600 Route 440Jersey City, NJ 07304Web: www.cooksonelectronics.comHIGH VOLTAGEUSB DIGITAL I/OThe RP00001616TB buffered USB DIOboard features 16 inputs and 16 outputs.Both leads of the optically-isolatedinputs are made available to the user.This allows the designer the flexibility touse a variety of DC voltages on the inputs.Each input requires a current limitingresistor and is sensitive to below 2mA. Two SIP resistor networks are suppliedto act as pull-ups for the digital inputs.When the resistor networks are installed,the user can connect the cathodeof any of the inputs to the ground suppliedon the input connector to signal aninput event.Both leads of each digital outputhave been made available to the user.Each output has the ability to switchloads up to 250 Vac/Vdc at a maximumcurrent of 120 mA.This low cost DIO board has aneasy-to-use USB interface. The unit ispowered by the USB port eliminatingthe need for external power supplies.Reading and writing the DIO is donethrough a DLL (dynamic link library).This makes it easy for the popular programminglanguages (C++Builder,VisualC, Visual Basic, NI’s MeasurementStudio, etc.) to access the routinesneeded to control the DIO. This boardcan also be accessed from an actionstep in NI’s Test Stand using the DLLFlexible Prototype Adapter.The RP00001616TB buffered USBDIO board is supplied as a PCB,making it ideal for OEM applications.A 10’ USB cable, two resistor networksand a CD containing the manual,drivers, and a variety of softwareexamples ships with each unit. Theboards are available for $125.For more information, contact:BCSWeb: www.bcsideas.comNO PERSONALCOMPUTERNEEDED!The 20-year habit of requiring a$1,000 personal computer for every$5 computer trainer, logic trainer, orcomputer educational device can nowbe broken with a stand-alone microcontrollerfrom Industrial Ventures (IV).The IV Prd Kit has been upgraded toinclude three meta-technical features:• Auto message generation includingloop-back facility and a complete ASCII-8 character set for testing any standardEIA RS232 device.• The partially assembled and testedkit with power supply, cables, andinstructions insures “out-of-the-boxoperation” without effort.• Self-programming Flash memory withthe Atmel MEGA8515 RISC microcontrollerfeatures 14 MIPS together with operatingsoftware including OS, Monitor,and Applications as examples/tutorial.The IV-Prd-Kit sells for $49, andcompletely unassembled kits areavailable starting at $24 each. Shippingis free within the US and begins in June2006. IV terms are Postal Money Orderwith order.Many low-cost accessories andbreadboards are available, and pricingand specifications are available from IV.For more information, contact:Industrial VenturesPO Box 245Waldwick, NJ 07463-024536 May 2006


“Now With 5xMore Products! ”We’ve added thousandsof money saving Jameco ValuePro andJameco ReliaPro products.These products are manufacturedfor us and shipped directly to you,eliminating costly supply chain layers.We’re also finding unique ways to help you save even more onname-brand products. Rather than print unneeded informationin our catalog, we’re printing just enough informationto let you know what we offer and where tofind it on our website.Less space means less paper,less postage, less waste andless costs. A simple and potentially big savingswe can pass on to you!Take alook atsome ofour popularname brands:AbbatronAlcoswitchAlpha WireAMDAMPAmphenolAvery DennisonBeldenC&KCDEChemtronicsCherryCinchCorcomCrydomEtasisFlukeGeneral CableGiga-ByteGrayhillHellermanIntelLexarLittelFuseMolexNeutrikP&BPanduitRaychemSanDiskSeasonicSparkleSpecoSwitchcraftTech SprayTycoVolexZynetOrdering is simplified, too! Just call us or visit our website and give us the product number.No SKU for you to provide, no messy search terms, just a simple manufacturer’s part number.We’re constantly updating the technical documents on our site as well. So as you’rethumbing through our catalog, be sure to look foradditional products referred to on our website atwww.Jameco.com.Great Products. Awesome Prices.Call 1-800-831-4242 for your free catalog—Or go directly to www.Jameco.com/NVM


PROJECTS■ THIS MONTH’S PROJECTSSimple Digital Tachometer . . . .38Chip Music Composing . . . . . .42Digital Capacitance Meter . . . .46■ LEVEL RATING SYSTEMA SIMPLE DIGITALTACHOMETERTo find out the level of difficultyfor each of these projects, turnto our ratings for the answers.●●●● . . . . Beginner Level●●●● . . . . Intermediate Level●●●● . . . . Advanced Level●●●● . . . . Professional LevelI bought a used Nissanpickup truck a few yearsback that had absolutely nobells or whistles on it whenit rolled off the assemblyline. I wanted to makesome “improvements” tothe engine, and I wanted atachometer to helpassess the results (forbetter or worse).The addontachometers available inauto parts stores didn’t appealto me, mostly becauseI knew I could make onemyself if I put my mind to it.What I reallywanted was adigital tachometer.The circuit would have to satisfythree objectives: it had tobe relatively accurate (±100 RPM);it had to be built with parts Ialready had lying around; and ithad to fit on top of the truck’ssteering column. The secondobjective ruled out using microcontrollersor multiplexed displaydrivers — the few of these I haveare already in use! With thesecriteria in mind, I dusted off someTTL databooks, dug through myparts bin and came up with thecircuit in Figure 1. The circuitconsists of five functional blocks:a Hall-effect sensor; a divideby-100counter and latch; a timerto set the count interval; a fourdigitdisplay and drivers; and a■ PHOTO 1. The Digital Tachometer.power supply.I decided I could live with anaccuracy of ±100 RPM, so I couldget away with only driving twodigits (the two most significantdigits, x1000 and x100) to saveboard space. By doing somesimple arithmetic I calculated thatcounting sensor pulses for 0.6seconds and multiplying thecount by 100 would yield revolutionsper minute. Multiplying thecount by 100 was accomplishedby adding two digits (x10 and x1)permanently wired as “0.” Thisallows the circuit to have areasonably fast refresh rate whilestill collecting enough pulsesin each 0.6 second window toyield acceptable counting accuracy(for example, the difference38 May 2006


BY DAN GRAVATTbetween 19 and 20pulses is half thepercentage differencebetween 9 and 10pulses).■ FIGURE 1Circuit DesignTo count the revolutionsof the engine, Iused a bidirectionalHall-effect sensor tosense the passage of amagnet I glued to theback of the crank pulley.The sensor I usedcame from an oldfloppy disc drive. Theresponse of the sensoris dependent on theorientation of themagnet relative to thesensor. Simply passingthe north or south poleof the magnet over thesensor caused it totoggle, but passing themagnet lengthwiseover the sensor (so thesensor sees both polesin succession) produceda nice pulse.The output pulsefrom the Hall-effectsensor is fed into theCP0 input on the first74LS90 counter, U1.This counter is wired ina divide-by-ten configurationby connectingoutput Q0 to input CP1and by grounding MS1and MS2. Output Q3of the first counter isconnected to the CP0input of the secondcounter, U2, also in adivide-by-ten configuration,which countsthe overflow from U1.The binary-coded-decimaloutputs fromboth counters are connectedto the inputs ofMay 2006 39


a 74LS374 eight-bit latch, U3.In order for the tachometer (orany frequency counter) to countaccurately, it needs a “gate” signal todefine the interval during which thecounters count pulses. This signal isprovided by the 555 timer U4 whichis configured to produce a shortpulse every 600 ms. The output of thetimer is fed to the clock pulse inputof the latch and the MR1 and MR2reset inputs on the counters. The74LS374 is an edge-triggered device,while the 74LS90 is a level-triggereddevice, so at the end of each 600 msinterval the count is latched justbefore the counters are reset. Thereset pulse is kept short (a fewmilliseconds) to minimize thechance of missing a pulse from theHall-effect sensor. The two diodesallow the timer to operate with thisvery low duty cycle. A tantalumtiming capacitor is recommended forimproved frequency stability over awide temperature range.The latched count data is fed tothe inputs of two 74LS47 commonanodeseven-segment LED displaydrivers, U5 and U6. Data from U1 isfed to the x100 driver U5, while datafrom U2 is fed to the x1000 driverU6. The ripple blanking input of U5is held high so that the x100 digitwill read “0” when power is firstapplied. The RBI of U6 is held low to■ PHOTO 2. A side view of thedigital tachometer.blank a leading zero. As mentionedearlier, the x10 and x1 digits arepermanently wired to display “0” bygrounding segment inputs “a”through “f.” I chose to use a singlecurrent-limiting resistor for eachdisplay to save space. This causesthe display brightness to vary slightlydepending on the number beingdisplayed, but the effect is minor aslong as low-current displays areused.The power supply for the circuitis a standard 7805 linear regulator ina TO-220 package. Since vehicles canproduce a lot of electrical noise, youmay need more bypass capacitorsthan the schematic indicates. FerriteRF chokes may also be needed onthe power and sensor cables. I useda total of five 0.1 μF capacitorsspread around the circuit board toensure glitch-free operation. Theregulator is dropping 12-14 V downto 5 V, so adequate heatsinking is amust.Constructionand TestingCircuit board layout is notcritical, but the arrangement of thedisplays should be thought out first.If you intend to mount the tachometeron a vertical surface, the displayscan be mounted on the board justlike the ICs. If the tachometer will bemounted on a horizontal surface,right-angle sockets mountedon the front of the board simplifydisplay installation. Alternatively,cut another small piece of circuitboard, mount the displays on it, andattach the display board to the mainboard with small right-angle brackets.Make sure the displays areplaced in the proper order, with thex1000 digit on the left and the x1digit on the right. A sun shadefor the displays is recommended to■ PHOTO 3. View of the top of thedigital tachometer.40 May 2006


A Simple Digital Tachometer■ PHOTO 4. Here’s a look at thetachometer sensor.prevent them from “washing out” indirect sunlight.Before installing the Hall-effectsensor, power up the circuit from aclean 12 V power supply and checkfor smoke. The display should read“000” with the x1000 digit blanked.Apply a 10 Hz squarewave signal tothe CP0 input of U1 where the Halleffectsensor will be attached.The display should read “600”consistently. Next, apply a 100 Hzsquarewave signal to the CP0 input,and the display should read “6000”consistently. If the displayed valuesare stable but incorrect, the valuesof the timing resistors and capacitorfor U4 may need to be adjusted. Ifthe display is erratic or garbled,check your wiring and make surethe ICs are not defective. This is alsoa good time to make sure theheatsink is sufficient to keep the7805 regulator cool.InstallationFirst, a few words of caution.Installing the tachometer in yourvehicle may void your warranty, damagethe vehicle, or injure you. Pleaseuse all applicable safeguards whenworking on the vehicle, and make surethe key is out of the ignition beforeproceeding!Install the tachometer in yourvehicle where it is easily visiblebut does not obstruct any otherinstruments or controls. Power forthe circuit can be obtained fromthe cigarette lighter socket or anyother switched power connectorthat is readily accessible. Use athree-wire shielded cable toconnect the circuit board to theHall-effect sensor and thread theAUTHOR BIO■ Dan Gravatt is a licensedgeologist with the State of Kansas.He can be reached at dgravatt@juno.comsensor and cable through anavailable hole in the firewall,routing the cable away from existingwiring and any hot and/or movingengine components.Find a suitable mounting locationon the front of the engine nearthe crank pulley and fashion a stablemounting bracket for the Hall-effectsensor to hold it parallel to the backof the pulley. Glue the magnet to aflat surface on the back of the pulleynear the outside edge, making surethat the orientation of the magnet iscorrect to generate a pulse from thesensor as it passes. If possible, use aplastic-coated magnet so that itPARTS LIST(All available through Digi-Key, 1-800-344-4539)does not rust, and keep the size ofthe magnet small to avoid unbalancingthe pulley. Make sure that thesensor will not collide with themagnet (or anything else) but isclose enough to sense the magnet’spassing.Start the vehicle and check fora reasonable RPM reading on thedisplay. If the display is erraticnow but worked fine during calibration,you probably need morebypass capacitors and/or RF chokeson the power supply and sensorleads.Well, good luck and happycruising! NV❑ U1, U2 — 74LS90 decade counter❑ U3 — 74LS374 tri-state octal latch❑ U4 — 555 timer❑ U5, U6 — 74LS47 BCD to seven-segment decoder/driver❑ Bidirectional Hall-effect sensor❑ 7805 5 V linear regulator, TO-220 pkg.❑ (4) Common-anode seven-segment LED displays❑ (2) 1N4148 diodes❑ (4) 220 W, 1/2 W resistors❑ 800 k W, 1/2 W resistor❑ 1 k W, 1/2 W resistor❑ 1 μF tantalum capacitor❑ 10 μF electrolytic capacitor❑ Several 0.1 μF ceramic disk capacitorsMay 2006 41


“Chip Music” maysound like a newterminology to you,but its meaningis really selfexplanitoryand ithas been aroundus for a long time.We all heard theChristmas or birthdaysongs coming outfrom various greetingcards. But do youknow how to createsuch music ina tiny chip? Honestly,I didn’t — untilrecently.■ FIGURE 1. This diagram is showing asection of the piano keys and the whitekeys’ frequencies.CHIPMUSICCOMPOSINGSIMPLIFIEDTheory and PracticeChip Music EraHas ComeBeginning this year, the pricesfor some eight-bit microcontrollershave dropped to anunprecedented new low. Forexample, only 38 cents each forthe Atmel’s eight-pin ATtiny11 atthe quantity of 100 is nowavailable (www.digikey.com). Ihave been able to purchaseAtmel’s 8051-like 4KB Flash microcontrollerAT89C4051 for only$1.50 each at a quantity of 150(www.jameco.com).This is a great phenomenonfor us as chip users. Lots ofnew opportunities are now opento us. What can we do with theseopportunities in order to takeadvantage?I can’t live without music. Ican’t pass July 4th withoutsinging and hearing TheStar-Spangled Banner. So, Ithought it was about time for meto program some of my favoritemusic into the chips. Eventhough I have been accustomedto those songs coming fromgreeting cards, I never knew howthey were programmed.I decided to try my own way byfirst learning some basics onmusic, then starting to write42 May 2006


BY G. Y. XUmusical tone subroutines emulatingpiano keys’ frequencies. The resultswere very rewarding and exciting. Bycomparing the standard “A” (440 Hz)tone frequency generated by my “A”Tone Generator program to mypiano’s A4 key, I noticed for thefirst time that my piano was a littleout-of-tune.This article is a recap of myrecent work. And I hope it will helpencourage more people to programtheir favorite songs into chips. Iexpect very soon there will be aflurry of chip music booming allaround.Acoustic Basicsof MusicI play piano almost every day,so the natural starting point ofmusic topic is piano. As we know,there are 88 keys on a piano rangingmore than seven octaves. The keyswithin an octave are named by theletters C, D, E, F, G, A, and B. In orderto designate a specific key on thepiano, we put a subscript numberafter the letter. Figure 1 shows partof the piano keys and the white keys’frequencies.The frequency for Middle C (C4key) is 261.626 Hz, but we can round itup to 262 Hz with no problem,because the human ear can’t distinguishtones if the frequency differenceis less than 3 Hz.The standard frequency formusical tuning is 440.000 Hz at theA4 key. This frequency has beenadopted as the InternationalFrequency Standard for musicalinstruments; any other key’s frequencycan be determined from it. Forinstance, its higher one octave keyA5 frequency is 880 Hz, its highertwo octave key A6 frequency is 1760Hz, etc. And its lower one octavekey A3 frequency is 220 Hz, butsuch low frequency will not be usedin our chip music program sincemost speakers or buzzers won’thave good response that low.■ FIGURE 2.HardwareConfiguration.Music ToneGenerationby MicrocontrollerNow, let’s seehow to use a microcontrollerto generatethe 440 Hz tone.Even though Iactually used aneight-pin AVR microto do it first here, Iwould like to utilizeAtmel’s 8051-likemicro AT89C1051/2051/4051 for explanation becausemost people are familiar with itthan the other micros, and writingthe assembly code for it is justthe same as writing 8051 assemblylanguage.Figure 2 is the hardware configurationfor this purpose. In additionto the micro, a reset capacitor, a 12MHz crystal or oscillator, and aspeaker are all we need to form thecircuit.Why do we choose 12 MHz?Because in the 8051, a machinecycle consists of 12 clock cycles, soeach machine cycle takes onemicrosecond (μS) and most 8051instructions take either one or twomachine cycles, so these instructionstake either one or two μS.Therefore, calculation becomes veryconvenient.The main idea in creating this “A”tone is very simple. A half period for440 Hz is T/2 = 1/(440*2) = 1,136 μS.As shown in Figure 3, if we applyhigh/low voltage to the speaker at T/2alternately, it will generate therequired frequency square wavetone.The entire assembly languageprogram is shown in Listing 1,which is available on the <strong>Nuts</strong> &<strong>Volts</strong> website (www.nutsvolts.com).As we can see, to get very highaccuracy, we create subroutineDL1132 μS; and because setting upa port pin or calling subroutinetakes two μS each, the total time fora half period comes to 1,136 μSexactly.With a good 40 ohm two-inchspeaker, and a programmedAT89C1051/2051/4051 microcontrollerusing my 8x51 programmer■ FIGURE 3. This diagram shows howto generate the required frequencysquare wave tone.May 2006 43


REFERENCES■ [1] John Backus: The AcousticalFoundations of Music, 1977.■ [2] Scientific American’sReading Series: The Physics ofMusic, 1978.■ [3] G.Y. Xu: 8x51 Flash/EPROMMicrocontroller Programmer,Circuit Cellar Magazine, April1998.■ [4] G.Y. Xu: Play the AVRHyperTerm, <strong>Nuts</strong> & <strong>Volts</strong>Magazine, February 2005.[3], I’ve found that its tone matchesmany fine-tuned Steinway andYamaha pianos. The frequencymeter or oscilloscope measurementshows 440.0 Hz. This circuit canbe built and mounted in a smallbox and act like a “Tuning fork” formusicians.Now, Let’s ComposeJust as the words saying “Whenyou know the notes to sing, you cansing (al)most anything.” Chip musiccomposing is no difference. Simplyput, we need to create the subroutinesfor each note, then call theseroutines to make a song. Listing 2 isan example showing how to composethe beginning melody of TheStar-Spangled Banner (Listing 2 isalso available on the <strong>Nuts</strong> & <strong>Volts</strong>website).It utilizes only four differentnotes, but we’ve created eight noteroutines for your conveniencefor future use. Each note routinedeals with two parameters: thefrequency and the duration of thenote.Using 8051’s Timer0 interrupt isthe main reason for creating eachnote routine. As we see, the 8051works in mode 3, where Timer0 acts astwo separate eight-bit counters TL0and TH0. If the register TL0 is loadedwith number 0 to start, it will count upone each microsecond, and overflowafter 256 μS.The necessary steps to enableTimer0 interrupt and start it areshown at the beginning part of themain program. After that, an infiniteloop is entered to generate the beginningmelody of The Star-SpangledBanner.The principle of frequencygeneration is the same as on “A”Tone, but the technique is different.Here we deal with a number ofdifferent frequencies, not just onelike 440 Hz or T/2 = 1,136 μS, and weneed to keep the Timer0 interruptservice routine the same for allthese frequencies.A simple solution is to set upthe Timer0 so that it alwaysoverflows every 8 μS, then calculatehow many timer Ticks are needed forT/2 of any frequency we are dealingwith.When counting elapsed timebetween timer ticks, the timeit takes to execute the interruptservice routine, that is, the InterruptExecution Time (IET) must be takeninto account. As calculated inListing 2, IET=7 μS/INT, so theelapsed time between two ticks isfixed 8+7=15 μS.Under this scheme the number ofticks for some frequencies may not bean integer and need to be rounded, insuch case the calculation can only beapproximate. But 8 μS is very smallcompared to any T/2 we can have,so the created note would still besatisfactory.Now, let’s look at an examplefrom the note subroutine: Howmany ticks are needed to generatethe 523 Hz (T/2=956 μS) tone.Since 956/15 = 63.73, we round itup to 64. But in the notesubroutine the tick starts from 0, soit should take 64-1 = 63 as therequired ticks. By the way, we haveused the note name “Doe” inparallel with “C5” for it; this is helpfulin composing.As for the second parameter, theduration of the note is decided by thenumber of repeat times Rp for asquare wave. Roughly speaking, wecan simply assign a fixed numbersuch as Rp = 250 to every noteroutine. It works, and I did it in mybeginning compositions. But this waycan’t achieve equal duration for everynote. The result is the lower thefrequency (with larger T/2), the longerthe note duration.A better way to achieve equalnote duration is to start from thehighest frequency (shortest T/2),assign the largest Rp=255, thencalculate the note duration. Forinstance, in the “C6” notesubroutine, the highest frequency is1,047 Hz, T/2 = 478 μS, if Rp=255is assigned to it, then the noteduration will beRp * T = 255 * 478 * 2 = 243780 μS,or roughly 1/4 second.After that, we use this formula toget the required Rp for other lowerfrequencies. For instance, in the “C5”note subroutine we getRp = 243780 / T = 243780 / (2*956) =127.5 => 128By doing so for all other notesubroutines, we keep each noteduration almost equal to 1/4 second.And we can think of each subroutinecall as a “quarter note.” This is veryhelpful when composing; you canestimate the required number ofcalls for the notes you are going toplay.Last, but not least, we needsome delay routines for REST notecomposing. For example, we alreadyprovide 10 milliseconds (ms) and100 ms delay routines. From there,you can create the “quarter rest”note routine, if needed. Just remember:“half time of all music issilence.”Now that we’ve created notesubroutines, composing The Star-Spangled Banner is just a matterof calling the required notes intothe main program to constructthe melody, as shown in Listing 2.Of course, in order to make a44 May 2006


good song, we need to do it forseveral iterations, not just once.We need to listen, try, and listenagain.The hardware for playing thissong is still the circuit shown inFigure 2, but it is more flexible. Forexample, you can use 11.0592 MHzinstead of 12 MHz, and won’t get anyunpleasing result. You may also use abuzzer to replace the speaker if spaceis limited and sound quality can betolerated.Build Your ChipMusic LibrarySo far, we‘ve discussed chipmusic composing only on the 8051,but the principles outlined here canbe easily modified and applied toother micros such as AVRs or PICs, asthey all have a timer and a similarinterrupt scheme.Once you’ve created your musicfiles, you need a device programmerto “burn” it on to a micro. For 8051-like micros, there are numerousprogrammers available on themarket, including my 8x51 Flash/EPROM programmer.With the information presentedhere, not only you can complete thecomposing of the remaining portionof The Star-Spangled Banner, butalso do much more. For example,you can compose Beethoven’s Odeto Joy. With chip prices dropping solow, it’s much easier and cheaperthan ever for chip music composing.So don’t miss this chance tobuild your own chip music library asI did.So, happy chip music composing.NVAUTHOR BIO■ G.Y. Xu is an ElectricalDesigner specializing inmicroprocessor/microcontrollersystems design and development,both in hardware and software.He can be reached by emailat gyxu@cmpmail.comCALLTOLL-FREETO ORDER(800) 292-7711Electronic Science LabMaxitronix 500-in-1 Electronic Project LabModel MX-909Everything you need to build500 exciting projects!• Learn the basics of electronics. 500 differentelectronic experiments, special lighting effects,radio transmitter and receivers, sound effects,cool games and MORE!• Includes built-in breadboard and an LCD.• Explore amplifiers, analog and digitalcircuits plus how to read schematicdiagrams.• Includes 11 parts.• Lab-style manual included.• Requires 6 “AA” batteries.MX-908 - 300-in-1 Lab $69.95 MX-906 - 130-in-1 Lab $39.95MX-907 - 200-in-1 Lab $49.95 EP-50 - 50-in-1 Lab $18.95Elenco ® Digital MultimetersModel M-1750 Model LCM-1950$24. 95• 3 3/4 Digit LCD• Freq. to 10MHz• Cap. to 200μF• AC/DC Voltage• Current up to 10A• Audible Cont.• Diode Test• Transistor Test• Overload Prot.$169Guaranteed Lowest PricesUPS SHIPPING: 48 STATES 7%(Minimum $7.00)OTHERS CALL FOR DETAILSIL Residents add 8.75% Sales TaxSEE US ON THE WEBElenco ® Snap CircuitsElenco’s new Snap Circuits make learning electronics fun and easy. Just follow the colorful pictures inour manual and build exciting projects, such as: FM radios, digital voice recorders, AM radios, burglaralarms, doorbells, and much more! You can even play electronic games with your friends. All parts aremounted on plastic modules and snap together with ease. Enjoy hours of educational fun while learningabout electronics. No tools required. Uses “AA” batteries.6 versions available.Build up to 750 projects!As low as $29.95C&S SALESwww.cs-sales.com4 Educational Models AvailableSC-750 - Extreme Version, contains over 80 parts to build over 750 experiments. Includes everything from SC-500plus experiments in solar, electromagnetism, vibration switches, and 70 computer interfaced experiments.SC-500 - Pro Version, contains over 75 parts including voice recording IC, FM radio module, analog meter,transformer, relay, and 7-segment LED display. Build over 500 experiments.SC-300 -Deluxe Version, contains over 60 parts. Build over 300 experiments.SC-100 - Snap Circuits, Jr., contains over 30 parts. Build over 100 experiments.$59. 95• Large 1” 3 3/4Digit LCD• Autoranging Freq.to 4MHz• Cap. to 400μF• Inductance to 40H• Res. to 4,000MΩ• Logic Test• Diode &Transistor Test• Audible ContinuityTestQuantity Discounts AvailableElenco ® Educational KitsModel RCC-7KRadio Control Car KitModel AM-780KTwo IC Radio KitModel M-1006KDMM Kit$27. 95• 18 Ranges• 3 1/2 DigitLCD• TransistorTest• 7 Functions$9. 95• Diode Test• Transmitter includedNon-soldering Version AM/FM VersionAK-870 $27.95 AM/FM-108K $29.95$18. 95Visit our website www.cs-sales.com to see our assortment.Elenco ® Quad Power SupplyModel XP-5814 Fully Regulated Power Supplies in 1 Unit$754 DC Voltages: 3 fixed; +5V @ 3A, +12V@ 1A, 1 variable; 2.5 - 20V @ 2A • Fullyregulated & short protected • Voltage &current meters • All metal caseElenco ® Oscilloscopes*Special*$329S1325 30MHzProbes includedS1330 30MHz Delayed Sweep $459S1340 40MHz Dual Trace $469S1345 40MHz Delayed Sweep $549S1360 60MHz Delayed Sweep $749S1390 100MHz Delayed Sweep $999C&S SALES, INC.150 CARPENTER AVE • WHEELING, IL 60090(847) 541-0710 FAX: (847) 541-9904E-mail: sales@cs-sales.comwww.cs-sales.comCALL ORE-MAIL USFOR OURFREECATALOG!GreatGiftIdea!CreateYour OwnExcitingExperimentsUpgrades and replacementparts available at:www.cs-sales.com$99$119.95$89.95$59.95$29.95Elenco ® Test EquipmentElenco ® Frequency Counter1MHz-3GHz Model F-2800• 10 digit LCDdisplay• 16-segment RSSIbargraph• Resolution to 1Hz• Hi-speed(300MHz) directcount• Includes NiCdcharger andantennaElenco ® 5MHz SweepFunction Generatorwith built-in 60MHzFrequency CounterModel GF-8056$229Generates square, triangle, and sinewaveforms, and TTL, CMOS pulse.15 DAY MONEYBACK GUARANTEE2 YEAR FACTORYWARRANTYPRICES SUBJECTTO CHANGEWITHOUT NOTICEMay 2006 45


Over the years, Ihave amassed quite aselection of air variablecapacitors and trimmers.Starting aproject that used oneof these devices usedto feel like it requiredan Act of Congress toselect the right one,since they were ofunknown values.I finally decided itwas time to add acapacitance meterto my test bench.However, I couldn’tjustify the cost($100+), so I decidedto build my own.■The Digital Capacitance Meter.A DIGITALCAPACITANCEMETERReviewing published designs ofcapacitance meters from thelast 20 years, I found that most hadflaws that included poor linearity,poor accuracy, and volatile testleads (could blow out internal ICs ifshorted together). Some of thedesigns were superb in resolutionand low-end range, reaching wellinto the femtofarad region.However, their complexity did notjustify their extreme accuracy,which was well beyond test-benchneeds.RequirementsAt that point, I decided todesign my own unit from scratch.My initial prerequisites would be:• Minimal range switching for anadequate span of measurements• No precision componentsrequired• Minimal adjustments• Decent accuracy and stability• Battery operationThe completed unit fulfillsthese requirements. Its accuracyis as good as its resolutionwill allow and as good as thestandard it is calibrated to.Overlap has been provided onall ranges except for the lowestone to help alleviate this problem.It has been my experiencethat once you get below 10 pF(the worst case resolutionhere), the physical circuit prettymuch dictates the values needed.This is usually the case of adding “alittle more or a little less” from thedesign-center values. Considerthis: The average PN junction has acapacity of 5 pF and varies with thevoltage across it, making it difficultto predict exactly how it willbehave in the finished circuit.Circuit boards and layout can addanother 1-5 pF between nodes,which are even more difficult topredict. It is for this reason Idecided not to go beyond tenths ofpicofarads resolution.The final design then spec’edout as follows:• Four ranges:– 0-999 pF– 0-99.9 nF– 0-9.99 μF– 0-999 μF• Four calibration adjustments• One “zero” adjustment• No precision components used• Nine-volt battery operation• Well beyond 1% accuracyTheory of OperationBefore I get into construction, Iwant to give a detailed theory ofoperation that will also be handyfor troubleshooting, if necessary.The heart of this design is U1, anLM311 comparator. Normally theoutput of U1-p7 is high. When acapacitor is inserted in the Cx test46 May 2006


BY ROBERT REEDjacks, it begins charging toward thep7 positive voltage through its rangetimingresistor (R8, R9, R10). Cx isalso connected to the negative inputof U1 (p3). When this voltage risesabove the reference voltage on p2(the positive input), the comparatortrips and U1-p7 goes low.Now Cx starts to dischargethrough the same timing resistance tothis new low voltage. The positiveinput has also immediately droppedto a lower voltage at this time due tofeedback resistor R6. U1-p2, the referencevoltage, is now lower than Cx(U1-p3 negative input). Cx continuesdischarging until its voltage dropsbelow the reference of U1-p2. Atthis point, the comparator trips, theoutput goes high, and the wholeprocess starts all over again.Resistors R5 and R6 provide agenerous amount of hysterisis for fastswitching, stability, and an adequatetiming period. R1-R4, in conjunctionwith P1-P4, provide calibration for eachrange by setting the proper referencevoltage at U1-p2. So basically what wehave done is change a physical quantity(capacitance) to an electrical timingsignal (period output at U1-p7).All the component values mentionedso far were chosen to provide a10.0 ms period at the output of U1-p7for a full-scale reading on the threedigitdisplay (999 > 000). This equatesto 10 μs per count. For example, onthe low range (0-999 pF), 1 pF = 1 μsand full scale equals 9.99 ms. Thisholds true for the first three ranges.Range four (0-999 mF) has a muchlonger period as will be explainedshortly.When I first constructed this unit,the timing resistors R8-R10 were connecteddirectly to the switch S1B withtwo inch leads from the board, and Ihad all kinds of instability problems.This was caused by internal andexternal noise pickup on these leads.Surprisingly enough, these pointswere much more noise prone than theleads to Cx. For this reason, U2 (ananalog switch) was added to provide■The Circuit Boards.switching right at the componentlocation, which totally eliminated thisproblem. R23,24 ensure their controlinputs remain at ground level whennot activated. Diode D1 eliminatesone switch pole by making S1A dodouble duty. This circuit is veryaccurate and linear throughout itsrange and has infinite resolutionsince it is basically an analog device.However, there is a price to pay,and that is noise interference. Even acouple hundred microvolts of noiseriding on the comparator inputs nearthe trip points can cause erraticreadings on a digital display (wouldn’tbe a problem with meter displays).But I have incorporated a couple ofnovel features downstream to almosttotally eliminate erratic displays.The first feature is U3 — a dualdecade counter series wired up togive a divide-by-100 function. This, ineffect, multiplies the period by 100(remember that period is the reciprocalof frequency). This is beneficial inseveral respects. It greatly expandsthe gating period at its output, allowingnot only the display’s latchedcount to hold longer, but also a slowermore stable clock frequency (U4C).But above all, it provides 100-periodaveraging for U1’s output, and thisgreatly improves accuracy and stabilityin noisy environments.So, up to this pointwe now have a period of1.0 s at U3’s output for afull-scale output on thefirst three ranges. Theoutput is a perfectsquare wave and thepositive going portionwill be used as the gatepulse for the clock. Onrange four (0-999 mF),this divider is bypassedas the time constantrequirement for thisrange is so long that by■ Assembled and Open.proper design its gating pulse can godirectly to S1C, which selects the propergating pulse for the range used.In all cases, we want a 500 mspositive pulse here representing fullscale for any range. This gating pulsewill drive two circuits from this point.One of these is the circuitry of Q1,Q2.This is a variable delay circuit for zeroingparasitic (stray) capacitance. Thepositive going edge of the gate pulseis integrated by the combination ofR11, P5, C2 before driving the clockoscillator U4A. This delays the startof the clock oscillator which is thesecond novel feature, as mentionedpreviously. Instead of merely gating afree running clock oscillator for countMay 2006 47


pulses, the incoming gate actuallystarts and stops the oscillator.When the incoming integratedpulse reaches sufficient amplitude, itinstantly starts up the clock oscillatorand runs it for that duration. We canPARTS LISTget away with a slow rising logic pulseat this point due to the fact that theseNAND gates have Schmidt triggersbuilt into their inputs. Also, the clockoscillator can be a onestagedeviceRESISTORS VALUE SUPPLIER PART NO.❑ R122K❑ R233K❑ R3 6.8K❑ R427K❑ R5, 14, 1819, 20, 2123, 24 10K❑ R639K❑ R71K❑ R8100K❑ R910M❑ R10 1.5K❑ R11, 12 5.6K❑ R13 4.7K❑ R15 57K*❑ R16, 1747K❑ R22 510❑ RN1 330 x 7HARDWARE❑ S1 Six pole-four pos. Mouser 10WR046❑ S2P.B. NO❑ Pin Jacks Digi-Key J17-ND, J18-ND❑ Miniature test jacks Digi-Key A-29071-NDCAPACITORS❑ C1❑ C2, C9❑ C3❑ C4, C5❑ C6❑ C7❑ C80.003 μF0.22 μF0.01 μF470 pF22 μF0.1 μF0.47 μFPOTENTIOMETERS❑ P1-P410K/15T❑ P5100K/15TSEMICONDUCTORS❑ D1, D21N914❑ D3LED five milliamp❑ Q12N3906❑ Q2-42N3904❑ U1LM311❑ U2CD4066❑ U374HC390❑ U474HC132❑ U574C926❑ U6ULN2003❑ Display Three digit MX Digi-Key 160-1545-5-NDfor the same reason.By gating the clock in this fashionwe eliminate “clock walk through” andits annoying display jitter. “Clock walkthrough” occurs when the start of agate can occur at any point in a freerunningclock cycle, thereby producinga marching pattern through it.This alternatively affects the display’sLSB, causing the “±1 digit” commonlyseen in counter specifications. Bylocking the two together, this is eliminated.U4A is a 2 kHz clock producing1,000 count pulses in a 500 ms gateperiod, giving a display of 999 > 000,for a full-scale reading. The clockpulses from here are fed to U5-p12clock input to operate this device.Now, let’s back up for a momentto the Q1,Q2 delay circuit. This circuitoperates only on range one (0-999pF). We neither need it nor desire iton the other ranges. This is accomplishedby turning on Q2 andenabling C2 to ground. Q2 is turnedon when the range switch S1A is inthe first range by applying +5 V intoits base through R13 . Diode D1 isolatesthis circuit from its associatedcalibration circuit. C1 provides asmall residual delay for the otherranges. Q1 is turned on when the gatepulse goes negative, thereby givingthe gate sharp turnoff characteristicsand clearing this circuit to ground,setting it up for the next incominggate pulse. The time constant of R11,P5, C2 determines the level of integrationhere and hence the amount ofdelay. P5 now essentially becomes azeroing control, blocking parasiticcapacitance that would otherwiseshow up on the display. This controlhas a range of 0-50 pF for zeroing outboth internal and external capacitance.This unit will have about 20 pFof internal parasitics to zero out, leavingabout 30 more for external parasitics.If desired, P5 could be frontpanelmounted, but you will need atleast a 10 turn pot for this control.Returning to the gate output atS1C, when this pulse goes low, U4Astops and the total count is registeredin U5’s counter circuitry. The negativegate portion fed to U4B is highly48 May 2006


A Digital Capacitance Meterdifferentiated by the time constant ofC4, R16 producing a 20 μs positivepulse at its output. This pulse is fed toU5-p5 and latches its stored countinto the display. At the same time, thenegative-going edge of this pulsedrives U4C through C5, R17 and itsoperation is identical to U4B. Again,there’s a 20 μs positive pulse, butdelayed 20 μs from U4B’s. This pulsedrives U5-p13 and resets the countercircuitry to zero, readying these stagesfor the next gated counting cycle.U5 is a four-digit counter withmultiplexed output drivers. The lastdigit (MSB) is not used as we onlyhave a three-digit display. Thecommon segment drivers are currentlimited through RN1, a 330 Ω DIPpackage. The common cathodes ofthe display are driven through U6, ahigh current, seven-pack inverter.One annoying feature of the displayI used is that the decimal pointsare also multiplexed. The only way toseparate these is with the decodingcircuitry of Q3, Q4. If you use a displaywhere the decimal points are individuallyaccessible, you can eliminatethis nonsense and run them directlyto S1D through suitable current limitingresistors (510 Ω).I had neither the room nor thedesire to add another chip for overflowcircuitry. However, there werethree idle inverters in U6 that weren’tearning their keep. I wired these uplogically to look for a loss of segment“a” at the same time digit “A” wasactive. Half baked? Yeah, but it doeswork for the first overflow cycle andtakes up almost no additional boardreal estate. This will at least confirmthat when the display reads “000,”it’s either at full scale or there’s nocapacitance at all!You will also note that there aretwo +5 V supplies. One of these (+5V analog) is reserved exclusively forthe LM311 (U1), which needs veryquiet supply lines to operate properly.Although I show one high-frequencybypass capacitor on the supply lines,in practice, I always use several —usually one for every three or fourchips and also at the end of long(three inches or so) supply traces.ConstructionAt this point, you should have agood understanding of the circuit andthe confidence to build it, so now Iwill go into the construction details.The circuitry was built on twoboards. One was 1-1/4” x 3” perf board,■The Schematic.May 2006 49


hand-wired for the display, U6, RN1,Q3, and Q4. The other was the mainboard 2-3/4” x 3-7/8” (RadioShack#276-1688). The display board getsfolded back and mounted on the samethreaded standoffs as the main boardwith proper spacers. I used a plastichousing that’s common to BUD andSERPAC — available through Mouser.Once the timing resistor switching(R8-R10) is done, using U2, there is nomore critical wiring to do. Just keepU1’s Inputs (p2, p3) short and in theclear as much as possible. All the datasheets for the display, chips, and plastichousings are downloadable throughMouser. Mouser has best price on S1.The best price on P1-P5 and U5(74C926) was from Unicorn Electronics(www.unicornelectronics.com).The 2 kHz clock oscillator (U4A)can be adjusted to the correctfrequency with R15. This does notneed to be exact: plus or minus 20 Hzis adequate. Use two resistors here.One will be as large as you can gowithout going over the target frequency,the other will be a small value tofine-tune it. I used a 51 kΩ in serieswith a 6.2 kΩ and came within 2 Hz ofthe 2 kHz target. All resistors are 5%carbon film. R9 (10 MΩ) should be a1% metal film, not for accuracy, butfor its stability. Carbon resistors withThe Standard for checkingCapacitors in-circuitGood enough to be thechoice of Panasonic,Pioneer, NBC, ABC, Ford,JVC, NASA and thousandsof independent servicetechnicians.Inexpensive enough to pay for itself in justone day’s repairs. At $209, it’s affordable.And with a 60 day trial period, satisfactionguaranteed or money-back policy, the onlything you can lose is all the time you’recurrently spending on trying to repair allthose dogs you’ve given up on.CapAnalyzer 88Athis high a value can have wildand unpredictable temperature coefficients.I used a 5% carbon film inthis unit but will replace it the nexttime I have an order going out. Thesemay be hard to find, but NewarkElectronics has them.Once the unit is completed, calibrationis achieved by adjusting P1-P4and P5. The nice feature about thesecalibration controls is that theycompensate for all circuit componenttolerances from their design centersincluding clock frequency error. Startby making a rough adjustment on thehigh end of each range. Then dropback to range one (0-999 pF) andadjust P5 (zero) to just eliminate anyparasitic display to “000.” Now readjustP1 to whatever standard you areusing. Then adjust ranges two throughfour to a standard on their high end.You should now see “000” on allranges with no capacitance in Cx. Ifranges two through four show anyparasitic reading, C1 will have to betweaked somewhere between 2,000-5,000 pF. When making these tests,use the small test receptacles (A-29071-ND that are wired in parallelwith Cx’s pin jacks) if possible. Thesewill accept lead diameters of 0.20-.40inches, which will accommodate 90%of tested capacitors. When necessary,Locate shorted or leakycomponents or conditionsto the exact spot in-circuitStill cutting up the pcb,and unsoldering everypart trying to guess atwhere the short is?$209Your DVM shows the same shorted reading allalong the pcb trace. LeakSeeker 82B has theresolution to find the defective component.Touch pads along the trace, and LeakSeekerbeeps highest in pitch at the defect’s pad. Nowyou can locate a shorted part only a quarter ofan inch away from a good part. Short can befrom 0 to 150 ohmsLeakSeeker 82BAvailable at your distributor, or call 561-487-6103Electronic Design Specialistswww.eds-inc.comuse short leads out of the pin jacksand subtract any residual readingsthat these add (2-10 pF) beforeconnecting the test capacitor.For calibration, use the beststandards you can scrounge up that arenear the high end of each range. I amfortunate enough to own a 1% capacitordecade substitution box, but youcan purchase a couple of 1% capacitorsfrom Digi-Key that will calibrate thetwo most critical ranges (one and two).These are 1,000 pF, p/n P3824-ND($0.63), and 100 nF, p/n P3872-ND($1.15).Calibrate, Test, UseAs opportunity presents, you canrecalibrate with better standards onranges three and four. This unit’saccuracy is only limited by the accuracyof the standards you calibrate itwith. In my case, that was 1%, which isquite adequate for test bench use.Although the display is quitestable, there will be instances wherethe Cx value is so close to the nextwhole digit (i.e., 99%), that it cancause LSB flicker. If that happens,simply move your free hand near thecapacitor in Cx (2-3 inches) whilereading the display. That will addthat last fraction of a picofarad andstabilize the LSB to the next wholedigit that it is already so close to.The average current draw on thisunit is about 35 mA, which is a prettyhefty load for a nine-volt battery. I ranaccelerated life tests, assuming 1,000tests per year at five seconds per test,and it appears the battery would lastalmost as long as its shelf life. For thefront panel, I tried something new. Idrew this up from one of my schematicCAD programs, along with text. Ithen printed this out on glossy photopaper and pasted it to the case withspray adhesive. Looks nice, but Idon’t know how durable it will be.Time will tell, I guess. I built this unitfor less than $30 and am very satisfiedwith it. The first tests I performed wereto quantify and label all those airvariable capacitors and trimmers. Itwas a breeze and a joy. NV50 May 2006


go to www.nutsvolts.com — click Electro-Net


CONSTANT CURRENT SOURCESby Vaughn D. MartinPART 2Part 1 explained what aconstant current source(CCS) is and examinedapplications in four-pointmeasurements, resistancetesting, electrical-contacttesting, and temperaturemeasurement using theDR (change in resistance)method. Now we’llconclude with semiconductor,electrical component,and finally electrochemicalapplications.AcknowledgementsI wish to thank the followingindividuals for help with thisarticle. Mike Kirk of Agilent and Dr.Mike Lauderbach of LeCroy gavetechnical assistance and suppliedartwork, and Juan Moore ofTektronix also supplied artwork.Figure 1Characteristic V-I curve for a P-Njunction diode.Semiconductor DeviceMeasurementsA CCS is ideal for testing currentcontrolleddevices, particularlybreakdown voltages of transistorjunctions, since manufacturersspecify breakdown voltages at aconstant current. And small-signalH-parameter measurements requireyou to supply the transistor with aconstant DC bias current upon whichyou superimpose AC modulation(see Table 1).However, youcannot measureall semiconductorparameters with aCCS. Collector leakagecurrent (I CEO )and emitter-base cutoff current (I CBO )require a constant voltage, which isdifficult for a CCS to supply. Even ifyou could measure these parameterswith a CCS, their currents areLilliputian (for small signal transistors,I CEO is usually less than amicroampere, and I CBO is often only afew nanoamperes).Diode Forward Voltage DropLet’s begin simply by measuringa diode’s forward voltage drop.Figure 1 shows a typical diode’s(P-N junction) characteristic.Manufacturers’ data sheets usuallyspecify the maximum forwardvoltage drop, V F , at several forwardcurrents, I F . Figure 2 shows thesetup. Note that different forward52 May 2006ParameterAlternateSymbolsDefinitionTypicalValueh ie h 11 , rInput impedance (v be /i b ),n output short circuited.2 kilohmsh re h 12 , μReverse voltage amplificationfactor (v be /v ce ), input 5 x 10 -4open circuited.h fe h 21 , β Forward current gain (i c /i b ),output short circuited.100h oe h 22 , gOutput admittance (i c /v ce ),o input open circuited.10μmhosTable 1. Definitions of small signal transistor H-parameters.


Constant Current SourcesFigure 2Basic set up for measuring thecharacteristic V-I curve for a P-Njunction diode.currents move the measuring pointalong the characteristic curve pointsA, B, and C in Figure 1.Diode Reverse Breakdown VoltageManufacturers’ data sheetsspecify a diode’s minimum reversebreakdown voltage (B V ) at a fixedreverse current. As with forwardvoltage drops, you measure thisparameter by simply applying aconstant current through the diode inthe reverse direction and measuringits voltage drop. The setup shown inFigure 2 is the same as for measuringthe forward voltage drop; just reversethe diode.You are non-destructively measuring“breakdown” voltage when youuse a CCS for this test. The breakdownvoltage in Figure 1 is at the beginningof the avalanche region. Largechanges in reverse current in thisregion result in only very smallchanges in reverse voltage. If youwere using a constant voltage source,a very small change in output voltagewould increase the reverse current(and power dissipation) until thediode failed. By using a CCS, however,you control current as the variable,not voltage.When you make the measurement,vary the diode’s current tomove the operating point as inthe forward voltage measurementexample, but in the reverse direction.Since the leakage current — seeFigure 1 again — is so small (oftenless than one microampere for siliconsignal diodes), you will rapidly crossthe almost-horizontal portion of thecharacteristic as the output of yourCCS increases from zero. Increasingthe current output above severalmicroamperes causes the measuredreverse voltage to increase veryslowly. When you observe this, itdefinitely indicates that the diodeis operating in the breakdownavalanche) mode.You can measure zener voltagewith this same procedure, sincezener voltage is simply the reversebreakdown voltage of a diodedesigned to be operated in thezener or avalanche region.Manufacturers’ data sheets usuallyspecify this parameter either at thetest current that dissipates 25% ofthe maximum ratedvalue for non-temperature-compensatedzener diodes, or at thecurrent causing a minimum voltagetemperature coefficient for reference(temperature-compensated)zener diodes.Diode Temperature CoefficientUsing a temperature-controlledoven, repeat the procedures fordetermining the forward (or reverse)voltage temperature coefficient ofa diode (or any other component).Place the diode in the oven (the CCSis outside the oven) as shown inFigure 2, and vary the temperatureover your desired range. Record thevoltage at each desired temperaturesetting. Allow enough time for thediode junction temperature tostabilize before taking anothervoltage reading. The forward voltagetemperature coefficient of siliconsignal diodes is typically 2 mV/°C.Typical temperature coefficients ofFigure 3Tektronix' fully-programmable 370B and 371Bdigital curve tracers for characterization and testof semiconductor components.May 2006 53


Constant Current Sourceszener voltage vary from 25 mV/°Cto essentially zero for referencediodes.V-I Characteristics of anySemiconductorYou can capture the entire V-Icharacteristic of any semiconductordevice, linear or non-linear.Using the methods describedabove of supplying a known currentand measuring voltage dropacross the device, take measurementsat numerous current levels.Instead of measuring two specificpoints on the characteristic ofe.g., a transistor, you can remotelyprogram a CCS’s meter terminaland connect it to your PC.There are commercially availableprograms that will dump thiscollected data into a spreadsheetand render a colorful plot.You’ll then have the basis of a54 May 2006Figure 4Test set up formeasuringtransistor collectorcurrent breakdownvoltages BV CEO ,BV CER , BV CES , andBV CEV (in ascendingorder), seeswitch position.semiconductorcurve tracer,similar to thesophisticatedTektronix modelsshown inFigure 3.Transistor Junction ReverseBreakdown VoltageFor a transistor junction (e.g.,the base-emitter junction), you canmeasure the breakdown voltage asfor a diode. Transistor data sheetsspecify BV EBO , the emitter-to-basebreakdown voltage with thecollector open, at a constant current(typically 100 μA). You can set thiscurrent on your CCS, and the breakdownvoltage (typically less than 10V for low-power silicon transistors),and read it directly from thevoltmeter connected to the meterterminal on the CCS. Similarly, youcan measure BV CBO , the collector-tobasebreakdown voltage with theemitter open. Typical values varywith devices selected for specificapplications.The most common breakdownvoltage is the collector-to-emittervalue. There are four differentcollector-emitter breakdownvoltages that you can measure,depending on the base connection.In order of increasing magnitude,these are: BV CEO (base open), BV CER(base connected to the emitterthrough a resistor of value R), BV CES(base shorted to the emitter), andBV CEV (base reversed biased withrespect to the emitter by voltage).Figure 4 shows a simple setupfor determining these voltages.Manufacturers usually specify thesebreakdown voltages at a highercollector current than the BV EBO andBV CBO specifications, typically 1 mA,in order to avoid problems withleakage-current multiplication.Transistor DC (Static) CurrentTransfer RatioThe most frequently usedtransistor parameter is the forwardcurrenttransfer ratio. This ratiomeasures a transistor’s gain (amplificationfactor). Manufacturerscommonly specify this ratio for twodifferent transistor connections:common emitter and common base.You can easily measure both using aCCS. This section describes thecommon-emitter transfer ratio (h FEor β) and the common-base transferratio (h FB or α).You can measure these on eithera qualitative or “pass-fail” basis. Bothuse virtually the same test setup,shown in Figure 5. In both cases,CCSs supply the base and collectorcurrent for the transistor. On transistordata sheets, manufacturersusually specify β at given collectorcurrents and collector-to-emittervoltages. Therefore, you need to setthe collector current for the specifiedI C , and adjust the base current untilV CE (displayed by the voltmeterconnected to the meter terminal ofyour CCS) reaches the specifiedvalue. You first measure the currentsupplied from the base CCS, thenyou calculate β by dividing the setcollector current by the base currentTest set up for measuring transistorcommon emitter DC current transferratio and junction saturation voltage.Figure 5


Constant Current SourcesFigure 6Test set up for measuringpotentiometer effective runningresistance.you measured.For small signal transistors, I C istypically 1-2 mA, and β ranges from20-400. For a typical β of 100, thebase current will be 10-20 μA. Butthis is too small for you to readaccurately from the CCS’ front panelmeter. You must measure this currentwith either a series ammeter(see Figure 5) or a small currentmonitoringresistor and a voltmeter.“Pass-fail” measurements are moresuited to production environments,but can follow this procedure too.The collector-to-emitter voltage thenbecomes the measured variable. Ifthe V CE you read on the meter isless than or greater than the testspecification, β is greater or less thanrequired, respectively.Transistor Junction Saturation VoltageVCE (SAT) is the voltage from thecollector to the emitter for a given I Cand I B while biased in the collectorsaturation region. The measurementof this parameter uses the setup inFigure 5. Set the specified base andcollector currents on the CCS andread VCE (SAT) directly from the voltmeterconnected to the CCS’ meterterminal. Typical values of VCE (SAT) forsmall-signal silicon transistors rangefrom 0.1-0.5 V.Component TestingElectrolytic CapacitorsElectrolytic capacitors are difficultto measure due to their effectiveseries resistance. This resistanceis dominant at higher frequencies,making an AC bridge measurementalmost useless. The Capacitancesidebar gives the definition of acapacitor.If you apply a constant current toa capacitor, the measured time for thevoltage across the capacitor to risefrom zero to its rated value is proportionalto the capacitance. (Anordinary DC power supply would notsupply a constant current, but ratheran exponential one! Therefore, itwould charge the capacitor accordingto the well known RC time-constantpattern in which, after five timeconstants, the capacitor would beover 99% fully charged.)Before you make this measurement,operate the capacitor for a fewminutes at its rated voltage to insurethat it is well formed, then shortcircuit it with a 1 kΩ resistor toground for at least 30 seconds. Thisminimizes leakage current in thecapacitor during the value measurementcharging cycle. The longdischarge period guards againstpolarization that often results inslight “re-volting” after a shortdurationshort circuit. Depending onthe value and rated voltage of thecapacitor under test, and themagnitude of the applied current,the measured time can vary from1-60 s. Using the equation in theCapacitance sidebar, with a 2,000 μF,50 VDC electrolytic capacitor and acurrent of 1 mA, the interval wouldbe (2 x 10 -3 F x 50 V) / 10 -2 A = 10 s.Relays and Analog MetersPull-in and drop-out currentsare important values for relays.These current values, normallyspecified at room temperature, takeon added significance at elevatedtemperatures because they may besignificantly different due tochanges in coil resistance. You candetermine these values by notingthe constant currents at which therelay armature pulls in and dropsout. The former value is always higherthan the latter.You can perform four tests onanalog meters using a CCS: (1) accuracy,(2) movement freedom, (3) midscalelinearity, and (4) temperaturecoefficient. First, you can use a CCSto accuracy measure and calibratemeters. Second, you can slowly varythis constant current from zero to thefull-scale value and sweep the pointerover the entire scale, ensuring themeter movement does not stick orencounter other mechanical difficulties.Third, you can set the meter toexactly full scale with a CCS and thenreduce the current by exactly half, tocheck mid-scale linearity. Finally, youcan check the temperature coefficientwith a temperature-controlledoven.This last parameter is a functionof the wire used in the movement coil.Typically, meter coils are wound withcopper wire having a temperaturecoefficient of approximately 4,000ppm/°C. You can also perform all ofthese — except (2) — on digitalmeters, as well.CapacitanceDefinition of a capacitor: Acapacitor has a value of one faradwhen a voltage change of one voltper second across it produces acurrent of one ampere.I = C ΔV / ΔT, that is, one ampere= one farad times the change involtage divided by change in timeMay 2006 55


Constant Current SourcesMost oscilloscopes can onlymeasure single-ended voltagesreferenced to earth ground. Internalprobe wiring connects the referencelead to the BNC’s shell. This ensuresthe scope probe’s reference lead iselectrically common to the scope’schassis. The power cord’s groundconductor further connects thechassis to earth ground. In mostmeasurement applications, singleendedmeasurements are acceptable,but not always.Measuring voltages that arenot referenced to ground, such asthe voltage across the switchingdevice in a switching power supply,is an application requiring differentialmeasurements. Examplesinclude balanced signals requiringequal impedance source andreturn paths. Applications includePotentiometersObviously you can check thebasic resistance value of a potentiometer,but the effective runningresistance (wiper noise) is another,more specialized, parameter. Thisparameter is the contact resistanceof the wiper touching the resistanceelement. Figure 6 shows thesetup. Apply a constant currentthrough portion “A” of thepotentiometer, producing a voltagewith respect to ground (seen at theA potentiometer (pot) is anelectro-mechanical transducer. Asyou rotate it, a change of resistanceoccurs. With connections only atone end and its wiper, it is arheostat — or essentially a variablewire-wound resistor. Historically,variable resistors emerged aseither blocks of carbon (or otherresistive material) with a slidingcontact. Modern pots have 270degrees of rotation. Connectionson both ends and the wiper constitutea true pot configuration.A pot’s taper is crucial. The vastmajority of pots are linear, that is, ifyou rotate them one-third of theirtotal rotation, the change in resistancewill likewise be one-third of itsOscilloscopesPotentiometerstelephone lines, read channels inmagnetic-storage systems, andsome digital-communication systems.To dramatically demonstratethis, we’ll make a measurementnot involving ground — a true“differential” measurement!Sometimes, you should makedifferential measurements evenof ground-referenced signals.Because the scope-probe referencelead is grounded, attaching it to acircuit creates multiple groundpaths, otherwise known as aground loop. Magnetic fieldsradiate from current that passesthrough circuit conductors. Passingthese currents through the groundloop induces circulating currentsin the loop. These currents caninterfere with the circuit operationand corrupt measured waveforms.“plus” input to the horizontalamplifier) that has magnitudeproportional to the sum of the “A”portion resistance and the wipercontact resistance. The “minus”input of the horizontal amplifiersees only the voltage drop acrossthe wiper contact resistance (notethat no current flows through the“B” portion of the potentiometer).Subtract this voltage from thevoltage at the “plus” input by virtueof the differential input, leaving atotal resistance. However, there arenon-linear or “logarithmic” taperedpots. These are used, for example, inaudio applications, because our earhas a logarithmic response to soundpressure. A stereo’s volume controlshould provide a smooth transitionfrom soft to loud, and that’s what an“audio tapered” pot gives you.A pot also has a dielectricrating that is a measure of the insulationof the pot’s “internal works”to its body. This becomes crucialif you connect the pot to an ACwall outlet with non-isolatedequipment. An example of this isan AC lamp dimmer. The dielectricrating for a pot connected to an ACoutlet should be at least 3 kV.voltage applied to the horizontaldeflection plates that is proportionalonly to the percent rotationof the potentiometer.The single-ended vertical amplifier,connected to the horizontal“minus” input, also sees only thevoltage drop across the wiper contactresistance. The resulting display onthe oscilloscope screen is a spot thatmoves horizontally as you turn thepotentiometer clockwise, and verticallyin proportion to the effectiverunning resistance.Select amplifier sensitivitiesthat will keep the spot on-screen.For example, for a horizontal deflectionof 10 cm with an applied currentof 1 mA, the horizontal amplifiershould be set to (0.1 V/cm) / 1 kΩ ofpotentiometer resistance. Since avertical deflection of 5 cm isequivalent to an effective runningresistance of 25 Ω, the verticalamplifier, in this case, should be setto 5 mV/cm.Other ApplicationsConstant current and electrochemistryare related by Faraday’slaws of electrolysis. Simply stated,these are:1. The amounts of primary productformed by electrolysis are directlyproportional to the amount of electricityflowing.2. The passage of a given quantity ofResources1 www.evaluationengineering.com/archive/articles/0396wafr.htm is an excellent explanation ofLow-Current Probing, as requiredwith submicron device technologyICs today.2 www.mt.com/mt/resourcedetail/articles.jsp?m=t&key=E3Mjg4NjM1Mz is an excellent source oncoulometric titration.3 www.epsilon-web.net/Ec/manual/Techniques/CPot/cp.html isan excellent introduction tochronopotentiometry.56 May 2006


Constant Current Sourceselectricity causes the amounts ofprimary products formed byelectrolysis to be in the ratios ofthe chemical equivalents of thoseproducts.The basic unit used for “amountof electricity flowing” is the coulomb.One coulomb is a current of oneampere flowing for one second. Thecurrent is the parameter of interest inmany electrochemical processes, anda precision CCS makes precise currentcontrol very simple.The most common electrochemicalprocess using constant current iscoulometric titration 2 . This analyticprocedure involves removing oneconstituent of a solution by quantitativeelectrolysis. It measures theamount of a substance in a solutionby measuring the number ofcoulombs (current magnitude timeselapsed time) required to completelytitrate the solution. One limitation ofElectrogravimetryElectrogravimetry is aninterference-removal techniqueusing two or three electrodes. Youapply a constant current to thepre-weighted, working electrodeand this electric current depositsa solid onto an electrode fromsolution. Normally, the deposit isa metallic plate formed by metalions in the solution.LeCroy DXC100 differential probes.Figure 9this procedureis that it mustbe 100% currentefficient:all the currentp a s s i n gFigure 7Oscilloscope amplifiers and passive probes are not preciselymatched for higher frequency gain (or attenuation), andthere are no provisions for fine adjustment of DC attenuationor precise alignment of time constants (AC compensation),CMRR above a few kHz will be very low. Measurements suchas high-side gate drive measurements become impossiblein high common mode voltage situations. The figure on theleft shows the high side gate measured without a differentialamplifier, the figure on the right catches the "ringing" byvirtue of the differential amplification of the entire signal.Figure 8LeCroy DA1855A differential amplifier.through thecell must beconverted intoelectrolyticproduct with no losses.Electrogravimetry and precisionelectroplating are two other electrochemicalapplications using constantcurrent. The former process, similar inend result to coulometric titration, is amethod of analytically determining theamount of a substance in a solution bydeposition onto a weighed electrode.In the latter process, you plate an electrode(such as that used in a pacemaker’simplanted catheter) with a thin metalfilm of precisely known thickness.Additional applications of constantcurrent in the electrochemicallaboratory include chrono-potentiometry3 (a mass transfer techniquefor determining the concentration of asubstance in a solution) and electrodekinetics (the study of the actualatomic mechanisms of electrochemicalreactions). NVDigital StorageOscilloscopesDigital Storage Oscilloscopes(DSOs) are virtually the only scopemanufactured today, yet they lackZ-axis (intensity) modulation and theability of analog scopes to makethe differential measurements thatFigure 7 requires. LeCroy, a leadingDSO manufacturer, addressed thisproblem with a differential amplifierand probe (see Figures 8 and 9). TheDA1855A is a stand-alone, high-performance100 MHz differential amplifier.It acts as a signal-conditioningpreamplifier for oscilloscopes andnetwork and spectrum analyzers byproviding differential measurementcapability to instruments havingonly a single-ended input.May 2006 57


Cutting edge products to quickly solve your toughestdesign and measurement problems!Polystyrene CapsEXFA - precision polystyreneCaps for ultra-low loss, excellentstability. 47 – 8200pF.Great for audio, no need toredesign existing products!Better than teflon, polypropylene.less than $1!USB-inSync LoggerRH-02 / PT104RH-02 - Temperature andHumidity Logger for PC.PT104 - High resolution andaccuracy. Platinum sensors.USB powered - no powersupply required. Free s/ware.from $320.99/643.60!FATfile StorageTouch-sensing ICsQuantum ICs- World-beating capacitive sensorICs for switching and control with patented featureslike Adjacent Key Suppression,Spreadspectrum, adjustable sensitivity. QRG ICsin use worldwide by the world’s largest consumer/appliancemanufacturers


WE CAN MAKE THIS BOARD,HOWEVER, OUR PCB ORDERS START AT ONLY $ 50CSR Bluetooth ModulePIC Programming Made Easy!Proton+ PICBASIC Development Suite3mil Track0 .1mmBlind Via0 . 5mm BGA Edged Half HolePlannar AntennaIn the past 12 months,our PCBs have beenshipped to 36 countries.The largest order:2360 square metersThe smallest order : 5pcs 0 . 4 " x 0 . 4 "2L2L: $50, 5pcs , 4 " x4"


SHOWCASEPRINTED CIRCUIT BOARDSQUALITY PRODUCTFAST DELIVERYCOMPETITIVE PRICING* UL approved* Single & Double sided* Multilayers to 8 layer* SMOBC, LPI mask* Reverse Engineering* Through hole or SMT* Nickel & Gold Plating* Routing or scoring* Electrical Testing* Artwork or CAD data* Fast quotesWe will beat anycompetitor’s prices!!!10 pcs (3 days)1 or 2 layers $24910 pcs (5 days)4 layers $695(up to 30 sq. in. ea.)includes tooling, artwork,LPI mask & legend9901 W. Pacific Ave.Franklin Park, IL 60131Phone 847.233.0012Fax 847.233.0013Modem 847.233.0014yogii@flash.net • flash.net/~yogiiSite: www.vandvmachy.comemail: victor@vandvmachy.comUSA Office: Blink Manufacturing 14019 Whispering Palms Dr.Houston, TX 77066, PH. 281 397 8101, Fax. 281 397 6220.Mexico Plant: Marketing Tech. De Mex. SA de CV. Alamo 93Cuarto Piso, Santa Monica, Tlal. Edo. De Mexico, 54040Tels. 011 52(555) 314 5325 & 011 52(555) 360 3648Fax. 011 52(555) 361 5996.


“It’s not science fiction anymore!”by James L. AntonakosPopular culture was recently taken for a wild ride in the three Matrix movies, whereNeo and his band of survivors plugged their brains into the computer-controlledMatrix to battle evil and save the world. In Minority Report, three ‘PreCogs’ have theirbrains wired up to record crimes that occur in the future. Science fiction has longbeen fascinated with the idea of tapping into the human brain.The photo above is a computer rendering of theCerebus device done by one of its designers, Scott Eaton.


Date62 May 2006Milestone1808Franz Gall publishes work on Phrenology — a now discreditedscience for measuring brain capacities.1848Phineas Gage has an iron rod blown into his brain during anaccident, and lives, with profound personality changes.1891 Wilhelm von Waldeyer coins the term neuron.1936 First lobotomy performed in the US.1953 Rapid Eye Movements (REM) discovered.1981Roger Sperry awarded Nobel Prize in Physiology for his discoveriesin the functional specialization of the cerebral hemispheres.2004FDA approves clinical trial of brain implant developed byCyberkinetics, Inc.TABLE 1. Timeline of brain research milestones.Brain FingerprintingA technique to measure brainresponse to crime-relevant stimulus.Closed-Loop SystemA system that uses feedback to send aportion of the output signal back tothe input. The output influences whatthe next output will be.EEGElectroencephalogram — patterns ofelectrical brain activity that canbe sensed on the scalp. Also calledbrainwaves.EEG BiofeedbackProcess where an individual trains theirbrain by watching their own EEG brainwaves.Also called brainwave training.Galvanic Skin Response (GSR)Changes in the electrical properties ofIn1972, Michael Crichton’s TheTerminal Man explored the use of abrain implant to treat a patientsuffering from blackouts. The 1991 StarTrek: The Next Generation episode TheNth Degree had a crew member constructa holographic interface to connecthis brain to the ship’s computer.Brain interfacing technology hasgone from science fiction to the realworld. Already there are many companiesoffering hardware and softwareproducts for making the brain connection.Educational institutions areperforming research,medical researchersare devising ways toassist the differentlyabled,and securityprofessionals are usingbrain fingerprintingtechniques to helpassess an individual’sTermsFigure 1. Invasivebrain implant.Image courtesy ofCyberkinetics, Inc.the skin due to anxiety or stress.Invasive Brain ProcedureA brain sensor is medically insertedinto the body.MERMERMemory and Encoding-RelatedMultifaceted ElectroencephalographicResponse — a wavelike response generatedby the brain during recognition.NeuronOne of billions of brain cells thatuses electrochemical signals forcommunication.Non-Invasive Brain ProcedureA brain sensor is attached externally.P300 ComplexA group of well-known brainwavecomponents that can be measured.PatternNameFrequencyRange (Hz)ActivityRepresentedDelta 1-4 Deep sleepTheta 4-8 Normal sleepAlpha 8-13 AwakeBeta 13-30PossiblymedicatedTABLE 2. Classificationof EEG patterns.state of mind.Searching on Yahoo! for thewords brain computer interface yieldsover 770,000 web pages. Clearly, thereis a good deal of interest in thissubject and its related offshoots. Abrief history of milestones in brainresearch are listed in Table 1.The purpose of a brain-computerinterface is to tap into the electricalsignals that are generated by thebrain. Where do those signals comefrom? There are hundreds of billionsof cells in the human brain, calledneurons, with a myriad number ofinterconnections with each other. Theneurons communicate using electrochemicalscalled neurotransmitters.Groups of neurons fire together tocontrol some action in the body (orguide some other brain process).The use of charged ions in thechemical reactions accounts for theelectrical activity that can be measuredand acted upon. The waveformsgenerated by the brain (called brainwaves)are classified into several differentcategories, depending on whatthe brain is doing. Each category hasits own frequency range and characteristics.Table 2 lists the brainwavecategories, which are also called EEGwaveforms or EEG patterns.There are essentially two campsin the BCI world: those that utilizeinvasive brain technology and thosethat use non-invasive technology. Thegoal of both technologies is to sensebrainwaves. An invasive brain sensorconsists of one or more electrodessurgically inserted under the scalp ordirectly into the brain. Figure 1 showsone type of invasive sensor, atwo-dimensional array measuring twomillimeters on each side, containing100 miniature electrodes.Note that brain implants areused for long-term monitoring. Anon-invasive sensor is simply placedonto the scalp (using an appropriate


Figure 2. EEG brainwave activityof a 22-year old subject duringa short question-answer period.The displayed activity spans 10seconds. Image courtesy ofPersyst DevelopmentCorporation.conductive gel). For long-term monitoringwith this type of sensor, theconductive gel contains an adhesive.Both types of sensors transmit electricalactivity to a computer or monitoring/recordingdevice, where it is digitizedand analyzed. This leads to aninteresting question: How fast shouldbrainwave information be gathered?The answer depends on the frequencycharacteristics of brainwaves, whichchange according to our activities.One BCI system samples thebrainwave signal at a rate of 128 Hz.Using sampling theory, this samplerate guarantees accurate sampling offrequencies up to 64 Hz. Anothersystem samples at 240 Hz, giving a120 Hz maximum signal rate.Compare these frequency samplinglimits with the various EEG patternslisted in Table 2.From the frequencies shown inTable 2, we realize it does not require aFlash A/D converter to accurately samplean EEG waveform. Furthermore,with such a low-frequency informationsignal, the computer is able to performreal-time analysis of the waveform,look for trends in amplitude change orother rhythms, and adjust the overallsystem accordingly.The Insight II software fromPersyst Development Corporation isone application that allows EEG displayand analysis of captured brainwaveactivity. As shown in Figure 2,multiple brainwaves can be displayedsimultaneously, as they might havelooked on an analog chart recorder.Figure 2 illustrates an importantproperty: the brain-computer interfaceis bi-directional! We do not justsiphon data from the brain, butinstead use the brain information tocraft a feedback stimulus. In Figure 2,the stimulus is the question beingasked and the feedback is thesubject’s response.In another example, suppose apatient is trying to train her brain tomove the cursor left, and it movesright instead. The patient needs toknow that. Typically, the patient’ssight would tell her if the cursor ismoving in the correct direction. Butwhat if she was blind, or visuallyimpaired enough to not see thecursor move? Some other kind offeedback will need to be used (suchas an audio indication).We may even send signals backinto the brain to stimulate it. Sincethe mid-1800s, brain researchers haveknown which portions of the brain areresponsible for movement. Byimplanting an electrode in the areathat controls muscles in the legs, forexample, the leg is caused to move byapplication of an electrical stimulusto the brain.Figure 3. Analysis of EEGresponse. Note the wide numberof options for frequencyanalysis. Image courtesy ofPersyst Development Corp.May 2006 63


Figure 4. Graphical display offrequency patterns within thebrain in response to a strobelight stimulus. At right in theanalysis window are fourviews of the frequency patternslooking down into the brainfrom the top of the head, withthe eyes pointing north. Imagecourtesy of PersystDevelopment Corporation.Research into the medicalaspects of the brain-computerinterface is wide ranging and popular.The web is filled with research paperswith titles such as:• Improving Transfer Rates in BrainComputer Interfacing• The Berlin Brain-Computer Interface(BBCI): Towards a NewCommunicationChannel for OnlineControl of MultimediaFigure 5. Closed-loopfeedback system witha human in the loop.Applications and Computer Games• On the Possibility of Developing aBrain-Computer Interface (BCI)• The use of the P3 Evoked PotentialComponent for Control in a VirtualApartment• Brain-Computer Interface inMultimedia CommunicationSome of this research is directedinto the security aspects of brain activity.For example, it is well establishedthat, upon seeing a familiar scene orhearing a familiar sound, the brainemits a wavelike response called theP300 Complex (part of the larger MER-MER response) 300 to 800 millisecondsafter the brain has been stimulated.This response has already beenused in a court of law to establish thatthe wrong person may be locked upfor a crime, since his brain responseindicates no recognition of the crimescene. This new science is called BrainFingerprinting. You can expect it to beas controversial as DNA evidence onceit becomes standard practice.Want to start experimenting withyour own brain? For as little as $20,you can start with a simple combinationstrobe light/sound machine. Amore advanced device — the ProteusSound and Light Machine — generatespulsing colors and stereo sound,and contains a biofeedback interface.There are plenty of personalbiofeedback devices on the market(referred to as mind machines). Thesedevices typically measure GalvanicSkin Response (GSR) — changes inthe skin’s resistance due to biologicalfactors caused by stress and anxiety.64 May 2006Figure 6. Mental Gamessoftware. Screenshot courtesyof iProducts.ws


Figure 7. Mental Gamessoftware. Screenshot courtesyof iProducts.wsThe sensors attach to the palms orfingertips of the user’s hands. For$100 to $200, you can choose from alarge variety of quality products.The ThoughtStream BiofeedbackSystem is one such product, providingaudio and visual feedback in responseto GSR changes in the user. To enhancethe training experience, the ThoughtStream allows the user to create aclosed-loop feedback system using theThoughtStream and a PC, and specialsoftware called Mental Games.The ThoughtStream machineconnects to the PC via a serial cable.As the user watches the imagesproduced by the Mental Games software,changes in GSR are measuredby the ThoughtStream machine, fedto the PC through the serial cable,and interpreted by the software. Thisforms a closed-loop system, with thebrain-body inserted directly into theloop, as indicated in Figure 5.The ThoughtStream’s MentalGames software is psychointeractivesoftware designed to assist you intraining your mind. The gamesinvolve landing and navigatingspaceships in virtual environmentsand other time and space relatedactivities, as shown in Figures 6 and 7.Unless your situation is one ofmedical necessity, it is unlikely youwill be able to have a sensor installeddirectly into your brain (unless thebrain interface goes the way of the cellphone and comes with bonuses, suchas fingerprint forwarding and stimuluswaiting). However, if you are disabledor differently-abled, the hardware andsoftware tools are already out there tohelp you begin getting back some control.The capabilities go far beyondtwo-dimensional cursor control. Forexample, the CyberLink System (fromwww.brainfingers.com) has a softwaredevelopment kit that allows thepatient to develop new C++ or VisualBasic applications.Skip ahead to a future time whenelectronic instruments are so sensi-AcknowledgmentsI would like to thank Michael Guessof Persyst Development Corporationfor his illuminating discussions of thebrain and its behavior and his screenshotsof the Insight II software.I would also like to thank JamesQuick of iProducts.ws for his imagesof the ThoughtStream BiofeedbackSystem Mental Games software.References, Vendors, and Further ExplorationPatients Put on Thinking Caps,Wired Newswww.wired.com/news/medtech/0,1286,66259,00.html?tw=wn_story_top5Good story on how physical handicapsmay be overcome through abrain-computer interface.Cyberkinetics NeurotechnologySystems, Inc.www.cyberkineticsinc.comDevelopers of the BrainGateSystem which utilizes an implanteddevice to stimulate or record fromthe brain surface.Neural Signals, Inc.www.neuralsignals.comDevelopers of the NeurotrophicElectrode, which implants into thebrain. Software interface allowspatient to control the computer’smouse, enter text, browse theInternet, and control environmentalconditions.Wadsworth Centerwww.wadsworth.org/resnres/wolpaw.htmBrain-computer interface researchbased on non-invasive EEG recordingand analysis.PBS Website on the Brainwww.pbs.org/wgbh/aso/tryit/brainInteractive Shockwave demo allowsyou to explore the motor cortex ofthe brain.The Brain, V2.0www.vankuyen.net/brainGood reference on the brain and itscomponents.How the Brain Workshttp://keck.ucsf.edu/~paul/brain.htmlExcellent description of brain activity.EEG Spectrum Internationalwww.eegspectrum.comBiofeedback training for medicalpurposes.Persyst Development Corporationwww.eegpersyst.com/web/MagicMarker.htmlDevelopers of MagicMarker ICU andNeonatal EEG monitoring softwareand Insight II EEG Analysis software.IProducts.ws Cutting EdgeMerchandisewww.iproducts.ws/Distributors of the ThoughtStreamBiofeedback System and other MindMachines.May 2006 65


tive they can read your brainwavesfrom a distance. Perhaps thesesensors could be installed in the verywalls of our homes, in the dashboardsof our cars, or in drinking fountains.No more Social Security number,just a digitized brainwave signatureunique to your brain. No more creditcard at the checkout counter, just awave of a wand over your head. Thereis opportunity for abuse, there aresocial implications, and, for some,the very essence of a meaningful life,all wrapped up in the expandingbrain-computer connection. NVAbout the AuthorJames Antonakos is a Professor inthe Departments of ElectricalEngineering Technology and ComputerStudies at Broome Community College.You may reach him at antonakos_j@sunybroome.edu or visit his websiteat www.sunybroome.edu/~antonakos_j66 May 2006


As a designer of chemical sensors that monitor harmful gases, Ihave always been intrigued by nature’s ability to detect chemicalsat one-molecule-per-trillion concentration levels. Current chemicaland biological detection technology still pales in comparison to thereliable sensory system of a properly trained biological organism interms of sensitivity and selectivity to the molecule of interest.Canine units are invaluable tolaw enforcement agencies when usedto detect various types of contraband.They have also proven their worth inthe area of humanitarian de-miningefforts. Amazingly, a mine-detectiondog is capable of detecting the explosivechemicals that diffuse throughthe mine casing. However, the use ofmine-detection dogs is cost prohibitivefor the third-world countries thatmost need this technology.The use of whole organisms aschemical sensors is not a new idea ornovel concept. I wonder how manycoal miners managed to skip purchasingtheir halo early because of someunlucky canary in a cage. However, theintegration of organisms like rodentsor insects with off-the-shelf electronicsis a fairly new area of R&D. Scientistsand engineers have long recognizednature’s superiority in olfactory design,and the US government, specificallythe Defense Advanced ResearchProjects Agency (DARPA), under theControlled Biological SystemsProgram, has invested millions ofdollars in this area of research.Researchers at the University ofGeorgia and USDA Crop Managementand Research Laboratory, with fundingfrom DARPA, have trained a typeMay 2006 67


Figure 1. Wholeorganism sensor apparatus.References[1] D.M. Oson, et al., “Parasitic Wasps Learn to ReportDiverse Chemicals with Unique ConditionableBehaviors,” Chemical Senses, 28: 545-549, 2003.[2] G.C. Rains, G.C., et al., “Development of a programmablewhole-organism wasp sensor for monitoring cropconditions from volatile chemicals,” ASAE Paper No.003062 St. Josephs, MI, ASAE, 2000.[3] www.tifton.uga.edu/grains/main.html[4] http://beekeeper.dbs.umt.edu/~bees/science.html[5] J. Otto, et al., “Training Rats to Search forContraband Odors,” Applied Animal Behaviour Science,77: 217-232 (2002).of parasitic wasp species, Microplitiscroceipes, to detect various chemicalsincluding DNT, a common chemicalfound in explosives [1-3]. This particularwasp species owes its veryexistence to its ability to detectchemical cues in the environment inorder to increase foraging success.The key to developing a wholeorganismsensor lies in the oldpsychological methods of classicalconditioning or associative learning.Remember Pavlov’s salivating dogsfrom Psychology 101? Well, apparentlythis concept of associative learningworks just as well for wasps. Duringtraining, the wasps were presentedwith the chemical of interest whilefeeding on sugar water from a smallhole drilled in a Teflon plate. Afterdoing this a few times, the wasp learnsto associate the chemical with feedingon sugar water. After it’s been conditionedin this way, the wasp will go68 May 2006down a hole to feed whenever itsenses that chemical. Then, all youhave to do is add a light-emittingdiode and photo resistor in the hole todetect the presence of the conditionedwasp and you have a low-cost biologicaldetector. (See Figures 1 and 2.)The setup in Figure 1 and theelectronic comparator circuit inFigure 2 could easily be used for ascience project or for your ownindependent research in invertebratechemical communication. The comparatorcircuit can be adjusted usingthe variable resistance to set thevoltage reference. When the LED isblocked by a wasp exhibiting feedingbehavior (chemical detected), thevoltage at the non-inverting input ishigher than the reference voltage atthe inverting input, and thealarm (piezo-buzzer) sounds. Foryou BASIC Stamp aficionados, theversatile RCTIME command could beapplied to interfacea photo-resistor-plus-capacitorcombinationinstead of the opamp-comparatordetectorcircuitshown in Figure 2.The mostinteresting part ofthe University ofGeorgia researchis that the waspsappear to haveFigure 2. Whole organism detector circuit.some plasticity or flexibility in therange and number of chemicals theycan detect. This suggests their use asprogrammable sensors that can beused to detect numerous odors. Withthe high reproduction rates ofmost insects, you have the addedadvantage of selecting for the bestperforming individuals and after a fewgenerations, you have an almostfail-safe detector.Entomologists at the Universityof Montana have computerized beehives in an effort to collect environmentaldata [4]. The idea is to usethe bees as environmental sentinelsthat go out and forage in the environmentfor pollen while inadvertentlycollecting whatever residual pollutantsmay reside there. After foraging,the bees return to the electronic hive,where standard chemical samplingsystems are used to detect thevarious pollutants they have carriedback with them. This electronic hivesystem could potentially provide realtimeinformation on environmentalquality, help with ecological riskassessment, and be used to detectbiowarfare agents.Researchers have even gone asfar as recruiting rats to do the work ofFido in the detection of illegal drugs.It makes sense considering that theyare cheaper, smaller (which can be anadvantage when searching in tightspaces), and require fewer resourcesthroughout their life cycle than dogs.Research at Villanova University andthe University of Baltimore has shown


UPDATEDWEBSITE!the feasibility of using rats to detectcontraband [5]. The rats were taughtto rear on their hind legs uponidentification of contraband odors.During the research, the rats wereoutfitted with a miniature harnesswith motion sensors that signaled toa computer upon positive identificationof contraband.Now, I can deal with a Beagleor German Shepard sniffing myluggage, but a rat with a backpack? Ican’t help but smile when I thinkof a possible future with mobilecomputerized organisms doing ourbidding, acting as our eyes and ears(and noses) at the frontlines of abrave new world. NVwww.goldmine–elec.comNEW Features Include:Improved website navigationCreate your own personalised accountQuick Ordering for faster check outUpdated Shopping Cart featuresSuper Power White LED BlowoutSuper bright white LEDs feature T1 3/4(5mm) clear lens and over2000 MCD output. Thesealmost hurt your eyes to look at directly. Brandnew prime and offered at one of the lowest pricesavailable anywhere. Operates on 3 up to 3.5VDC.Current draw at 3.5VDC is 30mA.G15843 8/$1.00Factory Bag of 900G15912 $90.00Light Spider Robot KitThis amazing new robot usesits electronic brain tofollow or find alight source(such as a standardflashlight). Using its drive motors, theLight Spider will scoot across any smoothhard surface. Soldering required.C6886 $11.95 ea.120VAC Negative Ion GeneratorCompact negative Ion Generatorfeatures 7.5KV outputand operates from standard120VAC. Fully encapsulatedmodule is about 2” x1 5/8” x 7/8”. Brand new!G1783 $10.95 ea.6VDC Powerful Solar PanelThis 4 3/4” x1 3/4” x3/16” Thick solarpanel features an outputof 6VDC open circuitvoltage and a short circuitcurrent output of 100mA. Has 2 solder tabs with3” long insulated leads attached.G15555 $8.95 SALE! $7.95 ea.Sony® ACX705AKM Color LCD Module6.92cm diagnol reflective512 color LCD module. Featuresan active matrix thin fullcolor reflective TFT–LCDmodule with built in brightfront light unit and drivingboard. Total number of active dots= 115,200. See complete specs on internet!G13752 $19.95 ea.May 2006 69


NEWS BYTES■NEWS ■ INNOVATIONS ■ IDEASOH, AND YOUR JOBIS ON MARSA bird’s-eye view self-portrait ofNASA’s Mars Exploration RoverSpirit. (Photography courtesy ofNASA/JPL-Caltech/Cornell)On March 17, 2006, NASA namedJohn Callas as the project managerfor NASA’s Mars ExplorationRover missions. Callas is a scientist atNASA’s Jet Propulsion Laboratory(JPL) in Pasadena, CA.“It continues to be an excitingadventure with each day like a wholenew mission,” Callas said.That modesty is the epitome ofunderstatement. For example, one ofSpirit’s six wheels has stopped working.Dragging that wheel, Spirit mustsprint to a slope where it can catchenough rays to continue operatingduring the upcoming Martian winter.This period of minimum sunshine ismore than 100 days away, but Spiritgets only enough power for about onehour per day of driving on flat ground.And you think that your localrobot competition is tough?The best spot for Spirit’s “snowbird” migration is the north-facingside of McCool Hill, where it couldspend the southern-hemispherewinter tilted toward the sun justsoakin’ in the fun.Spirit is currently driving towardthe hill. It has approximately 120meters (about 390 feet) to go.Expected progress is approximately12 meters (40 feet) per day.Jeez, if only we could get someoneup there to push that thing, thatwould be great. Any volunteers?70 May 2006ONE OF THE SELECTNXT FEWLEGO Mindstorms NXT AlphaRex.(Photograph courtesy of© 2005 The LEGO Group)The LEGO Group has officiallyreleased background informationabout the selection process for itsnew Mindstorms® DeveloperProgram (MDP). First of all, if youweren’t selected, don’t feel slighted.According to LEGO, the MDP isan exclusive cadre of 100 enthusiastswho are now charged with “helpingguide the product developmentprocess for LEGO® Mindstorms®NXT, the next generation of LEGOrobotics.”A total of 9,610 robotics enthusiasts,ages 18 to 75 years of age andrepresenting 79 countries respondedto the one-month online applicationprocess that was sponsored by LEGO.A thumbnail view of the 100 selectedcandidates shows that:• Range in age from 18-75 (50% underage 35)• More than 20% work in thesoftware/QA/DBA sector• Nearly 20% are teachers oreducators• 13 are architects or engineers• 40% are from the USContributing Editor to SERVOMagazine, Dave Prochnow is one ofthe chosen few elected to the MDP.And, no, Dave isn’t the 75 year-oldMDP member, either. You can expectto see and read a lot of insider informationfrom Dave starting in the NXT,err, next issue of SERVO Magazine.BUGS AWAYHave you ever thought that youcould talk to the animals? Maybeeven control the flight paths ofbutterflies? Well, Dr. Dolittle, UncleSam wants you.On March 9, 2006, the DefenseAdvanced Research Projects Agency(DARPA) website posted a presolicitationnotice for requesting researchproposals in the area of Hybrid InsectMicro-Electro-Mechanical Systems(MEMS).So funny that it’s scary, the noticestates: “DARPA seeks innovativeproposals to develop technology tocreate insect-cyborgs, possiblyenabled by intimately integratingmicrosystems within insects, duringtheir early stages of metamorphoses.“Once these platforms are integrated,various microsystem payloadscan be mounted on the platformswith the goal of controlling insectlocomotion, sense local environment,and scavenge power.”So what did noted bug botbuilder Mark W. Tilden say about thisproject? According to Tilden, “Wetried this for years and found thatgiven perfect digital control, anorganism will still do as it damn wellpleases.”Got a hankering to bug a bug, getcracking, the “original response date”for your proposal submission is June05, 2006.You can learn more about thisopportunity from the DARPA website,just look for solicitation BAA06-22 at:www.darpa.mil/baa/baa06-22.htmlSHAMEFUL DISPLAYOF ROBOT ABUSEThis just in from iRobotCorporation Chairman and co-


founder, Helen Greiner, PhillipTorrone was spotted in Texas recentlydis-ing a Roomba. Along with fellowtechno-lackey, Limor Fried, they didwillingly and without regard forproper traffic right-of-way laws hack aRoomba floor vacuum robot into apale representative of the centralcharacter in the video arcade game,Frogger.While the Bluetooth interface onthe Roomba does have merit (Hey,Phillip, fame awaits you; SERVOMagazine is still waiting for an articleabout this interface), the lameFrogger suit adds insult to theinevitable Roomba injury.Refer to the CNET News websitefor all of the gory details:n e w s . c o m . c o m / 2 3 0 0 - 1 0 4 1 _ 3 -6049976-1.html?tag=ne.gall.pgSPEAKING ABOUTMOWINGwatch for our upcoming article inSERVO Magazine about buildingyour own robotic lawn service for lessthan $200.KAMEN’S LATEST KAPERYou really gotta love a guy likeDean Kamen. Rather than sittingaround on his laurels, Mr.Segway is always hard at work tryingto improve our daily lives. In hislatest venture, Kamen has reacheddeep into his toolbox for a couple ofengineering marvels which he hopeswill alleviate the worldwide shortageof clean drinking water and bringelectricity to the world’s poorestpeople.Kamen’s two latest inventions area water purification system that hecalls Slingshot and an electricity-Friendly Robotics RL800 Robomower(Photograph courtesy ofFriendly Robotics®)Looking at a Roomba, wouldn’t itbe great if you could buy a robotthat could mow your lawn as good asRoomba vacuums your floors?Co-founded in 1995 by Udi Pelessand Shai Abramson, FriendlyRobotics® (formerly known asFriendly Machines) markets a line ofgrass cutting robots calledRobomower®.Probably the best knownRobomower is the RL800. This modelcan be purchased directly fromEarth’s most popular dealer:Amazon.com. Priced at $1,195.99, theRL800 might not fit into every homeowner’sbudget.If you’re looking for a little moredown-to-earth robotic lawn mower,May 2006 71


Turn Your PC into a Real-TimeAudio Spectrum AnalyzerFeaturesFFT to 1048576 pts24 bit, 192kHz1/96 OctaveDual Channel3-D Surface PlotSpectrogram PlotDigital FilteringSignal GenerationRT-60, Leq, DelayTHD, IMD, SNRDDE, LoggingVibration AnalysisPHSSpectraPLUS 5.0FFT Spectral Analysis SystemDownload 30 day FREE trial!www.spectraplus.com72 May 2006Starting at $295Pioneer Hill Software24460 Mason RdPoulsbo WA 98370360 697-3472 voice360 697-7717 faxpioneer@telebyte.com■ NEWS ■ INNOVATIONS ■ IDEASgenerating Stirling engine that produces one kilowatt ofelectricity from cow manure.But Kamen doesn’t want to fly solo on this venture.He’s enlisting entrepreneurs like the founder of aBangladesh cell phone company, Iqbal Quadir, to help withthe business model.Quadir’s model follows a similar one that hedeveloped for his cell phone company. How do you bringcell phone technology to villagers who are too poor to owna phone? Quadir used a “micro-credit” program where oneperson designated the “village entrepreneur” is given aloan for the cell phones and service.This village entrepreneur then sells the service on a“per call” basis to any villager who needs to reach out andtouch someone.Does this micro-credit approach work? According toQuadir, there are over 200,000 village entrepreneurs participatingin his cell phone business model. Now he wants todo the same with electricity and that’s where Dean Kamencomes in.Together the entrepreneur and the engineer haveformed a company called Emergence Energy. Supportedwith funding from The Lemelson Foundation, EmergenceEnergy is evaluating this same micro-credit model as ameans for bringing energy production to villagers inBangladesh.Based on Kamen’s own brilliantStirling engine design, thesemicro-power plants will utilize threevillage entrepreneurs instead of thesingle one used in the cell phonebusiness model. In this model, onevillager acquires the fuel (cowpoop), another sells the electricity,while the third one sells light bulbs.Ya gotta love being the “”cow dung”entrepreneur.While not exactly integrated withthe electricity production model,Kamen’s water purification systemcould work in concert with theStirling engine. Slingshot works byvaporizing water from sewage andseparates the clean water from theleftover waste. This waste could thenbe used, in turn, to fuel the Stirlingengine.All of this benevolence doesn’tcome cheap, however. The testStirling engines cost $100,000 tobuild. The goal of Emergence Energyis to lower that price into the $1,000to $2,000 ballpark. Once this pricepoint can be achieved, Quadirbelieves that he can market 500,000power plants in Bangladesh, alone.Let there be light. NV


Free 410+page CatalogAll pricesin USDRe-Map Your Fuel CurveAfter Upgrading Injectors!KC-5385 $50.95 + post & packingA huge revolution in Do It Yourselfautomotive modifications has occurred.This project allows you to re-map yourair/fuel ratio throughout the entire loadrange. One use for this is upgrading yourfuel injectors, then re-mapping the fuelsupply to eliminate the need for newengine or fuel management systems. Itoffers incredible mapping resolution, andfeatures rival many commerciallyavailable units costing hundreds of dollarsmore! Kit supplied with PCB, machinedcase, and all electronic components.Programmed via Digital Hand Controller(KC-5386 shown on right).Lead-Acid Battery Zapper KitKC-5414 $23.25 + post & packingThis simple circuit is designed to produce bursts ofhigh-energy pulses to help reverse the damaging effectsof sulphation in wet lead acid cells. This is particularlyuseful when a battery has been sitting for a period oftime without use. The effects are dependant on thebattery's condition and type, but the results can be quitegood indeed.Kit supplied with case, silkscreened lid, leads, inductors,all electronic components,with clear Englishinstructions.LCD Digital HandControllerKC-5386 $37.95 + post & packingNot only can you re-map yourinjectors with the kit to the left, it alsosuits other projects we offer such aselectronic boost controllers, additionalinjector controllers, and more!You can program the kit then removeit, or leave it connected for real timedisplay. Kit supplied with PCB,silkscreened and machined case, LCD,and all electronic components.Log on towww.jaycarelectronics.com/catalogfor your FREE catalog!1-800-784-0263(Monday - Friday 09.00 to 17.30 GMT + 10 hours only). For those who wantto write: 100 Silverwater Rd Silverwater NSW 2128 Sydney AUSTRALIAOur 2006 catalog is 410+ pages, jam-packedwith over 780 new and exciting products!We sell a huge range of innovative productsthrough our FREE 410+ page catalogPhone or hop on line towww.jaycarelectronics.com and purchase from us24/7/365 through our secure encrypted system.Post and Packing charges are modest so you canhave any of 8000+ unique products delivered toyour door within just 7-10 days of your order!Theremin Synthesiser KitKC-5295 $34.95 + post & packingThe Theremin is a weird musical instrument thatwas invented early last century but is still usedtoday. The Beach Boys' classic hit "GoodVibrations" featured a Theremin. By movingyour hand between the antenna and the metalplate, you can create strange sound effects. Kitincludes a machined, silkscreened, and predrilledcase, circuit board, all electroniccomponents, and clear English instructions.• This product is also available built and fullytested Cat. AM-4025 $64.95.Requires 9VDC wall adaptor(Jameco #252751 $12.05).New410+ pageCatalogAutomotive Headlight Reminder KitKC-5317 $15.50+ post & packingFeatures include a modulated alarm, ignition andlights monitoring, optional door switch detection,time-out alarm and a short delay before the alarmsounds. Build and install this hassle-saving kit andenjoy a feature in your car that many luxury vehicleowners have long taken for granted.Kit supplied with case, silkscreened lidand all electronic components.Post and Packing Charges:Order Value Cost$25 - $49.99 $7.50$50 - $99.99 $20$100 - $199.99 $40$200 - $499.99 $60$500+ $75Max weight 12lb (5kg)Heavier parcels POA.Minimum order $25.Explanation of icons used for kitsIndicates anapproximateconstructiontime for eachproject for a competentconstructor. It does not however,include any installationetc that may be required.Get the Video Quality You PaidFor With Our Doctor Video KitKC-5390 $64.95 + post and packingCopy protection is put in place on videos and DVDs for agood reason, but this robs you of the true high qualityreproduction that it is capable of. Get the quality you paidfor and strip out these annoying signals! It supportscomposite and S-video signals and can be configured forNTSC or PAL format. Kit includes case, circuit board, allelectronic components, and clear Englishinstructions. Note: Some SMDsoldering required.• Wall adaptor required. UseJameco #210729PS $3.95Caution: During signalconditioning, this unitremoves copyrightprotection. Piracy is acrime, & JaycarElectronics takes noresponsibility for itspotential for unlawfuluse.Straightforward to assemble,generally built in one session.Requires basic electronics andsoldering skills.Requires a good knowledge ofelectronics to understand itsoperation, and troubleshootingtechniques may be required.


■ BY JON WILLIAMSSTAMPAPPLICATIONSPUTTING THE SPOTLIGHT ON BASIC STAMP PROJECTS, HINTS & TIPSTHE OBJECT OF THE MACHINESO, IS YOUR HEAD SPINNING after last month’s introduction to the Propellerchip? Don’t worry, it happens to all of us, and I promise that after a bit of timethings will begin to click, a big smile will cross your face, and wonderful thingsyou thought never possible will start happening. Last month we talked aboutthe Spin programming language being object oriented, but didn’t really takeadvantage of it. Let’s change that, shall we? and unleash some of the power ofthe Propeller multi-controller.74 May 2006While I consider myself a prettyfair programmer, I always qualifythat statement with the assertionthat I’m a pretty fair high-level languageprogrammer. Of course, I canprogram a bit of assembly, but I reallydon’t like to. What that means, then,is when I’ve wanted to incorporateassembly code written by anotherprogrammer (e.g., in an SX/B project),it’s been a bit of work. I’ve got greatnews for Propeller users: usingassembly language written by anotherprogrammer is no trouble at all, andwe’re going to see that this month.But let’s go through a bit of areview first. Remember that thePropeller chip has eight 32-bit cogs(processors) in it, and all can be runningat the same time. Every cog thatis running has direct access to the I/Opins, as well as to the main systemcounter (useful for generating delays).There is a system manager called the“hub” that controls access to theshared resources; specifically themain system RAM (32 KB).A cog can run the Spin languageinterpreter or a custom assemblylanguage program. The fact is that theSpin interpreter is an assemblylanguage program that is loaded fromthe system ROM when needed. So, forthose of you concerned about eachcog having only 2 KB of RAM, don’tbe; this is plenty for assembly programs(remember, this is a whole newassembly language and is veryefficient). Any Spin code that we writeactually resides in the main systemRAM, so our Spin programs and theirdata space can be up to 32 KB. Ofcourse, there is a performance differencebetween Spin and Assembly, byabout a factor of 250x. That said, Chip(that clever guy who created theBASIC Stamp) has estimated thatwith a 5 MHz crystal and using the 16xPLL tap (system clock of 80 MHz), wecan run about 80,000 Spin instructionsper second. That’s pretty fast.So let’s jump right in and demonstratePropeller objects and the abilityto use assembly language with ourSpin projects. For our first projectwe’re going to create a “debug” objectthat allows us to send information toa PC. Some of you may be surprisedthat this is not a built-in function —don’t be. The Propeller is a differentbeast and you wouldn’t want to bepenalized by having code space consumedby unused functions. Let’s sayyou’d rather send values to a TV; youcan do that using the TV_Terminalobject that Chip wrote and comeswith the Propeller installation. In fact,I’ve borrowed the numeric conversionroutines from TV_Terminal object forus in PC_Debug. Let’s build thatobject.The purpose of PC_Debug is, ofcourse, to send information to a PCterminal program. What this means,then, is that we need a code to handlethe serial transmission. While wecould do that ourselves, why bother?Chip has kindly written a highperformanceUART object calledFullDuplex that we can takeadvantage of. What we’re going to dowith PC_Debug is provide aconvenient wrapper for FullDuplexthat gives us access to most of themethods in FullDuplex, as well asadding any conveniences that wemight like to have (like number-tostringconversion).Notice that the ZIP file I’veprovided for downloading this month(available on the <strong>Nuts</strong> & <strong>Volts</strong>website; www.nutsvolts.com) has avery specific name and namingconvention; this is actually aPropeller archive file. We’ll talk moreabout archives later; just know for themoment that an archive contains allthe files we need for a given project.Expand the archive so that you canopen the files with the Propeller Tool,and then have a look at PC_Debug.spin.In order to use an object in ourprogram we need to declare it; we dothat in the OBJ block like this:OBJuart : “fullduplex”


We now have an object in ourproject called “uart” that — oncestarted — gives us buffered serialcommunications using another cog(which means it can do thingswithout affecting the programrunning in the main program cog).What we’ve done, in essence, isadded a serial coprocessor to oursystem. Pretty cool, huh? It getsbetter.The Parallax philosophy is that support objects, i.e.,those that are not intended to stand alone, will have amethod called “start” that is used for instantiation. Thestart method will usually return True (-1) or False (0) basedon the success of the code at start. Note that there is nohard-and-fast rule on this, it’s just the current convention.Since PC_Debug is also designed as a support object,it will also have a start method. Here it is:PUB start(baud) : okay■ FIGURE 1. Object Hierarchy.STAMP APPLICATIONSNow we just need to assign theterminals to different Propeller I/Opins.PUB mainterminal[0].start(9600)terminal[1].startx(1, 0, 57600)In this case terminal.[0] is usingthe default programming pins (A31and A30) at 9600 baud, and terminal.[1]is using A1 (for RX) and A0 (for TX) at 57,600 baud.Keep in mind that underneath the terminal object is theFullDuplex UART object that requires its own cog, so thedefinition above would require two free cogs to operate.Let’s get back to our PC_Debug object. Again, this is awrapper for FullDuplex that adds features convenient forsending data to a terminal. Since the FullDuplex object startsa new cog, it also has a method for stopping that cog andmaking it available for other processes. By convention, thismethod is called stop and we simply provide access to it.okay := uart.start(31, 30, baud)This is a simple method, and yet a lot is happening. Westart with the PUB declaration — we need this method tobe public so that it can be accessed by higher-level objects.This method is expecting a parameter called baud. Notethat no matter what size we need, a parameter is alwayspassed as a Long. This method will return a value as well;the variable after the colon (okay) is what will be returned.Return values are also Longs but can be caste to smallersizes (Word or Byte) if needed.The code now is just one line: we’re assigning thereturn value of the uart.start method to okay. As we cansee, Spin uses the dot notation found in other objectorientedlanguages. We can also tell that the uart.startmethod expects three parameters: the receive pin, thetransmit pin, and the baud rate. What we’ve done hereis started the uart object using the Propeller’s standardprogramming pins.But what if we’ve got an extra port on our PC and wouldrather send information to it using a couple free I/O pins?No problem, we’ll just create another method.PUB startx(rx_pin, tx_pin, baud) : okayokay := uart.start(rx_pin, tx_pin, baud)As you can see the startx (x for extra) methodsimply passes along the desired pins with the baud rate.Using this method we could actually open more than oneterminal at the same time (using different ports on our PC,of course). Spin even lets us define an array of objects, sowe could do this:OBJterminal[2] : “pc_debug”PUB stopuart.stopThis may seem redundant but, in fact, it’s not. You see,any program (top object) that uses PC_Debug will notdirect access to methods in FullDuplex — we must explicitlyprovide wrappers for them. The good thing about this isthat we can provide wrappers only as needed and leave theother methods (even public ones) protected to a degree.Figure 1 shows the object hierarchy of our completedproject. Note that PC_Debug_Test does not have a directconnection to Full_Duplex.As you look through the PC_Debug object, you’ll seethat that are several other wrappers for objects inFullDuplex. They’re self-evident and we don’t need todescribe them all in detail.Let’s jump into the custom methods that are at thepurpose of our project: converting values to strings so thatwe can send them to a terminal program. Since we’ll mostfrequently use decimal values, let’s start there. The followingmethod will print a signed decimal number:PUB dec(value) | div, zpadif (value < 0)-valueout(“-”)div := 1_000_000_000zpad~repeat 10if (value => div)out(value / div + “0”)value //= divzpad~~elseif zpad or (div == 1)out(“0”)div /= 10May 2006 75


Okay, I know that this may look a little cryptic at first,but please trust me that once you get used to Spin you’lllove the efficiency of the language. As I told you lastmonth, Spin borrows from other languages, and those ofyou that have programmed in C will probably recognizesome of the operators and constructs right away.Let’s start with the declaration because it includessomething new. We can see that we’re going to pass avalue, and following that is a vertical bar and two symbols:div and zpad. The symbols are local variables that will beused by the method. Note that local variables are notpersistent and will be destroyed when we exit from themethod.The beginning of the code is quite simple; we simplycheck to see if the value passed is negative and if it is wemake it positive and print a “-” character with the outmethod. Next we initialize the divisor (div) and clear thezpad flag. There are a few cool things here: with 32 bits, wecan deal with really big numbers (-2,147,483,648 to+2,147,483,647) and Spin lets us see this clearly by usingan underscore character where a comma would normallybe. Next is a new operator, the post clear (~) operator.As you spend more time, you’ll find Spin is veryadvanced, and the placement of an operator can change itsmeaning considerably. In our case, the trailing tilde meansthat we’re going to clear the variable to zero. So ...zpad~is the same aszpad := 0but the former version is, in fact, more efficient internally.Now we get to the meat of the dec method. Since thelargest value in the system can be up to 10 digits wide,we’ll run the digit conversion loop 10 times. Again, notethe efficiency with the simple repeat 10 statement; thisreplaces for x = 1 to 10 in Basic (though there is an implementationof repeat that allows us to specify start and endvalues). You may be wondering about the control variablefor the repeat loop; this comes from the interpreter’sstack.Now we check to see if value is equal to or greaterthan the divisor. If it is, we get the current column digit bydividing value by the divisor, and then convert it to ASCII byadding “0” (decimal 48). Now we remove the currentcolumn by taking the modulus of the divisor. Since we’vestarted printing digits, we will now set the zpad flag so thatwe print zeros in proceeding columns as needed. Note thepost-set operator (two trailing tildes); this sets all thebits of the variable to 1 (making the value -1, which isgenerally used as True).When the current value is less than the divisor, wecheck the zpad flag or for the current column being 1; ifeither of those conditions is true then we’ll print a zero. Thefinal step is to adjust the divisor between columns bydividing it by 10.Okay, now let’s look at binary and hex conversion.These routines are trim and elegant (I didn’t create them76 May 2006so I can say that), yet also demonstrate some neatfeatures in Spin. We’ll start with binary as it is the simplerof the two.PUB bin(value, digits)digits := 1 #> digits


STAMP APPLICATIONSPUB main | idxdebug.start(460_800)debug.str(string(FF, “Debug Test”, CR, LF, LF))repeatdebug.hex(idx, 2)debug.out(Space)if ((++idx // 16) == 0)debug.crlfuntil (idx == $100)debug.crlfdebug.dec(-1)debug.crlfdebug.ibin(-1, 32)debug.crlfdebug.ihex(-1, 8)debug.stopThere’s only one public method in the program, andI’ve called it main — this is a style choice and notrequired. Remember, the first public method is whatruns when a Spin program is launched. The first thing wedo is start the debug object, and have a look at that baudrate: 460,800 — that is not a typo, that is 460.8 kBaud.Remember I said Chip’s FullDuplex object was “highperformance?” Now you can see what I’m talking about.And this is with a 5 MHz crystal connected to the Propellerchip.The first thing printed is a string that is composedof a form feed character (clears the screen inHyperTerminal), some text, a carriage return, and a coupleline feeds. All this is assembled with the string methodwhich creates the inline string and returns a pointer (theaddress in memory of) to it. The string pointer is what’sused by the debug.str method for printing. This is fine forone-off strings, but if we’re going to use the same textmore than once, it’s better to embed it into a DAT blocklike this:DATtitle byte “<strong>Nuts</strong> & <strong>Volts</strong> rocks!”, 0Note the zero terminator; this is important so don’tleave it out. To print this string, we can pass a pointer to itwith the @ operator.debug.str(@title)The main body of the program is a loop that prints hexvalues from $00 to $FF in a 16 by 16 array. After printing thedigit and a space, the value of idx is incremented and then testedwith modulus to see if 16 values have been printed on thecurrent line. If so, a carriage-return and line feed are inserted.The value of idx is tested at the end of the loop for termination.Of course, there are several ways to skin this cat — wecould have constructed the start of the loop like this:repeat idx from $00 to $FFAnother option is to replace the until termination with:if (idx == $100)quitMy point is to show you that repeat — the onlylooping construct in Spin — is quite flexible and has a widevariety of options.Okay, now that you’ve got a tool for sending values toa PC terminal program, it is time to play; you have enoughto experiment with the Spin programming language andget used to it before we start connecting external hardware.PROPELLER ARCHIVES■ FIGURE 2. Debug Test Output.You’ll notice that the ZIP that contains the files for thismonth has a very specific name; this ZIP was created by theArchive selection of the Propeller Tool > File menu. This isa tremendously useful feature of the IDE: it lets us gatherand archive all the files of a project, no matter where thefiles are located on the system. This makes sharing projectswith others a breeze as you are ensured that they will geteverything they need. There’s also an Archive feature thatincludes the IDE! With this you can open an archive folderseveral years from now and know that you’ve got what youneed to recreate that project.Have fun with your Propeller, and until next time ...Happy Spinning! And yes, we’ll be back to working with theBASIC Stamp and SX very soon. NVJON WILLIAMSRESOURCESjwilliams@parallax.comPARALLAX, INC.www.parallax.comMay 2006 77


■ BY PHIL DAVISPERSONALROBOTICSZEN AND THE ART OFZIGBEE — PART 2UNDERSTANDING, DESIGNING & CONSTRUCTING ROBOTS & ROBOTIC SYSTEMSCo-written by Joe StramagliaOKAY, LAST MONTH WE BRIEFLY DISCUSSED some of the architecture andnetwork topology possibilities of Zigbee along with many of its capabilities.As promised, this month, I want to demonstrate a simple project in which apeer-to-peer Zigbee connection will be used to control a robot using simplecommands and to receive data sent back from the robot.78 May 2006For those just joining us, Zigbee isone of the new technologiesdesigned to enable Wireless PersonalArea Networks (WPAN) based aroundthe new and emerging IEEE 802.15.4standard. You might think of a WPAN(area) as your home or your backyardor perhaps your office space with yousitting at your PC and communicatingto your robot, telling it to stop, start,turn left, etc., and your robot reportingback various bits and pieces ofstatus information.Hopefully, you took the opportunitysince last month to follow someof the links and do a little research ofyour own. In case you didn’t, now is agood opportunity to do so:www.freescale.com/webapp/sps/site/prod_summary.jsp?code=ZRP-1&nodeId=01J4Fs25657103http://zigbee.org/en/index.asp.One of the design goals of thisproject was to use free software, ridingpiggyback, as much as possible,on previously written applications, tomake controlling a robot via Zigbeefairly easy and accessible to most.You will have to purchase the Zigbeeboards that we used, but for a funproject like this, they are well worth it.We also decided to focus ondoing stuff with Zigbee, rather thanon robot details. To this end, wedecided to use as many off-the-shelfpieces as possible.THE ZIGBEE BOARDThe Zigbee board we used wasthe 13192-SARD (shown in Figure 1),which is one of Freescale’s developmentboards and may be purchasedin pairs from Freescale (see theResources sidebar for the URL).From a robotics hobbyist pointof-view,this particular board has a lotof nice features:• It has, of course, a Zigbee• It has its own processor — theMC9S08GT60 — which executes theZigbee stack• It has RS232 built in to allow forcommunication to external boardsand processors■ FIGURE 1. Freescale ZigbeeDemonstration Board.


PERSONAL ROBOTICS• It has four buttons and four LEDsthat your program can use to initiateor show various program functions• It also has a built-in (which is toocool) three-axis accelerometer thatyou can access to send back to the PCthe X, Y, and Z values caused bymovementWith this board, you can runeither a full Media Access Controller(MAC) or Freescale’s Simple MediaAccess Controller (SMAC) software,which supports simple point-to-pointand star networks and has a smallmemory requirement (less then 3KB). Since we are doing a simplepeer-to-peer communication link, wechoose to use SMAC and besides,that leaves us with more memory leftover for writing programs.I said earlier that we tried to useoff-the-shelf components. One of thesewas the ‘UART’ demonstration program.The UART demo app already interfaceswith the Zigbee stack to do all thecommunication-protocol stuff and even‘acks’ and ‘nacks’ packets as they arereceived, leaving us with little to doexcept layer our command-protocolstructure, and any additional functionswe want the robot to perform, on top.THE COMMUNICATIONPROTOCOLHaving decided which Zigbeeboard to use for this example project,the next thing to do was decide whatcapabilities we wanted the robot tohave and how best to accomplishthose, preferably providing expandabilityfor future enhancements.Minimally the robot should have:• Differential drive (probably the simplestform of drive), i.e., one motor oneach side, to allow forward and backwardmovement as well as steering• Start/stop control• Speed control■ FIGURE 2. Data flow between the PCand the robot.• The ability to send back informationThese features require a protocolstructure for sending motor-controlcommands (and perhaps other commands)to the robot and also torequest status and other informationin reply. Below is the simple commandprotocol we came up with. It iscomposed of a packet containing acouple of ‘start’ bytes, a commandbyte, four bytes of data, and finally atrailing byte for a total of eight bytes.Transmission from the PC to therobot:• Two leading “**” to identify the startof the packet• A command byte:– “P” to send PWM data to themotors– “A” to request accelerometerdata• Four bytes of data, padded if necessaryMay 2006 79


• A trailing “%” to signify the end ofthe packetIf the command byte is a “P” thenthe next byte is a “1” or a “2” referringto either motor one or motor two. Thebyte following that is the PWM value,which in our case is a range — “1” forfull forward, “128” for stop, and “255”for full reverse.Transmission from the robot tothe PC:• Two leading “**” to identify the start80 May 2006of the packet• A command byte:– “A” for accelerometer data fromthe board• Four bytes of data, padded if necessary• A trailing “%” to signify the end ofthe packetIf the command byte is “A” then thenext three bytes are the X, Y, and Z valuesretrieved from the accelerometer.Whew! Glad that’s out of the way.■ FIGURE 3. Our simpleRS232/PWM board.So now we have a way to tell the robotwhat to do and also a way for it to sendus information. All this is layered on topof the demonstration UART application,which provides reasonably reliablecommunication. Figure 2 shows thisdata flow between the PC and the robot.MAKING IT WORKOkay. What does the RobotZigbee board do once it receives a “P”command? Well, since we have accessto RS232 for external communication,we quickly whipped up our very ownsmall board, shown in Figure 3, to dothe PWM output. We constructed thisout of a Cypress CY8C29466-24Pprocessor, because we had a few lyingaround, and wrote a few lines of codeto accept the “P, motor-number, PWM”command from the Zigbee board andthen to drive the correct output ports.Although we built our own board,there are many small boards on themarket today that will accept RS232commands and drive sometimes asmany as a dozen PWM channels, so,perhaps in the vein of using off-theshelfcomponents, that is a better wayto go.Alternatively, if the Robot Zigbeereceives an “A” (a request foraccelerometer data), it accesses theonboard accelerometer, packages upthe X, Y, and Z values into thecommand structure, and sends themback to the PC.To cause the above functionalityto occur, all data coming back towardsthe PC is “passed through” the PCZigbee and handled within the PC.Similarly, all data sent from the PC isagain “passed through” the PC Zigbeeand handled within the Robot Zigbeeand any associated boards or processors.This will, of course, requiresome changes to the Robot ZigbeeUART application, layering on top ofour customized code to recognizecommand packets from the PC and totake the appropriate action: passingthe correct data through to the PWMprocessor board or sending back■ FIGURE 4. Command Console forZigbee control.


accelerometer data as requested.THE PC COMMANDCONSOLE■ FIGURE 5. All the components ofthe ‘bot laid out in a row.At this stage, we have conceptually(and physically) tied our PC throughZigbee to our Robot via a commandprotocol structure and a board togenerate PWM signals at the robotend. This leaves the creation of theCommand Console (shown in Figure4) at the PC end to manage all of this.The Command Console’s function isto provide a graphical interface forcontrolling the Robot and to receiveand display any incoming data. To doso, it must talk to the locally connectedZigbee board via RS232.There are several sets of functionalityavailable through the CommandConsole. Most notable are the twoareas to control the robot — the On/Off control area and the Proportionalcontrol area — and an area to displaythe received accelerometer data.We included the On/Off controlarea in case simple motor devicessuch as Continuous Rotation Servoswere attached. This control set willallow for the starting, stopping, andturning of the robot using these, bysimply pressing the buttons.The Proportional area is muchmore capable and allows for the continuouscontrol of both motors througha range from full forward to stop to fullreverse. This is done by moving eitherthe speed slider or the steering slider inthe appropriate direction.There are two small windows at thebottom of these areas which show theactual Left and Right PWM values thatare currently being transmitted to therobot. I should note that a transmissiononly occurs when a button ispushed or a slider position is changed.The PWM channels on the Cypressprocessor hold the last known PWMvalue, so there is no need for refresh. Ifthat were not the case with the PWMoutput device in use, then the codewould need to be modified accordingly.Finally, there is the area whichrequests and displays the accelerometerdata. Clicking the check box starts atimer that sends to the robot, 10 timesa second, a request for data. Whenreceived by the console, this data isdisplayed in the appropriate windows.The Command Console as it standsworks as expected and is a reasonablebase for developing further and morecomplex remote control Zigbee applications:it has the serial communicationto the Zigbee board, the commandstructure for sending and receivingdata, and some basic control functions.TESTING THE SETUPHmmmm ... Well how did it allwork? Good question! After somedebugging here and there, everythingworked pretty much as we had hoped.As shown in Figure 5, the PWM boardwas connected to the Zigbee boardand to that were connected twocontinuous rotation servos.Using this configuration, we wereable to start and stop the servos,reverse them, and cause them torotate in opposite directions, much asexpected.The next thing we did was connectthe PWM outputs to a scope tosee how the fully proportional aspectsof the console worked. Sure enough,as we moved the sliders, the PWMsquare wave grew and shrank between1-2 ms the way we had planned. Imust admit, I was a little concernedthat the Zigbee communication mightfail if I quickly moved the speed sliderup and down several times a second,causing many command packets (255top to bottom) to be sent, but as faras we could see (eyeball), the proportionalPWM continued to work quitePERSONAL ROBOTICSRESOURCES■ You can purchase the SARD boarddirectly from Zigbee at this link:www.freescale.com/webapp/sps/site/prod_summary.jsp?code=13192DSK&parentCode=MC13192&nodeId=01J4Fs862825658166.■ You can download the free CodeWarrior development tool at this link:www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CWX-HXX-SE&parentCode=null&nodeId=01272694011860.■ You can get online help onFreescale Zigbee at the followingforum link: www.freegeeks.net/smoothly. Not too shabby at all.WHAT WILL IT COST?So, can the reader do all thisthemselves and how much will itcost? Another great question! Well,except for the cost of the Zigbeeboards, the compiler to modify andwrite additional code for the Zigbeeboards is downloadable for free,though I believe in that form, it willonly compile up to 16 KB of code.That is probably more than enoughfor hobbyists, especially if they areusing it in a fashion similar to the waywe did. In addition, the demonstrationapplications are free and may bemodified and/or pieces of themincluded into your own programs.Also, before the end of this threepartseries (and possibly sooner), I willplace on the <strong>Nuts</strong> & <strong>Volts</strong> website all thecode we developed and used along withany circuit diagrams etc., which shouldhopefully give you a head start in devel-May 2006 81


oping your own Zigbee application.ENDNOTEThe command protocol discussedhere is not designed to be either robustor efficient. There are many ways optimizationscould be implemented, forexample, make each command specific:the request for accelerometer dataneed only be four bytes long “**A%” orthe ‘P’ command could set both motorsat the same time, etc. Also, as it stands,if a command is for some reason notrecognized, or not complete, it issimply thrown away, which is fine forthis experimental project and mostlikely for many hobbyist applications.Enhancements are for the reader toexperiment and play with.Next month, we will tackle moreadvanced Zigbee topologies andhopefully we will have multiple robotsrunning at the same time. NVcall toll freeFREECatalog!1-800-543-4330refer to or visit• Over 40,000ProductsStocked• Access to over1.5 millionelectronic partsand relatedproducts• Installer/Dealerpricing program• Quotation team,send us yourquotes for quickresponsewww.mcminone.com/magazineSource Code: NVM3782 May 2006


Up to 6 players at one time!A great interactive play experience.Trivia games, word games,card games and more.In order to meet both our gaming standards andtoday’s social dynamic, we got together withseveral international research and developmentfirms such as National Semiconductor, Panasonic,Macrovision and Altera to create the Game Waveand its operating system from scratch. Our customDVD game console accommodates up to sixinfra-red remote controls which meansno waiting for turns.May 2006 83


Order online at:www.melabs.comDevelopment Tools for PICmicro ® MCUsmicroEngineering Labs, Inc.Phone: (719) 520-5323Fax: (719) 520-1867Box 60039Colorado Springs, CO 80960Serial Programmerfor PIC ® MCUs$119.95Includes:ProgrammerOptional9-pin Serial CableUSB AdapterAC Power Adapter$39.95ZIF Adapter for 8 to 40-pin DIPSoftware for Windows 98/Me/NT/2K/XPEPIC ParallelPort Programmerstarting at $59.95LAB-X Experimenter Boards BASIC Compilers for PICmicro ®Pre-Assembled BoardAvailable for 8, 14, 18, 28,Easy-To-Use BASIC CommandsWindows 9x/Me/2K/XP Interfaceand 40-pin PIC ® MCUs2-line, 20-char LCD ModulePICBASIC Compiler $99.959-pin Serial PortBASIC Stamp 1 CompatibleSample ProgramsSupports most 14-bit Core PICsBuilt-In Serial Comm CommandsFull Schematic DiagramPricing from $69.95 to $349.95PICBASIC PRO Compiler $249.95PICPROTO Prototyping BoardsDouble-Sided with Plate-Thru HolesCircuitry for Power Supply and ClockLarge Prototype AreaBoards Available for Most PIC ® MCUsDocumentation and SchematicPricing from $8.95 to $19.95Supports All PICmicro ® MCU FamiliesDirect Access to Internal RegistersSupports In-Line Assembly LanguageInterrupts in PICBASIC and AssemblyBuilt-In USB, I2C, RS-232 and MoreSource Level DebuggingSee our full range of products, includingbooks, accessories, and components at:www.melabs.com84 May 2006


www.robobusiness2006.comPhotos courtesy of CarnegieMellon University, OpenwareRobotics, ActivMedia/MobileRobots and Frontline Robotics.Founding Sponsor:Keynote Luncheon Sponsor:June 20-21, 2006Sheraton Station SquarePittsburgh, PAThe International Business DevelopmentEvent for the Mobile Robotics andIntelligent Systems IndustryFive Comprehensive Tracks• Business Development and Partnership• Technology and Standards• Applications and Products• Investment Opportunities• Markets and Industries- Security and Defense Robotics- Intelligent Transportation and Field Robotics- Healthcare Robotics- Consumer RoboticsPremier Sponsors:Academic Co-sponsor:Gold Sponsor:Premier MediaSponsor:Produced by:Additional SponsorsAdvanced Digital LogicAmerican RobotApplied PerceptionAutomatikaAutonomous SolutionsClean Power ResourcesDiversified Case CompanyEnergidEvolution RoboticsFoster-MillerFuture RoboticsIZI RoboticsMBusMobileRobotsPittsburg Pattern RecognitionRC DriverRE2RoboTech CenterROBOTISSegwayShopBot ToolsSkeyes UnlimitedSystronixTobyhanna Army DepotValde SystemsYost EngineeringAssociation Co-SponsorsAllegheny Conference onCommunity DevelopmentCenter of Excellence forRemote and MedicallyUnder-Served AreasGlobal Emerging TechnologyInstituteInnovation WorksMass TechnologyLeadership CouncilMedDev Group Boston ForumObject Management GroupPittsburgh Regional AllianceRobot Hall of FameRobotics Society of AmericaWest Virginia High TechnologyConsortium Foundation


■ BY PETER BESTDESIGNADVANCED TECHNIQUES FOR DESIGN ENGINEERSFLIGHT TESTING THE ARMCYCLEWE GOT OUR ARM PROJECT TO “HOVER” LAST MONTH.This go-round, we’regoing to do a bit more flight testing. Right now, our ARM system consists ofthe bare essentials. For starters, we will add another serial port in additionto the existing serial port that is doing double-duty as the ICSP portal. We’llalso design in a 20-pin JTAG interface that will allow us to go beyondthe capabilities offered up by the free LPC2000 Flash Utility. I’ve noted theadditions in the updated LPC2136 schematic (see Schematic 1).86 May 2006THE■ PHOTO 1. This unassuming little boxholds the key to the magic of debuggingand programming our LPC2136 usinga JTAG interface. This is a must-havedevice as it can interface to an ARMtarget using free and more feature-richlicensed debugging tools.If you’ve been around microcontrollers,it doesn’t take very long torealize that the really important partof any microcontroller tool chain isthe debugger. A good compiler makeslife a bit easier on the coding side, buta good debugging system provides abird’s eye view of the microcontroller’sCPU and internal peripherals.The big advantage of owning a goodARM debugging system is that ifyou’re new to the ARM microcontrollerand its associated compiler,you can use the debugger to halt executionof example code and study itsoperation and note what effects thecode is having on the ARM hardware.As I alluded to earlier, a highquality C compiler will help you avoidsome of the traps laid by lower qualityC compilers that contain bugs and“gotchas” that can ruin your programmingday. You get what you pay forand a higher quality compiler willmost likely have fewer bugs and“gotchas” associated with it. And,you’re probably going to get a bettertechnical support structure with aquality C compiler you purchase froma proven C compiler vendor.Debugging is fun (at least to me it is),but all good things must come to anend. Once you’re happy with yourARM code, you’ve got to put it intoARM Flash before it can be useful.Thus, a suitable ARM programmingmechanism is also essential.It is important to consider flexibilitywhen collecting parts andpieces for your ARM tool chain. Dothe ARM debugging and compilationcomponents you’ve chosen allow youto move to other similar microcontrollerplatforms from differing manufacturers?Unless you work for RoyalPhilips, every ARM project youproduce most likely won’t include aPhilips ARM microcontroller. BuyingC compilers and debugging hardwarefor various types of ARM microcontrollerscan get expensive. If you feelthat you’re going to do more than oneARM project, invest in quality tools.You’ll find that you pay a bit more fora C compiler and debugger that canhandle the whole ARM7 family.However, you’ll also come to realizethat it will cost you more to buymultiple cheaper C compilers anddebugging tools.I test drove a number of ARM Ccompilers and debuggers. One of thebetter sets of JTAG-based debuggersand supporting debugging software Icame across is manufactured and producedby Segger. Segger also offers anARM Flash programming system andthe Segger programming/debuggingsoftware runs seamlessly with the ARMC compiler from IAR. I’m really anxiousto show you the cool ARM stuff I’ve discovered.So, let’s take a look at my collectionof Segger/IAR ARM tools.THE SEGGERJ-LINK FOR ARMAlthough my J-Link sports an IAR


moniker, it’s actually a Segger J-Link.The Segger J-Link device you see inPhoto 1 is the 20-pin link between us(the ARM system programmers) andour target ARM hardware. The J-Linkgets its power from the USBconnection and supports every ARM7device that we have discussed thus farin both 32-bit and thumb modes.The J-Link includes a feature set thatoperates unconditionally with the IARWorkbench.If you decide not to implement thefull 20-pin JTAG interface in yourdesign, the J-Link can operate in both20-pin and 14-pin JTAG configurations.Segger sells a 14-pin JTAG adapter forthis purpose. However, you can“garage manufacture” a suitable 14-pinJTAG adapter on your home benchusing the JTAG pinout information thatis found on the Segger website(www.segger.com). In fact, the Seggerwebsite is a good place to visit ifyou’re thinking about doing anythingwith ARM microcontrollers.Segger’s J-Link for ARM issupported by Windows 2000 andWindows XP via a full speed USB 2.0interface. No burden is placed on thepersonal computer‘s USB power supplyor your target ARM system as theSegger J-Link operates with less than50 mA of current. The maximumtransfer rate is between the J-Link andthe LPC2136 target is 12 MHz. So,there will be no time for smoking anddrinking between debug spins. J-Linksupports ARM devices that can acceptpower supply levels between 1.2 VDCand 3.3 VDC. If you need to design ina 5 VDC ARM device, Segger offers aready-to-roll 5 VDC adapter.USING THE SEGGERJ-LINK FOR ARMIn the first installment, we certifiedour new LPC2136 design with theTHE DESIGN CYCLELPC2000 Flash Utility. Now it’s time totake the next step and integrate theSegger J-Link into our LPC2136 Ccoding, programming, and debuggingstrategy. Segger offers a set of freeARM7 tools in addition to its licensedARM7 offerings. I happen to have theentire set of Segger licensed andunlicensed tools. So, let’s take a firsthandlook at what Segger has to offer.I’ve downloaded the free J-LinkARM package from the Segger websiteand installed it on my PC. Let’s putour newly added LPC2136 JTAG interfaceto the test. I attached my J-Link tothe updated LPC2136 prototype board(Photo 2) we’ve been building up. Iprepared myself for a possible smokesession and applied power to theupgraded LPC2136 prototype board.After powering up, I checked out■ SCHEMATIC 1. Adding the JTAGinterface and the second serial portcompletes the base hardware designfor the LPC2136 Development Board.P1P2162738495DB9 FEMALE162738495DB9 FEMALESW2RESETDTRR110KTX0OUTTX1OUTRX1INRX0INC8.1uFR222KTXD0TXD1C7.1uFD3LL4148D2LL4148+3.3VDCR310KSW1BC846Q1138U1R1INR2IN1110T1INT2IN1C1+SP3232 PIN 16 = +3.3VDCSP3232 PIN 15 = GNDR422KR51KSP3232ISPSELR1OUTR2OUT129147T1OUTT2OUT5C2-3 4C1- C2+2 6V+ V-RXD0RXD1C9.1uFC10.1uFTXD0RXD0RESETU219 P0.0/TXD0/PWM1 P1.16/TRACEPKT0 1621 P0.1/RXD0/PWM3/EINT0 P1.17/TRACEPKT1 1222 P0.2/SCL0/CAP0.0 P1.18/TRACEPKT2 826 P0.3/SDA0/MAT0.0/EINT1 P1.19/TRACEPKT3 427 P0.4/SCK0/CAP0.1/AD0.6 P1.20/TRACESY 4829 P0.5/MISO0/MAT0.1/AD0.7 P1.21/PIPESTAT0 4430 P0.6/MOSI0/CAP0.2/AD1.0 P1.22/PIPESTAT1 4031 P0.7/SSEL0/PWM2/EINT2 P1.23/PIPESTAT2 3633 P0.8/TXD1/PWM4/AD1.1 P1.31/TRST 2034 P0.9/RXD1/PWM6/EINT3P1.28/TDI 6035 P0.10/RTS1/CAP1.0/AD1.2 P1.30/TMS 5237 P0.11/CTS1/CAP1.1/SCL1 P1.29/TCK 5638 P0.12/DSR1/MAT1.0/AD1.3 P1.26/RTCK 2439 P0.13/DTR1/MAT1.1/AD1.4 P1.27/TDO 6441 P0.14/DCD1/EINT1/SDA1 P1.25/EXTIN0 2845 P0.15/RI1/EINT2/AD1.5 P1.24/TRACECLK 3246Y1 12MHzP0.16/EINT0/MAT0.2/CAP0.247 P0.17/CAP1.2/SCK1/MAT1.2XTAL1 62 C1153 P0.18/CAP1.3/MISO1/MAT1.354 P0.19/MAT1.2/MOSI1/CAP1.239pF55P0.20/MAT1.3/SSEL1/EINT31 P0.21/PWM5/AD1.6/CAP1.32 P0.22/AD1.7/CAP0.0/MAT0.058 P0.239 P0.25/AD0.4/AOUT10 P0.26/AD0.511 P0.27/AD0.0/CAP0.1/MAT0.113 P0.28/AD0.1/CAP0.2/MAT0.214 P0.29/AD0.2/CAP0.3/MAT0.315 P0.30/AD0.3/EINT3/CAP0.017 P0.3157 RESET3 RTXC15RTXC263 VrefC5+10uFJ112LPC2136+6-9VDCD11N5819C5 +10uFXTAL2 61Vbat 49Vdd1 23Vdd2 43Vdd3 51VddA 7Vss1 6Vss2 18Vss3 25Vss4 42Vss5 50VssA 59C1CC12139pFC2R610KC4.1uF .1uF .1uF .1uFVR1 +3.3VDCLM1086CS-3.31 3INOUTGND2+3.3VDC5432C3C6 +10uF+3.3VDC1 1 2 23 3 4 45 5 0607 07 0806 0809 09 10 1011 1213 13 111412 1415 15 16 1617 17 18 1819 19 20 20JTAGMay 2006 87


the LPC2136 prototype board’s communicationscapability one more timewith the LPC2000 Flash Utility just tomake sure I hadn’t fouled anything upwith my JTAG interface installation.Everything checked out fine and Ididn’t release any magic smoke fromany of the LPC2136 prototype board’scomponents. I then attached my J-Link to the LPC2136 prototype board’snew 20-pin JTAG connector and reappliedpower to the prototype board. Ialso connected a USB cable betweenthe J-Link and my PC. The J-Link statusLED started to blink indicating thatthe J-Link ARM was enumerating.When the J-Link status LED transitionedfrom blinking to solid, that wasmy cue that the J-Link had enumeratedsuccessfully and was ready to go.For those of you that arenot familiar with USB, USB devicesperform an enumeration operation toestablish a communications sessionwith a host controller. Lots of capabilityand configuration information ispassed between the enumerating88 May 2006■ PHOTO 2. This board isgetting pretty busy. If youcompare this photo to theone in last month’s DesignCycle, you’ll note theaddition of the 20-pin maleheader, which is theJTAG interface for the J-Link and an extra threewireserial port. Because Ihave “recycled” the baseprinted circuit board, Iconstructed a serial cableextension to mate with thefive-pin Berg connectorthat is standing in for astandard DB-9 female shellconnector.device and the host during theenumeration process. The enumeratingdevice passes through four states:Powered, Default, Address, andConfigured. If everything goes asplanned within each state, the enumeratingdevice becomes available tothe user and application program.With the LPC2136 developmentboard and J-Link seemingly on theready, I kicked off the free J-LinkCommander application. As you cansee in Photo 3, the LPC2136 onthe LPC2136 prototype board wasrecognized by J-Link Commander. TheJ-Link ARM hardware was also detectedand, as you can see in the screenshot, my LPC2136 produced an ARMcore ID of 0x4F1F0F0F. Things are verygood for us right now as we haveestablished a navigable portal intothe innards of the LPC2136.The J-Link Commander applicationis a very useful tool and allowsthe user to stop and start theLPC2136, as well as read and write theLPC2136’s memory. One can alsoinspect various memory locations andregisters of the LPC2136. To give youan idea of how memory inspectionlooks and works within the J-LinkCommander application, I dumpedthe first 100 bytes of the LPC2136Flash for you in Photo 3.Although you can use J-LinkCommander to alter the LPC2136’smemory contents, there’s a better toolfor reading and writing the LPC2136memory areas and it’s a free download,as well. The free Segger ARMmemory inspection and alteration toolis called J-Mem. Used with the J-LinkARM device, Segger’s J-Mem displaysthe LPC2136‘s memory contents andallows modification of the LPC2136registers and SRAM in real time.A J-Mem Flash and SRAM memorydump is shown in Photo 4. TheLPC2136 Flash dump begins ataddress 0x0, while LPC2136 SRAMbegins at address 0x40000000. As youcan see in the SRAM dump, I insertedsome text at the beginning of theLPC2136’s SRAM space. I did this bysimply typing in the text in the ASCIIarea of the J-Mem window.The free J-Link Commander and J-Mem applications can run at the sametime. So, to prove that J-Mem hadindeed written the LPC2136’s SRAM, Iused J-Link Commander to dump thefirst 100 bytes of the LPC2136’s SRAM.If you check each byte I entered in theJ-Mem SRAM dump with the J-LinkCommander SRAM dump, you’ll seethat the SRAM on-the-fly memoryalteration worked as designed. J-LinkCommander and J-Mem are goodtools. It gets better ...SEGGER’S J-LINK RDIThe Segger free tool set worksgreat but if you want to get serious,you’ll need to move into the licensedtool quadrant. J-Link RDI is an extensionof the RDI (Remote DebugInterface). RDI is a standard set ofdebugging data structures and func-■ PHOTO 3. This is good to see. This windowconfirms the existence of both theJ-Link ARM hardware and the LPC2136.At this point, we can use the J-Link Commanderapplication to turn some of theLPC2136 register and SRAM knobs.


tions aimed at the ARM hardwaremodel. RDI is implemented by Seggeras an API (Application ProgrammingInterface) that is distributed as astandard Windows DLL. Any RDIcompliant debugger can access theservices of Segger’s J-Link RDI DLL.Up to this point, the LPC2136 andits cousins have been presented assuper microcontrollers. Even with allof that Flash and SRAM spacecoupled with ultra high speeds, ARMhardware only supports two hardwarebreakpoints. This can present aprogrammer efficiency problem assome debuggers are designed to onlyoperate in SRAM.Walking along a large amount ofcode with only a couple of breakpointsmakes for a long debugging day. Mostmicrocontrollers have far more Flashthan SRAM. Thus, it may be difficult orimpossible for a standard SRAMbaseddebugger to load all of thenecessary program and data into theSRAM area for debugging. The J-LinkRDI brings the LPC2136 and companyback to hero status by providingunlimited breakpoint capability whileoperating in Flash or RAM.J-Link RDI’s ability to provideunlimited breakpoints is made possibleby the implementation of softwarebreakpoints. Hardware breakpoints donot depend on code to operate as theyare part of the hardware architecture.On the other hand, software breakpointsare implemented as minorchanges to the actual binary code.A software breakpoint is createdwhen the debugger modifies the originalprogram code at the desiredbreakpoint location by replacing thebinary code at the breakpoint locationwith a special breakpoint value. Thus,multiple software breakpoints can beplaced at any instruction boundarywithin the fabric of the binary code.The firmware must be modified tocreate a software breakpoint. So, it’sobvious that software breakpoints aremost suitable to be placed within thebinary code that resides in SRAM.To provide SRAM-like softwareTHE DESIGN CYCLEbreakpoints in Flash, the J-Link RDIsoftware uses a small SRAM-basedapplication to reprogram a sector ofFlash that sets or clears a softwarebreakpoint in Flash memory. Topreserve the life of the LPC2136 Flashmemory cells, J-Link RDI onlyprograms Flash sectors when it isabsolutely necessary. Many times onlya single sector has to be programmedas multiple software breakpoints areoften located in the same Flash sector.Even though software breakpointsare being utilized, hardwarebreakpoints are included in themix as well, when they can be usedefficiently by the J-Link RDI. A built-in■ PHOTO 4. The first 64 bytes of codeyou see in the Flash dump (address0x0) make up the interrupt vector area.This area of code is always remappedto 0x00000000 thru 0x0000003F. We’lltalk more about this code area later. TheLPC2136 SRAM begins at address0x40000000 and I’ve used a bit of it asa billboard in this shot. Note thatI dumped the SRAM in the J-LinkCommander window to prove a point.May 2006 89


LISTING 1:This code initializes the LPC2136’s UART1. If this doesn’t make much sense to you now, don’t worry.By the time we’re done with our LPC2136 Design Cycle, you’ll be right at home with this code./*Configure the pins that are connected to RX and TX on UART1 */PINSEL0 = (1


THE DESIGN CYCLEprinted circuit board version of theLPC2136 Development Board. Eitherway, I’ll make printed circuit boardsand all of the parts you’ll need availableto you via the EDTP Electronicswebsite (www.edtp.com).I’ll also have my programmer haton in the next installment of DesignCycle. After we walk through theassembly of our new LPC2136Development Board, we’ll investigatewhat it takes to write an LPC2136 Cprogram and put some more of theLPC2136 hardware through its paces.As always, feel free to contact meat peterbest@cfl.rr.com with anyquestions you may have. After all, it’smy job to help you put an ARM microcontrollerinto your Design Cycle. NVAtmel AVR based Micro64/128Embedded Controller Module8-Channel Analog to Digital ConvertorReal Time Clock/Calender29 Digital I/OSPI & I 2 C BusTwo Serial PortsSerial Boot LoaderRS-232, 422 or 485Selectable BaudRates up to 250 KbpsOnly 1.5 Cubic InchesSupports Assembly,BASIC and C Prog. LanguagesInexpensive CodeVision C CompilerABOUT THE AUTHOR■ Peter Best can be contacted viaemail at peterbest@cfl.rr.comStarting at Only- Single Qty$119Start DevelopingThe Micro6/128 DevelopmentBoard takes the Micro64/128 I/Opins and expands them out tosolder pads and headers for easeof connection when developing.It also connects USART1 to RS-232drivers or directly to screwterminals for RS-422 or RS-485communication. USART0 is alsoconnected to RS-232 drivers. TheRS-232 drivers are connected totwo DB9 connectors. This boardincludes a prototyping area so the user can add externalcircuitry. There is an onboard voltage regulator for powering theMicro64/128 and additional circuitry. The Micro64/64A/128/128Adevelopment system comes complete with a Micro64, Micro64A,Micro128 or Micro128A, a Micro64/128 Development Board, and apower supply.VISIT WWW.MICROMINT.COM FOR MOREINFORMATION or Call 1-800-635-3355Lead-AcidNi CadNi MHLi-ionBATTERY-BASEDPOWER SUBSYSTEMFOR YOURAPPLICATIONIntelligent Batteryand Power System• Highest Power DensityAvailable• Component Level PowerSupply - Includes UPSFunctionality• Built-in Safety Circuits• 95 to 12,000+ Watt-Hoursat 3.3 to 48+ VDC• Integrated Charger -AC/DC/Solar/Fuel Cell• Intuitive Windows-basedManagement GUICall today!508-678-0550www.ocean-server.comTMMay 2006 91


■ BY L. PAUL VERHAGEThe chart in Figure 2 is an exampleof the cosmic ray data from mynear space flights. Notice that thecosmic ray count rises from abouteight counts per minute (CPM) at thesurface (an elevation of 2,400 feet athome) to a maximum of around 700CPM at an altitude of 62,000 feet.NEARSPACEAPPROACHING THE FINAL FRONTIERTHE NEAR SPACE GEIGERCOUNTER TELESCOPE — Part 1MANY OF MY NEAR SPACE MISSIONS havemeasured the cosmic ray flux in near spacewith onboard Geiger counters. CombiningGeiger counter data with GPS altitude hasallowed me to generate charts showing thecosmic ray flux as a function of altitude.Experiments like this allowed the Austrianphysicist Victor Hess to prove the existenceof cosmic rays in 1911-1913.■ FIGURE 2. Example of cosmic-ray data.Altitude (feet)120000100000800006000040000200000Surprisingly though, the cosmic raycount decreases above 62,000 feet.It took me a few days to discoverwhy the cosmic ray flux decreases atthe highest altitudes. When a cosmicray enters Earth’s atmosphere, itslams into a molecule in the air andshatters it. This collision creates ashower of secondary cosmic rays thatTV03I Cosmic Ray0 100 200 300 400 500 600 700 800Flux (counts/minute)92 May 2006■ FIGURE 1. A mission-ready Geiger counter telescope.continue towards the surface. Asecondary cosmic ray can create additionalsecondary cosmic rays thoughcollisions. The decreased cosmic rayflux above 62,000 feet is therefore anindication that only original (primary)cosmic rays are being detected. Theyhaven’t yet had a chance to collide.After enough collisions, however,most secondary cosmic rays haveso little energy that they areundetectable at the Earth’s surface.So on the surface, we’re detectingonly those cosmic rays that survivedcollisions with molecules in the air.This introduction has so fardiscussed only the history of a cosmicray after it enters our atmosphere, notwhat a cosmic ray is. Most cosmic raysare hydrogen nuclei or protons. Thereare also some helium nuclei (alphaparticles) thrown into the mix alongwith the nuclei of heavier atoms,energetic electrons, and a few gammarays. Where does this zoo of subatomicparticles come from? Today it’sbelieved they originate in supernovaexplosions and from the sun.


Subatomic particles, such as protonsand electrons, gain energy andchange their direction of travel if theydrift through a supernova’s powerfulshockwave. Repeated passagesthrough the shockwave imparttremendous energy to them until theyare energetic enough to escape themagnetic fields of a supernova explosion.At this point they become cosmicrays. Most cosmic rays travelaround the galaxy because they don’thave the energy to escape its magneticfield. They create the backgroundradiation that permeates outer space.The sun’s activity is a secondsource of cosmic rays. When eventslike solar flares occur, radiation levelsin space can rise dramatically.Sometimes satellite electronics aredamaged by this radiation. Somesolar events increase the risk ofradiation poisoning for astronautsresiding outside the Earth’s protectivemagnetosphere, so Mars-boundastronauts will have radiation-stormshelters onboard their spacecraft.Because of their differing histories,cosmic rays carry a wide range ofenergies. The lowest energy ones areweak enough that a thin-skinnedspacecraft can shield astronautsinside. However, some of the ultrahighenergy (UHE) cosmic rays arereal animals. One UHE cosmic ray wasdetected carrying the same energy asthe fastest thrown baseball. Thinkabout that. We’re talking about theenergy of a baseball traveling at over100 mph inside a single subatomicparticle. If its energy could be capturedinside a thimbleful of water, thewater would boil instantly. A thimbleof water doesn’t stop cosmic rays ofthis energy. In fact, a UHE cosmic raywould hardly notice that the thimbleexisted as it plowed through it. Thesepowerful cosmic rays may originatefrom the most monstrous objects inthe universe — massive black holes inthe centers of galaxies with activenuclei. However, because of the BigBang’s pervasive cosmic microwavebackground (CMB), a UHE cosmic raymust originate in a nearby galaxy. AUHE cosmic ray will lose its energythrough collisions with the CMB’sphotons if it encounters too many.Counting cosmic rays amazes me.Every “click” of my Geiger counter isthe detection of a single cosmic ray.This means that at high altitudes, mycosmic ray experiments are detectingindividual atoms from another star.Having flown numerous cosmic raydetectors on near space missions, I’mnow looking for new ways to fly theseexperiments. While I haven’t founda way of determining cosmic ray energies,I now have a way to determinetheir direction. So this month I’lldescribe my Geiger counter telescope.In the next article you’ll be able toread about its testing and results.THE PROBLEM OF THESINGLE GEIGER COUNTERGeiger counters can only detectionizing radiation. Inside each Geigercounter is a Geiger-Muller (GM) tube— a metal tube filled with a lowpressuregas (or combination ofgases). Running through the center ofeach GM tube is a wire. The circuitry ofthe Geiger counter creates a potentialdifference between the wire and thetube’s metal jacket. While large, thepotential difference is still smallenough that current can’t travel acrossthe gap between the wire and thetube. A particle of ionizing radiationpassing through the tube creates achannel of ionized gas. The channel ofionized gas creates a path that allowssome electrons to flow between thetube and the wire. The flow of thesefirst few electrons knocksmore electrons off the gasmolecules inside the tube,allowing more electrons toflow through the channel.That current is amplified bythe Geiger counter’s circuitry,creating the click-click of badscience fiction movies.A process called quenchingeventually stops the flowof electrons between the centerwire and the metal jacket.Without quenching, the gasinside the GM tube would■ FIGURE 3. Two RM-60 Geigercounters and their coincidencecounter.NEAR SPACEremain ionized. With a GM tube filledwith ionized gas, a Geiger counter isunable to detect any additional ionizingradiation traveling through it. Thetime required to quench a GM tube iscalled its dead time. The shorter thedead time, the more frequently radiationcan be detected by the GM tube.The dead time of my Geiger counter is20 μs. Therefore, my Geiger countercan detect up to nearly 50,000 CPM(assuming that the radiation eventsare evenly spaced apart). Of course,this represents a nuclear-war level ofradiation. So if I detected a count ratethis high, I wouldn’t be around longenough to wonder what was going on.Geiger counters are insensitive todirection because ionizing radiationfrom any direction is capable of triggeringan output. So unless somekind of trick is employed, there is noway for a Geiger counter to determinethe source or direction of theradiation. One method used todetermine the source of radiation isto walk closer to the potential sourceand listen for a correspondingincrease in detected radiation.There’s another way to detect thedirection of radiation, and that’s withthe coincidence counter. A coincidencecounter is an AND gateemployed between two or moreGeiger counters. Two Geiger counterswill produce simultaneous outputsonly when an ionizing subatomic particlepasses through both detectorsand the particle passes through bothGM tubes during their dead times.May 2006 93


■ FIGURE 4. Aware Electronics’ RM-60Geiger counter.Note that in a high-radiation environment,there can be simultaneous, butunrelated detections. Think of thecoincidence counter as filtering outthe non-simultaneous signals andpassing only the simultaneous ones.Now, if the relative positions of bothGeiger counters are changed, then sois their direction of sensitivity. I’veused this principle to assemble aGeiger counter telescope capable ofmeasuring changes in cosmic ray fluxas a function of elevation in the sky.BUILDING THEGEIGER COUNTERTELESCOPE (GCT)Mine’s not the first. The Pioneer10 spacecraft — the first spacecraft totravel beyond the asteroid belt toJupiter — carried a Geiger counter telescopeto measure the flux and directionof radiation in the distant solarsystem. My near space GCT holds twoGeiger counters that are fixed relativeto one another. The GCT is able to94 May 2006change their pointing directionbecause I mounted the two Geigercounters inside a tube that a servocan rotate into any elevation. The outputsfrom each Geiger counter arerouted to their coincidence counterinside the near spacecraft. The flightcomputer inside the near spacecraftcommands the servo to rotate thetube to a new elevation and recordsthe output of the coincidence counteralong with the current GPS altitude.Before describing how to build theGCT, let me first explain what kind ofGeiger counter I use. Aware Electronicsmanufactures the RM-60 Geiger counter.The RM-60 operates over a PC orlaptop serial port. Not only does itsend data over the serial port (as aseries of five-volt pulses), but it alsogets its power over it. The RM-60 is avery smart and compact design. It’s theperfect Geiger counter to interface to amicrocontroller like the BASIC Stamp.The RM-60 weighs 3.8 ounces andmeasures 2.45” wide, 4.45” tall, and1.25” deep. There are three wires in itsserial connector: +5V, ground, andpulse. Its serial cable is a telephonecable terminating in a RJ-11 connector.I started this project by buildingthe GCT tube first. Then I built the GCTmount around the tube. The tube isconstructed from 1/4” balsa sheet. The■ FIGURE 5. Inside the RM-60.The GM tube is located at theupper left of the box.four sides of the tube are cutlarge enough that the completedtube can hold two RM-60s,one above the other, with a 1/2”head space above the topGeiger counter. The bottom ofthe tube is sealed, and the topis left open. The RM-60s fittightly enough inside the tubethat I had to drill a small holein the center of the tube’s bottom tolet me push the RM-60s out with adowel or pencil (using the eraser end).This tube rotates around its middleto limit torque acting on the elevationservo. But if I drilled two holes into the1/4” balsa and mounted the axle intothe balsa, it would most likely crack thetube. So I epoxied a 1/2” by 1/4” basswoodstrip along the midline of thetube for the axle. The basswood strip isstronger than the balsa and will notbreak when the axle is mounted to it.Because there’s no room betweenthe RM-60s, the axle does not go fullythrough the GCT tube. The axle is intwo pieces and they’re only mountedinto the basswood strip. One half ofthe axle is a 1/4” wooden dowel thatextends one inch beyond the GCTtube. This axle dowel freely rotateswithin a hole in the GCT mount, whichI’ll describe later. The other half of theaxle is a servo horn that is bolted tothe basswood strip. The servo hornattaches to the elevation servo that ismounted into the GCT mount.To prevent the RM-60s from fallingout of the GCT tube, the tube’s openedend is sealed with a cap of Styrofoamand plywood. The Styrofoam is 1/2”thick and fills up the remaining headspace inside the GCT tube. A 1/8” thickmodeling plywood plate epoxied tothe Styrofoam helps keep the cap inplace and prevents the rubber bandsfrom cutting into the Styrofoam. Twoholes are drilled through the end ofthe GCT tube. Dowels, epoxiedthrough the holes, are the hooks thatrubber bands wrap around to hold the■ FIGURE 6. Front and side views of theGCT tube. The center of the servo hornlines up with the dowel on the oppositeside of the GCT tube.


GCT cap in place in Figure 7.The GCT tube is finished bycutting small holes into it over theRJ-11 jacks in the RM-60s. Theseholes are where the RM-60 serialcables exit the GCT tube.Now that the tube is completedand its final dimensions known, it’stime to begin work on the GCT mount.The GCT mount is essentially a pair ofarms that hold the axle of the GCT tube.One side of the GCT tube axle rotatesfreely in the mount and the other sideof the GCT tube axle engages the elevationservo in the mount.On my near spacecraft, the GCTmount is attached to a plate of plywoodand Styrofoam that I call a quad port.My design is fully described in my nearspace book at the Parallax website(www.parallax.com/html_pages/resources/custapps/app_nearspace.asp). Youmay decide to adopt a different standardfor your near spacecraft airframes,and if so, you’ll need to attach your GCTmount differently than I do.My GCT mount is constructedfrom 1/8” modeling plywood. Thesheets are epoxied together to form apair of rigid arms. The arms must berigid or else the GCT tube will dropout of the mount. That’s not a goodthing at 100,000 feet. Figure 8 showsthe design I used for my GCT mount.Now the GCT tube is complete, sowe can make sure the arms are long andwide enough.The arms of theGCT mountmust be longenough that theelevation servo■ FIGURE 9.Gap betweenthe GCT tubeand the mountarms. The spaceris a brasslamp fixture.Normally I usenylon spacers,but I didn’t haveone in my junkbox that fit myaxle dowel. Youcan also usewashers to fillthe gap betweenthe GCT tubeand mount.can reach the servo horn in the tube.The width of the arms is partiallycontrolled by the size of the elevationservo. But by making them wider, wecan increase their rigidity in the verticaldirection. To increase their rigidity inthe horizontal direction, I epoxiedbraces to the arms. On my GCT the armsare 3-1/2” wide and 6” long.Normally, I make compositebooms for my near space experiments.You can read more about how Iconstruct them in my near space book.In my next column I’ll have a shortreport on their construction and sometests on their breaking strength. Thebreaking-strength test is somethingI’ve wanted to do for a long time.I made a rectangular cutout inone arm for the elevation servo. Theservo mounts into the cutout withonly two bolts that are in diagonalcorners of the servo. The left arm hasa much larger cutout. A thick plasticplate attaches to this cutout with fourbolts. A hole drilled in the plasticplate holds the GCT tube axle dowelto the arm. By making this plateremovable, it’s easier to attach theCGT tube to the mount.Since the elevation servo is fixedin place, I zip-tied it to its cable tomount to keep it from getting tangledup with the cables from the RM-60s.There’s a hole in the mount that letsNEAR SPACE■ FIGURE 7. The GCT cap.the elevation servo cable pass into theinterior of the near spacecraft airframe.I find most servo cables are too shortto reach the flight computer. So theelevation servo’s cable was cut in twoand extended in length with a wiresplice. This is cheaper than purchasinga servo extension cable at the hobbyshop. And I think it’s more reliablesince the connection is solderedtogether. You’ll note that there’s a gapbetween the GCT tube and the mountarms. That gap is filled with a plasticor metal tube that’s cut to the correct■ FIGURE 8. The GCT mount.May 2006 95


■ FIGURE 10. The completed GCT.length. That tube also makes it easierto mount the GCT tube into place. Cutthis tube slightly shorter than thewidth of the gap, since you wantthe GCT tube to rotate with minimumfriction (see Figure 9).Be sure to center the elevationservo before you attach the GCT tubeto it. Then slide the spacer over theaxle dowel and finish by bolting theplastic plate into its arm. The GCTtube should be free to rotate from atleast horizontally to vertically.I found that the arms in my GCTmount were not as rigid as they neededto be (that’s not a problem when I usemy customary laminated Styrofoam).So I epoxied an additional plate overthe top of the arms and near their base.Although the position of this plateprevents the GCT tube from rotatingbelow the horizon, I don’t need to makea measurement from that positionduring a near space mission.I finished the GCT mount bycutting two holes through it to allowthe RM-60 serial cables to passthrough and into the interior of thenear spacecraft airframe. Figure 10shows my completed GCT, and Figure11 shows it rotated into the verticaland horizontal positions.My next near space column willinclude the code needed to operatethe GCT and will describe the testingI performed on it. I figure you’ll haveyour GCT telescope done by then.Onwards and Upwards,Your Near Space Guide NVHobbyEngineeringThe technology builder's source for kits, components, supplies, tools, books and education.Robot Kits For All Skill LevelsICs, Transistors, Project Kits■ FIGURE 11. These images show theGCT mount on its side because that’sthe way it will mount to the airframe ofmy near spacecraft.Motors, Frame Componentsand Scratch Builder Supplies.Books andEducational KBEAM Kits and ComponentsOrder by Internet, phone, fax or mail.www.HobbyEngineering.com1-866-ROBOT-501-866-762-68501-650-552-99251-650-259-9590 (fax)sales@HobbyEngineering.com180 El Camino RealMillbrae, CA 94030Visit our store near SFO!Most orders ship the day received! World-wide shipping. Convenient payment options.96 May 2006


EH TUBES Our complete line of world-renowned vacuum tubes for any application.5U4GB EH6V6GT EH300B EHEL34 EH6BM8 EH12AT7 EH6550 EHEL84 EH6CA4 EH12AT7WC EH6922 EHKT88 EH6CA7 EH12AU7 EH6973 EHKT90 EH6CG7 EH12AX7 EH7591A EH6L6 EH12AY7/6072A EH7868 EH6SN7 EH12BH7 EHRaise the bar with gold-plated pins and grids.6C45Pi EH G6CG7 EH G6H30Pi EH G6SN7 EH GG OLD P INS12AT7 EH G12AU7 EH G12AX7 EH G12AY7/6072 EH G12BH7 EH G5751 EH G6922 EH G2A3 EH GG OLD G RIDS300B EH GTEL: 800.633.5477 FAX: 718.937.9111 info@ehx.com www.ehx.com www.newsensor.com


CLASSIFIEDSPLANS/KITS/SCHEMATICSSPEAKERSROBOTICSComplete Selection of MIL-Spec Coax,RF Connectors and RelaysUG-21B/U N Male for RG-213/214 .$5.00UG-21D/U N Male for RG-213/214 .$3.25N Connectors for 9913/Flexi4XL/9096UG-21B/9913 .....$6.00 / Pins Only......$1.50UG-21D/9913 ..$4.00 / Extra Gasket.$0.75Amphenol 83-1SP-1050 PL-259 $0.90UG-176/U Reducer RG-59/8X, $0.25or 5/$1.00UG-175/U Reducer RG-58/58A, $0.25or 5/$1.00Silver Teflon PL-259/Gold Pin, $1.00or 10/$9.00MIL-Spec Coax Available (Teflon, PVC IIA)New Product: Belden 9913F, 9913 withHigh Density PE Foam dielectric,stranded center cond. and DuobondIII Jacket $0.80/ft or $76.00/100ftAlso New: 9092, RG8X with Type II Jacket.Intro Price ............$23.00/100ftCall for Specials of the MonthFull Line of Audio Connectors for Icom,Kenwood, and Yaesu8 Pin Mike Female $2.508 Pin Mike Male Panel $2.5013 Pin DIN for Kenwood $2.758 Pin DIN for Icom $1.008 Pin DIN for Kenwood $1.50Prices Do Not Include ShippingOrders 800-783-2666Info 301-840-5477FAX 301-869-3680CONNECTORS/WIRE/CABLETC The RF ConnectionHRONNECTIE213 N. Frederick Ave., Ste. 11NVF Gaithersburg, MD USA 20877ONhttp://www.therfc.com/AUDIO/VIDEOLCDs/DISPLAYSBUSINESS SERVICESSubmit yourBESTsecurity/videostories for anupcoming book.$$ ADVANCESRBogdan.comwww.servomagazine.com98 May 2006


CLASSIFIED ADVERTISING $50.00 Per Inch — No extra charge for color.Classified ads must be paid in full prior to the closing date or the ad will beplaced in the following issue, at our discretion. Minimum charge is one inch withhalf-inch increments. No proofs will be sent. Ads to be typeset by <strong>Nuts</strong> & <strong>Volts</strong>must be received by the closing date. Supplied ads must be received by theartwork due date.Call 951-371-8497 or email classad@nutsvolts.com for closing dates,available sizes, and special prepay discount offers.COMPONENTSDESIGN/ENGINEERING SERVICESFloating Point CoprocessorI2C to 400 kHzSPI to 4 MHz32-bit IEEE 75432-bit integerPre-defined functionsUser-defined functions8-pin DIP or SMTuM-FPU IDE generates codefrom standard math expressionsApplications: sensor readings,GPS calculations, robotics, signalprocessing, embedded systemswww.micromegacorp.comFREE 120 Pg CATALOGElectronic components, kits,test equipment, tools, and suppliesfor hams, hobbyists, andbusinesses. Many hard-to-finditems like variable capacitors,vernier dials, coil forms, magnetwire, and toroids.Ocean State Electronicswww.oselectronics.comBaroModMEASUREALTITUDEBarometric Module0-5V analog outLinear response,20’ or better resol.Range: –500 to 20K’Use on science projects,kites, balloons, planes,flight recorders.Transolve.comjohnf@apk.netBATTERIES/CHARGERSSmart Battery ChargerFOR GEL- CELLS orLEAD ACID BATTERIESNew &ImprovedFeatures: Precision temperature tracking voltagereference & three mode charging sequence.Standard kit is for 12V @ 1/2 or 1 Amp. userselectable. Can be connected to the batteryindefinately, will not over-charge. Weighs 2 poundsand measures 4” W x 5 1 /2” D x 2 1 /2” H. Finishedenclosure included in kit.Complete Kit (#150-KIT) ............................... $59.95Assembled & Tested (#150-ASY) ................ $79.95CA Residents add 7.75% sales tax. S&H: $7.50 (insured)Foreign orders add 20%www.a-aengineering.comA & A Engineering2521 W. La Palma #K • Anaheim, CA 92801(714) 952-2114 • FAX: (714) 952-3280COMPUTERHARDWAREWANTEDDEC EQUIPMENTWANTED!!!Digital Equipment Corp.and compatibles.Buy - Sell - TradeCALL KEYWAYS 937-847-2300or email buyer@keyways.comSATELLITEFREE Satellite TV Buyer’s GuideHome of DishSkinzC-band • Ku-band4DTV • MPEG-2Get it all with just one call!800-500-9275MILITARY SURPLUSPUBLICATIONSCNC BookEasy CNCG-codeBit map draw programsBit map image converterBit map to G-codeCAD - machine drawingsCAM - DXF to G-codehttp://www.cncintro.comSQUARE 1ELECTRONICS(208) 664-4115Hayden, ID USAwww.skyvision.comMay 2006 99


READER FEEDBACKdoesn't have to be limited to the firsttwo pages, you can view the wholepatent at the patent office website:www.uspto.govOnce there, click on Search (underthe "patents" heading), then PatentNumber search, and when the text boxopens up just put in the number of thepatent (1,745,175)Howard MarkSuffern, NYBasic column. I realize that companiesspend quite a few advertising dollarswith you guys but, I'm really tired oflearning new and innovative ways toblink or flash an LED or two using a PICand PICBasic. Are these the only authorsyou can find? Or do you just ignore theothers in favor of your large advertisers?Don't get me wrong, I mean no offenseto the YAPB authors but two regularcolumns plus a project or two all basedon PICs and PICBasicwould perhaps bebetter served by a magazine titled PICsand Stamps rather than <strong>Nuts</strong> & <strong>Volts</strong>.Glenn HamblinTucson, AZGLAD “TRENCHES”GETS THE ... SHOVELI am very glad that the "In theFREE DIPSI noticed the info about Diptrace.I had no idea there was a free version.I was doing a project that was too largefor EagleCad and I wanted an autorouter.Diptrace did the job perfectly.It seems to be a great program forthose small to medium jobs. The bestpart is it isn't difficult to learn like andwill autoroute one layer with jumpers.The only downfall is it doesn't have anyof the new pics in the library, you haveto create them.Ben YarochGETTING OLDERAND BETTERJust wanted to say that I think themagazine has gotten better and betterover the years when all the industrialelectronics mags that I get are gettingworse. I really like the fact that I cannow download an electronic versionthat allows me to view past issues a loteasier than digging out a paper copy.Kudos to you for all your effort and thegreat content of your mag ... and keepthe PIC projects coming too!Bob StoutMilwaukee, WISAD “TRENCH” DIGGERI was quite disappointed to learnthat Gerard Fonte's column "In TheTrenches" was discontinued. I lookedforward to that column every month. Itwas always filled with the kind of insightthat is only obtainable after having beenaround the block a time or two. I waseven more disappointed to learn it wasapparently replaced by Yet Another PICNEW!HIDmaker FS for Full Speed FLASH PIC18F4550Creates complete PC and Peripheralprograms that talk to each other overUSB. Ready to compile and run!• Large data Reports• 64,000 bytes/sec per Interface• Easily creates devices with multipleInterfaces, even multiple Identities!• Automatically does MULTITASKING• Makes standard or special USB HIDdevicesNEW! “Developers Guide for USB HIDPeripherals” shows you how to makedevices for special requirements.Both PC and Peripheral programsunderstand your data items (even oddsized ones), and give you convenientvariables to handle them.PIC18F Compilers: PICBASIC Pro,MPASM, C18, Hi-Tech C.PIC16C Compilers: PICBASIC Pro,MPASM, Hi-Tech C, CCS C.PC Compilers: Delphi, C++ Builder,Visual Basic 6.HIDmaker FS Combo: Only $599.95DOWNLOAD the HIDmaker FS Test Drive today!www.TraceSystemsInc.com301-262-0300May 2006 101


Trenches" columnhas been discontinued.While I thought it was wellwrittenand very good for what it was,it was not at all congruent with the reasonsI enjoy <strong>Nuts</strong> & <strong>Volts</strong>. I rely on themagazine for information about electronicsprojects and new devices/circuits. This is not, in my view, what"In the Trenches" was about — at all!Please don't let the only electronicshobby magazine in the US go underbecause of non-electronics material!Thanks!Dave WisemanNO FUZZY LOGICI always thought the"fuzzball" rating system forprojects was out of place in<strong>Nuts</strong> & <strong>Volts</strong>. The plaincircles are much moreappropriate. Nut & <strong>Volts</strong> isa great magazine and theREADER FEEDBACKonly complaint I've ever had was thefuzzball thing and it seemed too pettyfor me to complain about it. But nowthat it's been changed, I can say “ThankYou.”Keep up the good work. <strong>Nuts</strong> &<strong>Volts</strong> just keeps getting better.Eric R. SnowAMP-ED UPExcellent article by GeorgeTrinkaus on the Mag-Amp. No boringretoric, excellent easy-to-understanddiagrams, top notch work. A beginnerwould have no trouble constructingone. In case you don't know all theangles, I use the same process insome of my positioning indicators.Figure 1 is a good enough diagram. Ifyou secure the ferrite stick to yourdoor, and the coil to the door frame,you can — with extreme accuracy —measure how far the door is opened.Also a tremble switch can beconstructed by connecting the ferritestick to a spring when the assemblyis wiggled, a voltage change occurs.One last thing, the article specifies115 volts, but the unit will work withvoltages as low as 12, and you canbuild them for free!Overall a perfect article.Steve BehlingSouth Bend, INPIN PICKINS’In my March PICto-PCcommunicationarticle, I made a mistakein the schematic.The C7 pin should beconnected to the R2outpin of the RS232 chip andthe C6 pin should beconnected to the T2in pin.This is opposite ofthe printed schematic. Acorrected schematic isshown to the right.— Chuck HellebuyckCOMPLETE OUR ONLINE READER SURVEY FOR A CHANCE TOWIN A TOM TOM GPSNAVIGATION SYSTEMYour input will help us make <strong>Nuts</strong> & <strong>Volts</strong> a betterelectronics magazine. At the end of the survey, you canenter our drawing for a portable GPS navigation system.Go to www.nutsvolts.com now and complete ourReader Survey for your chance to win!102 May 2006


May 2006 103


Interface a sharp LCD display to your BASIC Stamp® or othermicro-controller project with ease. No-solder wiring harnessesand easy mounting kits available too. See www.seetron.com today.• 3.2 x 1.4 in. supertwist LCD• 2400/9600 baud serial• Low (≈2mA) current draw• Great with BASIC Stamps ®BPI-216N• 3.2 x 2 in. backlit LCD• 1200-9600 baud serial• Advanced protocol, 4 switch inputs• EEPROM for configuration settings• Favorite for OEM applicationsILM-216L• 3.2 x 1.4 in. graphics LCD• 2400/9600 baud serial• Font and 15 screens in EEPROM• Easily draw points, lines, screensSGX-120L• 3 x 2 in. supertwist LCDTRM-425L• 1200-9600 baud serial• ESD-protected, 4x4 keypad input• Store up to 95 screens in EEPROM1939 S. Frontage Rd. #F, Sierra Vista, AZ 85635phone 520-459-4802 • fax 520-459-0623www.seetron.com • sales@seetron.com 104 May 2006


Logon to our website for secure shopping cart, powerfulsearch engine, and latest news!Silicon Valley’s Electronics Marketplace♦ Vwww.halted.comGot excess electronic inventory? Send us your list or give us a call, we’d be happy to make an offer!Call 1-800-4-HALTED (1-800-442-5833) to order... ...or use our web search! Deals @ HSC!SearchEmbedded Wireless Transceiver!2.4GHz - 200mW, 5VDCHSC#21001 $65.00Plantronics LS1 Computer Headset(Stereo & mic. plugs, not RJ-11)HSC#20948 $12.50Clamp-on Ferrite filterHSC#20718 $1.75Electro-Hobbyist Alert -- HSC is your source!Even before there was a place called “Silicon Valley”, HSC was the favorite stop of hardware hackers,techno-tinkerers, entrepreneurs and engineers on a budget! We have been buying and selling the Valley’sexcess inventory for 40 years now, and our collection is second-to-none! We are also factory-authorizeddistributors for many fine lines of parts, tools, equipment and accessories, so we feel we should be your firststop when shopping for electronic basics. Give our ever-expanding website a try and see what we mean!PCI Internet Phone cardHSC#80790 $9.95Monochrome 10.4” LCD panelHSC#20792 $9.95Small DC Motor, 9 - 24VDCHSC#19669 $1.95“Backpack Bantam”Parallel-port external CD ROMHSC#20972 $19.95Logitech QuickCam ExpressHSC#21061 $19.50Docking Logitech Mini USB Keyboard!Includes Playstation2 Gamepad!Toroidal Transformer, 70VCT, 1A HSC#21023 $14.95HSC#20691 $14.95Step-down Toroid Transformer240 - 120 VAC 250VAHSC#22058 $35.00Phihong switching power supply100-240 VAC in, 5VDC, 6A out -- small!HSC#20659 $17.50Ultrasonic Range SensorFixed distance (but hackable?)HSC#19833 $9.95Hands-free Cellphone headsetFits Nokia, many othersHSC#20248 $3.95300W ATX PS with huge fan!HSC#21055 $17.50Parallax Basic Stamp IIReg. $49.00HSC#PAR012 $39.00Jennings Vacuum Capacitor, 12pF, 20KVHSC#20134 $45.0012VDC Motor, worm gear reduction2 speeds, 40 & 106 RPM -- Hi torque!HSC#20554 $19.95Swiss-made DC gearmotor5VDC to 15VDC, approx. 60 RPMHSC#20774 $12.50TIL-311 Hexadecimal LED DisplayHSC#20219 $5.95Sound Activated NeonLight for your PC!HSC#20441 $9.95Wireless Transmit/Receive setfrom RainBird Sprinkler systemHSC#21057 $4.95CompuMotor OEM010Stepper Motor Indexer/Driver(pdf on HSC Website)HSC#20851 $29.50PCMCIA FireWire cardHSC# 20830 $12.50PCMCIA DVD/MPEG Video CardHSC# 20829 $12.50Bargain Multimeter...Tiny!HSC#20970 $8.95Fisher speaker, 5 dia. (5 1/2” mtg. holes)Fabric suspension (no rotten foam!)HSC#20790 $6.95Fujitsu PenCentraTablet Computer -Good to Go!♦ Fujitsu PenCentra 130 computer♦ 131 MHz NEC VR4121 MIPS CPU♦ 32MB DRAM, 24MB ROM, 8MB Flash♦ Color DSTN Touch LCD 640 x 480♦ PCMCIA, VGA, PS2, USB, SIO ports♦ Win CE 2.11 Pro in PROM (no disks!)♦ Microsoft Pocket Office, Outlook, IE♦ “Radio Ready” for LAN/WAN PC Card♦ Internal microphone, speaker & jacks♦ Stylus, Mini Keyboard, Dock & PS♦ New, never used, 90-day warranty!HSC# 80797 $159.00Outlets by the foot!♦ TrippLite PS6010-20T Outlet strip♦ 5 ft. long, extruded aluminum housing♦ 10 Standard AC receptacles (US)♦ 15 ft. 12ga cord, 20A twist-lock plug♦ Perfect for test benches, rack units!♦ Regular factory price over $90.00!♦ We sell reg. AC plugs, 8515PB, $2.95♦ New, factory boxed, with bracketsHSC#20794 $39.95Special! 3/$99.00!Rack Mount Power!♦ Pulizzi Engineering 1559C♦ Rack-mount power distribution unit♦ Dual 20 A EMI/RFI Filtering♦ 190 - 240 VAC input, 105 - 135 AC out♦ Perfect for server rack units!♦ Dual 20 A circuit breakers♦ 12 115 AC outlets, indicator lamp, fan♦ 2U height, 3.5” x 17”, 65 lbs. weight♦ Heavy 9’ cord with twist-lock plugHSC#20828 $125.00Three Retail Stores to serve you!Main Office - Mail Orders...3500 Ryder St., Santa Clara, CA 95051Santa Clara 1-408-732-1573Sacramento 1-916-338-2545Rohnert Park 1-707-585-7344Since 1964!...Silicon Valley’s BEST place to shop for Electronics!Look for us on...seller ID:hscelectronicsupplyOrder Toll-Free: 1-800-4-HALTED (442-5833)or...ONLINE AT: www.halted.comTerms: Some quantities limited; all items are subject to prior sale. Minimum order: $10.00plus shipping. Orders under $30.00 subject to $3.00 handling fee, in addition to shipping.All orders shipped by UPS Surface unless otherwise specified. $7.50 UPS charge addedfor COD. Visit our website for detailed information on domestic and international shipping.May 2006 105


EMBEDDED LINUXStarter KitFEATURES INCLUDE: Linux 2.4 Kernel 486-133 MHz based SBC 10/100 Base-T Ethernet 16MB DOC Flash Disk 32MB RAM Power Supply Carrying Case Starting at $399.00 X-Windows (option) RealTime Linux (option)Imagine running Embedded Linux on a SingleBoard Computer(SBC) that is 4.0" x 5.7" andboots Linux from a Flash-Disk. No hard drives,no fans, nothing to break. Now your hardwarecan be as reliable as Linux! If your applicationrequires video output, the X-Windows upgradeoption provides video output for a standardVGA monitor or LCD. Everything is included;Ready to Run Linux!Since 1985OVER20YEARS OFSINGLE BOARDSOLUTIONSEQUIPMENT MONITOR AND CONTROLPhone: (618) 529-4525 Fax: (618) 457-0110 www.emacinc.com106 May 2006


May 2006 107


Selected Titles for the Electronics Hobbyist and TechnicianThe <strong>Nuts</strong> & <strong>Volts</strong> Hobbyist BOOKSTOREHOME COMPUTINGSERVO CD-RomStarting with thefirst SERVO issue— November2003 — all of theissues through the2004 calendaryear are nowavailable on a CDthat can besearched, printed,and easily stored.This CD includes all of Volume 1, issues 11-12 and Volume 2, issues 1-12, for a total of14 issues.The CD-Rom is PC and Maccompatible. It requires Adobe AcrobatReader version 6 or above.Adobe AcrobatReader version 7 is included on the disc.$29.95Embedded Ethernet andInternet Completeby Jan AxelsonLearn how to designand program devicesthat host Web pages,send and receive e-mail, and exchange filesusing FTP. Put yourdevices on the Internetand monitor and controlyour devices fromacross town or aroundthe world. Create private,local networks that enable yourdevices to share information, send commands,and receive alarms and statusreports. Plus: learn about Ethernet controllers,hardware options for networks,networking protocols, and more $49.95Anti-Hacker Tool KitThird Editionby Mike ShemaStop hackers in theirtracks! Organized bycategory, Anti-HackerTool Kit,Third Editionprovides completedetails on the latest andmost critical securitytools, explains their function,and demonstrateshow to configure themto get the best results.It is completely revised to include the latestsecurity tools, including wireless tools.This book also includes new tips on howto configure the recent tools on Linux,Windows, and Mac OSX. $59.99If you don’t see what you needhere, check out our online store atwww.nutsvolts.com for a completelisting of the titles available.108 May 2006<strong>Nuts</strong> & <strong>Volts</strong> CD-RomHere’s some goodnews for <strong>Nuts</strong> &<strong>Volts</strong> readers!Starting with theJanuary 2004issue of <strong>Nuts</strong> &<strong>Volts</strong>, all of theissues throughthe 2004 calendaryear are nowavailable on a CDthat can be searched, printed, and easilystored.This CD includes all of Volume 25,issues 1-12, for a total of 12 issues.TheCD-Rom is PC and Mac compatible. Itrequires Adobe Acrobat Reader version 6or above.Adobe Acrobat Reader version 7is included on the disc. $29.95ELECTRONICSPrinted Circuit Boardsby R. S. KhandpurThe printed circuit isthe basic building blockof the electronics hardwareindustry.This is acomprehensive, singlevolume self-teachingguide to the art ofprinted circuit boarddesign and fabrication— covering the completecycle of PCBNEW!creation, design, layout,fabrication, assembly, and testing. Clear andconcise, Printed Circuit Boards leads readersthrough the complete cycle of PCB creation,from design, layout, fabrication, andassembly to final testing. Skirting densemathematics, the text provides insight andguidance on design challenges broughtabout by the ever-increasing density oftoday's microelectronics. $99.95MORE Electronic Gadgetsfor the Evil Geniusby Robert E. IanniniThis much anticipatedfollow-up to the wildlypopular cultclassicElectronic Gadgets for theEvil Genius gives basementexperimenters 40all-new projects to tinkerwith. Following thetried-and-true EvilGenius Series format,each project includes adetailed list of materials, sources for parts,schematics, documentation, and lots ofclear, well-illustrated instructions for easyassembly. Readers will also get a quickbriefing on mathematical theory and a simpleexplanation of operation along withenjoyable descriptions of key electronicstopics. $24.95Electronic Sensors for the EvilGenius — 54 Electrifying Projectsby Thomas PetruzzellisNature meets theEvil Genius via 54 fun,safe, and inexpensiveprojects that allowyou to explore thefascinating and oftenmysterious world ofnatural phenomenausing your own homebuiltsensors. Eachproject includes a listof materials, sourcesfor parts, schematics, and lots of clear, wellillustratedinstructions. Projects includerain detector, air pressure sensor, cloudchamber, lightning detector, electronic gassniffer, seismograph, radiation detector, andmuch more. $24.95Bionics for the Evil Geniusby Newton C. BragaStep into the future —(or the past, if youhave a touch of Dr.Frankenstein in yoursoul) — with these25 incredibly coolbionic experiments!Demonstrating howlife forms can beenhanced, combined,manipulated, andmeasured with electronicand mechanical components, theseinexpensive projects from internationallyrenowned electronics guru Newton Bragaprovide hours of fun and learning.Totallysafe, Bionics for the Evil Genius guides youstep by step through 25 complete, intriguing,yet low-cost projects developedespecially for this book — including anelectric fish, a bat ear, a lie detector, anelectronic nerve stimulator, a panicgenerator, and 20 other exciting bioelectric/mechanicalprojects! $24.95Solar Energy Projectsfor the Evil Geniusby John IovineSolar energy is a clean,inexhaustible supply ofenergy that is beingexplored more andmore given the currentstate of ourdependency on foreignoil and global environmentalconcerns.Thisis an easy, fun referencefor building 16NEW!practical and inexpensivesolar energy projects.All projects aretable-top sized models for ease of use andcan be scaled larger if necessary. $24.95


CALL 1-800-783-4624 today!Or Order online @ www.nutsvolts.comTeach Yourself Electricity andElectronics — Fourth Editionby Stan GibiliscoLearn the hows andwhys behind basicelectricity, electronics,and communicationswithout formal training.Thebest combinationself-teachingguide, home reference,and classroom texton electricity andNEW!electronics has beenupdated to deliver the latest advances.Great for preparing for amateur andcommercial licensing exams, this guide hasbeen prized by thousands of students andprofessionals for its uniquely thoroughcoverage ranging from DC and AC conceptsto semiconductors and integratedcircuits. $34.95AUTOMOTIVE50 Awesome Auto Projectsfor the Evil Geniusby Gavin D J HarperThe Evil Genius formatis the perfect "vehicle"for 50 incredible automotiveprojects thatare compatible withany car, no matterwhat make, model, oryear. Focusing on lowcost,easily obtainedcomponents, 50Awesome Auto Projectsfor the Evil Genius liststhe items needed to complete each projectalong with a troubleshooting and repairsection. $24.95MICROCONTROLLERSProgramming the BasicAtom Microcontrollerby Chuck HellebuyckThrough his uniqueway of making thecomplicated understandable,Chucktakes the readerthrough the innerworkings of the BasicAtom by explainingthe Microchip PICMicrocontroller andits roll in the Atommodule. From there,Chuck explains the various PIC based BasicAtom modules and how to use the BasicAtom compiler. Chuck then delivers 13projects the reader can build and learnfrom.The reader can then use this knowledgeto develop their own Basic Atomprojects. $39.95PIC in PracticeA Project-based ApproachSecond Editionby David W. SmithPIC in Practice is a gradedcourse based around thepractical use of the PICmicrocontroller throughproject work. Principlesare introduced gradually,through hands-onexperience, enablingstudents to develop theirunderstanding at theirown pace.The book canbe used at a variety oflevels and the carefullygraded projects make it ideal for colleges,schools, and universities. Newcomers tothe PIC will find it a painless introduction,whilst electronics hobbyists will enjoy thepractical nature of this first course inmicrocontrollers. $29.95Robot Builder's BonanzaThird Editionby Gordon McComb/Myke PredkoEverybody's favoriteamateur roboticsbook is bolder andbetter than ever —and now features thefield's "grand master"Myke Predko as thenew author! Authorduo McComb andPredko bring theirexpertise to this fullyillustratedrobotics "bible" to enhance thealready incomparable content on how tobuild — and have a universe of fun — withrobots. Projects vary in complexity soeveryone from novices to advanced hobbyistswill find something of interest.Amongthe many editions, this book features 30completely new projects! $27.95<strong>Nuts</strong> & <strong>Volts</strong> of BASICStamps — Volume #6by Jon Williams<strong>Nuts</strong> & <strong>Volts</strong> of BASICStamps — Volume 6includes articles #117-128, written for 2005.Article topics consistof RFID Readers andUltrasonicMeasurement, SX/Band the ProfessionalDevelopment Board,the advanced MIDIreceiver, programming the SX microcontrollerin BASIC, mastering the MC14489display driver, and more! The <strong>Nuts</strong> & <strong>Volts</strong>of BASIC Stamps books are a favoriteParallax technical pick and are a tremendoustechnical resource for all PBASICprogramming projects. $14.95NEW!ROBOTICSThe Official RobosapienHacker's Guideby Dave ProchnowThe Robosapien robotwas one of the mostpopular hobbyist giftsof the 2004 holidayseason.The brief manualaccompanying therobot covered onlybasic movements andmaneuvers — therobot's real powerand potential remainundiscovered by most owners — untilnow! This is the official Robosapien guide— endorsed by WowWee (the manufacturer)and Mark Tilden (the designer).Thistimely book covers all the possible designadditions, programming possibilities, and"hacks"not found anywhere else. $24.95Linux Roboticsby D. Jay NewmanIf you want your robotto have more brainsthan microcontrollerscan deliver — if youwant a truly intelligent,high-capability robot —everything you need isNowShipping!right here. LinuxRobotics gives youstep-by-step directionsfor "Zeppo," a supersmart,single-board-powered robot that canbe built by any hobbyist.You also get completeinstructions for incorporating Linuxsingle boards into your own unique roboticdesigns. No programming experience isrequired.This book includes access to allthe downloadable programs you need, pluscomplete training in doing original programming.$34.95CNC Roboticsby Geoff WilliamsWritten by anaccomplished workshopbot designer/builder,CNC Robotics gives youstep-by-step, illustrateddirections for designing,constructing, and testinga fully functional CNCrobot that saves you80% of the price of anoff-the-shelf bot — and can be customizedto suit your purposes exactly because youdesigned it. $34.95WE ACCEPT VISA, MC, AMEX,and DISCOVERPrices do not include shipping andmay be subject to change. Ask aboutour 10% subscriber discount onselected titles.May 2006 109


TECHFORUMThis is a READER-TO-READER Column.All questions AND answers are submitted by <strong>Nuts</strong> & <strong>Volts</strong> readers and are intended to promote the exchange of ideas and provide assistancefor solving problems of a technical nature. Questions are subject to editing and will be published on a space available basis if deemed suitableby the publisher. Answers are submitted by readers and NO GUARANTEES WHATSOEVER are made by the publisher. The implementation ofany answer printed in this column may require varying degrees of technical experience and should only be attempted by qualified individuals.Always use common sense and good judgement!All questions and answers shouldbe sent by email to forum@nutsvolts.com All diagrams should becomputer generated and sent with yoursubmission as an attachment.QUESTIONSTo be considered, all questions should relateto one or more of the following:❶ Circuit Design❷ Electronic Theory❸ Problem Solving❹ Other Similar Topics■ Be brief but include all pertinent information.If no one knows what you're asking, youwon't get any response (and we probablywon't print it either).■ Include your Name, Address, Phone Number,and email. Only your Name, City, andState will be published with the question,but we may need to contact you.■ No questions will be accepted that offerequipment for sale or equipment wanted tobuy.■ Selected questions will be printed onetime on a space available basis.■ Questions are subject to editing.ANSWERS■ Include in the subject line of your email,the question number that appears directlybelow the question you are responding to.■ Payment of $25.00 will be sent if your answeris printed. Be sure to include your mailingaddress or we cannot send payment.■ Only your Name, City, and State, will beprinted, unless you say otherwise. If youwant your email address included, indicateto that effect.■ Comments regarding answers printed inthis column may be printed in the ReaderFeedback section if space allows.110 May 2006>>> QUESTIONSI am trying to remake a 3.5 x 5calculator, with a 4mm x 6mm hole inthe center to install a push button inbetweenthe digital readout and thebuttons. What parts do I need tomake a circuit board, calculator, digitalreadout, etc.? Any information wouldbe greatly appreciated.#5061 Brent Dicksonvia emailI need a log-scale level indicatorusing bipolar transistors.Without using an integrated-circuitcomparator, or an op-amp, thereshould be a method to make a bipolartransistor-based five-LED output VUor level display for an audio amp. Inthis case, though, I want the displayto take its input at the pre-amp levelsignal as it is applied to a 10K volumepot, so that it indicates the level ofinput prior to the volume control, andso is independent of the volume control.The response should be logarithmic.I know how to do this with comparatorsand op-amps, but not usingonly bipolar transistors as the log generatorand LED drivers. I’d like to seea minimal parts-count solution withthe applicable math. The power-amplifierin question (TEA-2025) has a +12VDC-to-ground supply, an inputimpedance of 30K, and gain of 45 db,so the applicable pre-amp level signalis derived from those parameters —having no way to measure it directly— and is fed from the wiper of the10K volume control. An interestingold-school problem.#5062 Stephen ClanahanCoalinga, CAI would like to monitor the voltageand current of my solar electricsystem. The array open circuit voltageis 270 VDC, under load at 230VDC, and current is at 11 amps. Cansomeone suggest an input circuitwhich provides isolation and protectionfor the PIC16F688 I plan to use?#5063 Steve YangSunnyvale, CAHow are fireworks controlled inthe big July 4th shows? They must becomputer controlled because therockets, roman candles, etc., go off atclosely spaced times. If so, what isthe interface between the fuses andthe computer; and, how are the signalsdistributed?#5064 Ronald Rosienvia emailI have a rear view camera from a2004 Honda MDX. Other than thepower and ground connections, thereare leads for video, camera ground,shutter, and camera adap.(?). Placingan oscilloscope across the video andcamera ground leads gives me hori-


READER-TO-READER QUESTIONS AND ANSWERSzontal blanking and sync pulses butno video. I have placed a load resistor(75 ohms) across the video andcamera ground terminals. Also, Ihave tried connecting five volts(through a 10 ohm limiting resistor)to the shutter and the camera adap.leads; but I still cannot see videoinformation. Is there some type of acircuit I need to build in order tohave the camera operate?#5065 Doug PorayJackson, NJ>>>> ANSWERS[#4062 - April 2006]I recently purchased a Flashcard player. The power unit thatcame with it is an AC to DC supplyrated at 5V @ 1.5A. While playing, itactually is using 620 mA.I wanted to connect to 12Vautomobile power by replacing theAC to DC unit with a 12V to 5V. Imeasured the amperage and it toowas 600 mA. The problem now isthat the 12V to 5V regulator overheatsand eventually will fail.If you are using a one amp voltageregulator in a TO-220 package withouta heatsink, the thermal resistancejunction to ambient is 50degrees C per watt. The 12 volts isactually 13.8 volts when the motoris running, so the voltage dropacross the regulator is: 13.8-5=8.8volts. The power dissipation is:8.8*.6 = 5.28 watts. Multiplying bythe thermal resistance, the junctiontemperature of the IC is 50*5.28 =264 degrees C, which is way overthe allowed temperature.The solution is to use aheatsink. A half-brick heatsink(Wakefield 528-45AB) is about fivesquare inches and is rated 8.6degrees C per watt. The TO-220package is rated 2.5 degrees C perwatt junction to case. If an insulatoris used, it is about 0.1 degrees C perwatt. The total thermal resistance inthis case is: 2.5+0.1+8.6 = 11.2degrees C per watt. Now the junctiontemperature is 5.28 watts * 11.2= 59 degrees C, which is within therating of the IC.Russell KincaidMilford, NH[#2062 - February 2006] (Revisited)I am looking for an easy build-it-yourself receiverto pick up the 60 kHz signal from WWVB. I live in thePittsburgh, PA area and I have a few atomic clocksthat never receive the updates. I would like to hear orat least see the pulses via an LED indicator just to seeif the signal is really there.I have not built this receiver, but it simulates okay.The gain is 60 dB so you will have to be careful that itdoes not oscillate. Don't make it too compact; keep theinput and output separated. Place the inductors to be atright angles to each other to minimize any coupling. Uselots of power supply bypassing. The antenna is a loop,tuned to 60 kHz. The LED should change brightness withthe modulation on the signal. Russell KincaidMilford, NHMay 2006 111


READER-TO-READER QUESTIONS AND ANSWERS[#4064 - April 2006]I built a device that signals mymother from inside the house whenthe mail has come, so she does nothave to watch for the postal carrier.Now, I want to take it a bit furtherand connect the device to the TVand have it send both a messageand a video flag in one corner whileshe watches TV. Can someone helpor point me to a device that can dothis? I would welcome any ideas.#1 Decade Engineering sellsan On-Screen-Display that can dowhat you want. You would have toconnect a microcontroller to it andplace it in-line between yourCABLE/SAT/VCR and your TV'svideo jacks. Here is a link to theirwebsite: www.decadenet.com/bob3/bob3.html112 May 2006Daryl Rictorvia email#2 That sounds like a greatproject. May I suggest the SX-VideoOSD module. This module will overlaytext on the TV screen.You will need a BASIC Stamp orsome controller that can output serialdata at 2400 baud to communicatewith the module.You can purchasethe module directly fromwww.sxvm.com or from ParallaxInc. item # 30015.Terry Hittvia email[#4063 - April 2006]I need a circuit to converts-video to composite video.#1 It is possible to construct ans-video to composite converter withjust a couple connectors and acapacitor. It is not an ideal converterbecause the signal impedances andlevels aren't matched perfectly, butit works well in most cases. Just cutup an s-video cable, and connect theY ground and C ground to the outerground ring of an RCA connector.Then wire one end of a 470 pfcapacitor to the C pin and the otherend of the capacitor to the Y pin.Then wire the Y pin to the center pinof the RCA connector. Looking intothe end of a male s-video cable withthe plastic key pin up, the pins are Yground, Y, C, and C ground clockwisearound the connector. If this isfor a computer and your cable hasmore than four pins — as somevideo card output cables do — it isnot a standard pinout and you willneed to look up the pinout for yourvideo card to find the positions ofthe appropriate pins.Carl D. Smith Jr.Fargo, NDFemaleMaleSEVEN PIN S-Video MINI-DINPin Name Description1 GND Ground (Y)2 GND Ground (C)3 Y Intensity (Luminance)4 C Color (Chrominance)5 - -6 V Composite Video7 VGND Composite Ground#2 If you have a seven pin s-video source, the composite signalis already there. Pin 6 carries thecomposite video and pin 7 is theground.If you have a four pin s-video, you can try an inexpensiveconverter, such as the oneHometech Solutions sells ($4.95):www.hometech.com/video/svconv.html (Part #GC-AVF2RF).Daryl Rictorvia email[#4066 - April 2006]I would like to hear my TV audioat a remote location through externalspeakers or earphones. My TVshave audio outlets in the back, butno audio is coming out of them.First, make sure those RCAaudio jacks are not INPUTS. Theyshould be labeled with the words"IN" (for input from a VCR or DVDplayer) and "OUT" (to send to areceiver/external amp). Consult yourUser Manual — it should tell you.If the RCA jacks are indeedOUTPUTS, access the "Audio Setup"option of the TV's menu and ensurethe "Audio Output" option isenabled. Then, connect SHIELDEDRCA cables from those jacks to theAUX inputs of your remote receiver/amp,adjust the volume of theremote amp to taste, and enjoy.However, if those jacks areINPUTS only, it means you'll have totap the audio directly from acrossthe TV speakers. This circuit workswell and provides isolation betweenthe source speaker and the remotereceiver/amp:speaker "+" — C — R —> toRCA plug center pinspeaker "-" — C —> toRCA plug outer shieldThe capacitors "C" are .1 μFpolyester units, rated at 50 VDCminimum. The resistor (R) is a 1Kohm, 1/2 watt unit. The componentscan be directly soldered to thespeaker terminals and keep theleads AS SHORT AS POSSIBLE.Use SHIELDED AUDIO CABLE fromthe RCA plug to the componentsand cover the components withheat shrink or electrical tape. Makesure there are NO SHORTSbetween the capacitors and resistorAND no shorts between all componentsand any exposed metal part ofthe TV chassis.Run the RCA plugs to the AUXinput of the remote receiver/ampand set the REMOTE amp's volumeto MINIMUM. Turn on the TV andadjust its volume to BARELY AUDI-BLE. At this time, turn on theremote amp and adjust its volumeto the desired level. NOTE: Theaudio quality WILL NOT be thatgreat and you may hear some 60 Hz"background buzz." However, this isto be expected in this setup.Finally, for "crystal clear" remoteaudio, assuming the TV's RCA jacksare not outputs, get a cheap Hi-FiVCR and feed your cable-TV's inputto it. Couple the VCR's audio outRCA jacks to the AUX input of theremote receiver/amp. When youwant to remotely listen to the TVstation's audio, tune the VCR to thatstation and enjoy!Ken SimmonsAuburn, WA


■ LOOK FOR ■ SEARCH FOR ■ FINDFind your favorite advertisers here!AMATEURRADIO AND TVPolarisUSA Video, Inc. .........................11Ramsey Electronics, Inc. ................20-21Surplus Sales of Nebraska ................104BATTERIES/CHARGERSCunard Associates ...............................60Ocean Server Technology, Inc. ...........91BUSINESSOPPORTUNITIESEZ PCB ................................................59BUYING ELECTRONICSURPLUSEarth Computer Technologies . ............60GreenChip ............................................60Jaycar Electronics ................................73CCD CAMERAS/VIDEOCircuit Specialists, Inc. ................114-115Cosmos ................................................66Matco, Inc. ...........................................60PolarisUSA Video, Inc. .........................11Ramsey Electronics, Inc. ...............20-21CIRCUIT BOARDSBlink Manufacturing .............................60Cunard Associates ...............................60ExpressPCB .........................................18EZ PCB ................................................59Manufacturing Consortium, Int’l ...........71Maxstream ...........................................59Micromint .............................................91PCB Cart ..............................................72PCB Pool .............................................69Pulsar, Inc. ...........................................60R4Systems, Inc. ...................................59Saelig Company, Inc. ...........................58COMPONENTSElectronic Goldmine .............................69Electronics123 ...................................107Electronix Express ...............................84Front Panel Express LLC .....................96Jameco ................................................37Lemos International Co., Inc. ...............31Linx Technologies ................................30Maxstream ...........................................59Micromint .............................................91New Sensor ...................................29, 97Pulsar, Inc. ...........................................60COMPUTERHardwareActiveWire, Inc. ....................................60COMFILE Technology ...........................3Earth Computer Technologies . ............60Halted Specialties Co. ........................105National Control Devices, LLC ...........103Surplus Sales of Nebraska .................104Microcontrollers / I/O BoardsAbacom Technologies ........................104COMFILE Technology ...........................3Conitec DataSystems ...........................69EMAC, Inc. .........................................106HVW Technologies ..............................60Microchip ..............................................19microEngineering Labs ........................84Micromint .............................................91mikroElektronika ..................................82National Control Devices, LLC ...........103Net Media................................................2Parallax, Inc. ..........................Back CoverR4Systems, Inc. ...................................59Scott Edwards Electronics, Inc. .........104Trace Systems, Inc. ...........................101World Educational Services .................31XGameStation ......................................60SoftwarePioneer Hill Software ............................72DESIGN/ENGINEERING/REPAIR SERVICESBlink Manufacturing .............................60eMachineShop.com .............................28ExpressPCB .........................................18EZ PCB ................................................59Front Panel Express LLC .....................96GME Technology .................................60Manufacturing Consortium, Int’l ...........71PCB Cart ..............................................72PCB Pool .............................................69Pulsar, Inc. ...........................................60R4Systems, Inc. ...................................59Trace Systems, Inc. ...........................101EDUCATIONAtlantic Int’l Institute, Inc. ...................106Command Productions ........................33EMAC, Inc. .........................................106Hobby Engineering ..............................96XGameStation ......................................60ENCLOSURESIntegrated Ideas & Technologies, Inc. ..106EVENTSROBO Business 2006 ..........................85GAMESZAPiT ...................................................83KITS & PLANSC & S Sales, Inc. ..................................45DesignNotes.com, Inc. .........................66Earth Computer Technologies . ............60Electronics123 ...................................107EMAC, Inc. .........................................106Hobby Engineering ..............................96Industrial Ventures .......................60, 101Information Unlimited ...........................33Jaycar Electronics.................................73QKITS ...................................................60RABBIT Semiconductor..........................7Ramsey Electronics, Inc. ................20-21Scott Edwards Electronics, Inc. .........104XGameStation ......................................60LASERSInformation Unlimited ...........................33MISC./SURPLUSAll Electronics Corp. .............................32Electronic Goldmine .............................69Front Panel Express LLC .....................96GreenChip ............................................60Halted Specialties Co. ........................105MCM ....................................................82Ocean Server Technology, Inc. ...........91Surplus Sales of Nebraska ................104MOTORSJameco ................................................37AD INDEXOPTICSAnchor Optics ......................................33PROGRAMMERSConitec DataSystems ...........................69Electronics123 ...................................107microEngineering Labs ........................84mikroElektronika ..................................82PUBLICATIONSMouser Electronics ..............................31RF TRANSMITTERS/RECEIVERSAbacom Technologies .......................104Linx Technologies ................................30Matco, Inc. ...........................................60ROBOTICSBudget Robotics ...................................71COMFILE Technology ...........................3CrustCrawler ........................................84Hobby Engineering ..............................96HVW Technologies ..............................60Jameco ................................................37LabJack ..............................................107Lemos International Co., Inc. ...............31Lynxmotion, Inc. ...................................83mikroElektronika ..................................82Net Media ...............................................2Ocean Server Technology, Inc. ...........85ROBO Business 2006 ..........................84Test N Tools .........................................30SATELLITELemos International Co., Inc.................31SECURITYCosmos ................................................66Information Unlimited ...........................33Linx Technologies ................................30Matco, Inc. ...........................................60PolarisUSA Video, Inc. .........................11TEST EQUIPMENTC & S Sales, Inc. ..................................45Circuit Specialists, Inc. ................114-115Conitec DataSystems ...........................69DesignNotes.com, Inc. .........................66Electronic Design Specialists................50GME Technology .................................60Jaycar Electronics.................................73LabJack ..............................................107Link Instruments .....................................5Pioneer Hill Software ............................72Pico Technology Ltd. UK ...................107Saelig Company, Inc. ...........................58Test N Tools .........................................30Trace Systems, Inc. ...........................101TOOLSC & S Sales, Inc. ..................................45GME Technology .................................60Test N Tools .........................................30WIRE, CABLEAND CONNECTORSDesignNotes.com, Inc. .........................66Jameco ................................................37WIRELESSPRODUCTSNational Control Devices, LLC ...........103Abacom Technologies .............104ActiveWire, Inc. .........................60All Electronics Corp. ..................32Anchor Optics ............................33Atlantic Int’l Institute, Inc. ........106Blink Manufacturing ...................60Budget Robotics ........................71C & S Sales, Inc. .......................45Circuit Specialists, Inc. .....114-115COMFILE Technology .................3Command Productions ..............33Conitec DataSystems ................69Cosmos .....................................66CrustCrawler .............................84Cunard Associates ....................60DesignNotes.com, Inc. ...............66Earth Computer Technologies ...60Electronic Design Specialists .....50Electronic Goldmine ..................69Electronics123 .........................107Electronix Express ....................84eMachineShop.com ..................28EMAC, Inc. ..............................106ExpressPCB ..............................18EZ PCB .....................................59Front Panel Express LLC ...........96GME Technology .......................60GreenChip..................................60Halted Specialties Co. .............105Hobby Engineering.....................96HVW Technologies ....................60Industrial Ventures ............60, 101Information Unlimited ................33Integrated Ideas & Tech. ..........106Jameco.......................................37Jaycar Electronics ......................73LabJack....................................107Lemos International Co., Inc. .....31Link Instruments ..........................5Linx Technologies .....................30Lynxmotion, Inc. ........................83Manufacturing Consortium, Int’l ...71Matco, Inc. .................................60Maxstream ................................59MCM ..........................................82Microchip ...................................19microEngineering Labs ..............84Micromint ...................................91mikroElektronika ........................82Mouser Electronics ....................31National Control Devices, LLC...103Net Media.....................................2New Sensor..........................29, 97Ocean Server Technology, Inc. ..91Parallax, Inc. ...............Back CoverPCB Cart ...................................72PCB Pool ...................................69Pioneer Hill Software .................72Pico Technology Ltd. UK..........107PolarisUSA Video, Inc................11Pulsar, Inc. ................................60QKITS ........................................60R4Systems, Inc. .........................59RABBIT Semiconductor ...............7Ramsey Electronics, Inc. .....20-21ROBO Business 2006 ................85Saelig Company, Inc. ................58Scott Edwards Electronics, Inc. ..104Surplus Sales of Nebraska ......104Test N Tools ..............................30Trace Systems, Inc. ................101World Educational Services ......31XGameStation ...........................60ZAPiT ........................................83May 2006 113


CircuitSpecialists.com CircuitSpecialists.com CircuitSpecialists.comPowerSupply1 Switching Power SuppliesCircuit Specialists Soldering StationSw/Ceramic Element & SeperateSolder Stand•Ceramic heating element for more accuratetemp control•Temp control knob in F(392° to 896°) &C(200° to 489°)•3-prong grounded power cord/static safe tip•Seperate heavy duty iron stand•Replaceable iron/easy disconnect•Extra tips etc. shown at web siteAlso Available w/Digital Display& MicroProProcessorocessor ControllerollerNew to CircuitSpecialists.com are these HighlyReliable, Universal AC input/full range single outputpower supplies. Choose between various 40, 60, 100 &150 Watt versions. They have the approval of UL andCUL and come 100% full load burn-in tested and areprotected with overload/over and voltage/short circuit.Also included is a 2 year warranty.PowerSupply1 Qty 1 Qty 10 Qty 25 Qty 100 Qty 500 Qty 100040W SeriesAvailable in5,12,15,24,48V60W SeriesAvailable in5,12,15,24,48V100W SeriesAvailable in3.3,5,7.5,12,15,24,48V150W SeriesAvailable in5,7.5,9,12,24,28,36VItem#CSI-STATION2ATION2A$49.95Item#CSI-STATION1ATION1AHeavy Duty Regulated LinearBench Power Supplies•Multi-loop high precision voltage regulation•Automatic voltage & current stabilizing conversion•Automatic radiant cooling system•Over-heating protectionDual Output DC Bench Power$34.95!SMD Hot TweezerAdaptor Fits CSIStations 1A & 2A,and CSI906Rapid Heat Up!DC Bench Power SuppliesHigh stability digital read-out bench power suppliesfeaturing constant voltage and current outputs. Shortcircuitand current limiting protection is provided.SMT PC boards and a built-in cooling fan help ensurereliable performance and long life.•Source Effect: 5x10 -4 =2mV•Load Effect: 5x10 -4 =2mV HOT•Ripple Coefficient:: Test Equipment > Power Supplieswww.Cir.CircuitSpecialists.com$29.00Item#CSITWZ-STATIONTIONDetails at Web Site> Soldering Equipment & Supplies > Soldering StationsCSI5030S: 0-50v/0-30amp $595.00CSI12005S: 0-120v/0-5amp $595.00CSI20002S: 0-200v/0-2amp $595.00$28.99 $26.09ea $24.53ea $21.95ea $15.98ea $13.79ea$32.99 $29.69ea $27.91ea $25.95ea $17.69ea $15.49ea$38.50 $34.65ea $32.57ea $29.99ea $21.18ea $18.49ea$48.99 $44.09ea $39.00ea $37.50ea $26.93ea $23.49eaDetails at Web Site> Test Equipment > Power SuppliesAs Low As$93.00!In BusinessSince 1971Programmable DC Power SuppliesThe CSI 3600 SeriesProgrammable DC PowerSupplies are equipped with aback-lit LCD display, numberkeypad and a rotary codeswitch for ease of use & quickprogramming. Voltage, Current & Power can all be displayed on theLCD or computer screen (with optional RS-232 interface module). It canbe operated at constant current mode, constant voltage mode & constantpower mode. It also can be set with maximum limits for current &power output. Ideal instruments for scientific research, educational labsor any application requiring a sophisticated DC-power source.Model CSI3644A CSI3645A CSI3646ADC Voltage 0-18V 0-36V 0-72VDC Current 5A 3A 1.5APower (max) 90W 108W 108WOnly $199.00 Each!Programmable DC Electronic LoadsThe CSI 3700 series electronicloads are single input programmableDC electronic loads thatprovide a convenient way totest batteries and DC powersupplies. It offers constant current mode, constant resistancemode and constant power mode. The backlightLCD, numerical keypad and rotary knob make it mucheasier to use. Up to 10 steps of program can be stored.Model CSI3710A CSI3711AInput Voltage 0-360V DC 0-360V DCInput Current 0-30A DC 0-30A DCInput Power 0-150W 0-300WCSI3710A: $349.002 Amp Multi-Output Power SupplyThis unit is switchable and providesregulated outputs of 3V,4.5V, 6V, 7.5V, 9V & 12V. All outputsprovide 2 Amps of power.Fuse protected. Grey plastic enclosurewith on/off switch & red &black output jacks.Item# PS-28Details $19.95at Web Site> Test Equipment > Power SuppliesHigh Capacity Nickel Metal HydrideRechargeable BatteriesItem# 1+ 10+ 100+AA2700mAH“AA” cell 2500mAH $1.45 1.25 1.09AAA1000MAH“AAA”cell 850mAH $0.99 0.65 0.51C3500MAH“C” cell 3500mAH $2.99 2.30 2.09D11000MAH“D” cell 11000mAH $6.95 5.55 4.399V220MAH“9V” cell 220mAH $3.69 3.29 2.99Details at Web Site> Batteries & Accessories > NiMH BatteriesTriple Output Bench Power Supplieswith Large LCD Displays•Output: 0-30VDC x 2 @ 3 or 5 Amps& 1ea. fixed output @ 5VDC@3A•Source Effect: 5x10 -4 =2mV•Load Effect: 5x10 -4 =2mV•Ripple Coefficient: Test Equipment > Power SuppliesCircuit Specialists, Inc. 220 S. Country Club Dr., Mesa, AZ 85210800-528-1417 / 480-464-2485 / FAX: 480-464-5824CSI3711A: 1A: $499.00


CircuitSpecialists.com CircuitSpecialists.com CircuitSpecialists.comESD Safe CPU Controlled olled SMD Hot Air Rework StationSThe heater and air control system arebuilt-in and adjusted by the simple touchof the front keypad for precise settings.Temperature range is from 100°C to480°C / 212°F to 896°F, and the entireunit will enter a temperature drop stateafter 15 minutes of non-use for safety andto eliminate excessive wear.•CPU Controlled•Built-in Vacuum System•Temperature Range:100°C to 480°C / 212°F to 896°F•15-Minute Stand-By temperature "sleep" mode•Power:110/120 VAC, 320 W maximumDetails at Web SiteItem# CSI825A++Only$199.00!> Soldering Equipment & SuppliesThe 3290 is a high quality hand-heldRF Field Strength Analyzer with wideband reception ranging from 100kHzto 2900MHz.The 3290 is a compact &lightweight portable analyzer & is amust for RF Technicians. Ideal fortesting, installing & maintenance ofMobile Telephone Comm systems,Cellular Phones,Cordless phones, pagingsystems, cable & Satellite TV aswell as antenna installations.May alsobe used to locate hidden cameras usingRF transmissions.2.9GHz RF Field StrStrengthAnalyzerItem# 3290Fantastic LowPrice:$1899.00!•WFM/NFM/AM/SSB modulated signals maybe measured.•Signal Levels up to 160Channels can bedisplayed simulaneously on the LCD•PLL tuning system for precise frequencymeasurement and tuning•Built-in Frequency Counter•LED Backlight LCD (192x192 dots)•All fuctions are menu selected.•RS232C with software for PC & printerinterface•Built-in speaker(Includes Antenna)Details at Web Site> Test Equipment > RF Test EquipmentAuto Ranging DMM w/Bar Graph•3 3/4 Digits LCD with a Max. Reading of 3260•Dual Display (digits & bar graph) Item# CSI68 DMM•Capacitance FunctionSALE•Frequency Range$19.00•Transistor & Diode Test Details at Web Site•Data HoldButane Portable Soldering Iron & KitDigital Storage SOscilloscope ModulePC based Digital Storage Oscilloscope,200MHz 5GS/s equiv. sampling USBinterface> Test Equipment > Digital Multimeters/World Beater Prices•Electronic Instant Ignition System•Naked Flame Burner: Temp to1300°C/2370°F•Flameless Burner: up to 400°C/750°F•Equipped with U.S.CPSC ApprovalChild Safety StandardTwo-Piece Iron comes •Electronic Instant Ignition Systemwith Solder Tip.•Naked Flame Welding: Temp to1300°C/2370°FRK3212: Solder Iron •Soldering Temp: up to 500°C/930°F RK3124: Solder Kit$14.95•Heat Shrinking: up to 500°C/930°F$34.00•Hot cutting of plastic sheets or platesDetails at Web Site> Soldering Equipment & Supplies > Soldering IronsConvert any PC with USB interface to a highperformance Digital Storage Oscilloscope.This is a sophisticated PC basedscope adaptorproviding performance compatible tomid/high level stand alone products costingmuch more! Comes with two probes.Details & SoftwarePriceDownload at Web SiteBreakthrough!> Test Equipment > Oscilloscopes/Outstanding Prices$749.00Item# 200DSO Only$749.00LogicPort t Logic AnalyzerThe LogicPort provides 34 sampled channels$379.00!including two state-mode clock inputs. Itconnects to your PC's USB port for ultimateconvenience and performance.•34 Channels•500MHz Timing mode sample rate•200MHz State mode sample rate•Real-time Sample Compression•Multi-level trigger•+6V to -6V Adjustable ThresholdItem# LOGICPORTDetails at Web Site> Test Equipment > Logic Analyzers20MHz Dual Trace Oscilloscope•20MHz Bandwidth•Alt-Mag sweep for simultaneous display ofmain and X5 magnified trace•1mV/Div Vertical sensitivity•Alternate trigger for a stable display of unrelated signals•Multi-level trigger•X5 Sweep MagnificationDetails at Web Site> Test Equipment > Oscilloscopes/Outstanding prices2MHz Sweep Function Generator•0.02Hz-2MHz(7 Ranges)•Sine,Triangle,Square,Pulse,Ramp, Slewed Sine Waveform•Sync. Out (TTL Square Waveform)•Accuracy: ±5% of Full Scale to 200KHz,±8% of Full Scale from 200KHz-2MHz•Sweep Function•VCG InputItem# PROTEK 9205Details at Web Site> Test Equipment > Function GeneratorsItem# PROTEK 6502$279.00!Special$179.00!480TV LinesResolutionSONY Super HAD CCD ColorWeatherproof IR Cameras•Day & Night Auto Switch•Signal System: NTSC•Image Sensor: 1/3" SONY Super HAD CCD•Horizontal Resolution: 480TV lines•Min. Illumination: 0LuxItem# VC-827D1-4:$149.005+:$139.00SONY Super HAD CCD B/WWeatherproof IR Camera•Day & Night Auto Switch•Signal System: EIA•Image Sensor: 1/3" SONY Super HAD CCD•Horizontal Resolution: 420TV lines•Min. Illumination: 0LuxItem# VC-317D1-4:$69.005+:$65.00$65.00Details at Web SiteSONYSuper HADCCD equippedcamera’s feature dramaticallyimprovedlight sensitivitySONY Super HADCCD Color Camera•Weather Proof•Signal System: NTSC•Image Sensor: 1/4" SONY Super HAD CCD•Horizontal Resolution: 420TV lines•Min. Illumination: 1Lux/F1.2Item# VC-805 1-4:$69.005+:$65.00> Miniature Cameras(Board,Bullet,Mini’s, B/W, Color)Intelligent DMM w/ RS-232•3999 Counts and 38 Segment Bar Graph Item# CSI345•Dual Display (digits & bar graph)SALE•Capacitance Function, Transistor & Diode Test $29.95•Frequency Range & Temperature•RS232C Standard Interface Details at Web Site•Data Hold> Test Equipment > Digital Multimeters/World Beater PricesSONY Super HAD CCD ColorWeatherproof IR Camera•Day & Night Auto Switch•Signal System: NTSC•Image Sensor: 1/4" SONY SuperHAD CCD•Horizontal Resolution: 420TV lines•Min. Illumination: 0LuxItem# VC-819D1-4:$89.005+:$79.00Visit our website for a complete listing of our offers. We have over 8,000 electronic items on line @ www.CircuitSpecialists.com. PC based data acquisition,industrial computers, loads of test equipment, optics, I.C’s, transistors, diodes, resistors, potentiometers, motion control products, capacitors,miniature observationcameras, panel meters, chemicals for electronics, do it yourself printed circuit supplies for PCB fabrication, educational D.I.Y. kits, cooling fans, heat shrink, cableties & other wire handleing items, hand tools for electronics, breadboards, trainers, programmers & much much more! Some Deals you won’t believe!Circuit Specialists, Inc. 220 S. Country Club Dr., Mesa, AZ 85210800-528-1417 / 480-464-2485 / FAX: 480-464-5824


Parallax and Ubicom have formed an agreement in which Parallaxwill now be the exclusive supplier of the SX microcontroller. Partnumbers ending in “-G” are RoHS compliant (lead free).SX CHIP OVERVIEWPart # Pins I/O EE/Flash RAMSX20AC/SS 20 12 2K bytes 137 bytesSX20AC/SS-G 20 12 2K bytes 137 bytesSX28AC/DP 28 20 2K bytes 136 bytesSX28AC/DP-G 28 20 2K bytes 136 bytesSX28AC/SS 28 20 2K bytes 136 bytesSX28AC/SS-G 28 20 2K bytes 136 bytesSX48BD 48 36 4k x 12 words 262 bytesSX48BD-G 48 36 4k x 12 words 262 bytesVisit our web site at www.parallax.com/sx formore details and pricing on SX chips. Or calltoll-free 888-512-1024 (M-F, 7am-5pm, PT).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!