make: electronicswebéducation.com/wp-content/uploads/2020/12/platt...preface how to have fun with...
TRANSCRIPT
![Page 1: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/1.jpg)
![Page 2: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/2.jpg)
![Page 3: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/3.jpg)
Make:ElectronicsLearningbyDiscovery
CharlesPlattwithphotographsandillustrationsbytheauthor
![Page 4: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/4.jpg)
Make:ElectronicsbyCharlesPlatt
Copyright©HelpfulCorporation.Allrightsreserved.PrintedinCanada.PublishedbyMakerMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.MakerMediabooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:[email protected]:DaleDoughertyandBrianJepsonDevelopmentEditor:GarethBranwynProductionEditor:RachelMonaghanTechnicalEditor:Andrew“Bunnie”HuangCopyeditor:NancyKotaryProofreader:NancyReinhardtIndexer:JulieHawksCoverDesigner:MarkPagliettiInteriorDesigner:RonBilodeauIllustrator/Photographer:CharlesPlattCoverPhotographer:MarcdeVinckPrintHistory:
December2009:FirstEdition.TheMakelogoandMakerMedialogoareregisteredtrademarksofMakerMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andMakerMedia,Inc.,wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedherein.ISBN:978-0-596-15374-8[TI]
![Page 5: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/5.jpg)
FormydearestErico
![Page 6: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/6.jpg)
ContentsPreface
1.ExperiencingElectricity
ShoppingList:Experiments1Through5
Experiment1:TastethePower!
Experiment2:Let’sAbuseaBattery!
Experiment3:YourFirstCircui
Experiment4:VaryingtheVoltage
Experiment5:Let’sMakeaBattery
2.SwitchingBasicsandMore
ShoppingList:Experiments6Through11
Experiment6:VerySimpleSwitching
Experiment7:Relay-DrivenLEDs
Experiment8:ARelayOscillator
Experiment9:TimeandCapacitors
Experiment10:TransistorSwitching
Experiment11:AModularProject
3.GettingSomewhatMoreSerious
ShoppingList:Experiments12Through15
Experiment12:JoiningTwoWiresTogether
Experiment13:BroilanLED
Experiment14:APulsingGlow
Experiment15:IntrusionAlarmRevisited
4.Chips,Ahoy!
ShoppingList:Experiments16Through24
Experiment16:EmittingaPulse
Experiment17:SetYourTone
Experiment18:ReactionTimer
Experiment19:LearningLogic
Experiment20:APowerfulCombination
Experiment21:RacetoPlace
Experiment22:FlippingandBouncing
Experiment23:NiceDice
Experiment24:IntrusionAlarmCompleted
5.WhatNext?
ShoppingList:Experiments25Through36
![Page 7: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/7.jpg)
CustomizingYourWorkArea
ReferenceSources
Experiment25:Magnetism
Experiment26:TabletopPowerGeneration
Experiment27:LoudspeakerDestruction
Experiment28:MakingaCoilReact
Experiment29:FilteringFrequencies
Experiment30:Fuzz
Experiment31:OneRadio,NoSolder,NoPower
Experiment32:ALittleRobotCart
Experiment33:MovinginSteps
Experiment34:HardwareMeetsSoftware
Experiment35:CheckingtheRealWorld
Experiment36:TheLock,Revisited
InClosing
Appendix.OnlineRetailSourcesandManufacturers
![Page 8: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/8.jpg)
PrefaceHowtoHaveFunwithThisBookEveryoneuseselectronicdevices,butmostofusdon’treallyknowwhatgoesoninsidethem.Ofcourse,youmayfeelthatyoudon’tneedtoknow.Ifyoucandriveacarwithoutunderstandingtheworkingsofaninternalcombustionengine,presumablyyoucanuseaniPodwithoutknowinganythingaboutintegratedcircuits.However,understandingsomebasicsaboutelectricityandelectronicscanbeworthwhileforthreereasons:
Bylearninghowtechnologyworks,youbecomebetterabletocontrolyourworldinsteadofbeingcontrolledbyit.Whenyourunintoproblems,youcansolvetheminsteadoffeelingfrustratedbythem.Learningaboutelectronicscanbefun—solongasyouapproachtheprocessintherightway.Thetoolsarerelativelycheap,youcandoalltheworkonatabletop,anditdoesn’tconsumealotoftime(unlessyouwantitto).Knowledgeofelectronicscanenhanceyourvalueasanemployeeorperhapsevenleadtoawholenewcareer.
LearningbyDiscoveryMostintroductoryguidesbeginwithdefinitionsandfacts,andgraduallygettothepointwhereyoucanfollowinstructionstobuildasimplecircuit.Thisbookworkstheotherwayaround.Iwantyoutostartputtingcomponentstogetherrightaway.Afteryouseewhathappens,you’llfigureoutwhat’sgoingon.Ibelievethisprocessoflearningbydiscoverycreatesamorepowerfulandlastingexperience.Learningbydiscoveryoccursinseriousresearch,whenscientistsnoticeanunusualphenomenonthatcannotbeexplainedbycurrenttheory,andtheystarttoinvestigateitinanefforttoexplainit.Thismayultimatelyleadtoabetterunderstandingoftheworld.We’regoingtobedoingthesamething,althoughobviouslyonamuchlessambitiouslevel.Alongtheway,youwillmakesomemistakes.Thisisgood.Mistakesarethebestofalllearningprocesses.Iwantyoutoburnthingsoutandmessthingsup,becausethisishowyoulearnthelimitsofcomponentsandmaterials.Sincewe’llbeusinglowvoltages,there’llbenochanceofelectrocution,andsolongasyoulimittheflowofcurrentinthewaysI’lldescribe,therewillbenoriskofburningyourfingersorstartingfires.
StayWithintheLimits!AlthoughIbelievethateverythingsuggestedinthisbookissafe,I’massumingthatyouwillstaywithinthelimitsthatIsuggest.Pleasealwaysfollowtheinstructionsandpayattentiontothewarnings,denotedbytheiconyouseehere.Ifyougobeyondthelimits,youwillexposeyourselftounnecessaryrisks.
FigureP-1.Learningbydiscoveryallowsyoutostartbuildingsimplecircuitsrightaway,usingahandfulofcheapcomponents,afewbatteries,andsomealligatorclips.
HowHardWillItBe?Iassumethatyou’rebeginningwithnopriorknowledgeofelectronics.So,thefirstfewexperimentswillbeultra-simple,andyouwon’tevenusesolderorprototypingboardstobuildacircuit.You’llbeholdingwirestogetherwithalligatorclips.Veryquickly,though,you’llbeexperimentingwithtransistors,andbytheendofChapter2,youwillhaveaworkingcircuitthathasusefulapplications.Idon’tbelievethathobbyelectronicshastobedifficulttounderstand.Ofcourse,ifyouwanttostudyelectronicsmoreformallyanddoyourowncircuitdesign,thiscanbechallenging.Butinthisbook,thetoolsandsupplieswillbeinexpensive,theobjectiveswillbeclearlydefined,andtheonlymathyou’llneedwillbeaddition,subtraction,multiplication,division,andtheabilitytomovedecimalpointsfromonepositiontoanother.
MovingThroughThisBookBasicallytherearetwowaystopresentinformationinabookofthiskind:intutorialsandinreferencesections.I’mgoingtousebothofthesemethods.You’llfindthetutorialsinsectionsheadedasfollows:
ShoppingListsUsingToolsExperiments
You’llfindreferencesectionsunderthefollowingheadings:
Fundamentals
![Page 9: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/9.jpg)
TheoryBackground
Howyouusethesectionsisuptoyou.Youcanskipmanyofthereferencesectionsandcomebacktothemlater.Butifyouskipmanyofthetutorials,thisbookwon’tbeofmuchusetoyou.Learningbydiscoverymeansthatyouabsolutely,positivelyhavetodosomehands-onwork,andthisinturnmeansthatyouhavetobuysomebasiccomponentsandplaywiththem.Youwillgainverylittlebymerelyimaginingthatyouaredoingthis.It’seasyandinexpensivetobuywhatyouneed.InalmostanyurbanorsuburbanareaintheUnitedStates,chancesareyoulivenearastorethatsellselectroniccomponentsandsomebasictoolstoworkwiththem.Iamreferring,ofcourse,toRadioShackfranchises.SomeShackshavemorecomponentsthanothers.ManymaycarrytheMakerShedkitsthatweredevelopedtogowiththisbook.YoucanalsovisitautosupplystoressuchasAutoZoneandPepBoysforbasicssuchashookupwire,fuses,andswitches,whilestoressuchasAceHardware,HomeDepot,andLowe’swillsellyoutools.Ifyouprefertobuyviamailorder,youcaneasilyfindeverythingyouneedbysearchingonline.Ineachsectionofthebook,I’llincludetheURLsofthemostpopularsupplysources,andyou’llfindacompletelistofURLsintheappendix.
FundamentalsMail-orderingcomponentsandtoolsHerearetheprimarymail-ordersourcesthatIusemyselfonline.Ileaveittoyoutoshoparoundforbargains,ifyouaresoinclined.http://www.radioshack.com
RadioShack,a.k.a.TheShack.Fortoolsandcomponents.Thesiteiseasyandconvenient,andsomeofthetoolsareexactlywhatyouneed.
http://www.mouser.comMouserElectronics.
http://www.digikey.comDigi-KeyCorporation.
http://www.newark.comNewark.
Mouser,Digi-Key,andNewarkareallgoodsourcesforcomponents,usuallyrequiringnominimumquantities.http://www.allelectronics.com
AllElectronicsCorporation.Anarrowerrangeofcomponents,butspecificallyaimedatthehobbyist,withkitsavailable.http://www.ebay.com
Youcanfindsurpluspartsandbargainshere,butyoumayhavetotryseveraleBayStorestogetwhatyouwant.ThosebasedinHongKongareoftenverycheap,andI’vefoundthattheyarereliable.
http://www.mcmaster.comMcMaster-Carr.Especiallyusefulforhigh-qualitytools.
Lowe’sandHomeDepotalsoallowyoutoshoponline.
FigureP-2.You’llfindnoshortageofparts,tools,kits,andgadgetsonline.
CompanionKits
MakerShed(www.makershed.com)offersanumberofMake:Electronicscompanionkits,bothtoolkitsandbundlesofthevariouscomponentsusedinthebook’sexperiments.Thisisasimple,convenient,andcost-effectivewayofgettingallthetoolsandmaterialsyouneedtodotheprojectsinthisbook.
CommentsandQuestionsPleaseaddresscommentsandquestionsconcerningthisbooktothepublisher:
MakerMedia,Inc.1005GravensteinHighwayNorthSebastopol,CA95472800-998-9938(intheUnitedStatesorCanada)707-829-0515(internationalorlocal)707-829-0104(fax)
Wehaveawebpageforthisbook,wherewelisterrata,examples,largerversionsofthebook’sfigures,andanyadditionalinformation.Youcanaccessthispageat:
http://oreilly.com/catalog/9780596153748
![Page 10: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/10.jpg)
Tocommentorasktechnicalquestionsaboutthisbook,sendemailto:[email protected]
Formoreinformationaboutourpublications,events,andproducts,seeourwebsiteat:http://makermedia.com
Safari®BooksOnline
SafariBooksOnlineisanon-demanddigitallibrarythatletsyoueasilysearchover7,500technologyandcreativereferencebooksandvideostofindtheanswersyouneedquickly.Withasubscription,youcanreadanypageandwatchanyvideofromourlibraryonline.Readbooksonyourcellphoneandmobiledevices.Accessnewtitlesbeforetheyareavailableforprint,andgetexclusiveaccesstomanuscriptsindevelopmentandpostfeedbackfortheauthors.Copyandpastecodesamples,organizeyourfavorites,downloadchapters,bookmarkkeysections,createnotes,printoutpages,andbenefitfromtonsofothertime-savingfeatures.O’ReillyMediahasuploadedthisbooktotheSafariBooksOnlineservice.TohavefulldigitalaccesstothisbookandothersonsimilartopicsfromO’Reillyandotherpublishers,signupforfreeathttp://my.safaribooksonline.com.
![Page 11: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/11.jpg)
1.ExperiencingElectricityIwantyoutogetatasteforelectricity—literally!—inthefirstexperiment.Thisfirstchapterofthebookwillshowyou:
HowtounderstandandmeasureelectricityandresistanceHowtohandleandconnectcomponentswithoutoverloading,damaging,ordestroyingthem
Evenifyouhavesomepriorknowledgeofelectronics,youshouldtrytheseexperimentsbeforeyouventureontotherestofthebook.
![Page 12: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/12.jpg)
ShoppingList:Experiments1Through5Ifyouwanttolimityournumberofshoppingtripsoronlinepurchases,lookaheadinthebookforadditionalshoppinglists,andcombinethemtomakeonebulkpurchase.Inthisfirstchapter,Iwillgiveyoupartnumbersandsourcesforeverytoolandcomponentthatwe’llbeusing.Subsequently,Iwon’texpectyoutoneedsuchspecificinformation,becauseyouwillhavegainedexperiencesearchingforitemsonyourown.
MakerShed(www.makershed.com)hasputtogetheraseriesofMake:Electronicscompanionkits.Theseincludeallofthetoolsandcomponentsusedinbook’sexperiments.Thisisaquick,simple,andcost-effectivewayofgettingeverythingyouneedtocompletetheprojectsinthisbook.
ToolsSmallpliers
RadioShack4.5-inchMiniLongNosePliers,Partnumber64-0062orXcelite4-inchminilong-nosepliers,modelL4G.Orsimilar.SeeFigures1-1through1-3.Lookforthesetoolsinhardwarestoresandthesourceslistedinthepreface.Thebrandisunimportant.Afteryouusethemforawhile,you’lldevelopyourownpreferences.Inparticular,youhavetodecidewhetheryoulikespring-loadedhandles.Ifyoudecideyoudon’t,you’llneedasecondpairofplierstopullthespringsoutofthefirst.
WirecuttersRadioShack4.5-inchMiniDiagonalCutters,Partnumber64-0061,orStanley7-inchmodel84-108.Orsimilar.Usethemforcuttingcopperwire,nothardermetals(Figure1-4).
Figure1-1.Genericlong-nosedpliersareyourmostfundamentaltoolforgripping,bending,andpickingthingsupafteryoudropthem.
Figure1-2.Longer-nosedpliers:theseareusefulforreachingintotinyspaces.
Figure1-3.Sharp-pointedpliersaredesignedformakingjewelry,butarealsousefulforgrabbingtinycomponents.
Figure1-4.Wirecutters,sometimesknownassidecutters,areessential.
MultimeterExtechmodelEX410orBKPrecisionmodel2704-BorAmprobemodel5XP-A.Orsimilar.Becauseelectricityisinvisible,weneedatooltovisualizethepressureandflow,andameteristheonlyway.Acheapmeterwillbesufficientforyourinitialexperiments.Ifyoubuyonline,trytocheckcustomerreviews,becausereliabilitymaybeaproblemforcheapmeters.Youcanshoparoundforretailersofferingthebestprice.Don’tforgettosearchoneBay.Themetermustbedigital—don’tgettheold-fashionedanalogkindwithaneedlethatmovesacrossasetofprintedscales.This
![Page 13: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/13.jpg)
bookassumesthatyouarelookingatadigitaldisplay.Isuggestthatyoudonotbuyanautorangingmeter.“Autoranging”soundsuseful—forexample,whenyouwanttochecka9-voltbattery,themeterfiguresoutforitselfthatyouarenottryingtomeasurehundredsofvolts,norfractionsofavolt.Thetroubleisthatthiscantrickyouintomakingerrors.Whatifthebatteryisalmostdead?Thenyoumaybemeasuringafractionofavoltwithoutrealizingit.Theonlyindicationwillbeaneasilyoverlooked“m”for“millivolts”besidethelargenumeralsofthemeterdisplay.Onamanual-rangingmeter,youselecttherange,andifthesourcethatyouaremeasuringisoutsideofthatrange,themetertellsyouthatyoumadeanerror.Ipreferthis.IalsogetimpatientwiththetimeittakesfortheautorangingfeaturetofigureouttheappropriaterangeeachtimeImakeameasurement.Butit’samatterofpersonalpreference.SeeFigures1-5through1-7forsomeexamplesofmultimeters.
Figure1-5.Youcanseebythewearandtearthatthisismyownfavoritemeter.Ithasallthenecessarybasicfeaturesandcanalsomeasurecapacitance(theFsection,forFarads).Itcanalsochecktransistors.Youhavetochoosetherangesmanually.
Figure1-6.Mid-pricedRadioShackmeter,whichhasthebasicfeatures;however,thedualpurposeforeachdialposition,selectedwiththeSELECTbutton,maybeconfusing.Thisisanautorangingmeter.
Figure1-7.AnautorangingmeterfromExtechoffersbasicfunctions,plusatemperatureprobe,whichmaybeusefultocheckwhethercomponentssuchaspowersuppliesarerunningundulyhot.
SuppliesBatteries
9-voltbattery.Quantity:1.AAbatteries,1.5voltseach.Quantity:6.Thebatteriesshouldbedisposablealkaline,thecheapestavailable,becausewemaydestroysomeofthem.YoushouldabsolutelynotuserechargeablebatteriesinExperiments1and2.
BatteryholdersandconnectorsSnapconnectorfor9-voltbattery,withwiresattached(Figure1-8).Quantity:1.RadioShackpartnumber270-325orsimilar.Anysnapconnectorthathaswiresattachedwilldo.
Figure1-8.Snapconnectorfora9-voltbattery.
BatteryholderforsingleAAcell,withwiresattached(Figure1-9).Quantity:1.RadioShackpartnumber270-401orMouser.com
![Page 14: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/14.jpg)
catalognumber12BH311A-GR,orsimilar;anysingle-batteryholderthathasthinwiresattachedwilldo.
Figure1-9.SingleAA-sizedbatterycarrierwithwires.
BatteryholderforfourAAcells,withwiresattached(Figure1-10).Quantity:1.AllElectronicscatalognumberBH-342orRadioShackpart270-391orsimilar.
Figure1-10.BatterycarrierforfourAAcells,tobeinstalledinseries,delivering6volts.
AlligatorclipsVinyl-insulated.Quantity:atleast6.AllElectronicscatalognumberALG-28orRadioShackpartnumber270-1545orsimilar(Figure1-11).
Figure1-11.Alligatorclipsinsidevinylsheaths,whichreducethechanceofaccidentalshortcircuits.
ComponentsYoumaynotknowwhatsomeoftheseitemsare,orwhattheydo.Justlookforthepartnumbersanddescriptions,andmatchthemwiththephotographsshownhere.Veryquickly,inthelearningbydiscoveryprocess,allwillberevealed.Fuses
Automotive-style,mini-bladetype,3amps.Quantity:3.RadioShackpartnumber270-1089,orBussmannpartATM-3,availablefromautomotivepartssupplierssuchasAutoZone(Figure1-12).
Figure1-12.A3-ampfuseintendedprimarilyforautomotiveuse,shownherelargerthanactualsize.
Orsimilar.Ablade-typefuseiseasiertogripwithalligatorclipsthanaroundcartridgefuse.Potentiometers
Panel-mount,single-turn,2Klinear,0.1wattminimum.Quantity:2.AlphapartRV170F-10-15R1-B23orBITechnologiespartP160KNPD-2QC25B2K,fromMouser.comorothercomponentsuppliers(Figure1-13).
Figure1-13.Potentiometerscomeinmanyshapesandsizes,withdifferentlengthsofshaftsintendedfordifferenttypesofknobs.Forourpurposes,anystylewilldo,butthelarger-sizedonesareeasiertoplaywith.
Orsimilar.The“watt”ratingtellsyouhowmuchpowerthiscomponentcanhandle.Youdon’tneedmorethan0.5watts.Resistors
Assortment1/4-wattminimum,variousvaluesbutmustinclude470ohms,1K,and2Kor2.2K.Quantity:atleast100.RadioShackpartnumber271-312.OrsearcheBayfor“resistorassorted.”
Light-emittingdiodes(LEDs)Anysizeorcolor(Figures1-14and1-15).Quantity:10.RadioShackpartnumber276-1622orAllSpectrumElectronicspartK/LED1fromMouser.com.Orsimilar.JustaboutanyLEDswilldoforthesefirstexperiments.
![Page 15: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/15.jpg)
Figure1-14.Typical5-mmdiameterlight-emittingdiode(LED).
Figure1-15.Jumbo-sizedLED(1cmdiameter)isnotnecessarilybrighterormoreexpensive.Formostoftheexperimentsinthisbook,buywhateverLEDsyoulikethelookof.
![Page 16: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/16.jpg)
Experiment1:TastethePower!Canyoutasteelectricity?Maybenot,butitfeelsasifyoucan.Youwillneed:
9-voltbatterySnapconnectorforbatteryterminalsMultimeter
NoMoreThan9VoltsA9-voltbatterywon’thurtyou.Butdonottrythisexperimentwithahigher-voltagebatteryoralargerbatterythatcandelivermorecurrent.Also,ifyouhavemetalbracesonyourteeth,beverycarefulnottotouchthemwiththebattery.
ProcedureMoistenyourtongueandtouchthetipofittothemetalterminalsofa9-voltbattery.Thesuddensharptinglethatyoufeeliscausedbyelectricityflowingfromoneterminalofthebattery(Figure1-16),throughthemoistureonandinyourtongue,totheotherterminal.Becausetheskinofyourtongueisverythin(it’sactuallyamucusmembrane)andthenervesareclosetothesurface,youcanfeeltheelectricityveryeasily.Nowstickoutyourtongue,drythetipofitverythoroughlywithatissue,andrepeattheexperimentwithoutallowingyourtonguetobecomemoistagain.Youshouldfeellessofatingle.
Figure1-16.Step1intheprocessoflearningbydiscovery:the9-volttonguetest.
What’shappeninghere?We’regoingtoneedametertofindout.
ToolsSettingupyourmeterChecktheinstructionsthatcamewiththemetertofindoutwhetheryouhavetoinstallabatteryinit,orwhetherabatteryispreinstalled.Mostmetershaveremovablewires,knownasleads(pronounced“leeds”).Mostmetersalsohavethreesocketsonthefront,theleftmostoneusuallybeingreservedtomeasurehighelectricalcurrents(flowsofelectricity).Wecanignorethatonefornow.Theleadswillprobablybeblackandred.Theblackwireplugsintoasocketlabeled“COM”or“Common.”Plugtheredoneintothesocketlabeled“V”or“volts.”SeeFigures1-17through1-20.
Figure1-17.TheblackleadplugsintotheCommon(COM)socket,andtheredleadplugsintotheredsocketthat’salmostalwaysontherighthandsideofamultimeter.
Theotherendsoftheleadsterminateinmetalspikesknownasprobes,whichyouwillbetouchingtocomponentswhenyouwanttomakeelectricalmeasurements.Theprobesdetectelectricity;theydon’temititinsignificantquantities.Therefore,theycannothurtyouunlessyoupokeyourselfwiththeirsharpends.Ifyourmeterdoesn’tdoautoranging,eachpositiononthedialwillhaveanumberbesideit.Thisnumbermeans“nohigherthan.”Forinstanceifyouwanttochecka6-voltbattery,andonepositiononthevoltagesectionofthedialisnumbered2andthenextpositionisnumbered20,position2means“nohigherthan2volts.”Youhavetogotothenextposition,whichmeans“nohigherthan20volts.”Ifyoumakeamistakeandtrytomeasuresomethinginappropriate,themeterwillshowyouanerrormessagesuchas“E”or“L.”Turnthedialandtryagain.
![Page 17: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/17.jpg)
Figure1-18.
Figure1-19.
Figure1-20.Tomeasureresistanceandvoltage,plugtheblackleadintotheCommonsocketandtheredleadintotheVoltssocket.Almostallmetershaveaseparatesocketwhereyoumustplugtheredleadwhenyoumeasurelargecurrentsinamps,butwe’llbedealingwiththislater.
FUNDAMENTALSOhmsWemeasuredistanceinmilesorkilometers,weightinpoundsorkilograms,temperatureinFahrenheitorCentigrade—andelectricalresistanceinohms.Theohmisaninternationalunit.TheGreekomegasymbol(Ω)isusedtoindicateohms,asshowninFigures1-21and1-22.LetterK(oralternatively,KΩ)meansakilohm,whichis1,000ohms.LetterM(orMΩ)meansamegohm,whichis1,000,000ohms.
NUMBEROFOHMSUSUALLYEXPRESSEDAS ABBREVIATEDAS
1,000ohms 1kilohm 1KΩor1K
10,000ohms 10kilohms 10KΩor10K
100,000ohms 100kilohms 100KΩor100K
1,000,000ohms 1megohm 1MΩor1M
10,000,000ohms 10megohms 10MΩor10M
Amaterialthathasveryhighresistancetoelectricityisknownasaninsulator.Mostplastics,includingthecoloredsheathsaroundwires,areinsulators.Amaterialwithverylowresistanceisaconductor.Metalssuchascopper,aluminum,silver,andgoldareexcellentconductors.
Figure1-21.Theomegasymbolisusedinternationallytoindicateresistanceonohms.
Figure1-22.You’llfinditprintedorwritteninawidevarietyofstyles.
ProcedureWe’regoingtousethemetertodiscovertheelectricalresistanceofyourtongue.First,setyourmetertomeasureresistance.Ifithasautoranging,looktoseewhetheritisdisplayingaK,meaningkilohms,orM,meaningmegohms.Ifyouhavetosettherangemanually,beginwithnolessthan100,000ohms(100K).SeeFigures1-23through1-25.
![Page 18: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/18.jpg)
Figure1-23.
Figure1-24.
Figure1-25.Tomeasureohms,turnthedialtotheohm(omega)symbol.Onanautorangingmeter,youcanthenpresstheRangebuttonrepeatedlytodisplaydifferentrangesofresistance,orsimplytouchtheprobestoaresistanceandwaitforthemetertochoosearangeautomatically.Amanualmeterrequiresyoutoselecttherangewiththedial(youshouldsetitto100Korhigher,tomeasureskinresistance).Ifyoudon’tgetameaningful
reading,tryadifferentrange.
Touchtheprobestoyourtongue,aboutaninchapart.Notethereading,whichshouldbearound50K.Nowputasidetheprobes,stickoutyourtongue,anduseatissuetodryitverycarefullyandthoroughly.Withoutallowingyourtonguetobecomemoistagain,repeatthetest,andthereadingshouldbehigher.Finally,presstheprobesagainsttheskinofyourhandorarm:youmaygetnoreadingatall,untilyoumoistenyourskin.
Whenyourskinismoist(forinstance,ifyouperspire),itselectricalresistancedecreases.Thisprincipleisusedinliedetectors,becausesomeonewhoknowinglytellsalie,underconditionsofstress,tendstoperspire.
A9-voltbatterycontainschemicalsthatliberateelectrons(particlesofelectricity),whichwanttoflowfromoneterminaltotheotherasaresultofachemicalreactioninsideit.Thinkofthecellsinsideabatteryasbeingliketwowatertanks—oneofthemfull,theotherempty.Iftheyareconnectedwithapipe,waterflowsbetweenthemuntiltheirlevelsareequal.Figure1-26mayhelpyouvisualizethis.Similarly,whenyouopenupanelectricalpathwaybetweenthetwosidesofabattery,electronsflowbetweenthem,evenifthepathwayconsistsonlyofthemoistureonyourtongue.Electronsflowmoreeasilythroughsomesubstances(suchasamoisttongue)thanothers(suchasadrytongue).
Figure1-26.Thinkofthecellsinabatteryasbeingliketwocylinders:onefullofwater,theotherempty.Openaconnectionbetweenthecylinders,andthewaterwillflowuntilthelevelsareequalonbothsides.Thelessresistanceintheconnection,thefastertheflowwillbe.
BACKGROUNDThemanwhodiscoveredresistanceGeorgSimonOhm,picturedinFigure1-27,wasborninBavariain1787andworkedinobscurityformuchofhislife,studyingthenatureofelectricityusingmetalwirethathehadtomakeforhimself(youcouldn’ttruckondowntoHomeDepotforaspoolofhookupwirebackintheearly1800s).Despitehislimitedresourcesandinadequatemathematicalabilities,Ohmwasabletodemonstratein1827thattheelectricalresistanceofaconductorsuchascoppervariedininverseproportionwithitsareaofcross-section,andthecurrentflowingthroughitisproportionalto
![Page 19: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/19.jpg)
thevoltageappliedtoit,aslongastemperatureisheldconstant.Fourteenyearslater,theRoyalSocietyinLondonfinallyrecognizedthesignificanceofhiscontributionandawardedhimtheCopleyMedal.Today,hisdiscoveryisknownasOhm’sLaw.
Figure1-27.GeorgSimonOhm,afterbeinghonoredforhispioneeringwork,mostofwhichhepursuedinrelativeobscurity.
FurtherInvestigationAttachthesnap-onterminalcap(shownearlierinFigure1-8)tothe9-voltbattery.Takethetwowiresthatareattachedtothecapandholdthemsothatthebareendsarejustafewmillimetersapart.Touchthemtoyourtongue.Nowseparatetheendsofthewiresbyacoupleofinches,andtouchthemtoyourtongueagain.(SeeFigure1-28.)Noticeanydifference?
Figure1-28.Modifyingthetonguetesttoshowthatashorterdistance,withlowerresistance,allowsgreaterflowofelectricity,andabiggerzap.
Useyourmetertomeasuretheelectricalresistanceofyourtongue,thistimevaryingthedistancebetweenthetwoprobes.Whenelectricitytravelsthroughashorterdistance,itencounterslesstotalresistance.Asaresult,thecurrent(theflowofelectricitypersecond)increases.Youcantryasimilarexperimentonyourarm,asshowninFigure1-29.
Figure1-29.Moistenyourskinbeforetryingtomeasureitsresistance.Youshouldfindthattheresistancegoesupasyoumovethemeterprobesfartherapart.Theresistanceisproportionaltothedistance.
Useyourmetertotesttheelectricalresistanceofwater.Dissolvesomesaltinthewater,andtestitagain.Nowtrymeasuringtheresistanceofdistilledwater(inacleanglass).Theworldaroundyouisfullofmaterialsthatconductelectricitywithvaryingamountsofresistance.
CleanupandRecyclingYourbatteryshouldnothavebeendamagedorsignificantlydischargedbythisexperiment.You’llbeabletouseitagain.Remembertoswitchoffyourmeterbeforeputtingitaway.
![Page 20: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/20.jpg)
Experiment2:Let’sAbuseaBattery!Togetabetterfeelingforelectricalpower,you’regoingtodowhatmostbookstellyounottodo.You’regoingtoshortoutabattery.Ashortcircuitisadirectconnectionbetweenthetwosidesofapowersource.
ShortCircuitsShortcircuitscanbedangerous.Donotshortoutapoweroutletinyourhome:there’llbealoudbang,abrightflash,andthewireortoolthatyouusewillbepartiallymelted,whileflyingparticlesofmeltedmetalcanburnyouorblindyou.Ifyoushortoutacarbattery,theflowofcurrentissohugethatthebatterymightevenexplode,drenchingyouinacid(Figure1-30).Lithiumbatteriesarealsodangerous.Nevershort-circuitalithiumbattery:itcancatchfireandburnyou(Figure1-31).Useonlyanalkalinebatteryinthisexperiment,andonlyasingleAAcell(Figure1-32).Youshouldalsowearsafetyglassesincaseyouhappentohaveadefectivebattery.
Youwillneed:
1.5-voltAAbatterySingle-batterycarrier3-ampfuseSafetyglasses(regulareyeglassesorsunglasseswilldo)Alligatorclip(smallorlarge)
Figure1-30.Anyonewhohasdroppedanadjustablewrenchacrossthebareterminalsofacarbatterywilltellyouthatshortcircuitscanbedramaticata“mere”12volts,ifthebatteryisbigenough.
Figure1-31.Thelowinternalresistanceoflithiumbatteries(whichareoftenusedinlaptopcomputers)allowshighcurrentstoflow,withunexpectedresults.Neverfoolaroundwithlithiumbatteries!
Figure1-32.Shortingoutanalkalinebatterycanbesafeifyoufollowthedirectionsprecisely.Evenso,thebatteryisliabletobecometoohottotouchcomfortably.Don’ttrythiswithanytypeofrechargeablebattery.
ProcedureUseanalkalinebattery.Donotuseanykindofrechargeablebattery.Putthebatteryintoabatteryholderthat’sdesignedforasinglebatteryandhastwothininsulatedwiresemergingfromit,asshowninFigure1-32.Donotuseanyotherkindofbatteryholder.Useanalligatorcliptoconnectthebareendsofthewires,asshowninFigure1-32.Therewillbenospark,becauseyouareusingonly1.5volts.Waitoneminute,andyou’llfindthatthewiresaregettinghot.Waitanotherminute,andthebattery,too,willbehot.Theheatiscausedbyelectricityflowingthroughthewiresandthroughtheelectrolyte(theconductivefluid)insidethebattery.Ifyou’veeverusedahandpumptoforceairintoabicycletire,youknowthatthepumpgetswarm.Electricitybehavesinmuchthesameway.Youcanimaginetheelectricitybeingcomposedofparticles(electrons)thatmakethewirehotastheypushthroughit.Thisisn’taperfectanalogy,butit’scloseenoughforourpurposes.Chemicalreactionsinsidethebatterycreateelectricalpressure.Thecorrectnameforthispressureisvoltage,whichismeasuredinvoltsandisnamedafterAlessandroVolta,anelectricalpioneer.Goingbacktothewateranalogy:theheightofthewaterinatankisproportionatetothepressureofthewater,andcomparableto
![Page 21: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/21.jpg)
voltage.Figure1-33mayhelpyoutovisualizethis.
Figure1-33.Thinkofvoltageaspressure,andamperesasflow.
Butvoltsareonlyhalfofthestory.Whenelectronsflowthroughawire,theflowisknownasamperage,namedafteryetanotherelectricalpioneer,André-MarieAmpère.Theflowisalsogenerallyknownascurrent.It’sthecurrent—theamperage—thatgeneratestheheat.
BACKGROUNDWhydidn’tyourtonguegethot?Whenyoutouchedthe9-voltbatterytoyourtongue,youfeltatingle,butnoperceptibleheat.Whenyoushortedoutabattery,yougeneratedanoticeableamountofheat,eventhoughyouusedalowervoltage.Howcanweexplainthis?Theelectricalresistanceofyourtongueisveryhigh,whichreducestheflowofelectrons.Theresistanceofawireisverylow,soifthere’sonlyawireconnectingthetwoterminalsofthebattery,morecurrentwillpassthroughit,creatingmoreheat.Ifallotherfactorsremainconstant:
Lowerresistanceallowsmorecurrenttoflow(Figure1-34).Theheatgeneratedbyelectricityisproportionaltotheamountofelectricity(thecurrent)thatflows.
Herearesomeotherbasicconcepts:
Theflowofelectricitypersecondismeasuredinamperes,oramps.Thepressureofelectricity,measuredinvolts,causestheflow.Theresistancetotheflowismeasuredinohms.Ahigherresistancerestrictsthecurrent.Ahighervoltageovercomesresistanceandincreasesthecurrent.
Figure1-34.Largerresistanceresultsinsmallerflow—butifyouincreasethepressure,itmayovercometheresistanceandincreasetheflow.
Ifyou’rewonderingexactlyhowmuchcurrentflowsbetweentheterminalsofabatterywhenyoushortitout,that’sadifficultquestiontoanswer.Ifyoutrytouseyourmultimetertomeasureit,you’reliabletoblowthefuseinsidethemeter.Still,youcanuseyourveryown3-ampfuse,whichwecansacrificebecauseitdidn’tcostverymuch.Firstinspectthefuseverycarefully,usingamagnifyingglassifyouhaveone.YoushouldseeatinyS-shapeinthetransparentwindowatthecenterofthefuse.ThatSisathinsectionofmetalthatmeltseasily.
Figure1-35.Whenyouattachbothwirestothefuse,thelittleS-shapedelementinsidewillmeltalmostinstantly.
Removethebatterythatyoushort-circuited.Itisnolongerusefulforanything,andshouldberecycledifpossible.Putafreshbatteryintothebatterycarrier,connectthefuseasshowninFigure1-35,andtakeanotherlook.YoushouldseeabreakinthecenteroftheSshape,wherethemetalmeltedalmostinstantly.Figure1-36showsthefusebeforeyouconnectedit,andFigure1-37depictsablownfuse.Thisishowafuseworks:itmeltstoprotecttherestofthecircuit.Thattinybreakinsidethefusestopsanymorecurrentfromflowing.
![Page 22: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/22.jpg)
Figure1-36.A3-ampfuse,beforeitselementwasmeltedbyasingle1.5-voltbattery.
Figure1-37.Thesamefuseafterbeingmeltedbyelectriccurrent.
FUNDAMENTALSVoltbasicsElectricalpressureismeasuredinvolts.Thevoltisaninternationalunit.Amillivoltis1/1,000ofavolt.
NUMBEROFVOLTS USUALLYEXPRESSEDAS ABBREVIATEDAS
0.001volts 1millivolt 1mV
0.01volts 10millivolts 10mV
0.1volts 100millivolts 100mV
1volt 1,000millivolts 1V
AmperebasicsWemeasureelectricalflowinamperes,oramps.Theampereisaninternationalunit,oftenreferredtoasan“amp.”Amilliampis1/1,000ofanampere.
NUMBEROFAMPERES USUALLYEXPRESSEDAS ABBREVIATEDAS
0.001amps 1milliamp 1mA
0.01amps 10milliamps 10mA
0.1amps 100milliamps 100mA
1amp 1,000milliamps 1A
BACKGROUNDInventorofthebatteryAlessandroVolta(Figure1-38)wasborninItalyin1745,longbeforesciencewasbrokenupintospecialties.Afterstudyingchemistry(hediscoveredmethanein1776),hebecameaprofessorofphysicsandbecameinterestedintheso-calledgalvanicresponse,wherebyafrog’slegwilltwitchinresponsetoajoltofstaticelectricity.Usingawineglassfullofsaltwater,Voltademonstratedthatthechemicalreactionbetweentwoelectrodes,onemadeofcopper,theotherofzinc,willgenerateasteadyelectriccurrent.In1800,herefinedhisapparatusbystackingplatesofcopperandzinc,separatedbycardboardsoakedinsaltandwater.This“voltaicpile”wasthefirstelectricbattery.
Figure1-38.AlessandroVoltadiscoveredthatchemicalreactionscancreateelectricity.
FUNDAMENTALSDirectandalternatingcurrentTheflowofcurrentthatyougetfromabatteryisknownasdirectcurrent,orDC.Liketheflowofwaterfromafaucet,itisasteadystream,
![Page 23: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/23.jpg)
inonedirection.Theflowofcurrentthatyougetfromthe“hot”wireinapoweroutletinyourhomeisverydifferent.Itchangesfrompositivetonegative60timeseachsecond(inGreatBritainandsomeothernations,50timespersecond).Thisisknownasalternatingcurrent,orAC,whichismorelikethepulsatileflowyougetfromapowerwasher.Alternatingcurrentisessentialforsomepurposes,suchascrankingupvoltagesothatelectricitycanbedistributedoverlongdistances.ACisalsousefulinmotorsanddomesticappliances.ThepartsofanAmericanpoweroutletareshowninFigure1-39.Afewothernations,suchasJapan,alsouseAmerican-styleoutlets.FormostofthisbookI’mgoingtobetalkingaboutDC,fortworeasons:first,mostsimpleelectroniccircuitsarepoweredwithDC,andsecond,thewayitbehavesismucheasiertounderstand.Iwon’tbothertomentionrepeatedlythatI’mdealingwithDC.JustassumethateverythingisDCunlessotherwisenoted.
Figure1-39.ThisstyleofpoweroutletisfoundinNorthAmerica,SouthAmerica,Japan,andsomeothernations.Europeanoutletslookdifferent,buttheprincipleremainsthesame.SocketAisthe“live”sideoftheoutlet,supplyingvoltagethatalternatesbetweenpositiveandnegative,relativetosocketB,whichiscalledthe“neutral”side.Ifanappliancedevelopsafaultsuchasaninternalloosewire,itshouldprotectyouby
sinkingthevoltagethroughsocketC,theground.
BACKGROUNDFatherofelectromagnetismBornin1775inFrance,André-MarieAmpère(Figure1-40)wasamathematicalprodigywhobecameascienceteacher,despitebeinglargelyself-educatedinhisfather’slibrary.Hisbest-knownworkwastoderiveatheoryofelectromagnetismin1820,describingthewaythatanelectriccurrentgeneratesamagneticfield.Healsobuiltthefirstinstrumenttomeasuretheflowofelectricity(nowknownasagalvanometer),anddiscoveredtheelementfluorine.
Figure1-40.Andre-MarieAmperefoundthatanelectriccurrentrunningthroughawirecreatesamagneticfieldaroundit.Heusedthisprincipletomakethefirstreliablemeasurementsofwhatcametobeknownasamperage.
CleanupandRecyclingThefirstAAbatterythatyoushortedoutisprobablydamagedbeyondrepair.Youshoulddisposeofit.Puttingbatteriesinthetrashisnotagreatidea,becausetheycontainheavymetalsthatshouldbekeptoutoftheecosystem.Yourstateortownmayincludebatteriesinalocalrecyclingscheme.(Californiarequiresthatalmostallbatteriesberecycled.)You’llhavetocheckyourlocalregulationsfordetails.Theblownfuseisofnofurtheruse,andcanbethrownaway.Thesecondbattery,whichwasprotectedbythefuse,shouldstillbeOK.Thebatteryholderalsocanbereusedlater.
![Page 24: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/24.jpg)
Experiment3:YourFirstCircuitNowit’stimetomakeelectricitydosomethingthat’satleastslightlyuseful.Forthispurpose,you’llusecomponentsknownasresistors,andalight-emittingdiode,orLED.Youwillneed:
1.5-voltAAbatteries.Quantity:4.Four-batteryholder.Quantity:1.Resistors:470Ω,1K,andeither2Kor2.2K(the2.2Kvaluehappenstobemorecommonthan2K,buteitherwilldointhisexperiment).Quantity:1ofeachresistor.AnLED,anytype.Quantity:1.Alligatorclips.Quantity:3.
SetupIt’stimetogetacquaintedwiththemostfundamentalcomponentwe’llbeusinginelectroniccircuits:thehumbleresistor.Asitsnameimplies,itresiststheflowofelectricity.Asyoumightexpect,thevalueismeasuredinohms.Ifyouboughtabargain-basementassortmentpackageofresistors,youmayfindnothingthattellsyoutheirvalues.That’sOK;wecanfindouteasilyenough.Infact,eveniftheyareclearlylabeled,Iwantyoutochecktheirvaluesyourself.Youcandoitintwoways:
Useyourmultimeter.Thisisexcellentpracticeinlearningtointerpretthenumbersthatitdisplays.Learnthecolorcodesthatareprintedonmostresistors.Seethefollowingsection,“Fundamentals:Decodingresistors,”forinstructions.
Afteryoucheckthem,it’sagoodideatosortthemintolabeledcompartmentsinalittleplasticpartsbox.Personally,IliketheboxessoldattheMichaelschainofcraftsstores,butyoucanfindthemfrommanysources.
FUNDAMENTALSDecodingresistorsSomeresistorshavetheirvalueclearlystatedontheminmicroscopicprintthatyoucanreadwithamagnifyingglass.Most,however,arecolor-codedwithstripes.Thecodeworkslikethis:first,ignorethecolorofthebodyoftheresistor.Second,lookforasilverorgoldstripe.Ifyoufindit,turntheresistorsothatthestripeisontherighthandside.Silvermeansthatthevalueoftheresistorisaccuratewithin10%,whilegoldmeansthatthevalueisaccuratewithin5%.Ifyoudon’tfindasilverorgoldstripe,turntheresistorsothatthestripesareclusteredattheleftend.Youshouldnowfindyourselflookingatthreecoloredstripesontheleft.Someresistorshavemorestripes,butwe’lldealwiththoseinamoment.SeeFigures1-41and1-42.
Figure1-41.Somemodernresistorshavetheirvaluesprintedonthem,althoughyoumayneedamagnifiertoreadthem.This15Kresistorislessthanhalfaninchlong.
Figure1-42.Fromtoptobottom,theseresistorvaluesare56,000ohms(56K),5,600ohms(5.6K),and560ohms.Thesizetellsyouhowmuchpowertheresistorcanhandle;ithasnothingtodowiththeresistance.Thesmallercomponentsareratedat1/4watt;thelargeroneinthecenter
canhandle1wattofpower.
Startingfromtheleft,thefirstandsecondstripesarecodedaccordingtothistable:
Black 0
Brown 1
Red 2
Orange 3
Yellow 4
Green 5
Blue 6
Violet 7
Gray 8
White 9
Thethirdstripehasadifferentmeaning:Ittellsyouhowmanyzerostoadd,likethis:
Black - Nozeros
Brown 0 1zero
![Page 25: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/25.jpg)
Red 00 2zeros
Orange 000 3zeros
Yellow 0000 4zeros
Green 00000 5zeros
Blue 000000 6zeros
Violet 0000000 7zeros
Gray 00000000 8zeros
White 000000000 9zeros
FUNDAMENTALSDecodingresistors(continued)Notethatthecolor-codingisconsistent,sothatgreen,forinstance,meanseitheravalueof5(forthefirsttwostripes)or5zeros(forthethirdstripe).Also,thesequenceofcolorsisthesameastheirsequenceinarainbow.So,aresistorcoloredbrown-red-greenwouldhaveavalueof1-2andfivezeros,making1,200,000ohms,or1.2MΩ.Aresistorcoloredorange-orange-orangewouldhaveavalueof3-3andthreezeros,making33,000ohms,or33KΩ.Aresistorcoloredbrown-black-redwouldhaveavalueof1-0andtwoadditionalzeros,or1KΩ.Figure1-43showssomeotherexamples.
Figure1-43.Toreadthevalueofaresistor,firstturnitsothatthesilverorgoldstripeisontheright,ortheotherstripesareclusteredontheleft.Fromtoptobottom:Thefirstresistorhasavalueof1-2andfivezeros,or1,200,000,whichis1.2MΩ.Thesecondis5-6andonezero,or560Ω.The
thirdis4-7andtwozeros,or4,700,whichis4.7KΩ.Thelastis6-5-1andtwozeros,or65,100Ω,whichis65.1KΩ.
Ifyourunacrossaresistorwithfourstripesinsteadofthree,thefirstthreestripesaredigitsandthefourthstripeisthenumberofzeros.Thethirdnumericstripeallowstheresistortobecalibratedtoafinertolerance.Confusing?Absolutely.That’swhyit’seasiertouseyourmetertocheckthevalues.Justbeawarethatthemeterreadingmaybeslightlydifferentfromtheclaimedvalueoftheresistor.Thiscanhappenbecauseyourmeterisn’tabsolutelyaccurate,orbecausetheresistorisnotabsolutelyaccurate,orboth.Aslongasyou’rewithin5%oftheclaimedvalue,itdoesn’tmatterforourpurposes.
LightinganLEDNowtakealookatoneofyourLEDs.Anold-fashionedlightbulbwastesalotofpowerbyconvertingitintoheat.LEDsaremuchsmarter:theyconvertalmostalltheirpowerintolight,andtheylastalmostindefinitely—aslongasyoutreatthemright!AnLEDisquitefussyabouttheamountofpoweritgets,andthewayitgetsit.Alwaysfollowtheserules:
ThelongerwireprotrudingfromtheLEDmustreceiveamorepositivevoltagethantheshorterwire.Thevoltagedifferencebetweenthelongwireandtheshortwiremustnotexceedthelimitstatedbythemanufacturer.ThecurrentpassingthroughtheLEDmustnotexceedthelimitstatedbythemanufacturer.
Whathappensifyoubreaktheserules?Well,we’regoingtofindout!Makesureyouareusingfreshbatteries.YoucancheckbysettingyourmultimetertomeasurevoltsDC,andtouchingtheprobestotheterminalsofeachbattery.Youshouldfindthateachofthemgeneratesapressureofatleast1.5volts.Iftheyreadslightlyhigherthanthis,it’snormal.Abatterystartsoutaboveitsratedvoltage,anddeliversprogressivelylessasyouuseit.Batteriesalsolosesomevoltagewhiletheyaresittingontheshelfdoingnothing.Loadyourbatteryholder(takingcarethatthebatteriesaretherightwayaround,withthenegativeendspressingagainstthespringsinthecarrier).Useyourmetertocheckthevoltageonthewirescomingoutofthebatterycarrier.Youshouldhaveatleast6volts.Nowselecta2KΩresistor.Remember,“2KΩ”means“2,000ohms.”Ifithascoloredstripes,theyshouldbered-black-red,meaning2-0andtwomorezeros.Because2.2Kresistorsaremorecommonthan2Kresistors,youcansubstituteoneofthemifnecessary.Itwillbecoloredred-red-red.WireitintothecircuitasshowninFigures1-44and1-45,makingtheconnectionswithalligatorclips.YoushouldseetheLEDglowverydimly.Nowswapoutyour2Kresistorandsubstitutea1Kresistor,whichwillhavebrown-black-redstripes,meaning1-0andtwomorezeros.TheLEDshouldglowmorebrightly.
![Page 26: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/26.jpg)
Figure1-44.ThesetupforExperiment3,showingresistorsof470Ω,1KΩ,and2KΩ.Applyalligatorclipswhereshown,tomakeasecurecontact,andtryeachoftheresistorsoneatatimeatthesamepointinthecircuit,whilewatchingtheLED.
Swapoutthe1Kresistorandsubstitutea470Ωresistor,whichwillhaveyellow-violet-brownstripes,meaning4-7andonemorezero.TheLEDshouldbebrighterstill.Thismayseemveryelementary,butitmakesanimportantpoint.Theresistorblocksapercentageofthevoltageinthecircuit.Thinkofitasbeinglikeakinkorconstrictioninaflexiblehose.Ahigher-valueresistorblocksmorevoltage,leavinglessfortheLED.
Figure1-45.Here’showitactuallylooks,usingalargeLED.Ifyoustartwiththehighestvalueresistor,theLEDwillglowverydimlyasyoucompletethecircuit.Theresistordropsmostofthevoltage,leavingtheLEDwithinsufficientcurrenttomakeitshinebrightly.
CleanupandRecyclingWe’llusethebatteriesandtheLEDinthenextexperiment.Theresistorscanbereusedinthefuture.
![Page 27: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/27.jpg)
Experiment4:VaryingtheVoltagePotentiometerscomeinvariousshapesandsizes,buttheyalldothesamething:theyallowyoutovaryvoltageandcurrentbyvaryingresistance.Thisexperimentwillenableyoutolearnmoreaboutvoltage,amperage,andtherelationshipbetweenthem.You’llalsolearnhowtoreadamanufacturer’sdatasheet.Youwillneedthesamebatteries,batterycarrier,alligatorclips,andLEDfromthelastexperiment,plus:
Potentiometer,2KΩlinear.Quantity:2.(SeeFigure1-46.)Full-sizedpotentiometersthatlooklikethisarebecominglesscommon,asminiatureversionsaretakingtheirplace.I’dlikeyoutousealargeone,though,becauseit’ssomucheasiertoworkwith.OneextraLED.Multimeter.
LookInsideYourPotentiometerThefirstthingIwantyoutodoisfindouthowapotentiometerworks.Thismeansyou’llhavetoopenit,whichiswhyyourshoppinglistrequiredyoutobuytwoofthem,incaseyoucan’tputthefirstonebacktogetheragain.Mostpotentiometersareheldtogetherwithlittlemetaltabs.Youshouldbeabletograbholdofthetabswithyourwirecuttersorpliers,andbendthemupandoutward.Ifyoudothis,thepotentiometershouldopenupasshowninFigures1-47and1-48.
Figure1-46.
Figure1-47.
Figure1-48.Toopenthepotentiometer,firstpryupthefourlittlemetaltabsaroundtheedge(youcanseeonestickingoutattheleftandanotheronestickingoutattherightinFigure1-47).Insideisacoilofwirearoundaflatplasticband,andapairofspringycontacts(thewiper),whichconduct
electricitytoorfromanypointinthecoilwhenyouturntheshaft.
Dependingwhetheryouhaveareallycheappotentiometeroraslightlymorehigh-classversion,youmayfindacirculartrackofconductiveplasticoraloopofcoiledwire.Eitherway,theprincipleisthesame.Thewireortheplasticpossessessomeresistance(atotalof2Kinthisinstance),andasyouturntheshaftofthepotentiometer,awiperrubsagainsttheresistance,givingyouashortcuttoanypointfromthecenterterminal.Youcantrytoputitbacktogether,butifitdoesn’twork,useyourbackuppotentiometerinstead.Totestyourpotentiometer,setyourmetertomeasureresistance(ohms)andtouchtheprobeswhileturningthepotentiometershafttoandfro,asshowninFigure1-49.
Figure1-49.Measuretheresistancebetweenthesetwoterminalsofthepotentiometerwhileyouturnitsshafttoandfro.
DimmingYourLEDBeginwiththepotentiometerturnedallthewaycounterclockwise,otherwiseyou’llburnouttheLEDbeforeweevengetstarted.(Avery,verysmallnumberofpotentiometersincreaseanddecreaseresistanceintheoppositewaytowhichI’mdescribinghere,but
![Page 28: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/28.jpg)
aslongasyourpotentiometerlooksliketheoneinFigure1-48afteryouopenitup,mydescriptionshouldbeaccurate.)NowconnecteverythingasshowninFigures1-50and1-51,takingcarethatyoudon’tallowthemetalpartsofanyofthealligatorclipstotoucheachother.Nowturnupthepotentiometerveryslowly.You’llnoticetheLEDglowingbrighter,andbrighter,andbrighter—until,oops,itgoesdark.Youseehoweasyitistodestroymodernelectronics?ThrowawaythatLED.Itwillneverglowagain.SubstituteanewLED,andwe’llbemorecarefulthistime.
Figure1-50.ThesetupforExperiment4.Rotatingtheshaftofthe2Kpotentiometervariesitsresistancefrom0to2,000Ω.ThisresistancerestrictsthecurrentthatcanflowthroughtheLED,andalsochangesthevoltageacrosstheLED.
Figure1-51.TheLEDinthisphotoisdarkbecauseIturnedthepotentiometerupjustalittlebittoofar.
Whilethebatteriesareconnectedtothecircuit,setyourmetertomeasurevoltsDCasshowninFigures1-52through1-54.NowtouchtheprobeseithersideoftheLED.Trytoholdtheprobesinplacewhileyouturnthepotentiometerupalittle,anddownalittle.YoushouldseethevoltagepressurearoundtheLEDchangingaccordingly.WecallthisthepotentialdifferencebetweenthetwowiresoftheLED.
Figure1-52.
Figure1-53.
Figure1-54.EachmeterhasadifferentwaytomeasurevoltsDC.Themanuallyadjustedmeter(top)requiresyoutomoveasliderswitchto“DC”andthenchoosethehighestvoltageyouwanttomeasure:Inthiscase,theselectedvoltageis20(because2wouldbetoolow).Usingtheautoranging
RadioShackmeter,yousetitto“V”andthemeterwillfigureoutwhichrangetouse.
![Page 29: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/29.jpg)
Ifyouwereusingaminiatureold-fashionedlightbulbinsteadofanLED,you’dseethepotentialdifferencevaryingmuchmore,becausealightbulbbehaveslikea“pure”resistor,whereasanLEDself-adjuststosomeextent,modifyingitsresistanceasthevoltagepressurechanges.Nowtouchtheprobestothetwoterminalsofthepotentiometerthatwe’reusing,sothatyoucanmeasurethepotentialdifferencebetweenthem.ThepotentiometerandtheLEDsharethetotalavailablevoltage,sowhenthepotentialdifference(thevoltagedrop)aroundthepotentiometergoesup,thepotentialdifferencearoundtheLEDgoesdown,andviceversa.SeeFigures1-55through1-57.Afewthingstokeepinmind:
Ifyouaddthevoltagedropsacrossthedevicesinthecircuit,thetotalisthesameasthevoltagesuppliedbythebatteries.Youmeasurevoltagerelatively,betweentwopointsinacircuit.Applyyourmeterlikeastethoscope,withoutdisturbingorbreakingtheconnectionsinthecircuit.
Figure1-55.Howtomeasurevoltageinasimplecircuit.
Figure1-56.ThemetershowshowmuchvoltagetheLEDtakes.
Figure1-57.Themetershowshowmuchvoltagethepotentiometertakes.
CheckingtheFlow
![Page 30: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/30.jpg)
NowIwantyoutomakeadifferentmeasurement.Iwantyoutomeasuretheflow,orcurrent,inthecircuit,usingyourmetersettomA(milliamps).Remember,tomeasurecurrent:
Youcanonlymeasurecurrentwhenitpassesthroughthemeter.Youhavetoinsertyourmeterintothecircuit.Toomuchcurrentwillblowthefuseinsideyourmeter.
MakesureyousetyourmetertomeasuremA,notvolts,beforeyoutrythis.Somemetersrequireyoutomoveoneofyourleadstoadifferentsocketonthemeter,tomeasuremA.SeeFigures1-58through1-61.
Figure1-58.Anymeterwillblowitsinternalfuseifyoutrytomakeitmeasuretoohighanamperage.Inourcircuit,thisisnotariskaslongasyoukeepthepotentiometerinthemiddleofitsrange.Choose“mA”formilliampsandrememberthatthemeterdisplaysnumbersthatmeanthousandthsof
anamp.
Figure1-59.
Figure1-60.
Figure1-61.Amanualmetersuchastheoneheremayrequireyoutoshifttheredleadtoadifferentsocket,tomeasuremilliamps.Mostmodernmetersdon’trequirethisuntilyouaremeasuringhighercurrents.
Insertyourmeterintothecircuit,asshowninFigure1-62.Don’tturnthepotentiometermorethanhalfwayup.Theresistanceinthepotentiometerwillprotectyourmeter,aswellastheLED.Ifthemetergetstoomuchcurrent,you’llfindyourselfreplacingitsinternalfuse.Asyouadjustthepotentiometerupanddownalittle,youshouldfindthatthevaryingresistanceinthecircuitchangestheflowofcurrent—theamperage.ThisiswhytheLEDburnedoutinthepreviousexperiment:toomuchcurrentmadeithot,andtheheatmeltsitinside,justlikethefuseinthepreviousexperiment.Ahigherresistancelimitstheflowofcurrent,oramperage.Nowinsertthemeterinanotherpartofthecircuit,asshowninFigure1-63.Asyouturnthepotentiometerupanddown,youshouldgetexactlythesameresultsaswiththeconfigurationinFigure1-62.Thisisbecausethecurrentisthesameatallpointsinasimilarcircuit.Ithastobe,becausetheflowofelectronshasnoplaceelsetogo.It’stimenowtonailthisdownwithsomenumbers.Here’sonelastthingtotry.SetasidetheLEDandsubstitutea1KΩresistor,asshowninFigure1-64.Thetotalresistanceinthecircuitisnow1KΩpluswhatevertheresistancethepotentiometerprovides,dependinghowyousetit.(Themeteralsohassomeresistance,butit’ssolow,wecanignoreit.)
![Page 31: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/31.jpg)
Figure1-62.Tomeasureamps,asillustratedhereandinFigure1-63,thecurrenthastopassthroughthemeter.Whenyouincreasetheresistance,yourestrictthecurrentflow,andthelowerflowmakestheLEDglowlessbrightly.
Figure1-63.
Figure1-64.IfyousubstitutearesistorinsteadoftheLED,youcanconfirmthatthecurrentflowingthroughthecircuitvarieswiththetotalresistanceinthecircuit,ifthevoltagestaysthesame.
Turnthepotentiometerallthewaycounterclockwise,andyouhaveatotalof3Kresistanceinthecircuit.Yourmetershouldshowabout2mAflowing.Nowturnthepotentiometerhalfway,andyouhaveabout2Ktotalresistance.Youshouldseeabout3mAflowing.Turnthepotentiometerallthewayclockwise,sothere’satotalof1K,andyoushouldsee6mAflowing.Youmaynoticethatifwemultiplytheresistancebytheamperage,weget6eachtime—whichjusthappenstobethevoltagebeingappliedtothecircuit.Seethefollowingtable.
TOTALRESISTANCE CURRENT VOLTAGE
(KΩ) (mA) (Volts)
![Page 32: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/32.jpg)
3 2 6
2 3 6
1 6 6
Infact,wecouldsay:voltage=kilohms×milliamps
Butwaitaminute:1Kis1,000ohms,and1mAis1/1,000ofanamp.Therefore,ourformulashouldreallylooklikethis:voltage=(ohms×1,000)×(amps/1,000)
Thetwofactorsof1,000cancelout,sowegetthis:volts=ohms×amps
ThisisknownasOhm’sLaw.Seethesection,“Fundamentals:Ohm’sLaw,”onthefollowingpage.
FUNDAMENTALSSeriesandparallelBeforewegoanyfurther,youshouldknowhowresistanceinacircuitincreaseswhenyouputresistorsinseriesorinparallel.Figures1-65through1-67illustratethis.Remember:
Resistorsinseriesareorientedsothatonefollowstheother.Resistorsinparallelareorientedsidebyside.
Whenyouputtwoequal-valuedresistorsinseries,youdoublethetotalresistance,becauseelectricityhastopassthroughtwobarriersinsuccession.Whenyouputtwoequal-valuedresistorsinparallel,youdividethetotalresistancebytwo,becauseyou’regivingtheelectricitytwopathswhichitcantake,insteadofone.Inrealitywedon’tnormallyneedtoputresistorsinparallel,butweoftenputothertypesofcomponentsinparallel.Lightbulbsinyourhouse,forinstance,areallwiredthatway.So,it’susefultounderstandthatresistanceinacircuitgoesdownifyoukeepaddingcomponentsinparallel.
Figure1-65.Oneresistortakestheentirevoltage,andaccordingtoOhm’sLaw,itdrawsv/R=6/1,000=0.006amps=6mAofcurrent.
Figure1-66.Whentworesistorsareinseries,theelectricityhastopassthroughonetoreachtheother,andthereforeeachofthemtakeshalfthevoltage.Totalresistanceisnow2,000ohms,andaccordingtoOhm’sLaw,thecircuitdrawsv/R=6/2,000=0.003amps=3mAofcurrent.
Figure1-67.Whentworesistorsareinparallel,eachisexposedtothefullvoltage,soeachofthemtakes6volts.Theelectricitycannowflowthroughbothatonce,sothetotalresistanceofthecircuitishalfasmuchasbefore.AccordingtoOhm’sLaw,thecircuitdrawsv/R=6/500=0.012
amps=12mAofcurrent.
UsingOhm’sLawOhm’sLawisextremelyuseful.Forexample,ithelpsustofigureoutwhetheracomponentcanbeusedsafelyinacircuit.Insteadofstressingthecomponentuntilweburnitout,wecanpredictwhetheritwillwork.Forinstance,thefirsttimeyouturnedthepotentiometer,youdidn’treallyknowhowfaryoucouldgountiltheLEDburnedout.Wouldn’titbeusefultoknowpreciselywhatresistancetoputinserieswithanLED,toprotectitadequatelywhileprovidingasmuchlightaspossible?
FUNDAMENTALSOhm’sLawForreasonsI’llexplaininamoment,ampsarenormallyabbreviatedwiththeletterI.VstandsforvoltsandRstandsforresistanceinohms(becausetheomegasymbol,Ω,isnoteasilygeneratedfrommostkeyboards).Usingthesesymbols,youcanwriteOhm’sLawinthreedifferentways:
![Page 33: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/33.jpg)
V=I×RI=V/RR=V/I
Remember,Visadifferenceinvoltagebetweentwopointsinasimplecircuit,Ristheresistanceinohmsbetweenthesametwopoints,andIisthecurrentinampsflowingthroughthecircuitbetweenthetwopoints.LetterIisusedbecauseoriginallycurrentwasmeasuredbyitsinductance,meaningtheabilitytoinducemagneticeffects.ItwouldbemuchlessconfusingtouseAforamps,butunfortunatelyit’stoolateforthattohappen.
HowtoReadaDataSheetLikemostinformation,theanswertothisquestionisavailableonline.Here’showyoufindamanufacturer’sdatasheet(Figure1-68).First,findthecomponentthatyou’reinterestedinfromamail-ordersource.Next,Googlethepartnumberandmanufacturer’sname.Usuallythedatasheetwillpopupasthefirsthit.AsourcesuchasMouser.commakesiteveneasierbygivingyouadirectlinktomanufacturers’datasheetsformanyproducts.
Figure1-68.Thebeginningofatypicaldatasheet,whichincludesallrelevantspecificationsfortheproduct,freelyavailableonline.
BACKGROUNDHowmuchvoltagedoesawireconsume?Normally,wecanignoretheresistanceinelectricwires,suchasthelittleleadsofwirethatstickoutofresistors,becauseit’strivial.However,ifyoutrytoforcelargeamountsofcurrentthroughlonglengthsofthinwire,theresistanceofthewirecanbecomeimportant.Howimportant?Onceagain,wecanuseOhm’sLawtofindout.Supposethataverylongpieceofwirehasaresistanceof0.2Ω.Andwewanttorun15ampsthroughit.Howmuchvoltagewillthewirestealfromthecircuit,becauseofitsresistance?Onceagain,youbeginbywritingdownwhatyouknow:
R=0.2I=15
WewanttoknowV,thepotentialdifference,forthewire,soweusetheversionofOhm’sLawthatplacesVontheleftside:V=I×R
Nowpluginthevalues:V=15×0.2=3volts
Threevoltsisnotabigdealifyouhaveahigh-voltagepowersupply,butifyouareusinga12-voltcarbattery,thislengthofwirewilltakeone-quarteroftheavailablevoltage.Nowyouknowwhythewiringinautomobilesisrelativelythick—toreduceitsresistancewellbelow0.2Ω.SeeFigure1-69.
Figure1-69.Whena12-voltcarbatteryrunssomekindofelectricaldevicethroughalongpieceofthinwire,theresistanceofthewirestealssomeofthevoltageanddissipatesitasheat.
Here’sanexample.SupposeIwantaredLED,suchastheVishaypartTLHR5400,whichhasbecomesuchacommonitemthatIcanbuythemindividuallyfor9centsapiece.Iclickthelinktothedatasheetmaintainedbythemanufacturer,VishaySemiconductor.AlmostimmediatelyIhaveaPDFpageonmyscreen.ThisdatasheetisforTLHR,TLHG,andTLHYtypesofLED,whicharered,
![Page 34: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/34.jpg)
green,andyellowrespectively,assuggestedbytheR,G,andYintheproductcodes.Iscrolldownandlookatthe“OpticalandElectricalCharacteristics”section.Ittellsmethatunderconditionsofdrawingacurrentof20mA,theLEDwillenjoya“Typ,”meaning,typical,“forwardvoltage”of2volts.The“Max,”meaningmaximum,is3volts.Let’slookatoneotherdatasheet,asnotallofthemarewrittenthesameway.I’llchooseadifferentLED,theKingbrightpartWP7113SGC.Clickonthelinktothemanufacturer’ssite,andIfindonthesecondpageofthedatasheetatypicalforwardvoltageof2.2,maximum2.5,andamaximumforwardcurrentof25mA.Ialsofindsomeadditionalinformation:amaximumreversevoltageof5andmaximumreversecurrentof10uA(that’smicroamps,whichare1,000timessmallerthanmilliamps).ThistellsusthatyoushouldavoidapplyingexcessivevoltagetotheLEDthewrongwayaround.Ifyouexceedthereversevoltage,youriskburningouttheLED.Alwaysobservepolarity!KingbrightalsowarnsushowmuchheattheLEDcanstand:260°C(500°F)forafewseconds.Thisisusefulinformation,aswe’llbeputtingasideouralligatorclipsandusinghotmoltensoldertoconnectelectricalpartsinthenearfuture.Becausewehavealreadydestroyedabattery,afuse,andanLEDinjustfourexperiments,maybeyouwon’tbesurprisedwhenItellyouthatwewilldestroyatleastacouplemorecomponentsaswetesttheirlimitswithasolderingiron.Anyway,nowweknowwhatanLEDwants,wecanfigureouthowtosupplyit.Ifyouhaveanydifficultiesdealingwithdecimals,checktheFundamentalssection“Decimals,”onthenextpage,beforecontinuing.
BACKGROUNDTheoriginsofwattageJamesWatt(Figure1-70)isknownastheinventorofthesteamengine.Bornin1736inScotland,hesetupasmallworkshopintheUniversityofGlasgow,wherehestruggledtoperfectanefficientdesignforusingsteamtomoveapistoninacylinder.Financialproblemsandtheprimitivestateoftheartofmetalworkingdelayedpracticalapplicationsuntil1776.Despitedifficultiesinobtainingpatents(whichcouldonlybegrantedbyanactofparliamentinthosetimes),Wattandhisbusinesspartnereventuallymadealotofmoneyfromhisinnovations.Althoughhepredatedthepioneersinelectricity,in1889(70yearsafterhisdeath),hisnamewasassignedtothebasicunitofelectricpowerthatcanbedefinedbymultiplyingamperesbyvolts.SeetheFundamentalssection,“WattBasics,”onpage31.
Figure1-70.JamesWatt’sdevelopmentofsteampowerenabledtheindustrialrevolution.Afterhisdeath,hewashonoredbyhavinghisnameappliedtothebasicunitofpowerinelectricity.
HowBigaResistorDoesanLEDNeed?SupposethatweusetheVishayLED.Rememberitsrequirementsfromthedatasheet?Maximumof3volts,andasafecurrentof20mA.I’mgoingtolimititto2.5volts,tobeonthesafeside.Wehave6voltsofbatterypower.Subtract2.5from6andweget3.5.Soweneedaresistorthatwilltake3.5voltsfromthecircuit,leaving2.5fortheLED.Thecurrentflowisthesameatallplacesinasimplecircuit.Ifwewantamaximumof20mAtoflowthroughtheLED,thesameamountofcurrentwillbeflowingthroughtheresistor.Nowwecanwritedownwhatweknowabouttheresistorinthecircuit.Notethatwehavetoconvertallunitstovolts,amps,andohms,sothat20mAshouldbewrittenas0.02amps:
V=3.5(thepotentialdropacrosstheresistor)I=0.02(thecurrentflowingthroughtheresistor)
WewanttoknowR,theresistance.So,weusetheversionofOhm’sLawthatputsRontheleftside:R=V/I
Nowpluginthevalues:R=3.5/0.02
Runthisthroughyourpocketcalculatorifyoufinddecimalsconfusing.Theansweris:R=175Ω
Itsohappensthat175Ωisn’tastandardvalue.Youmayhavetosettlefor180or220Ω,butthat’scloseenough.Evidentlythe470ΩresistorthatyouusedinExperiment3wasaveryconservativechoice.IsuggesteditbecauseIsaidoriginallythatyoucoulduseanyLEDatall.Ifiguredthatnomatterwhichoneyoupicked,itshouldbesafewith470Ωtoprotectit.
CleanupandRecyclingThedeadLEDcanbethrownaway.Everythingelseisreusable.
FUNDAMENTALSDecimalsLegendaryBritishpoliticianSirWinstonChurchillisfamousforcomplainingabout“thosedamneddots.”Hewasreferringtodecimalpoints.BecauseChurchillwasChancelloroftheExchequeratthetime,andthusinchargeofallgovernmentexpenditures,hisdifficultywithdecimalswasabitofaproblem.Still,hemuddledthroughintime-honoredBritishfashion,andsocanyou.Youcanalsouseapocketcalculator—orfollowtwobasicrules.
Doingmultiplication:movethedecimalpoints
![Page 35: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/35.jpg)
Supposeyouwanttomultiply0.03by0.002:1.Movethedecimalpointstotheendsofboththenumbers.Inthiscase,youhavetomovethedecimalpointsbyatotalof5placesto
get3and2.2.Dothemultiplicationofthewholenumbersyouhavecreatedandnotetheresult.Inthiscase,3x2=6.3.Movethedecimalpointbackagainbythesamenumberofplacesyoucountedinstep1.Inthiscase,youget0.00006.
Doingdivision:cancelthezerosSupposeyouneedtodivide0.006by0.0002:
1.Shiftthedecimalpointstotheright,inboththenumbers,bythesamenumberofsteps,untilboththenumbersaregreaterthan1.Inthiscase,shiftthepointfourstepsineachnumber,soyouget60dividedby2.
2.Dothedivision.Theresultinthiscaseis30.
THEORYDoingthemathonyourtongueI’mgoingtogobacktothequestionIaskedinthepreviousexperiment:whydidn’tyourtonguegethot?NowthatyouknowOhm’sLaw,youcanfigureouttheanswerinnumbers.Let’ssupposethebatterydelivereditsrated9volts,andyourtonguehadaresistanceof50K,whichis50,000ohms.Writedownwhatyouknow:
V=9R=50,000
Wewanttoknowthecurrent,I,soweusetheversionofOhm’sLawthatputsthisontheleft:I=V/R
Pluginthenumbers:I=9/50,000=0.00018amps
Movethedecimalpointthreeplacestoconverttomilliamps:I=0.18mA
That’satinycurrentthatwillnotproducemuchheatat9volts.Whataboutwhenyoushortedoutthebattery?Howmuchcurrentmadethewiresgethot?Well,supposethewireshadaresistanceof0.1ohms(probablyit’sless,butI’llstartwith0.1asaguess).Writedownwhatweknow:
V=1.5R=0.1
Onceagainwe’retryingtofindI,thecurrent,soweuse:I=V/R
Pluginthenumbers:I=1.5/0.1=15amps
That’s100,000timesthecurrentthatmayhavepassedthroughyourtongue,whichwouldhavegeneratedmuchmoreheat,eventhoughthevoltagewaslower.Couldthattinylittlebatteryreallypumpout15amps?Rememberthatthebatterygothot,aswellasthewire.Thistellsusthattheelectronsmayhavemetsomeresistanceinsidethebattery,aswellasinthewire.(Otherwise,whereelsedidtheheatcomefrom?)Normallywecanforgetabouttheinternalresistanceofabattery,becauseit’ssolow.Butathighcurrents,itbecomesafactor.Iwasreluctanttoshort-circuitthebatterythroughameter,totrytomeasurethecurrent.Mymeterwillfryifthecurrentisgreaterthan10A.HoweverIdidtryputtingotherfusesintothecircuit,toseewhethertheywouldblow.WhenItrieda10Afuse,itdidnotmelt.Therefore,forthebrandofbatteryIused,I’mfairlysurethatthecurrentintheshortcircuitwasunder10A,butIknowitwasover3A,becausethe3Afuseblewrightaway.Theinternalresistanceofthe1.5-voltbatterypreventedthecurrentintheshortcircuitfromgettingtoohigh.ThisiswhyIcautionedagainstusingalargerbattery(especiallyacarbattery).Largerbatterieshaveamuchlowerinternalresistance,allowingdangerouslyhighcurrentswhichgenerateexplosiveamountsofheat.Acarbatteryisdesignedtodeliverliterallyhundredsofampswhenitturnsastartermotor.That’squiteenoughcurrenttomeltwiresandcausenastyburns.Infact,youcanweldmetalusingacarbattery.Lithiumbatteriesalsohavelowinternalresistance,makingthemverydangerouswhenthey’reshortedout.Highcurrentcanbejustasdangerousashighvoltage.
FUNDAMENTALSWattbasicsSofarIhaven’tmentionedaunitthateveryoneisfamiliarwith:watts.Awattisaunitofwork.Engineershavetheirowndefinitionofwork—theysaythatworkisdonewhenaperson,ananimal,oramachinepushessomethingtoovercomemechanicalresistance.Exampleswouldbeasteamenginepullingatrainonaleveltrack(overcomingfrictionandairresistance)orapersonwalkingupstairs(overcomingtheforceofgravity).Whenelectronspushtheirwaythroughacircuit,theyareovercomingakindofresistance,andsotheyaredoingwork,whichcanbemeasuredinwatts.Thedefinitioniseasy:
watts=volts×ampsOr,usingthesymbolscustomarilyassigned,thesethreeformulasallmeanthesamething:
W=V×IV=W/II=W/V
Wattscanbeprecededwithan“m,”for“milli,”justlikevolts:
NUMBEROFWATTS USUALLYEXPRESSEDAS ABBREVIATEDAS
0.001watts 1milliwatt 1mW
0.01watts 10milliwatts 10mW
0.1watts 100milliwatts 100mW
1watt 1,000milliwatts 1W
![Page 36: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/36.jpg)
Becausepowerstations,solarinstallations,andwindfarmsdealwithmuchlargernumbers,youmayalsoseereferencestokilowatts(usingletterK)andmegawatts(withacapitalM,nottobeconfusedwiththelowercasemusedtodefinemilliwatts):
NUMBEROFWATTS USUALLYEXPRESSEDAS ABBREVIATEDAS
1,000watts 1kilowatt 1KW
1,000,000watts 1megawatt 1MW
Lightbulbsarecalibratedinwatts.Soarestereosystems.ThewattisnamedafterJamesWatt,inventorofthesteamengine.Incidentally,wattscanbeconvertedtohorsepower,andviceversa.
THEORYPowerassessmentsImentionedearlierthatresistorsarecommonlyratedasbeingcapableofdealingwith1/4watt,1/2watt,1watt,andsoon.Isuggestedthatyoushouldbuyresistorsof1/4wattorhigher.HowdidIknowthis?GobacktotheLEDcircuit.Rememberwewantedtheresistortodropthevoltageby3.5volts,atacurrentof20mA.Howmanywattsofpowerwouldthisimposeontheresistor?Writedownwhatyouknow:
V=3.5(thevoltagedropimposedbytheresistor)I=20mA=0.02amps(thecurrentflowingthroughtheresistor)
WewanttoknowW,soweusethisversionoftheformula:W=V×I
Pluginthevalues:W=3.5×0.02=0.07watts(thepowerbeingdissipatedbytheresistor)
Because1/4wattis0.25watts,obviouslya1/4wattresistorwillhaveaboutfourtimesthenecessarycapacity.Infactyoucouldhaveuseda1/8wattresistor,butinfutureexperimentswemayneedresistorsthatcanhandle1/4watt,andthere’snopenaltyforusingaresistorthatisratedformorewattsthanwillactuallypassthroughit.
![Page 37: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/37.jpg)
Experiment5:Let’sMakeaBatteryLongago,beforewebsurfing,filesharing,orcellphones,kidsweresohorriblydeprivedthattheytriedtoamusethemselveswithkitchen-tableexperimentssuchasmakingaprimitivebatterybypushinganailandapennyintoalemon.Hardtobelieve,perhaps,buttrue!Thisisseriouslyold-school—butIwantyoutotryitanyway,becauseanyonewhowantstogetafeelforelectricityshouldseehoweasyitistoextractitfromeverydayobjectsaroundus.Plus,ifyouuseenoughlemons,youjustmightgenerateenoughvoltagetopoweranLED.Thebasiccomponentsofabatteryaretwometalelectrodesimmersedinanelectrolyte.Iwon’tdefinethesetermshere(they’reexplainedinthefollowingsection“Theory:Thenatureofelectricity”).Rightnowallyouneedtoknowisthatlemonjuicewillbeyourelectrolyte,andcopperandzincwillbeyourelectrodes.Apennyprovidesthenecessarycopper,aslongasitisfairlynewandshiny.Penniesaren’tsolidcopperanymore,buttheyarestillcopper-plated,whichisgoodenough.Tofindsomemetalliczinc,youwillhavetomakeatriptoahardwarestore,whereyoushouldaskforroofingnails.Thenailsarezinc-platedtopreventthemfromrusting.Smallmetalbracketsormendingplatesalsoareusuallyzinc-plated.Theyshouldhaveaslightlydull,silverylook.Iftheyhaveamirror-brightfinish,they’remorelikelytobenickel-plated.Cutalemoninhalf,setyourmultimetersothatitcanmeasureupto2voltsDC,andholdoneprobeagainstapennywhileyouholdtheotherprobeagainstaroofingnail(orotherzinc-platedobject).Nowforcethepennyandthenailintotheexposedjuicyinteriorofthelemon,asclosetoeachotheraspossible,butnotactuallytouching.Youshouldfindthatyourmeterdetectsbetween0.8voltsand1volt.Youcanexperimentwithdifferentitemsandliquidstoseewhichworksbest.Immersingyournailandpennyinlemonjuicethatyouhavesqueezedintoashotglassoreggcupmayenhancetheefficiencyofyourbattery,althoughyou’llhaveahardertimeholdingeverythinginplace.Grapefruitjuiceandvinegarwillworkassubstitutesforlemonjuice.TodriveatypicalLED,youneedmorethan1volt.Howtogeneratetheextraelectricalpressure?Byputtingbatteriesinseries,ofcourse.Inotherwords,morelemons!(Ormoreshotglassesoreggcups.)You’llalsoneedlengthsofwiretoconnectmultipleelectrodes,andthismayentailskippingaheadtoChapter2,whereIdescribehowtostripinsulationfromhookupwire.Figures1-71and1-72showtheconfiguration.
Figure1-71.Athree-lemonbattery.Don’tbetoodisappointediftheLEDfailstolightup.Thelemonshaveahighelectricalresistance,sotheycan’tdelivermuchcurrent,especiallythroughtherelativelysmallsurfaceareaofthenailsandthepennies.However,thelemonbatterydoesgenerate
voltagethatyoucanmeasurewithyourmeter.
Figure1-72.Bottledlemonjuiceseemstoworkjustaswellasfreshlemonjuice.Icutthebottomsoffthreepapercups,insertedagalvanizedbracketintoeach,andusedheavyweightstrandedcopperwiretomakethepositiveelectrodes
Ifyousetthingsupcarefully,makingsurethannoneoftheelectrodesaretouching,youmaybeabletoilluminateyourLEDwithtwoorthreelemon-juicebatteriesinseries.(SomeLEDsaremoresensitivetoverylowcurrentsthanothers.LaterinthebookI’llbetalkingaboutvery-low-currentLEDs.Ifyouwantyourlemon-juicebatterytohavethebestchanceofworking,youcansearchonlineforlow-currentLEDsandbuyacouple.)
THEORYThenatureofelectricityTounderstandelectricity,youhavetostartwithsomebasicinformationaboutatoms.Eachatomconsistsofanucleusatthecenter,containingprotons,whichhaveapositivecharge.Thenucleusissurroundedbyelectrons,whichcarryanegativecharge.Breakingupthenucleusofanatomrequiresalotofenergy,andcanalsoliberatealotofenergy—ashappensinanuclearexplosion.Butpersuadingacoupleofelectronstoleaveanatom(orjoinanatom)takesverylittleenergy.Forinstance,whenzincreactschemicallywithanacid,itcanliberateelectrons.ThisiswhathappensatthezincelectrodeofthechemicalbatteryinExperiment5.Thereactionsoonstops,aselectronsaccumulateonthezincelectrode.Theyfeelamutualforceofrepulsion,yettheyhavenowheretogo.Youcanimaginethemlikeacrowdofhostilepeople,eachonewantingtheotherstoleave,andrefusingtoallownewonestojointhem,asshowninFigure1-73.
![Page 38: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/38.jpg)
Figure1-73.Electronsonanelectrodehaveabadattitudeknownasmutualrepulsion.
Nowconsiderwhathappenswhenawireconnectsthezincelectrode,whichhasasurplusofelectrons,toanotherelectrode,madefromadifferentmaterial,thathasashortageofelectrons.Theelectronscanpassthroughthewireveryeasilybyjumpingfromoneatomtothenext,sotheyescapefromthezincelectrodeandrunthroughthewire,propelledbytheirgreatdesiretogetawayfromeachother.SeeFigure1-74.Thismutualforceofpropulsioniswhatcreatesanelectricalcurrent.Nowthatthepopulationofelectronsonthezincelectrodehasbeenreduced,thezinc-acidreactioncancontinue,replacingthemissingelectronswithnewones—whichpromptlyimitatetheirpredecessorsandtrytogetawayfromeachotherbyrunningawaydownthewire.Theprocesscontinuesuntilthezinc-acidreactiongrindstoahalt,usuallybecauseitcreatesalayerofacompoundsuchaszincoxide,whichwon’treactwithacidandpreventstheacidfromreactingwiththezincunderneath.(Thisiswhyyourzincelectrodemayhavelookedsootywhenyoupulleditoutoftheacidicelectrolyte.)
Figure1-74.Assoonasweopenupapathwayfromazincelectrodecrowdedwithelectronstoacopperelectrode,whichcontains“holes”fortheelectrons,theirmutualrepulsionmakesthemtrytoescapefromeachothertotheirnewhomeasquicklyaspossible.
Thisdescriptionappliestoa“primarybattery,”meaningonethatisreadytogenerateelectricityassoonasaconnectionbetweenitsterminalsallowselectronstotransferfromoneelectrodetotheother.Theamountofcurrentthataprimarybatterycangenerateisdeterminedbythespeedatwhichchemicalreactionsinsidethebatterycanliberateelectrons.Whentherawmetalintheelectrodeshasallbeenusedupinchemicalreactions,thebatterycan’tgenerateanymoreelectricityandisdead.Itcannoteasilyberecharged,becausethechemicalreactionsarenoteasilyreversible,andtheelectrodesmayhaveoxidized.Inarechargeablebattery,alsoknownasasecondarybattery,asmarterchoiceofelectrodesandelectrolytedoesallowthechemicalreactionstobereversed.
Howmuchcurrentisbeinggeneratedinyourlemonbattery?Setyourmetertomeasuremilliamps,andconnectitbetweenthenailandthepenny.Imeasuredabout2mA,butgot10mAwhenIusedsome#10strandedcopperwireinsteadofapennyandalargemendingplateinsteadofaroofingnail,immersedinacupofgrapefruitjuice.Whenalargersurfaceareaofmetalmakesbettercontactwiththeelectrolyte,yougetagreaterflowofcurrent.(Don’teverconnectyourmetertomeasureampsdirectlybetweentheterminalsofarealbattery.Thecurrentwillbetoohigh,andcanblowthefuseinsideyourmeter.)What’stheinternalresistanceofyourlemon?Putasidethecopperandzincelectrodesandinsertyournickel-platedmeterprobesintothejuice.Igotareadingofaround30Kwhenbothprobeswereinthesamesegmentofthelemon,but40Korhigheriftheprobeswereindifferentsegments.Istheresistancelowerwhenyoutestliquidinacup?Hereareacouplemorequestionsthatyoumaywishtoinvestigate.Forhowlongwillyourlemonbatterygenerateelectricity?Andwhydoyouthinkyourzinc-platedelectrodebecomesdiscoloredafterithasbeenusedforawhile?Electricityisgeneratedinabatterybyanexchangeofions,orfreeelectrons,betweenmetals.Ifyouwanttoknowmoreaboutthis,checkthesection“Theory:Thenatureofelectricity”onthepreviouspage.
CleanupandRecyclingThehardwarethatyouimmersedinlemonsorlemonjuicemaybediscolored,butitisreusable.Whetheryoueatthelemonsisuptoyou.
BACKGROUNDPositiveandnegativeIfelectricityisaflowofelectrons,whichhaveanegativecharge,whydopeopletalkasifelectricityflowsfromthepositiveterminaltothenegativeterminalofabattery?Theanswerliesinafundamentalembarrassmentinthehistoryofresearchintoelectricity.Forvariousreasons,whenBenjaminFranklinwastryingtounderstandthenatureofelectriccurrentbystudyingphenomenasuchaslightningduringthunderstorms,hebelievedheobservedaflowof“electricalfluid”frompositivetonegative.Heproposedthisconceptin1747.Infact,FranklinhadmadeanunfortunateerrorthatremaineduncorrecteduntilafterphysicistJ.J.Thomsonannouncedhisdiscoveryoftheelectronin1897,150yearslater.Electricityactuallyflowsfromanareaofgreaternegativecharge,tosomeotherlocationthatis“lessnegative”—thatis,“morepositive.”Inotherwords,electricityisaflowofnegativelychargedparticles.Inabattery,theyoriginatefromthenegativeterminalandflowtothepositiveterminal.Youmightthinkthatwhenthisfactwasestablished,everyoneshouldhavediscardedFranklin’sideaofaflowfrompositivetonegative.Butwhenanelectronmovesthroughawire,youcanstillthinkofanequalpositivechargeflowingintheoppositedirection.Whentheelectronleaveshome,ittakesasmallnegativechargewithit;therefore,itshomebecomesabitmorepositive.Whentheelectronarrivesatitsdestination,itsnegativechargemakesthedestinationabitlesspositive.Thisisprettymuchwhatwouldhappenifanimaginarypositiveparticletraveledintheoppositedirection.Moreover,allofthemathematicsdescribingelectricalbehaviorarestillvalidifyouapplythemtotheimaginaryflowofpositivecharges.
![Page 39: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/39.jpg)
AsamatteroftraditionandconveniencewestillretainBenFranklin’serroneousconceptofflowfrompositivetonegative,becauseitreallymakesnodifference.Inthesymbolsthatrepresentcomponentssuchasdiodesandtransistors,youwillactuallyfindarrowsremindingyouwhichwaythesecomponentsshouldbeplaced—andthearrowsallpointfrompositivetonegative,eventhoughthat’snotthewaythingsreallyworkatall!BenFranklinwouldhavebeensurprisedtolearnthatalthoughmostlightningstrikesoccurwhenanegativechargeincloudsdischargestoneutralizeapositivechargeontheground,someformsoflightningareactuallyaflowofelectronsfromthenegativelychargedsurfaceoftheearth,uptoapositivechargeintheclouds.That’sright:someonewhois“struckbylightning”maybehurtbyemittingelectronsratherthanbyreceivingthem,asshowninFigure1-75.
Figure1-75.Insomeweatherconditions,theflowofelectronsduringalightningstrikecanbefromtheground,throughyourfeet,outofthetopofyourhead,anduptotheclouds.BenjaminFranklinwouldhavebeensurprised.
THEORYBasicmeasurementsElectricalpotentialismeasuredbyaddingupthechargesonindividualelectrons.Thebasicunitisthecoulomb,equaltothetotalchargeonabout6,250,000,000,000,000,000electrons.Ifyouknowhowmanyelectronspassthroughapieceofwireeachsecond,thisestablishestheflowofelectricity,whichcanbeexpressedinamperes.Infact1amperecanbedefinedas1coulombpersecond.Thus:
1ampere=1coulomb/second=about6.25quintillionelectrons/second
There’snowayto“see”thenumberofelectronsrunningthroughaconductor(Figure1-76),butthereareindirectwaysofgettingatthisinformation.Forinstance,whenanelectrongoesrunningthroughawire,itcreatesawaveofelectromagneticforcearoundit.Thisforcecanbemeasured,andwecancalculatetheamperagefromthat.Theelectricmeterinstalledatyourhomebytheutilitycompanyfunctionsonthisprinciple.
Figure1-76.Ifyoucouldlookinsideanelectricwirewithasufficientlypowerfulmagnifyingdevice,andthewirehappenedtobecarrying1ampereofelectronflowatthetime,youmighthopetoseeabout6.25quintillionelectronsspeedingpasteachsecond.
Ifelectronsarejustmovingfreely,theyaren’tdoinganywork.Ifyouhadaloopofwireofzeroresistance,andyoukick-startedaflowofelectronssomehow,theycouldjustgobuzzingaroundforever.(Thisiswhathappensinsideasuperconductor—almost.)Undereverydayconditions,evenacopperwirehassomeresistance.Theforcethatweneedtopushelectronsthroughitisknownas“voltage,”andcreatesaflowthatcancreateheat,asyousawwhenyoushortedoutabattery.(Ifthewirethatyouusedhadzeroresistance,theelectricityrunningthroughitwouldnothavecreatedanyheat.)Wecanusetheheatdirectly,asinanelectricstove,orwecanusetheelectricalenergyinotherways—torunamotor,forinstance.Eitherway,wearetakingenergyoutoftheelectrons,todosomework.Onevoltcanbedefinedastheamountofpressurethatyouneedtocreateaflowof1ampere,whichdoes1wattofwork.Aspreviouslydefined,1watt=1volt×1ampere,butthedefinitionactuallyoriginatedtheotherwayaround:
1volt=1watt/1ampereIt’smoremeaningfulthisway,becauseawattcanbedefinedinnonelectricalterms.Justincaseyou’reinterested,wecanworkbackwardthroughtheunitsofthemetricsystemlikethis:
1watt=1joule/second1joule=aforceof1newtonactingthrough1meter1newton=theforcerequiredtoaccelerate1kilogramby1meterpersecond,eachsecond
Onthisbasis,theelectricalunitscanallbeanchoredwithobservationsofmass,time,andthechargeonelectrons.
PracticallySpeakingForpracticalpurposes,anintuitiveunderstandingofelectricitycanbemoreusefulthanthetheory.PersonallyIlikethewater
![Page 40: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/40.jpg)
analogiesthathavebeenusedfordecadesinguidestoelectricity.Figure1-77showsatalltankhalffullofwater,withaholepunchedinitnearthebottom.Thinkofthetankasbeinglikeabattery.Theheightofthewateriscomparabletovoltage.Thevolumeofflowthroughthehole,persecond,iscomparabletoamperage.Thesmallnessoftheholeiscomparabletoresistance.SeeFigure1-79onthenextpage.
Figure1-77.Ifyouwanttogetworkoutofasystem…
Where’sthewattageinthispicture?Supposeweplacealittlewaterwheelwhereitishitbytheflowfromthehole.Wecanattachsomemachinerytothewaterwheel.Nowtheflowisdoingsomework.(Remember,wattageisameasurementofwork.)Maybethislooksasifwe’regettingsomethingfornothing,extractingworkfromthewaterwheelwithoutputtinganyenergybackintothesystem.Butremember,thewaterlevelinthetankisfalling.AssoonasIincludesomehelpershaulingthewastewaterbackuptothetopofthetank(inFigure1-78),youseethatwehavetoputworkintogetworkout.
Figure1-78....somehoworotheryouhavetoputworkbackintoit.
Similarly,abatterymayseemtobegivingpoweroutwithouttakinganythingin,butthechemicalreactionsinsideitarechangingpuremetalsintometalliccompounds,andthepowerwegetoutofabatteryisenabledbythischangeofstate.Ifit’sarechargeablebattery,wehavetopushpowerbackintoittoreversethechemicalreactions.Goingbacktothetankofwater,supposewecan’tgetenoughpoweroutofittoturnthewheel.Oneanswercouldbetoaddmorewater.Theheightofthewaterwillcreatemoreforce.Thiswouldbethesameasputtingtwobatteriesendtoend,positivetonegative,inseries,todoublethevoltage.SeeFigure1-80.Aslongastheresistanceinthecircuitremainsthesame,greatervoltagewillcreatemoreamperage,becauseamperage=voltage/resistance.Whatifwewanttoruntwowheelsinsteadofone?Wecanpunchasecondholeinthetank,andtheforce(voltage)willbethesameateachofthem.However,thewaterlevelinthetankwilldroptwiceasfast.Really,we’ddobettertobuildasecondtank,andhereagaintheanalogywithabatteryisgood.Ifyouwiretwobatteriessidebyside,inparallel,yougetthesamevoltage,butfortwiceaslong.Thetwobatteriesmayalsobeabletodelivermorecurrentthanifyoujustusedone.SeeFigure1-81.Summingup:
Twobatteriesinseriesdelivertwicethevoltage.Twobatteriesinparallelcandelivertwicethecurrent.
Allright,that’smorethanenoughtheoryfornow.Inthenextchapter,we’llcontinuewithsomeexperimentsthatwillbuildonthefoundationsofknowledgeaboutelectricity,totakeusgraduallytowardgadgetsthatcanbefunanduseful.
Figure1-79.Greaterforcegeneratesmoreflow,aslongastheresistanceremainsthesame.
![Page 41: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/41.jpg)
Figure1-80.Whenyouplacetwoequalbatteriesinseries,youdoublethevoltage.
Figure1-81.Twoequalbatteriesthatarewiredinparallelwilldeliverthesamevoltagefortwiceaslongasone.
![Page 42: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/42.jpg)
2.SwitchingBasicsandMoreTheconceptofswitchingisfundamentalinelectronics,andI’mnotjusttalkingaboutpowerswitches.By“switching,”Imeanusingoneflowofelectricitytoswitch,orcontrol,another.Thisissuchanimportantprinciplethatnodigitaldevicecanexistwithoutit.Today,switchingismostlydonewithsemiconductors.BeforeIdealwiththem,I’llbackupandillustratetheconceptbyintroducingyoutorelays,whichareeasiertounderstand,becauseyoucanseewhat’sgoingoninsidethem.AndbeforeIgettorelays,I’lldealwitheverydayon/offswitches,whichmayseemverysimple—butwehavetonaildownthebasics.Alsointhischapter,I’lldealwithcapacitance,becausecapacitanceandresistancearefundamentaltoelectroniccircuits.Bytheendofthechapter,youshouldhaveabasicgroundinginelectronicsandbeabletobuildthenoisemakingsectionofasimpleintrusionalarm.Thiswillbeyourfirstcircuitthatdoessomethinggenuinelyuseful!
![Page 43: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/43.jpg)
ShoppingList:Experiments6Through11Asinthepreviousshoppinglist,youshouldvisitthevariousonlinesuppliersforavailabilityandpricingofcomponentsanddevices.Manufacturersseldomsellsmallnumbersofpartsdirectly.ChecktheappendixforacompletelistofURLsforallthecompaniesmentionedhere.
DevicesPowersupply/universalACadapter,3to12voltsat1A(1,000mA).SeeFigure2-1.Partnumber273-0316fromRadioShack,partPH-62092byPhilips,orsimilar.
Figure2-1.ACadaptersofthisgeneraltypecansupplyavarietyofvoltages,witharangeaswideas3to12volts.
Breadboardsuitableforintegratedcircuits.Quantity:1.SeeFigures2-2and2-3.Part276-002fromRadioShack,model383-X1000madebyPSP,part923252-Iby3M,orsimilar.Abreadboardthathasscrewterminalsmountedbesideitwillbealittleeasiertousebutmoreexpensivethanonethatdoesnothaveterminals.
Figure2-2.This“breadboard”forquicklyconstructingelectroniccircuitshasametalbase,andscrewterminalsforattachingwiresfromapowersupply.
Figure2-3.Abreadboardwithoutscrewterminalsisalmostasconvenient,andischeaper.
ToolsWirestrippers
Idealmodel45-121wirestrippersfor16-to26-gaugewire,orsimilar.SeeFigure2-4.(The“gauge”ofthewiretellsyouhowthickitis.Ahighergaugemeansathinnerwire.Inthisbook,wewillmainlybeusingthinwireof20-to24-gauge.)YoumayalsoconsidertheKronusAutomaticWireStrippers,part64-0083fromRadioShack,orGBAutomaticWireStrippers,partSE-92fromAmazon.com.SeeFigure2-5.TheKronusandGBwirestrippersarefunctionallyidentical.Theadvantageoftheirdesignisthatitenablesyoutostripinsulationfromawirewithonehand.Buttheydonotworkwellonreallythinwire.
Figure2-4.Tousethesewirestrippers,insertapieceofinsulatedwireintheappropriate-sizedholebetweenthejaws,gripthehandles,andpullasectionofinsulationaway.Seepage45.
![Page 44: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/44.jpg)
Figure2-5.Theseautomaticwirestrippersenableone-handedoperation,butarenotsuitableforverysmallwirediameters.Seepage44.
SuppliesHookupwire
Solid-conductor,22-gauge,minimum25feetofeachcolor.SeeFigure2-6.Part278-1221fromRadioShack,catalogitem9948T17fromMcMaster-Carr,orcheckeBayfordeals.It’seasytobuythewrongkindofwire.Youneedsolid-corewire,whichhasasingleconductorinsidetheplasticinsulation,notstranded,whichhasmultiple,thinnerconductors.SeeFigures2-7and2-8.You’regoingtobepushingwiresintolittleholesina“breadboard,”andstrandedwirewon’tletyoudothis.Youwillalsohaveproblemsifyoubuywirethickerthan22-gauge.Remember:thelowerthegaugenumber,thethickerthewire.Foralittleextramoney,youcanbuyanassortmentofprecutsectionsofwire,withendsstrippedandreadyforuse.TrycatalogitemJW-140(jumperwireassortment)fromAllElectronicsorsearcheBayfor“breadboardwire.”SeeFigure2-9.
Figure2-6.Usinghookupwirewithdifferentcolorsofplasticinsulationwillhelpyoutodistinguishonewirefromanotherinyourcircuits.
PatchcordsPatchcordsarenotstrictlynecessarybutveryconvenient.Youdon’twantaudioorvideopatchcords,whichhaveaplugoneachend;youwantwireswithalligatorclipsoneachend,alsosometimesreferredtoas“testleads.”Trycatalogitem461-1176-NDfromDigi-KeyorcatalogitemMTL-10fromAllElectronics.SeeFigure2-10.
Figure2-7.Solid-conductorwireof22or24gaugeissuitableformostoftheexperimentsinthischapter.
Figure2-8.Strandedismoreflexible,butcannotbeusedeasilywithbreadboards.
Figure2-9.Precutwireswithstrippedendscansavealotoftimeandtrouble—ifyoudon’tmindpayingalittleextra.
Figure2-10.Patchcords,sometimesknownastestleads,consistofwirespreattachedtoalligatorclips.Thisisanotherofthoselittleluxuriesthatreducesthehasslefactorinhobbyelectronics.
![Page 45: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/45.jpg)
ComponentsPushbutton
Momentary-on,SPST,sometimesreferredtoasOFF-(ON)or(ON)-OFFtype.MustbePCB-orPC-mount,meaningisextremelysmallwiththinspikycontactsonthebottom.Quantity:1.SeeFigure2-11.
Figure2-11.Theterminalsprotrudingfromthistinypushbuttonarespaced0.2inchesapart,makingitidealforthe“breadboard”thatyou’llbeusing.
ExamplesarepartnumberAB11APbyNKK,partMPA103B04byAlcoswitch,orpartEP11SD1CBEbyC&K.Ifyouhaveachoice,buythecheapest,aswe’regoingtoswitchverylowcurrent.
SwitchesToggleswitch,single-pole,double-throw(SPDT),sometimesreferredtoasON-ONtype.Quantity:2.SeeFigure2-12.
Figure2-12.ThisrelativelylargetoggleswitchmadebyNKKhasscrewterminals,whichwillreducetheinconvenienceofattachingittohookupwire.
ModelS302T-RObyNKKisideal;ithasscrewterminalsthatwilleliminatetheneedforalligatorclips.OtheroptionsarecatalogitemMTS-4PCfromAllElectronicsorpart275-603fromRadioShack.Wewon’tbeswitchinglargecurrentsorhighvoltages,sotheexacttypeofswitchisunimportant.However,theterminalsonlarger-sizeswitchesarespacedwiderapart,whichmakesthemeasiertodealwith.
RelaysDPDT,nonlatching,12vDC.Quantity:2.It’simportanttogettherightkindofrelay—onewhoseconfigurationmatchesthepicturesI’llbeusing.LookforpartsFTR-F1CA012VorFTR-F1CD012VbyFujitsu,G2RL-24-DC12byOmron,orOMI-SH-212DbyTyco.Avoidsubstitutions.
Potentiometer1megohmlinearpotentiometer,Partnumber271-211fromRadioShack,partnumber24N-1M-15R-RfromJameco,orsimilar.
TransistorsNPNtransistor,general-purpose,suchas2N2222bySTMicroelectronics,partPN2222byFairchild,orpart2N2222fromRadioShack.Quantity:4.SeeFigure2-13.
Figure2-13.Transistorsarecommonlysoldeitherinlittlemetalcansorsealedintolittlelumpsofplastic.Forourpurposes,thepackagingmakesnodifference.
2N6027programmableunijunctiontransistormanufacturedbyOnSemiconductororMotorola.Quantity:4(allowingfor2sparesincaseofdamage).
CapacitorsElectrolyticcapacitors,assorted.Mustberatedforaminimumof25voltsandincludeatleastonecapacitorof1,000μF(microfarads)andtwocapacitorsof2.2μF.IfyousearchoneBay,makesureyoufindelectrolyticcapacitors.Ifthey’reratedforhighervoltages,that’sOK,althoughtheywillbephysicallylargerthanyouneed.SeeFigure2-14.
Figure2-14.Anassortmentofelectrolyticcapacitors.
Ceramiccapacitors,assorted.Makesureyougetatleastoneratedat0.0047μF(whichcanalsobewrittenas4.7nF).SeeFigure2-15.
Figure2-15.Ceramiccapacitorsmostlylooklikethis,althoughmanyofthemareroundorbead-shapedinsteadofsquare.Thepackagingshapeisunimportanttous.
![Page 46: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/46.jpg)
ResistorsIfyouboughtonlyaminimalselectionforexperiments1through5,now’sthetimetobuyalargerassortment,sothatyouwon’tbestuckneedingtheonevaluethatyoudon’thave.1/4-wattminimum.
LoudspeakerAny8Ω,1-inchminiatureloudspeakersuchaspart273-092fromRadioShack.SeeFigure2-16.
Figure2-16.Thisminiatureloudspeaker,justover1inchindiameter,isusefulforverifyingaudiooutputdirectfromtransistorcircuits.
![Page 47: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/47.jpg)
Experiment6:VerySimpleSwitchingYouwillneed:
AAbatteries.Quantity:2.Batterycarrierfor2AAbatteries.Quantity:1.LED.Quantity:1.Toggleswitches,SPDT.Quantity:2.SeeFigure2-12.220Ωorsimilarvalueresistor,1/4-wattminimum.Quantity:1.Alligatorclips.Quantity:8.Wireorpatchcords.SeeFigure2-10,shownpreviously.Wirecuttersandwirestrippersifyoudon’tusepatchcords.SeeFigure2-4,shownpreviously.
InExperiment3,youilluminatedanLEDbyattachingabattery,andswitcheditoffbyremovingthebattery.Forgreaterconvenienceourcircuitsshouldhaveproperswitchestocontrolpower,andwhileI’mdealingwiththegeneraltopicofswitches,I’mgoingtoexploreallthevarieties,usingacircuittosuggestsomepossibilities.AssemblethepartsasshowninFigures2-17and2-18.TheshortleadontheLEDmustconnectwiththeresistor,becausethatisthemorenegativesideofthecircuit.You’llnoticethatyouhavetoincludeacouplelengthsofwire.Isuggestgreenwiretoremindyouthatthesesectionsarenotconnecteddirectlytopositiveortonegativepower.Butyoucanuseanycoloryoulike.Youcanalsosubstitutepatchcords,ifyouhavethem.However,learningtostripinsulationfrompiecesofwireisanecessaryskill,solet’sdealwiththatnow.
Figure2-17.IftheLEDison,flippingeitheroftheswitcheswillturnitoff.IftheLEDisoff,eitheroftheswitcheswillturniton.Usealligatorclipstoattachthewirestoeachother,andtotheswitchesifyourswitchesdon'thavescrewterminals.Becarefulthattheclipsdon'ttoucheachother.
![Page 48: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/48.jpg)
Figure2-18.Full-sizetoggleswitcheswithscrewterminalsmakeiteasytohookupthissimplecircuit.
ToolsIfautomaticwirestrippers(Figure2-19)don’tgripskinny22-gaugewireveryeffectively,trytheIdealbrandofwirestrippersshownbackinFigure2-4,oruseplainandsimplewirecuttersasshowninFigure2-20.Whenusingwirecutters,youholdthewireinonehandandapplythetoolinyourotherhand,squeezingthehandleswithmoderatepressure—justenoughtobiteintotheinsulation,butnotsomuchthatyouchopthewire.Pullthewiredownwhileyoupullthecuttersup,andwithalittlepracticeyoucanriptheinsulationofftoexposetheendofthewire.
Figure2-19.Usingautomaticwirestrippers,whenyousqueezethehandlesthejawontheleftclampsthewire,thesharpgroovesontherightbiteintotheinsulation.Squeezeharderandthejawspullawayfromeachother,strippingtheinsulationfromthewire.
Machohardwarenerdsmayusetheirteethtostripinsulationfromwires.WhenIwasyounger,Iusedtodothis.Ihavetwoslightlychippedteethtoproveit.Really,it’sbettertousetherighttoolforthejob.
Figure2-20.Toremoveinsulationfromtheendofathinpieceofwire,youcanalsousewirecutters.Thistakesalittlepractice.
Figure2-21.Thosewhotendtomisplacetools,andfeeltooimpatienttosearchforthem,mayfeeltemptedtousetheirteethtostripinsulationfromwire.Thismaynotbesuchagoodidea.
ConnectionProblemsDependingonthesizeoftoggleswitchesthatyouareusing,youmayhavetroublefittinginallthealligatorclipstoholdthewirestogether.Miniaturetoggleswitches,whicharemorecommonthanthefull-sizedonesthesedays,canbeespeciallytroublesome(seeFigure2-22).Bepatient:fairlysoonwe’llbeusingabreadboard,whichwilleliminatealligatorclipsalmostcompletely.
![Page 49: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/49.jpg)
Figure2-22.Miniaturetoggleswitchescanbeused—ideally,withminiaturealligatorclips—butwatchoutforshortcircuits.
TestingMakesurethatyouconnecttheLEDwithitsshortwiretowardthenegativesourceofpower(theresistor,inthiscase).Nowflipeitherofthetoggleswitches.IftheLEDwason,itwillgooff,andifitwasoff,itwillgoon.Fliptheothertoggleswitch,anditwillhavethesameeffect.IftheLEDdoesnotgoonatall,you’veprobablyconnecteditthewrongwayaround.Anotherpossibilityisthattwoofyouralligatorclipsmayhaveshortedoutthebattery.AssumingyourtwoswitchesdoworkasIdescribedthem,what’sgoingonhere?It’stimetonaildownsomebasicfacts.
FUNDAMENTALSAllaboutswitchesWhenyouflipthetypeoftoggleswitchthatyouusedinExperiment6,itconnectsthecenterterminalwithoneoftheouterterminals.Fliptheswitchback,anditconnectsthecenterterminalwiththeotherouterterminal,asshowninFigure2-23.
Figure2-23.Thecenterterminalisthepoleoftheswitch.Whenyouflipthetoggle,thepolechangesitsconnection.
Thecenterterminaliscalledthepoleoftheswitch.Becauseyoucanflip,orthrow,thisswitchtomaketwopossibleconnections,itiscalledadouble-throwswitch.Asmentionedearlier,asingle-pole,double-throwswitchisabbreviatedSPDT.Someswitchesareon/off,meaningthatifyouthrowtheminonedirectiontheymakeacontact,butintheotherdirection,theymakenocontactatall.Mostofthelightswitchesinyourhousearelikethis.Theyareknownassingle-throwswitches.Asingle-pole,single-throwswitchisabbreviatedSPST.Someswitcheshavetwoentirelyseparatepoles,soyoucanmaketwoseparateconnectionssimultaneouslywhenyoufliptheswitch.Thesearecalleddouble-poleswitches.CheckthephotographsinFigures2-24through2-26ofold-fashioned“knife”switches(whicharestillusedtoteachelectronicstokidsinschool)andyou’llseethesimplestrepresentationofsingleanddoublepoles,andsingleanddoublethrows.VarioustoggleswitchesthathavecontactssealedinsidethemareshowninFigure2-27.
![Page 50: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/50.jpg)
Figure2-24.Thisprimitive-lookingsingle-pole,double-throwswitchdoesexactlythesamethingasthetoggleswitchesinFigures2-23and2-27.
Figure2-25.Asingle-pole,single-throwswitchmakesonlyoneconnectionwithonepole.Itstwostatesaresimplyopenandclosed,onandoff.
Figure2-26.Adouble-pole,single-throwswitchmakestwoseparateon/offconnections.
FUNDAMENTALSAllaboutswitches(continued)
Figure2-27.Thesearealltoggleswitches.Generally,thelargertheswitch,themorecurrentitcanhandle.
Tomakethingsmoreinteresting,youcanalsobuyswitchesthathavethreeorfourpoles.(Somerotaryswitcheshaveevenmore,butwewon'tbeusingthem.)Also,somedouble-throwswitcheshaveanadditional“centeroff”position.Puttingallthistogether,Imadeatableofpossibletypesofswitches(Figure2-28).Whenyou’rereadingapartscatalog,youcancheckthistabletoremindyourselfwhattheabbreviationsmean.
Figure2-28.Thistablesummarizesallthevariousoptionsfortoggleswitchesandpushbuttons.
Now,whataboutpushbuttons?Whenyoupressadoorbell,you’remakinganelectricalcontact,sothisisatypeofswitch—andindeedthecorrecttermforitisamomentaryswitch,becauseitmakesonlyamomentarycontact.Anyspring-loadedswitchorbuttonthatwantstojumpbacktoitsoriginalpositionisknownasamomentaryswitch.Weindicatethisbyputtingitsmomentarystateinparentheses.Herearesomeexamples:
OFF-(ON):BecausetheONstateisinparentheses,it’sthemomentarystate.Therefore,thisisasingle-poleswitchthat
![Page 51: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/51.jpg)
makescontactonlywhenyoupushit,andflipsbacktomakenocontactwhenyouletitgo.Itisalsoknownasa“normallyopen”momentaryswitch,abbreviated“NO.”ON-(OFF):Theoppositekindofmomentarysingle-poleswitch.It’snormallyON,butwhenyoupushit,youbreaktheconnection.So,theOFFstateismomentary.Itisknownasa“normallyclosed”momentaryswitch,abbreviated“NC.”(ON)-OFF-(ON):Thisswitchhasacenter-offposition.Whenyoupushiteitherway,itmakesamomentarycontact,andreturnstothecenterwhenyouletitgo.
Othervariationsarepossible,suchasON-OFF-(ON)orON-(ON).Aslongasyourememberthatparenthesesindicatethemomentarystate,youshouldbeabletofigureoutwhattheseswitchesare.
Figure2-29.Thisevilmadscientistisreadytoapplypowertohisexperiment.Forthispurpose,heisusingasingle-pole,double-throwknifeswitch,convenientlymountedonthewallofhisbasementlaboratory.
FUNDAMENTALSAllaboutswitches(continued)
SparkingWhenyoumakeandbreakanelectricalconnection,ittendstocreateaspark.Sparkingisbadforswitchcontacts.Iteatsthemuntiltheswitchdoesn’tmakeareliableconnectionanymore.Forthisreason,youmustuseaswitchthatisappropriateforthevoltageandamperagethatyouaredealingwith.Electroniccircuitsgenerallyarelow-current,andlow-voltage,soyoucanusealmostanyswitch,butifyouareswitchingamotor,itwilltendtosuckaninitialsurgeofcurrentthatisatleastdoubletheratingofthemotorwhenitisrunningconstantly.Youshouldprobablyusea4-ampswitchtoturna2-ampmotoronandoff.
CheckingaswitchYoucanuseyourmetertocheckaswitch.Doingthishelpsyoufindoutwhichcontactsareconnectedwhenyouturnaswitchonewayortheother.It’salsousefulifyouhaveapushbuttonandyoucan’trememberwhetherit’sthetypethatisnormallyopen(youpressittomakeaconnection)ornormallyclosed(youpressittobreaktheconnection).Setyourmetertomeasureohms,andtouchtheprobestotheswitchterminalswhileyouworktheswitch.Thisisahassle,though,becauseyouhavetowaitwhilethemetermakesanaccuratemeasurement.Whenyoujustwanttoknowwhetherthereisaconnection,yourmeterhasa“continuitytester”setting.Itbeepsifitfindsaconnection,andstayssilentifitdoesn’t.SeeFigures2-30through2-32forexamplesofmeterssettotestcontinuity.Figure2-33offersanexampleofatoggleswitchbeingtestedforcontinuity.
Figure2-30.
Figure2-31.
![Page 52: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/52.jpg)
Figure2-32.Tocheckacircuitforcontinuity,turnthedialofyourmetertothesymbolshown.Onlyusethisfeaturewhenthereisnopowerinthecomponentorthecircuitthatyouaretesting.
Figure2-33.Whentheswitchconnectstwoofitsterminals,themetershowszeroresistancebetweenthemandwillbeepifyouhavesetittoverifycontinuity.
Usethecontinuity-testingfeatureonyourmeteronlyoncircuitsorcomponentsthathavenopowerinthematthetime.
BACKGROUNDEarlyswitchingsystemsSwitchesseemtobesuchafundamentalfeatureofourworld,andtheirconceptissosimplethatit’seasytoforgetthattheywentthroughagradualprocessofdevelopmentandrefinement.Primitiveknifeswitcheswerequiteadequateforpioneersofelectricitywhosimplywantedtoconnectanddisconnectelectricitytosomeapparatusinalaboratory,butamoresophisticatedapproachwasneededwhentelephonesystemsbegantoproliferate.Typically,anoperatorata“switchboard”neededawaytoconnectanypairof10,000linesontheboard.Howcoulditbedone?In1878,CharlesE.Scribner(Figure2-34)developedthe“jack-knifeswitch,”socalledbecausethepartofitthattheoperatorheldlookedlikethehandleofajackknife.Protrudingfromitwasaplug,andwhentheplugwaspushedintoasocket,itmadecontactinsidethesocket.Thesocket,infact,wastheswitch.
Figure2-34.CharlesE.Scribnerinventedthe“jack-knifeswitch”tosatisfytheswitchingneedsoftelephonesystemsinthelate1800s.Today’saudiojacksstillworkonthesamebasis.[1]
Audioconnectorsonguitarsandamplifiersstillworkonthesameprinciple,andwhenwespeakofthemasbeing“jacks,”thetermdatesbacktoScribner’sinvention.Switchcontactsstillexistinsideajacksocket.Today,ofcourse,telephoneswitchboardshavebecomeasrareastelephoneoperators.Firsttheywerereplacedwithrelays—electricallyoperatedswitches,whichI’lltalkaboutlaterinthischapter.Andthentherelaysweresupercededbytransistors,whichmadeeverythinghappenwithoutanymovingparts.Beforetheendofthischapter,you’llbeswitchingcurrentusingtransistors.[1]ThephotoonwhichthisdrawingisbasedfirstappearedinTheHistoryoftheTelephonebyHerbertNewtonCassonin1910(Chicago:A.C.McClurg&Co.).
IntroducingSchematicsInFigure2-35,I’veredrawnthecircuitfromExperiment6inasimplifiedstyleknownasa“schematic.”Fromthispointonward,Iwillbeillustratingcircuitswithschematics,becausetheymakecircuitseasiertounderstand.Youjustneedtoknowafewsymbolstointerpretthem.ComparetheschematicherewiththedrawingofthecircuitinFigure2-17.Theybothshowexactlythesamething:Components,andconnectionsbetweenthem.Thegrayrectanglesaretheswitches,thezigzagthingistheresistor,andthesymbolwithtwodiagonalarrowsistheLED.TheschematicLEDsymbolincludestwoarrowsindicatingthatitemitslight,becausetherearesomekindsofdiodes,whichwe’llgettolater,thatdon’t.Thetriangleinsidethediodesymbolalwayspointsfrompositivetonegative.Tracethepaththatelectricitycantakethroughthecircuitandimaginetheswitchesturningonewayortheother.YoushouldseeclearlynowwhyeitherswitchwillreversethestateoftheLEDfromontoofforofftoon.Thissamecircuitisusedinhouseswhereyouhaveaswitchatthebottomofaflightofstairs,andanotheroneatthetop,bothcontrollingthesamelightbulb.Thewiresinahousearemuchlonger,andtheysnakearoundbehindthewalls,butbecausetheirconnectionsarestillthesame,theycouldberepresentedwiththesamebasicschematic.SeeFigure2-36.Aschematicdoesn’ttellyouexactlywheretoputthecomponents.Itjusttellsyouhowtojointhemtogether.Oneproblem:
![Page 53: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/53.jpg)
Differentpeopleuseslightlydifferentschematicsymbolstomeanthesamething.Checktheupcomingsection,“Fundamentals:Basicschematicsymbols,”forthedetails.
Figure2-35.ThisschematicshowsthesamecircuitasinFigure2-17andmakesiteasiertoseehowtheswitchesfunction.
Figure2-36.Thetwo-switchcircuitshowninFigures2-17and2-35isoftenfoundinhousewiring,especiallywhereswitchesarelocatedatthetopandbottomofaflightofstairs.Thissketchshowswhatyoumightfindinsidethewalls.Wiresarejoinedwith“wirenuts”insideboxesthatarehiddenfrom
everydayview.
FUNDAMENTALSBasicschematicsymbolsSchematicsymbolsarelikewordsinalanguage:theyhavemutatedovertheyearsintoaconfusingrangeofvariations.Asimpleon/off(single-pole,single-throw,orSPST)switch,forinstance,canberepresentedbyanyofthesymbolsshowninFigure2-37.Theyallmeanexactlythesamething.
Figure2-37.Variationsonatheme:Justsomeofthedifferentstylesusedtodepictasingle-pole,single-throwswitchinschematicdiagrams.Thebottomversionisthestyleusedinthisbook.
Figure2-38showsdouble-pole,double-throwswitches.Adottedlineindicatesamechanicalconnectioninsidetheswitch,sothatwhenyouflipit,youaffectboththepolessimultaneously.Remember,thepolesareelectricallyisolatedfromeachother.
![Page 54: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/54.jpg)
Figure2-38.Morevariations:somedifferentstylesfordepictingadouble-pole,double-throwswitch.Thestyleatbottom-rightisusedinthisbook.
Onceinawhile,youmayfindaschematicinwhichswitchesseemtobescatteredaround,butthewaytheyareidentified(suchasS1A,S1B,S1C,andsoon)tellsyouthatthisisreallyalloneswitchwithmultiplepoles.Intheschematicsinthisbook,I’llplaceagrayrectanglebehindeachswitch.Thisgrayrectangleisnotastandardsymbol;youwon’tfinditinotherbooks.I’mjustincludingittoremindyouthatthepartsinsideareallcontainedinonepackage.Averyimportantstylisticvariationinschematicsisthewaytheyshowwhetherwiresmakeaconnectionwitheachother.Oldschematicsusedtoshowalittlesemicircularbumpinawireifitcrossedanotherwirewithoutmakingaconnection.Becausemoderncircuit-drawingsoftwaredoesn’tcreatethisstyleofschematic,itisnolongeroftenused.Themodernstyle,whichyouarelikelytofindifyoubrowsethroughschematicsonline,canbesummarizedlikethis:
Adotjoiningtwowiresindicatesanelectricalconnection.Nodotindicatesnoconnection.
FUNDAMENTALSBasicschematicsymbols(continued)Theproblemisthatthisisnotveryintuitive,especiallywhenyou’rejustbeginningtouseschematics.Whenyouseetwowirescrossing,youcaneasilyimaginethattheyaremakingaconnection,eventhoughthere’snodotattheintersection.Therefore,intheinterestsofclarity,I’vechosentousetheold“semicircularbump”styleofschematicinthisbook(seeFigure2-39).Itcanbesummarizedlikethis:
Adotjoiningtwowiresindicatesanelectricalconnection.Abumpinawirethatcrossesanotherwireindicatesnoconnection.
Inthisbook,youwon’tfindwirescrossingeachotherwithouteitheradotorabump.
Figure2-39.Inwiringschematics,adotalwaysindicatesanelectricalconnection.However,thecross-shapedintersectionofwiresattop-rightisconsideredbadstylebecauseifthedotisaccidentallyomittedorpoorlyprinted,theintersectioncanbemistakenforthetypeshownatbottomleft,inwhichthewiresdonotmakeaconnection.Allthreeoftheconfigurationsinthebottomrowindicatenoconnection,thefirstexamplebeingthemostcommonstyle,thecenterexamplebeingleastcommon,andthethirdbeingthemostold-fashioned—althoughforreasonsofclarity,itisused
inthisbook.
Inabattery-poweredcircuit,youmayfindabatterysymbol,butmoreoftenyouwillfindalittlenoteindicatingwherepositivevoltageentersthesystem,whilenegativeisindicatedbya“ground”symbol.Infacttheremaybegroundsymbolsallovertheplace.Youhavetorememberthatwhenyoubuildacircuit,allthewiresleadingtogroundsmustactuallybeconnectedtogether,tothenegativesideofthevoltagesupply.Theideaofthegroundsymboldatesbacktothetimewhenelectronicgadgetsweremountedonametalchassis,whichwasconnectedtothenegativesideofthepowersupply.Thegroundsymbolreallymeant“connecttothechassis.”SomevariantsinthegroundsymbolareshowninFigure2-40.
Figure2-40.Allofthesesymbolsareusedtomeanthesamething:connectthewireto“ground”or“chassis”orthenegativesideofthepowersource.Thefar-rightsymbolisusedinthisbook.
Inthisbook,wehavecolorthroughout,soI’llshowaredpositiveandbluenegativetoclarifywherethepowerisconnected,andIwon’tusegroundsymbols.Onceagain,mypurposeistominimizetheriskofmisunderstandings,becauseIknowhowfrustratingitistobuildacircuitthatdoesn’twork.Abiginconsistencyinschematicsisthewayinwhichtheyshowresistors.ThetraditionalzigzagsymbolhasbeenabandonedinEurope.Insteadtheyusearectanglewithanumberinsideindicatingthenumberofohms.SeeFigure2-41.TheEuropeansalsochangedthewayinwhichdecimalpointsarerepresented:theyomitthemasmuchaspossible,becauseinbadlyprintedschematics,thelittledotstendtogetlost(orcanbeconfusedwithdustanddirt).So,a4.7KΩresistorwillbelistedas4K7,anda1.2MΩresistorwillbe1M2.Ilikethisnotation,soI’mgoingtobeusingitmyself,butI’llbekeepingthezigzagresistorsymbol,whichremainswidelyusedintheUnitedStates.
![Page 55: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/55.jpg)
Figure2-41.Twostylesfordepictinga220Ωresistor.Theupperversionistraditional,andstillusedintheUnitedStates.ThelowerversionisEuropean.
FUNDAMENTALSBasicschematicsymbols(continued)PotentiometerssufferfromthesameinconsistentstylebetweentheUnitedStatesandEurope,buteitherway,you’llfindanarrowshowingwherethewiper(usually,thecenterterminal)touchestheresistance.SeeFigure2-42.AndsometimesLEDsareshowninsidecircles,andsometimesnot.Iprefercircles,myself.SeeFigure2-46.
Figure2-42.Potentiometersymbols:theleftistraditionalandusedintheUnitedStates,therightisEuropean.Inbothcasesthearrowindicatesthewiper(usuallythecenterterminal).
Figure2-43.Threewaysofindicatingapushbuttonswitch.
Figure2-44.Thebatterysymbolisusuallyshownwithout+and–symbols.I’veaddedthemforclarity.
Figure2-45.Symbolforanincandescentlightbulb.
I’llexploreothersymbolvariantslaterinthebook.Meanwhile,themostimportantthingstorememberare:
Thepositionsofcomponentsinaschematicarenotimportant.Thestylesofsymbolsusedinaschematicarenotimportant.Theconnectionsbetweenthecomponentsareextremelyimportant.
Figure2-46.SometimesanLEDisshownwithacirclearoundit;sometimesnot.Inthisbook,Iwillincludethecircle.Thearrowsindicateemittedlight.
FUNDAMENTALSBasicschematicsymbols(continued)Forexample,thethreeLEDcircuitsthatIhaveincludedinFigure2-47showcomponentsindifferentpositions,usingdifferentsymbols,but
![Page 56: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/56.jpg)
allthreecircuitsfunctionexactlythesameway,becausetheirconnectionsarethesame.Infact,theyalldepictthecircuitthatyoubuiltinExperiment4,showninFigure1-50.Oftenthesymbolsinaschematicareplacedsothatthecircuitismostintuitivelyeasytounderstand,regardlessofhowyoumaybuilditwithactualcomponents.ComparetheexampleinFigure2-48,showingthetwoSPDTswitches,withtheversionshownbackinFigure2-35.Thepreviousonelookedmorelikeyourbench-topversionofit,butFigure2-48showstheflowofelectricitymoreclearly.
Figure2-47.Thesethreeschematicsalldepictthesamebasiccircuit.It’sthecircuitthatyoubuiltwiththepotentiometerinExperiment4.
Inmanyschematics,thepositivesideofthepowersupplyisshownatthetopofthediagram,andnegativeorgroundatthebottom.Manypeoplealsotendtodrawaschematicwithaninput(suchasanaudioinput,inanamplifiercircuit)attheleftside,andtheoutputattheright.So,“positivevoltage”flowsfromtoptobottomwhileasignaltendstopassfromlefttoright.WhenIwasplanningthisbook,initiallyIdrewtheschematicstoconformwiththistop-to-bottom,left-to-rightconvention,butasIstartedbuildingandtestingthecircuits,Ichangedmymind.Weuseadeviceknownasa“breadboard”tocreatecircuits,anditsinternalconnectionsrequireustolayoutcomponentsverydifferentlyfromatypicalschematic.Whenyou’restartingtolearnelectronics,it’sveryconfusingtotrytorearrangecomponentsfromaschematicintheconfigurationthatyouneedforabreadboard.Therefore,throughoutthisbook,you’llfindthatIhavedrawntheschematicstoimitatethewayyou’llwirethemonabreadboard.Ibelievetheadvantagesofdoingthingsthiswayoutweighthedisadvantagesofbeingalittledifferentfromtheschematicstylesthatareusedelsewhere.
Figure2-48.Thisschematicisjustanother,clearer,simplerwayofshowingthecircuitthatappearedinFigure2-35.
![Page 57: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/57.jpg)
Experiment7:Relay-DrivenLEDsYouwillneed:
ACadapter,wirecuttersandstrippers.DPDTrelay.Quantity:2.LEDs.Quantity:2.Resistor,680Ωapprox.Quantity:1.Pushbutton,SPST.Quantity:1.Hookupwire,22gauge,orpatchcords.Alligatorclips.Quantity:8.Utilityknife.
Thenextstepinourexplorationofswitchingistousearemote-controlledswitch.By“remote-controlled,”Imeanonetowhichyoucansendasignaltoturnitonoroff.Thiskindofswitchisknownasarelay,becauseitrelaysaninstructionfromonepartofacircuittoanother.Oftenarelayiscontrolledbyalowvoltageorsmallcurrent,andswitchesalargervoltageorhighercurrent.Thissetupcanbecost-effective.Whenyoustartyourcar,forinstance,arelativelysmall,cheapswitchsendsasmallsignaldownarelativelylong,thin,inexpensivepieceofwire,toarelaythatisnearthestartermotor.Therelayactivatesthemotorthroughashorter,thicker,moreexpensivepieceofwire,capableofcarryingasmuchas100amps.Similarly,whenyouraisethelidonatop-loadingwashingmachineduringitsspincycle,youclosealightweightswitchthatsendsasmallsignaldownathinwiretoarelay.Therelayhandlesthebiggertaskofswitchingoffthelargemotorspinningthedrumfullofwetclothes.Beforeyoubeginthisexperiment,youneedtoupgradeyourpowersupply.We’renotgoingtousebatteriesanymore,becausemostrelaysrequiremorethan6volts,andinanycaseyoushouldhaveapowersupplythatcangiveyouavarietyofvoltagesondemand.ThesimplestwaytoachievethisisbyusinganACadapter.Firstyou’llsetuptheACadapter.Afteryouhaveitrunning,you’lluseittopowertherelay.InitiallytherelaywilljustswitchbetweentwoLEDs,butthenyou’llmodifythecircuittomaketheLEDsflashautomatically.Finallyyou’llrebuildthecircuitonabreadboard,andsaygoodbyetoalligatorclips,formostofthetimeatleast.
PreparingYourACAdapterAnACadapterplugsintothewallandconvertsthehigh-voltageACsupplyinyourhomeintoasafe,lowDCvoltageforelectronicdevices.Anychargerthatyouusewithyourcellphone,oriPod,orlaptopcomputerisaspecial-purposeACadapterthatdeliversonlyonevoltageviaaspecifictypeofplug.I’veaskedyoutobuyageneral-purposeadapterthatdeliversmanydifferentvoltages,andwe’regoingtobeginbygettingridofitsplug.1.It’simportanttomakesurethatyourACadapterisnotpluggedintothewall!2.Chopoffthelittleplugattheendofitswire.SeeFigure2-49.
Figure2-49.PreparinganACadapter.First,cutoffthelittlelow-voltageplugandthrowitaway.
3.Useaboxcutterorutilityknifeorscissorstomakeahalf-inchcutbetweenthetwoconductors,andthenpulltheconductorsapartacoupleofinches.
4.Usewirecutterstotrimoneoftheconductorsshorterthantheother,sothatafteryoustripawayalittleoftheinsulation,theexposedcopperwirescannoteasilytoucheachother.Thisisaprecautionagainstshort-circuitingyourACadapterandburningitout.
5.Stripthetwoconductorsusingyourwirestrippers.Twistthecopperstrandsbetweenfingerandthumbsothattherearenoloosestrandsstickingout.SeeFigure2-50.
Figure2-50.Second,stripthewires,makingoneshorterthantheothertoreducetheriskofthemtouching.Coloroneoftheadapterwiresredwithamarker,toidentifyitasthepositiveone.
![Page 58: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/58.jpg)
6.Makesurethatthetwowiresarenottouchingeachother,andplugyourACadapterintoawalloutlet.SetyourmetertoDCvoltsandapplythemeterprobestothewiresfromtheadapter.Ifthevoltageisprecededwithaminussign,youhavetheprobesthewrongwayaround.Reversethemandtheminussignshouldgoaway.Thistellsyouwhichwireispositive.
7.Markthepositivewirefromtheadapter.Ifthewirehaswhiteinsulation,youcanmarkitwitharedmarker.Ifithasblackinsulation,youcantagitwithalabel.ThepositivewirewillremainpositiveregardlessofwhichwayupyouplugtheACadapterintoawalloutlet.
TheRelayThetypeofrelaythatIwantyoutousehaslittlespikylegsonthebottom,inastandardizedlayout.Ifyoubuysomeotherkindofrelay,youwillhavetofigureoutforyourselfwhichpinsareconnectedtothecoilinside,whichpinsgotothepolesoftheswitchinsideit,andwhichgotothenormallyclosedandnormallyopencontacts.Youcancheckthemanufacturer’sdatasheetforthispurpose,butIstronglysuggestyouuseoneoftherelaysmentionedintheshoppinglist,sothatyoucanfollowtheinstructionsheremoreeasily.Iaskedyoutobuytworelayssothatyoucanuseoneforinvestigationalpurposes—meaningthatyoucanbreakitopenandtakealookinside.Ifyoudothisvery,verycarefully,therelayshouldstillbeusableafterward.Ifnot,well,youstillhaveaspare.Theeasiestwaytoopentherelayiswithaboxcutterorutilityknife.Figures2-52,2-53,and2-54showthetechnique.Shavetheedgesoftheplasticshellcontainingtherelay,bevelingthemuntilyouseejustahair-thinopening.Don’tgoanyfarther;thepartsinsidearevery,veryclosetoitshousing.Nowpopthetopoff.Youcanuseneedle-nosedplierstonibbletherestoftheshellaway.Readthefollowingsection,“Fundamentals:Insidearelay,”andthenapplypowertotherelaytoseehowitworks.
Figure2-51.Thisisonewaythatthepartsinsidearelaycanbearranged.Thecoil,A,generatesamagneticattractionpullingleverBdownward.Aplasticextension,C,pushesoutwardagainstflexiblemetalstripsandmovesthepolesoftherelay,D,betweenthecontacts.
Figure2-52.Tolookinsideasealedrelay,shavethetopedgesoftheplasticpackagewithautilityknifetilyouopenathincrack.
Figure2-54.Ifyouarereally,reallycareful,therelayshouldstillworkafteryouopenit.
Figure2-53.Insertthebladeofyourknifetopryopenthetop,thenrepeattheprocedureforthesides.
![Page 59: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/59.jpg)
Figure2-55.
Figure2-56.Patienceisessentialwhencarvingtheedgesofarelaypackageinordertoopenit.Fastermethodssuchasatomahawkoraflamethrowerwillsatisfytheemotionalneedsofthosewithashortattentionspan,butresultsmaybeunpredictable.
Figure2-57.Fourassorted12-voltrelays,shownwithandwithouttheirpackages.Theautomotiverelay(farleft)isthesimplestandeasiesttounderstand,becauseitisdesignedwithoutmuchconcernforthesizeofthepackage.Smallerrelaysaremoreingeniouslydesigned,morecomplex,and
moredifficulttofigureout.Usually,butnotalways,asmallerrelayisdesignedtoswitchlesscurrentthanalargerone.
FUNDAMENTALSInsidearelayArelaycontainsacoilofwirewrappedaroundanironcore.Whenelectricityrunsthroughthecoil,theironcoreexertsamagneticforce,whichpullsalever,whichpushesorpullsaspringystripofmetal,closingtwocontacts.Soaslongaselectricityrunsthroughthecoil,therelayis“energized”anditscontactsremainclosed.Whenthepowerstopspassingthroughthecoil,therelayletsgoandthespringystripofmetalsnapsbackintoitsoriginalposition,openingthecontacts.(Theexceptiontothisruleisalatchingrelay,whichrequiresasecondpulsethroughaseparatecoiltoflipitbacktoitsoriginalposition;butwewon’tbeusinglatchingrelaysuntillaterinthebook.)Relaysarecategorizedlikeswitches.Thus,youhaveSPSTrelays,DPST,SPDT,andsoon.ComparetheschematicsinFigure2-58withtheschematicsofswitchesinFigure2-38.Themaindifferenceisthattherelayhasacoilthatactivatestheswitch.Theswitchisshowninits“relaxed”mode,whennopowerflowsthroughthecoil.
Figure2-58.Variouswaystoshowarelayinaschematic.Topleft:SPST.Toprightandbottomleft:SPDT.Bottomright:DPDT.Thestylesatbottom-leftandbottom-rightwillbeusedinthisbook.
Thecontactsareshownaslittletriangles.Whentherearetwopolesinsteadofone,thecoilactivatesbothswitchessimultaneously.Mostrelaysarenonpolarized,meaningthatyoucanrunelectricitythroughthecoilineitherdirection,andtherelaydoesn’tcare.Youshouldcheckthedatasheettomakesure,though.SomerelaycoilsworkonACvoltage,butalmostalllow-voltagerelaysusedirectcurrent—asteadyflowofelectricity,suchasyouwouldgetfromabattery.We’llbeusingDCrelaysinthisbook.Relayssufferfromthesamelimitationsasswitches:theircontactswillbeerodedbysparkingifyoutrytoswitchtoomuchvoltage.It’snotworthsavingafewdollarsbyusingarelaythatisratedforlesscurrentorvoltagethanyourapplicationrequires.Therelaywillfailyouwhenyouneeditmost,andmaybeinconvenienttoreplace.Becausetherearesomanydifferenttypesofrelays,readthespecificationscarefullybeforeyoubuyone.Lookforthesebasics:Coilvoltage
Thevoltagethattherelayissupposedtoreceivewhenyouenergizeit.Setvoltage
Theminimumvoltagethattherelayneedstocloseitsswitch.Thiswillbeabitlessthantheidealcoilvoltage.Operatingcurrent
Thepowerconsumptionofthecoil,usuallyinmilliamps,whentherelayisenergized.Sometimesthepowerisexpressedinmilliwatts.Switchingcapacity
Themaximumamountofcurrentthatyoucanswitchwithcontactsinsidetherelay.Usuallythisisfora“resistiveload,”meaningapassivedevicesuchaslightbulb.Whenyouusearelaytoswitchonamotor,themotortakesabiginitialsurgeofcurrentbeforeitgetsuptospeed.Inthiscase,youshouldchoosearelayratedfordoublethecurrentthatthemotordrawswhenitisrunning.
![Page 60: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/60.jpg)
ProcedureTurntherelaywithitslegsintheairandattachwiresandLEDsasshowninFigure2-59,witha680Ωresistor(a1KresistorwillbeOKifyoudon’thavethecorrectvalue).Alsoattachapushbuttonswitch.(Yourpushbuttonswitchmaylookdifferentfromtheoneshown,butaslongasitisaSPSTpushbuttonwithtwocontactsatthebottom,itwillworkthesameway.)Whenyoupressthepushbutton,therelaywillmakethefirstLEDgooutandthesecondLEDlightup.Whenyoureleasethepushbutton,thefirstLEDlightsupandthesecondonegoesout.
Figure2-59.Asbefore,youcanusepatchcords,ifyouhavethem,insteadofsomeofthewiredconnectionsshownhere.
HowItWorksChecktheschematicinFigure2-60andcompareitwithFigure2-59.AlsoseeFigure2-62,whichshowshowthepinsoutsidetherelaymakeconnectionsinsidetherelaywhenitscoilisenergized,andwhenitisnotenergized.
Figure2-60.Samecircuit,showninschematicform.
ThisisaDPDTrelay,butweareonlyusingonepoleandignoringtheother.WhynotbuyaSPDTrelay?BecauseIwantthepinstobespacedthewaytheyarewhenyouwillupgradethiscircuitbytransferringitontoabreadboard,whichwillhappenveryshortly.Ontheschematic,Ihaveshowntheswitchinsidetherelayinitsrelaxedstate.Whenthecoilisenergized,theswitchflipsupward,whichseemscounterintuitive,butjusthappenstobethewaythatthisparticularrelayismade.Whenyou’resureyouunderstandhowthecircuitworks,it’stimetomoveontothenextstep:makingasmallmodificationtogettherelaytoswitchitselfonandoff,aswe’lldoinExperiment8.
Figure2-61.Thelayoutofthepinsoftherelay,superimposedonagridof1/10-inchsquares.ThisisthetypeofrelaythatyouwillneedinExperiment8.
Figure2-62.Howtherelayconnectsthepins,whenitisnotenergized(left)andwhenitisenergized(right).
![Page 61: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/61.jpg)
Experiment8:ARelayOscillatorYouwillneed:
ACadapter,breadboard,wire,wirecuttersandstrippers.DPDTrelay.Quantity:1.LEDs.Quantity:2.Pushbutton,SPST.Quantity:1.Alligatorclips.Quantity:8.Resistor,approximately680Ω.Quantity:1.Capacitor,electrolytic,1,000μF.Quantity:1.
LookatthereviseddrawinginFigure2-63andtherevisedschematicinFigure2-64andcomparethemwiththepreviousones.Originally,therewasadirectconnectionfromthepushbuttontothecoil.Inthenewversion,thepowergetstothecoilbygoing,first,throughthecontactsoftherelay.
Figure2-63.Asmallrevisiontothepreviouscircuitcausestherelaytostartoscillatingwhenpowerisapplied.
Figure2-64.Theoscillatorcircuitshowninschematicform.
Now,whenyoupressthebutton,thecontactsintheirrelaxedstatefeedpowertothecoilaswellastothelefthandLED,asshownintheschematic.Butassoonasthecoilisenergized,itopensthecontacts.Thisinterruptsthepowertothecoil—sotherelayrelaxes,andthecontactscloseagain.Theyfeedanotherpulseofpowertothecoil,whichopensthecontactsagain,andthecyclerepeatsendlessly.Becausewe’reusingaverysmallrelay,itswitchesonandoffextremelyfast.Infact,itoscillatesperhaps50timespersecond(toofastfortheLEDstoshowwhat’sreallyhappening).Makesureyourcircuitlooksliketheoneinthediagram,andthenpressthepushbuttonverybriefly.Youshouldheartherelaymakeabuzzingsound.Ifyouhaveimpairedhearing,touchtherelaylightlywithyourfinger,andyoushouldfeeltherelayvibrating.Whenyouforcearelaytooscillatelikethis,it’sliabletoburnitselfoutordestroyitscontacts.That’swhyIaskedyoutopressthepushbuttonbriefly.Tomakethecircuitmorepractical,weneedsomethingtoslowtherelaydownandpreventitfromself-destructing.Thatnecessaryitemisacapacitor.
AddingCapacitanceAdda1,000μFelectrolyticcapacitorinparallelwiththecoiloftherelayasshowninthediagraminFigure2-65andtheschematicinFigure2-66.CheckFigure2-14ifyou’renotsurewhatacapacitorlookslike.The1,000μFvaluewillbeprintedonthesideofit,andI’llexplainwhatthismeansalittlelater.
Figure2-65.Addingacapacitormakestherelayoscillatemoreslowly.
![Page 62: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/62.jpg)
Figure2-66.Thecapacitorappearsatthebottomofthisschematicdiagram.
Makesurethecapacitor’sshortwireisconnectedtothenegativesideofthecircuit;otherwise,itwon’twork.Inadditiontotheshortwire,youshouldfindaminussignonthebodyofthecapacitor,whichistheretoremindyouwhichsideisnegative.Electrolyticcapacitorsarefussyaboutthis.Whenyoupressthebuttonnow,therelayshouldclickslowlyinsteadofbuzzing.What’shappeninghere?Acapacitorislikeatinyrechargeablebattery.It’ssosmallthatitchargesinafractionofasecond,beforetherelayhastimetoopenitslowerpairofcontacts.Then,whenthecontactsareopen,thecapacitoractslikeabattery,providingpowertotherelay.Itkeepsthecoiloftherelayenergizedforaboutonesecond.Afterthecapacitorexhaustsitspowerreserve,therelayrelaxesandtheprocessrepeats.
FUNDAMENTALSFaradbasicsTheFaradisaninternationalunittomeasurecapacitance.Moderncircuitsusuallyrequiresmallcapacitors.Consequentlyitiscommontofindcapacitorsmeasuredinmicrofarads(one-millionthofafarad)andevenpicofarads(one-trillionthofafarad).Nanofaradsarealsoused,moreofteninEuropethanintheUnitedStates.Seethefollowingconversiontable.
0.001nanofarad 1picofarad 1pF
0.01nanofarad 10picofarads 10pF
0.1nanofarad 100picofarads 100pF
1nanofarad 1,000picofarads 1,000pF
0.001microfarad 1nanofarad 1nF
0.01microfarad 10nanofarads 10nF
0.1microfarad 100nanofarads 100nF
1microfarad 1,000nanofarads 1,000nF
0.000001Farad 1microfarad 1mF
0.00001Farad 10microfarads 10mF
0.0001Farad 100microfarads 100mF
0.001Farad 1,000microfarads 1,000mF
(Youmayencountercapacitancesgreaterthan1,000microfarads,buttheyareuncommon.)
FUNDAMENTALSCapacitorbasicsDCcurrentdoesnotflowthroughacapacitor,butvoltagecanaccumulateveryquicklyinsideit,andremainsafterthepowersupplyisdisconnected.Figures2-67and2-68mayhelptogiveyouanideaofwhathappensinsideacapacitorwhenitisfullycharged.
GettingZappedbyCapacitorsIfalargecapacitorischargedwithahighvoltage,itcanretainthatvoltageforalongtime.Becausethecircuitsinthisbookuselowvoltages,youdon’thavetobeconcernedaboutthatdangerhere,butifyouarerecklessenoughtoopenanoldTVsetandstartdiggingaroundinside(whichIdonotrecommend),youmayhaveanastysurprise.Anundischargedcapacitorcankillyouaseasilyasifyoustickyourfingerintoanelectricaloutlet.Nevertouchalargecapacitorunlessyoureallyknowwhatyou’redoing.
Figure2-67.WhenDCvoltagereachesacapacitor,nocurrentflows,butthecapacitorchargesitselflikealittlebattery.Thepositiveandnegativechargesareequalandopposite.
![Page 63: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/63.jpg)
Figure2-68.Youcanimaginepositive“chargeparticles”accumulatingononesideofthecapacitorandattractingnegative“chargeparticles”totheoppositeside.
Inmostmodernelectrolyticcapacitors,theplateshavebeenreducedtotwostripsofverythin,flexible,metallicfilm,oftenwrappedaroundeachother,separatedbyanequallythininsulator.Discceramiccapacitorstypicallyconsistofjustasinglediscofnonconductivematerialwithmetalpaintedonbothsidesandleadssolderedon.Thetwomostcommonvarietiesofcapacitorsareceramic(capableofstoringarelativelysmallcharge)andelectrolytic(whichcanbemuchlarger).Ceramicsareoftendisc-shapedandyellowincolor;electrolyticsareoftenshapedlikeminiaturetincansandmaybejustaboutanycolor.ReferbacktoFigures2-14and2-15forsomeexamples.
FUNDAMENTALSCapacitorbasics(continued)Ceramiccapacitorshavenopolarity,meaningthatyoucanapplynegativevoltagetoeithersideofthem.Electrolyticsdohavepolarity,andwon’tworkunlessyouconnectthemtherightwayaround.Theschematicsymbolforacapacitorhastwosignificantvariants:withtwostraightlines(symbolizingtheplatesinsideacapacitor),orwithonestraightlineandonecurvedline,asshowninFigure2-69.Whenyouseeacurvedline,thatsideofthecapacitorshouldbemorenegativethantheother.Theschematicsymbolmayalsoincludea+sign.Unfortunately,somepeopledon’tbothertodrawacurvedplateonapolarizedcapacitor,yetothersdrawacurvedplateevenonanonpolarizedcapacitor.
Figure2-69.Thegenericschematicforacapacitorisontheleft.Theversionontherightindicatesapolarizedcapacitorwhichrequiresitsleftplatetobe“morepositive”thanitsrightplate.Theplussignisoftenomitted.
Figure2-70.Atantalumcapacitorwaspluggedintothisbreadboard,accidentallyconnectedthewrongwayaroundtoapowersourcecapableofdeliveringalotofcurrent.Afteraminuteorsoofthisabuse,thecapacitorrebelledbypoppingopenandscatteringsmallflamingpieces,which
burnedtheirwayintotheplasticofthebreadboard.Lessonlearned:observepolarity!
CapacitorPolarityYoumustconnectanelectrolyticcapacitorsothatitslongerwireismorepositivethanitsshorterwire.Theshellofthecapacitorisusuallymarkedwithanegativesignneartheshorterwire.Somecapacitorsmaybehavebadlyifyoudon’tobservetheirpolarity.OnetimeIconnectedatantalumcapacitortoacircuit,usingapowersupplyabletodeliveralotofcurrent,andwasstaringatthecircuitandwonderingwhyitwasn’tworkingwhenthecapacitorburstopenandscatteredlittleflamingfragmentsofitselfina3-inchradius.Ihadforgottenthattantalumcapacitorscanbefussyaboutpositiveandnegativeconnections.Figure2-70showstheaftermath.
BACKGROUNDMichaelFaradayandcapacitorsTheearliestcapacitorsconsistedoftwometalplateswithaverysmallgapbetweenthem.Theprincipleofthethingwassimple:
![Page 64: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/64.jpg)
Ifoneplatewasconnectedtoapositivesource,thepositivechargesattractednegativechargesontotheotherplate.Ifoneplatewasconnectedtoanegativesource,thenegativechargesattractedpositivechargesontotheotherplate.
Figures2-67and2-68,shownpreviously,conveythebasicidea.Theelectricalstoragecapacityofacapacitorisknownasitscapacitance,andismeasuredinfarads,namedafterMichaelFaraday(Figure2-71),anotherofthepantheonofelectricalpioneers.HewasanEnglishchemistandphysicistwholivedfrom1791to1867.AlthoughFaradaywasrelativelyuneducatedandhadlittleknowledgeofmathematics,hehadanopportunitytoreadawidevarietyofbookswhileworkingforsevenyearsasabookbinder’sapprentice,andthuswasabletoeducatehimself.Also,helivedatatimewhenrelativelysimpleexperimentscouldrevealfundamentalpropertiesofelectricity.Thushemademajordiscoveriesincludingelectromagneticinduction,whichledtothedevelopmentofelectricmotors.Healsodiscoveredthatmagnetismcouldaffectraysoflight.Hisworkearnedhimnumeroushonors,andhispicturewasprintedonEnglish20-poundbanknotesfrom1991through2001.
Figure2-71.MichaelFaraday
BreadboardingtheCircuitIpromisedtofreeyouintimefromthefrustrationsofalligatorclips,andthattimehascome.PleaseturnyourattentiontotheblockofplasticwithlotsoflittleholesinitthatIaskedyoutobuy.ForreasonsthatIdonotknow,thisiscalledabreadboard.Whenyouplugcomponentsintotheholes,hiddenmetalstripsinsidethebreadboardconnectthecomponentsforyou,allowingyoutosetupacircuit,testit,andmodifyitveryeasily.Afterwardyoucanpullthecomponentsoffthebreadboardandputthemawayforfutureexperiments.Withoutadoubt,breadboardingisthemostconvenientwaytotestsomethingbeforeyoudecidewhetheryouwanttokeepit.Almostallbreadboardsaredesignedtobecompatiblewithintegratedcircuitchips(whichwewillbeusinginChapter4ofthisbook).Thechipstraddlesanemptychannelinthecenterofthebreadboardwithrowsoflittleholeseitherside—usuallyfiveholesperrow.Youinsertothercomponentsintotheseholes.Inaddition,thebreadboardshouldhavecolumnsofholesrunningdowneachside.Theseareusedtodistributepositiveandnegativepower.TakealookatFigures2-72and2-73,whichshowtheupperpartofatypicalbreadboardseenfromabove,andthesamebreadboardseenasifwithX-rayvision,showingthemetalstripsthatareembeddedbehindtheholes.
Figure2-72.Atypicalbreadboard.Youcanplugcomponentsintotheholestotestacircuitveryquickly.
![Page 65: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/65.jpg)
Figure2-73.ThisX-ray-visionviewofthebreadboardrevealsthecopperstripsthatareembeddedinit.Thestripsconductelectricityfromonecomponenttoanother.
Importantnote:somebreadboardsdivideeachverticalcolumnofholes,ontheleftandtheright,intotwoseparateupperandlowersections.Useyourmeter’scontinuitytestingfeaturetofindoutifyourbreadboardconductspoweralongitsfulllength,andaddjumperwirestolinktheupperandlowerhalfofthebreadboardifnecessary.Figure2-74showshowyoucanusethebreadboardtoreplicateyouroscillatingrelaycircuit.Tomakethiswork,youneedtoapplythepositiveandnegativepowerfromyourACadapter.BecausethewirefromyourACadapterisalmostcertainlystranded,you’llhavedifficultypushingitintothelittleholes.Awayaroundthisistosetupacoupleofpiecesofbare22-gaugewire,andusethemasterminalstowhichyouclipthewirefromtheadapter,asinFigure2-75.(Yes,youstillneedjustacoupleofalligatorclipsforthispurpose.)Alternatively,youcanuseabreadboardwithpowerterminalsbuiltintoit,whichismoreconvenient.
Figure2-74.Ifyouplacethecomponentsonyourbreadboardinthepositionsshown,theywillcreatethesamecircuitthatyoubuiltfromwireandalligatorclipsinExperiment8.Componentvalues:
D1,D2:Light-emittingdiodesS1:DPDTrelay
S2:SPSTmomentaryswitchC1:Electrolyticcapacitor,1,000µF
R1:Resistor,680Ωminimum
Figure2-75.Ifyourbreadboarddoesn’thavescrewterminals,inserttwoshortpiecesofsolid-corewirewithstrippedendsandthenattachthestrandedwiresfromtheadapterusingalligatorclips.
You’llneedsomemore22-gaugewire,orsomeprecuthookupwire,tosupplythepowertoyourcomponents,whicharepluggedintothebreadboardasshowninFigures2-76and2-77.Ifyougetalltheconnectionsright,thecircuitshouldfunctionthesamewayasbefore.
![Page 66: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/66.jpg)
Thegeometryofthemetalconnectingstripsinthebreadboardoftenforcesyoutoconnectcomponentsinaroundaboutway.Thepushbutton,forinstance,suppliespowertothepoleoftherelaybutcannotbeconnecteddirectlyopposite,becausethereisn’troomforit.Rememberthatthestripsinsidethebreadboardthatdon’thaveanywiresorcomponentspluggedintothemareirrelevant;theydon’tdoanything.I’llincludesomesuggestedbreadboardlayoutsforcircuitsasyoucontinuethroughthisbook,buteventuallyyou’llhavetostartfiguringoutbreadboardlayoutsforyourself,asthisisanessentialpartofhobbyelectronics.
Figure2-76.TwooversizedLEDs,oneresistor,andthenecessaryjumperwireshavebeenaddedtothebreadboard.
Figure2-77.Nowthepushbutton,relay,andcapacitorhavebeenaddedtocompletethecircuitshowninthediagramandtheschematic.Whenthepushbuttonispressed,therelayoscillatesandtheLEDsflash.
![Page 67: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/67.jpg)
Experiment9:TimeandCapacitorsYouwillneed:
ACadapter,breadboard,wire,wirecutters,andstrippers.Multimeter.Pushbutton,SPST.Quantity:1.Resistorsandelectrolyticcapacitors,assorted.
InExperiment8,whenyouputacapacitorinparallelwiththecoiloftherelay,thecapacitorchargedalmostinstantlybeforedischargingitselfthroughtherelaycoil.Ifyouaddaresistorinserieswithacapacitor,thecapacitorwilltakelongertocharge.Bymakingacapacitortakelongertocharge,youcanmeasuretime,whichisaveryimportantconcept.CleanthecomponentsoffyourbreadboardanduseittosetuptheverysimplecircuitshowninFigure2-78,whereC1isa1,000µFcapacitor,R1isa100Kresistor,R2isa100Ωresistor,andS1isthepushbuttonthatyouusedpreviously.SetyourmetertomeasurevoltsDC,placetheprobesaroundthecapacitor,andholddownthepushbutton.Youshouldseethemetercountingupwardasthevoltageaccumulatesonthecapacitor.(Thisiseasierwithameterthatdoesn’thaveautoranging,becauseyouwon’thavetowaitwhilethemeterfiguresoutwhichrangetoapply.)ResistorR1slowsthechargingtimeforthecapacitor.
Figure2-78.Watchthevoltagebuildinguponthecapacitorwhileyouholddownthepushbutton.SubstituteothervaluesforR1,dischargethecapacitorbytouchingR2acrossit,andthenrepeatyourmeasurementprocess.
S1:Momentarypushbutton,OFF(ON)R1:100Kinitially
R2:100ΩC1:1,000µF
Releasethepushbutton,setasideyourmeter,anddischargethecapacitorbytouchingR2acrossitforasecondortwo.Nowsubstitutea50KresistorforR1,andrepeatthemeasurement.Themetershouldcountupwardalmosttwiceasfastasbefore.
Voltage,Resistance,andCapacitanceThinkoftheresistorasafaucet,andthecapacitorasaballoonthatyouaretryingtofillwithwater.Whenyouscrewdownthefaucetuntilonlyatricklecomesthrough,theballoonwilltakelongertofill.Butaslowflowofwaterwillstillfilltheballooncompletelyifyouwaitlongenough,and(assumingtheballoondoesn’tburst)theprocessendswhenthepressureinsidetheballoonisequaltothewaterpressureinthepipesupplyingthefaucet.SeeFigure2-79.
Figure2-79.Whenthefaucetisclosedhalf-way,theballoonwilltakelongertofill,butwillstillcontainasmuchwaterandasmuchpressureintheend.
Similarly,inyourcircuit,ifyouwaitlongenough,eventuallythevoltageacrossthecapacitorshouldreachthesamevalueasthevoltageofthepowersupply.Ina12-voltcircuit,thecapacitorshouldeventuallyacquire12volts(although“eventually”maytakelongerthanyouthink).Thismayseemconfusing,becauseearlieryoulearnedthatwhenyouapplyvoltageatoneendofaresistor,yougetlessvoltagecomingoutthanyouhavegoingin.Whyshouldaresistordeliverthefullvoltagewhenitispairedwithacapacitor?Forgetthecapacitorforamoment,andrememberhowyoutestedjusttwo1Kresistors.Inthatsituation,eachresistorcontainedhalfthetotalresistanceofthecircuit,soeachresistordroppedhalfthevoltage.Ifyouheldthenegativeprobeofyourmeteragainstthenegativesideofyourpowersupplyandtouchedthepositiveprobetothecenterpointbetweenthetworesistors,youwouldmeasure6volts.Figure2-80illustratesthis.Now,supposeyouremoveoneofthe1Kresistorsandsubstitutea9Kresistor.Thetotalresistanceinthecircuitisnow10K,andthereforethe9Kresistordrops90%ofthe12volts.That’s10.8volts.Youshouldtrythisandcheckitwithyourmeter.(Youareunlikelytofinda9Kresistor,becausethisisnotastandardvalue.Substitutethenearestvalueyoucanfind.)Nowsupposeyouremovethe9Kresistorandsubstitutea99Kresistor.Itsvoltagedropwillbe99%oftheavailablevoltage,or11.88volts.Youcanseewherethisisheading:thelargertheresistor,thelargeritscontributiontovoltagedrop.However,InotedpreviouslythatacapacitorblocksDCvoltagecompletely.Itcanaccumulateanelectricalcharge,butnocurrentpassesthroughit.Therefore,acapacitorbehaveslikearesistorthathasinfiniteresistancetoDCcurrent.
![Page 68: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/68.jpg)
(Actuallytheinsulationinsidethecapacitorallowsalittlebitof“leakage,”butaperfectcapacitorwouldhaveinfiniteresistance.)Thevalueofanyresistorthatyouputinserieswiththecapacitoristrivialbycomparison.Nomatterhowhighthevalueoftheresistoris,thecapacitorstillprovidesmuchmoreresistanceinthecircuit.Thismeansthatthecapacitorstealsalmostthecompletevoltagedropinthecircuit,andthevoltagedifferencebetweenoneendoftheresistorandtheotherwillbezero(assumingthatweignorelittleimperfectionsinthecomponents).Figure2-80mayhelptoclarifythisconcept.
Figure2-80.Whentworesistancesareinseries,thelargeronedropsthevoltagemorethanthesmallerone.Ifthelargerresistancebecomesinfinite(asinthecaseofacapacitor),thesmalleronenolongerhasanymeasurablecontributiontothevoltagedrop,andthevoltageisalmostexactlythe
sameatbothends.
Youshouldtrythisusingrealresistorsandcapacitors—althoughifyoudo,youwillrunintoalittleproblem.Whenyouuseyourmeterinits“DCvolts”mode,itdivertsalittleofthecurrentinthecircuit—justatinytaste—intheprocessofmeasuringit.Themeterstealssuchasmallamount,itdoesn’taffectthereadingsignificantlywhenyouarecheckingvoltageacrossaresistor.Theinternalresistanceofthemeterishigherthanthevaluesofmostresistors.However,rememberthattheinternalresistanceofacapacitorisalmostinfinite.Nowtheinternalresistanceofthemeterbecomessignificant.Becauseyoucanneverhaveanidealmeter,anymorethanyoucanhaveanidealcapacitororresistor,yourmeterwillalwaysinterferewiththecircuitslightly,andyouwillgetonlyanapproximateindication.Ifyoutrytomeasurethevoltageonacapacitorthathasbeenchargedbutisnownotconnectedtoanythingelse,you’llseethenumberslowlyfalling,asthecapacitordischargesitselfthroughthemeter.
THEORYThetimeconstantYoumaybewonderingifthere’sawaytopredictexactlyhowmuchtimeittakesforvariouscapacitorstocharge,whentheyarepairedwithvariousresistors.Isthereaformulatocalculatethis?Ofcourse,theanswerisyes,butthewaywemeasureitisabittricky,becauseacapacitordoesn’tchargeataconstantrate.Itaccumulatesthefirstvoltveryquickly,thesecondvoltnotquiteasquickly,thethirdvoltevenlessquickly—andsoon.Youcanimaginetheelectronsaccumulatingontheplateofacapacitorlikepeoplewalkingintoanauditoriumandlookingforaplacetosit.Thefewerseatsthatareleft,thelongerpeopletaketofindthem.Thewaywedescribethisiswithsomethingcalleda“timeconstant.”Thedefinitionisverysimple:
TC=R×CwhereTCisthetimeconstant,inseconds,andacapacitorofCfaradsisbeingchargedthrougharesistorofRohms.Goingbacktothecircuityoujusttested,tryusingitagain,thistimewitha1Kresistorandthe1,000µFcapacitor.Wehavetochangethosenumberstofaradsandohmsbeforewecanputthemintheformula.Well,1,000µFis0.001farads,and1Kis1,000ohms,sotheformulalookslikethis:
TC=1,000×0.001Inotherwords,TC=1—alessonthatcouldnotbemucheasiertoremember:
A1Kresistorinserieswitha1,000µFcapacitorhasatimeconstantof1.Doesthismeanthatthecapacitorwillbefullychargedin1second?No,it’snotthatsimple.TC,thetimeconstant,isthetimeittakesforacapacitortoacquire63%ofthevoltagebeingsuppliedtoit,ifitstartswithzerovolts.(Why63%?Theanswertothatquestionistoocomplicatedforthisbook,andyou’llhavetoreadabouttimeconstantselsewhereifyouwanttoknowmore.Bepreparedfordifferentialequations.)Here’saformaldefinitionforfuturereference:
TC,thetimeconstant,isthetimeittakesforacapacitortoacquire63%ofthedifferencebetweenitscurrentchargeandthevoltagebeingappliedtoit.WhenTC=1,thecapacitoracquires63%ofitsfullchargein1second.WhenTC=2,thecapacitoracquires63%ofitsfullchargein2seconds.Andsoon.
Whathappensifyoucontinuetoapplythevoltage?Historyrepeatsitself.Thecapacitoraccumulatesanother63%oftheremainingdifferencebetweenitscurrentcharge,andthevoltagebeingappliedtoit.Imaginesomeoneeatingacake.Inhisfirstbitehe’sravenouslyhungry,andeats63%ofthecakeinonesecond.Inhissecondbite,notwantingtoseemtoogreedy,hetakesjustanother63%ofthecakethatisleft—andbecausehe’snotfeelingsohungryanymore,herequiresthesametimetoeatitashetooktoeatthefirstbite.Inhisthirdbite,hetakes63%ofwhatstillremains,andstilltakesthesameamountoftime.Andsoon.Heisbehavinglikeacapacitoreatingelectricity(Figure2-81).
![Page 69: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/69.jpg)
Figure2-81.Ifourgourmetalwayseatsjust63%ofthecakestillontheplate,he“chargesup”hisstomachinthesamewaythatacapacitorchargesitself.Nomatterhowlonghekeepsatit,hisstomachisnevercompletelyfilled.
THEORYThetimeconstant(continued)Thecakeeaterwillalwayshaveafewcrumbstoeat,becausehenevertakes100%oftheremainder.Likewise,thecapacitorwillneveracquireafullcharge.Inaperfectworldofperfectcomponents,thisprocesswouldcontinueforaninfinitetime.Intherealworld,wesayratherarbitrarily:
After5×TCthecapacitorwillbesonearlyfullycharged,wewon’tcareaboutthedifference.Inthetableisacalculation(roundedtotwodecimalplaces)showingthechargeaccumulatingonacapacitorina12-voltcircuitwherethetimeconstantis1second.Here’showtounderstandthetable.V1isthecurrentchargeonthecapacitor.Subtractthisfromthesupplyvoltage(12volts)tofindthedifference.CalltheresultV2.Nowtake63%ofV2,andaddthistothecurrentcharge(V1)andcalltheresultV4.Thisisthenewchargethatthecapacitorwillhaveafter1second,sowecopyitdowntothenextlineinthetable,anditbecomesthenewvalueforV1.Nowwerepeatthesameprocessalloveragain.Figure2-82showsthisingraphicalform.Notethatafter5seconds,thecapacitorhasacquired11.92volts,whichis99%ofthepowersupplyvoltage.Thisshouldbecloseenoughtosatisfyanyone’sreal-worldrequirements.
TIMEINSECS
V1:CHARGEONCAPACITOR
V2:12–V1
V3:63%OFV2
V4:V1+V3
0 0.00 12.00 7.56 7.56
1 7.56 4.44 2.80 10.36
2 10.36 1.64 1.03 11.39
3 11.39 0.61 0.38 11.77
4 11.77 0.23 0.15 11.92
5 11.92
Ifyoutrytoverifythesenumbersbymeasuringthevoltageacrossthecapacitorasitcharges,rememberthatbecauseyourmeterstealsalittlecurrent,therewillbeasmalldiscrepancythatwillincreaseastimepasses.Forpracticalpurposes,thesystemworkswellenough.
Figure2-82.Acapacitorstartswith0volts.After1timeconstantitadds63%oftheavailablevoltage.Afteranothertimeconstant,itaddsanother63%oftheremainingvoltagedifference,andsoon.
![Page 70: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/70.jpg)
Experiment10:TransistorSwitchingYouwillneed:
ACadapter,breadboard,wire,andmeter.LED.Quantity:1.Resistors,various.Pushbutton,SPST.Quantity:1.Transistor,2N2222orsimilar.Quantity:1.Potentiometer,1megohm,linear.
Atransistorcanswitchaflowofelectricity,justlikearelay.Butit’smuchmoresensitiveandversatile,asthisfirstultra-simpleexperimentwillshow.We’llstartwiththe2N2222transistor,whichisthemostwidelyusedsemiconductorofalltime(itwasintroducedbyMotorolain1962andhasbeeninproductioneversince).First,youshouldgetacquaintedwiththetransistor.BecauseMotorola’spatentsonthe2N2222ranoutlongago,anycompanycanmanufacturetheirownversionofit.Someversionsarepackagedinalittlepieceofblackplastic;othersareenclosedinalittlemetal“can.”(SeeFigure2-83.)Eitherway,itcontainsapieceofsilicondividedintothreesectionsknownasthecollector,thebase,andtheemitter.I’lldescribetheirfunctioninmoredetailinamoment,butinitiallyyoujustneedtoknowthatinthistypeoftransistor,thecollectorreceivescurrent,thebasecontrolsit,andtheemittersendsitout.
Figure2-83.Atypicaltransistorispackagedeitherinalittlemetalcanoramoldedpieceofblackplastic.Themanufacturer’sdatasheettellsyoutheidentitiesofthethreewireleads,relativetotheflatsideofablackplastictransistororthetabthatsticksoutofametal-cantransistor.
UseyourbreadboardtosetupthecircuitshowninFigure2-85.Becarefultogetthetransistortherightwayaround!(SeeFigure2-84.)ForthethreebrandsIhavementionedintheshoppinglist,theflatsideshouldfaceright,ifthetransistorispackagedinblackplastic,orthelittletabshouldfacetowardthelowerleft,ifthetransistorispackagedinmetal.
Figure2-84.The2N2222transistormaybepackagedineitheroftheseformats.Left:RadioShackorFairchild.Right:STMicroelectronics(notethelittletabstickingoutatthelower-leftside).Ifyouuseadifferentbrand,you’llhavetocheckthemanufacturer’sdatasheet.Insertthetransistorinyour
breadboardwiththeflatsidefacingright,asseenfromabove,orthetabpointingdownandtotheleft,seenfromabove.
Figure2-85.ThetransistorblocksvoltagethatreachesitthroughR1.ButwhenpushbuttonS1ispressed,thistellsthetransistortoallowcurrenttopassthroughit.NotethattransistorsarealwaysidentifiedwithletterQinwiringdiagramsandschematics.
S1:Pushbutton,momentary,OFF(ON)R1:180ΩR2:10KR3:680Ω
Q1:2N2222orsimilarD1:LED
Initially,theLEDshouldbedark.NowpressthepushbuttonandtheLEDshouldglowbrightly.Electricityisfollowingtwopathshere.LookattheschematicinFigure2-86,whichshowsthesamecircuitmoreclearly.I’veshownpositiveatthetopandnegativeatthebottom(thewaymostschematicsdoit)becauseithelpstoclarifythefunctionofthisparticularcircuit.Ifyouviewtheschematicfromtheside,thesimilaritywiththebreadboardlayoutiseasiertosee.
![Page 71: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/71.jpg)
Figure2-86.ThisshowsthesamecircuitasthebreadboarddiagraminFigure2-85.
ThroughR1,voltagereachesthetoppin(thecollector)ofthetransistor.Thetransistoronlyletsatinytrickleofitpassthrough,sotheLEDstaysdark.Whenyoupressthebutton,voltageisalsoappliedalongaseparatepath,throughR2tothemiddlepin(thebase)ofthetransistor.Thistellsthetransistortocloseitssolid-stateswitchandallowcurrenttoflowoutthroughitsthirdpin(theemitter),andthroughR3,totheLED.YoucanuseyourmeterinvoltsDCmodetocheckthevoltageatpointsinthecircuit.Keepthenegativeprobefromthemetertouchingthenegativevoltagesourcewhileyoutouchthepositiveprobetothetoppinofthetransistor,themiddlepin,andthebottompin.Whenyoupressthebutton,youshouldseethevoltagechange.
FingertipSwitchingNowhere’ssomethingmoreremarkable.RemoveR2andthepushbutton,andinserttwoshortpiecesofofwireasshowninFigure2-87.Theupperpieceofwireconnectswiththepositivevoltagesupply;thelowerpiececonnectswiththemiddlepinofthetransistor(itsbase).Nowtouchthetipofyourfingertothetwowires.Onceagain,theLEDshouldglow,althoughnotasbrightlyasbefore.Lickthetipofyourfinger,tryagain,andtheLEDshouldglowmorebrightly.
NeverUseTwoHandsThefingertipswitchingdemoissafeiftheelectricitypassesjustthroughyourfinger.Youwon’tevenfeelit,becauseit’s12voltsDCfromapowersupplyof1amporless.Butit’snotagoodideatoputthefingerofonehandononewire,andthefingerofyourotherhandontheotherwire.Thiswouldallowtheelectricitytopassthroughyourbody.Althoughthechanceofhurtingyourselfthiswayisextremelysmall,youshouldneverallowelectricitytorunthroughyoufromonehandtotheother.Also,whentouchingthewires,don’tallowthemtopenetrateyourskin.
Yourfingerisconductingpositivevoltagetothebaseofthetransistor.Eventhoughyourskinhasahighresistance,thetransistorstillresponds.Itisn’tjustswitchingtheLEDonandoff;itisamplifyingthecurrentappliedtoitsbase.Thisisanessentialconcept:atransistoramplifiesanychangesincurrentthatyouapplytoitsbase.CheckFigure2-88toseemoreclearlywhat’shappening.Ifyoustudiedthesection“Background:Positiveandnegative”inChapter1,youlearnedthatthereisreallynosuchthingaspositivevoltage.Allwereallyhaveisnegativevoltage(createdbythepressureoffreeelectrons)andanabsenceofnegativevoltage(wheretherearefewerfreeelectrons).Butbecausetheideaofaflowofelectricityfrompositivetonegativewassowidelybelievedbeforetheelectronwasdiscovered,andbecausetheinnerworkingsofatransistorinvolve“holes”whichareanabsenceofelectronsandcanbethoughtofaspositive,wecanstillpretendthatelectricityflowsfrompositivetonegative.Seethefollowingsection,“Essentials:AllaboutNPNandPNPtransistors,”formoredetails.
Figure2-87.
![Page 72: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/72.jpg)
Figure2-88.Thesetwodiagramsshowthesamecomponentsasbefore,withafingertipsubstitutedforR2.Althoughonlyatrickleofvoltagenowreachesthebaseofthetransistor,it’senoughtomakethetransistorrespond.
ESSENTIALSAllaboutNPNandPNPtransistorsAtransistorisasemiconductor,meaningthatsometimesitconductselectricity,andsometimesitdoesn’t.Itsinternalresistancevaries,dependingonthepowerthatyouapplytoitsbase.NPNandPNPtransistorsarebipolarsemiconductors.Theycontaintwoslightlydifferentvariantsofsilicon,andconductusingbothpolaritiesofcarriers—holesandelectrons.TheNPNtypeisasandwichwithP-typesiliconinthemiddle,andthePNPtypeisasandwichwithN-typesiliconinthemiddle.Ifyouwanttoknowmoreaboutthisterminology,andthebehaviorofelectronswhentheytrytocrossanNPjunctionoraPNjunction,you’llhavetoreadaseparatesourceonthissubject.It’stootechnicalforthisbook.Allyouneedtorememberis:
Allbipolartransistorshavethreeconnections:Collector,Base,andEmitter,abbreviatedasC,B,andEonthemanufacturer’sdatasheet,whichwillidentifythepinsforyou.NPNtransistorsareactivatedbypositivevoltageonthebaserelativetotheemitter.PNPtransistorsareactivatedbynegativevoltageonthebaserelativetotheemitter.
Intheirpassivestate,bothtypesblocktheflowofelectricitybetweenthecollectorandemitter,justlikeanSPSTrelayinwhichthecontactsarenormallyopen.(Actuallyatransistorallowsatinybitofcurrentknownas“leakage.”)Youcanthinkofabipolartransistorasifitcontainsalittlebuttoninside,asshowninFigures2-89and2-90.Whenthebuttonispressed,itallowsalargecurrenttoflow.Topressthebutton,youinjectamuchsmallercurrentintothebasebyapplyingasmallvoltagetothebase.InanNPNtransistor,thecontrolvoltageispositive.InaPNPtransistor,thecontrolvoltageisnegative.
Figure2-89.Youcanthinkofabipolartransistorasifitcontainsabuttonthatcanconnectthecollectorandtheemitter.InanNPNtransistor,asmallpositivepotentialpressesthebutton.
Figure2-90.InaPNPtransistor,asmallnegativepotentialhasthesameeffect.Thearrowspointinthedirectionof“positivecurrentflow.”
NPNtransistorbasics
Tostarttheflowofcurrentfromcollectortoemitter,applyarelativelypositivevoltagetothebase.Intheschematicsymbol,thearrowpointsfrombasetoemitterandshowsthedirectionofpositivecurrent.Thebasemustbeatleast0.6volts“morepositive”thantheemitter,tostarttheflow.Thecollectormustbe“morepositive”thantheemitter.
PNPtransistorbasics
Tostarttheflowofcurrentfromemittertocollector,applyarelativelynegativevoltagetothebase.Intheschematicsymbol,thearrowpointsfromemittertobaseandshowsthedirectionofpositivecurrent.Thebasemustbeatleast0.6volts“morenegative”thantheemitter,tostarttheflow.Theemittermustbe“morepositive”thanthecollector.
![Page 73: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/73.jpg)
ESSENTIALSAllaboutNPNandPNPtransistors(continued)
All-transistorbasics
Neverapplyapowersupplydirectlyacrossatransistor.Youcanburnitoutwithtoomuchcurrent.Protectatransistorwitharesistor,inthesamewayyouwouldprotectanLED.Avoidreversingtheconnectionofatransistorbetweenpositiveandnegativevoltages.SometimesanNPNtransistorismoreconvenientinacircuit;sometimesaPNPhappenstofitmoreeasily.Theybothfunctionasswitchesandamplifiers,theonlydifferencebeingthatyouapplyarelativelypositivevoltagetothebaseofanNPNtransistor,andarelativelynegativevoltagetothebaseofaPNPtransistor.PNPtransistorsareusedrelativelyseldom,mainlybecausetheyweremoredifficulttomanufactureintheearlydaysofsemiconductors.PeoplegotintothehabitofdesigningcircuitsaroundNPNtransistors.Rememberthatbipolartransistorsamplifycurrent,notvoltage.Asmallfluctuationofcurrentthroughthebaseenablesalargechangeincurrentbetweenemitterandcollector.Schematicssometimesshowtransistorswithcirclesaroundthem,andsometimesdon’t.Inthisbook,I’llusecirclestodrawattentiontothem.SeeFigures2-91and2-92.Schematicsmayshowtheemitteratthetopandthecollectoratthebottom,orviceversa.Thebasemaybeontheleft,orontheright,dependingonwhatwasmostconvenientforthepersondrawingtheschematic.Becarefultolookcarefullyatthearrowinthetransistortoseewhichwayupitis,andwhetheritisNPNorPNP.Youcandamageatransistorbyconnectingitincorrectly.Transistorscomeinvariousdifferentsizesandconfigurations.Inmanyofthem,thereisnowaytotellwhichwiresconnecttotheemitter,thecollector,orthebase,andsometransistorshavenopartnumbersonthem.Beforeyouthrowawaythepackagingthatcamewithatransistor,checktoseewhetheritidentifiestheterminals.Ifyouforgetwhichwireiswhich,somemultimetershaveafunctionthatwillidentifyemitter,collector,andbaseforyou.Checkyourmultimeterinstructionbookletformoredetails.
Figure2-91.ThesymbolforanNPNtransistoralwayshasanarrowpointingfromitsbasetoitsemitter.Somepeopleincludeacirclearoundthetransistor;othersdon’tbother.Thestyleofthearrowmayvary.Butthemeaningisalwaysthesame.Thetop-leftversionistheoneIuseinthisbook.
Figure2-92.ThesymbolforaPNPtransistoralwayshasanarrowpointingfromitsemittertoitsbase.Somepeopleincludeacirclearoundthetransistor;othersdon’tbother.Thestyleofthearrowmayvary.Butthemeaningisalwaysthesame.Thetop-leftversionistheoneIuseinthisbook.
BACKGROUNDTransistororiginsThoughsomehistorianstracetheoriginsofthetransistorbacktotheinventionofdiodes(whichallowelectricitytoflowinonedirectionwhilepreventingreversaloftheflow),there’snodisputethatthefirstworkingtransistorwasdevelopedatBellLaboratoriesin1948byJohnBardeen,WilliamShockley,andWalterBrattain(Figure2-93).Shockleywastheleaderoftheteam,whohadtheforesighttoseehowpotentiallyimportantasolid-stateswitchcouldbe.Bardeenwasthetheorist,andBrattainactuallymadeitwork.Thiswasahugelyproductivecollaboration—untilitsucceeded.Atthatpoint,Shockleystartedmaneuveringtohavethetransistorpatentedexclusivelyunderhisownname.Whenhenotifiedhiscollaborators,theywere—naturally—unhappyaboutthisidea.Awidelycirculatedpublicityphotographdidn’thelp,inthatitshowedShockleysittingatthecenterinfrontofamicroscope,asifhehad
![Page 74: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/74.jpg)
donethehands-onwork,whiletheothertwostoodbehindhim,implyingthattheyhadplayedalesserrole.InfactShockley,asthesupervisor,wasseldompresentinthelaboratorywheretherealworkwasdone.Theproductivecollaborationquicklydisintegrated.BrattainaskedtobetransferredtoadifferentlabatAT&T.BardeenmovedtotheUniversityofIllinoistopursuetheoreticalphysics.ShockleyeventuallyleftBellLabsandfoundedShockleySemiconductorinwhatwaslatertobecomeSiliconValley,buthisambitionsoutstrippedthecapabilitiesofthetechnologyofhistime.Hiscompanynevermanufacturedaprofitableproduct.EightofShockley’scoworkersinhiscompanyeventuallybetrayedhimbyquittingandestablishingtheirownbusiness,FairchildSemiconductor,whichbecamehugelysuccessfulasamanufactureroftransistorsand,later,integratedcircuitchips.
Figure2-93.PhotographsprovidedbytheNobelFoundationshow,lefttoright,JohnBardeen,WilliamShockley,andWalterBrattain.Fortheircollaborationindevelopmentoftheworld’sfirstworkingtransistorin1948,theysharedaNobelprizein1956.
ESSENTIALSTransistorsandrelaysOnelimitationofNPNandPNPtransistorsisthattheyarenaturally“off”untilyouturnthem“on.”Theybehavelikeanormallyopenpushbutton,whichconductselectricityonlyforaslongasyouholditdown.Theydon’tnormallybehavelikeanormalonswitch,whichstaysonuntilyouapplyasignaltoturnitoff.Arelayoffersmoreswitchingoptions.Itcanbenormallyopen,normallyclosed,oritcancontainadouble-throwswitch,whichgivesyouachoiceoftwo“on”positions.Itcanalsocontainadouble-poleswitch,whichmakes(orbreaks)twoentirelyseparateconnectionswhenyouenergizeit.Single-transistordevicescannotprovidethedouble-throwordouble-polefeatures,althoughyoucandesignmorecomplexcircuitsthatemulatethisbehavior.Here’salistoftransistorandrelaycharacteristics.
TRANSISTOR RELAY
Long-termreliability Excellent Limited
ConfigurableforDPandDTswitching No Yes
Abilitytoswitchlargecurrents Limited Good
Abletoswitchalternatingcurrent(AC) Usuallynot Yes
Canbetriggeredbyalternatingcurrent(AC) Usuallynot Optional
Suitabilityforminiaturization Excellent Verylimited
Sensitivetoheat High Moderate
Abilitytoswitchathighspeed Excellent Limited
Priceadvantageforlow-voltagelow-current Yes No
Priceadvantageforhigh-voltagehigh-current No Yes
Currentleakagewhen“off” Yes No
Thechoicebetweenrelaysortransistorswilldependoneachparticularapplication.
THEORYSeethecurrentIfyouwanttogetamorepreciseunderstandingofhowatransistorworks,youshouldtrythislittletest.Itshowstheprecisebehaviorandlimitsofthe2N2222transistorthatyouusedinthepreviousexperiment.I’vesaidthatinanNPNtransistor,thecollectorshouldalwaysbemorepositivethantheemitterandthatthebaseshouldhaveapotentialsomewherebetweenthosetwovoltages.Figure2-94showsthisrathervaguerelationship.NowIwanttosubstitutesomenumbersforthesegeneralstatements.
Figure2-94.TheproperfunctioningofanNPNtransistorrequiresyoutomaintainthesevoltagerelationships.
TakealookattheschematicinFigure2-95,andcheckthecomponentvalues.Noticethatthetotalresistanceabovethetransistor,fromR1+R2,isthesameasthetotalresistancebelowit,fromR3+R4.Thereforethepotentialonthebaseofthetransistorshouldbehalfway
![Page 75: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/75.jpg)
betweenthetwoextremes—untilyouusepotentiometerP1toadjustthevoltageofthebaseofthetransistorupanddown.Thetwo180Ωresistors,R1andR3,protectthetransistorfrompassingexcessivecurrent.Thetwo10Kresistors,R2andR4,protectthebasewhenthepotentiometeristurnedallthewayuporallthewaydown.IwouldlikeyoutoseewhatthetransistorisdoingbymeasuringtheamperageflowingintothebaseatthepositionmarkedA1,andthetotalamperageflowingoutthroughtheemitteratthepositionmarkedA2.Todothis,itwouldbereallyhelpfulifyouhadtwometers.Asthatmaybeimpractical,thebreadboarddiagramsinFigures2-96and2-97showhowyoucanswaponemeterbetweenthetwolocations.Rememberthattomeasuremilliamps,youhavetopasselectricitythroughthemeter.Thismeansthatthemetermustbeinsertedintothecircuit,andwheneveryouremovethemeter,youhavetoremaketheconnectionwherethemeterwas.Thebreadboarddiagramshowshowyoucandothis.Fortunately,it’sveryeasytoremoveandreplacewiresinabreadboard.Wherewiresareconnectedtothepotentiometer,youmayneedtoreverttousingalligatorclips.Beginwiththepotentiometerturnedabouthalfwaythroughitsrange.MeasureatA1andA2.Turnthepotentiometerupabit,andmeasurecurrentatthetwolocationsagain.FollowingisatableshowingsomeactualreadingsIobtainedatthosetwolocations,usingtwodigitalmeterssimultaneously.
MILLIAMPSPASSINGTHROUGHLOCATIONA1 MILLIAMPSPASSINGTHROUGHLOCATIONA2
0.01 1.9
0.02 4.9
0.03 7.1
0.04 9.9
0.05 12.9
0.06 15.5
0.07 17.9
0.08 19.8
0.09 22.1
0.10 24.9
0.11 26.0
0.12 28.3
There’saveryobviousrelationship.Thecurrentemergingfromtheemitterofthetransistor,throughlocationA2,isabout240timesthecurrentpassingthroughlocationA1,intothebase.TheratioofcurrentcomingoutfromtheemitterofanNPNtransistortocurrentgoingintothebaseisknownasthebetavalueforatransistor.Thebetavalueexpressesthetransistor’samplifyingpower.It’saveryconstantratio,untilyoupushitalittletoofar.Above0.12mA,thisparticulartransistorbecomes“saturated,”meaningthatitsinternalresistancecannotgoanylower.
THEORYSeethecurrent(continued)Inmylittleexperiment,IfoundthatthemaximumcurrentatA2was33mA.AsimplecalculationusingOhm’sLawshowedmethatthismeantthetransistor’sinternalresistancewasnearzero.Thisiswhyyoushouldprotectatransistorwithsomeadditionalresistanceinthecircuit.Ifyoudon’t,itslowinternalresistancewouldallowahugecurrentflowthatwouldimmediatelyburnitout.Whatabouttheotherendofitsrange?Whenitpassesonly1.9mA,thetransistorhasaninternalresistanceofaround6,000Ω.Theconclusionisthatdependinghowmuchcurrentyouapplytothistransistor,itsinternalresistancevariesbetweenzeroand6,000Ω,approximately.Somuchforthetheory.Nowwhatcanwedowithatransistorthat’sfun,oruseful,orboth?WecandoExperiment11!
Figure2-95.Thisisbasicallythesameasthepreviouscircuit,withapotentiometeraddedandtheLEDremoved.Componentvalues:
R1:180ΩR2:10KR3:180ΩR4:10K
P1:1MlinearpotentiometerQ1:2N2222transistor
![Page 76: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/76.jpg)
Figure2-96.ThemeterismeasuringcurrentflowingfromthepotentiometerintothebaseofthetransistoratpositionA1(seeFigure2-95).
Figure2-97.OneendofresistorR3hasbeenunpluggedfromthebreadboardsothatthemeternowmeasurescurrentflowingoutthroughtheemitterofthetransistor,intoR3,atpositionA2.
![Page 77: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/77.jpg)
Experiment11:AModularProjectYouwillneed:
ACadapter,breadboard,wire,andmeter.LED.Quantity:1.Resistors,various.Capacitors,various.Transistor,2N2222orsimilar.Quantity:2.2N6027programmableunijunctiontransistor(PUT).Quantity:2.Miniature8Ωloudspeaker.Quantity:1.
Sofar,I’vedescribedsmallcircuitsthatperformverysimplefunctions.Nowit’stimetoshowhowmodulescanbecombinedtocreateadevicethatdoesabitmore.Theendproductofthisexperimentwillbeacircuitthatmakesanoiselikeasmallsiren,whichcouldbeusedinanintrusionalarm.Youmayormaynotbeinterestedinowninganalarm,butthefour-stepprocessofdevelopingitisimportant,becauseitshowshowindividualclustersofcomponentscanbepersuadedtocommunicatewitheachother.I’llbeginbyshowinghowtouseatransistortomakeasolid-stateversionoftheoscillatingcircuitthatyoubuiltwitharelayinExperiment8.Therelay,youmayremember,waswiredinsuchawaythatthecoilreceivedpowerthroughthecontactsoftherelay.Assoonasthecoilwasenergized,itopenedthecontacts,thuscuttingoffitsownpower.Assoonasthecontactsrelaxedtheyrestoredthepower,andtheprocessrepeateditself.There’snowaytodothiswithasinglebipolartransistor.Youactuallyneedtwoofthem,switchingeachotheronandoff,andthewaythatthisworksisquitehardtounderstand.Aneasieroptionistouseadifferentthingknownasaprogrammableunijunctiontransistor,orPUT.Unijunctiontransistorsweredevelopedduringthe1950s,butfellintodisusewhensimplesiliconchipsacquiredtheabilitytoperformthesamekindsoffunctions,moreaccuratelyandmorecheaply.However,theso-calledprogrammableunijunctiontransistorisstillwidelyavailable,oftenusedinapplicationssuchaslampdimmersandmotorcontrollers.Becauseitsprimaryuseisingeneratingastreamofpulses,it’sidealforourpurposes.IfyouputtogetherthecomponentsshowninFigure2-98,theLEDshouldstartflashingassoonasyouapplypower.
Figure2-98.Assemblethesecomponents,applypower,andtheLEDshouldstartflashing.
R1:470KR2:15KR3:27K
C1:2.2μFelectrolyticcapacitorD1:LED
Q1:2N6027programmableunijunctiontransistor
Notethatthiscircuitwillworkon6volts.Youwon’tdamageanythingifyourunitwith12volts,butaswecontinueaddingpiecestoit,you’llfindthatitactuallyperformsbetterat6voltsthanat12.Ifyoureadthenextsection,“Essentials:Allaboutprogrammableunijunctiontransistors,”you’llfindouthowthecircuitworks.
ESSENTIALSAllaboutprogrammableunijunctiontransistorsTheschematicsymbolforaprogrammableunijunctiontransistor,orPUT,looksverydifferentfromthesymbolforabipolartransistor,anditspartsarenameddifferently,too.Nevertheless,itdoeshaveasimilarfunctionasasolid-stateswitch.ThesymbolandthenamesofthethreeconnectionsareshowninFigure2-99.Notethatthisisararecase(maybetheonlyoneinthewholeofelectronics!)inwhichyouwon’trunintoconfusingvariationsofthebasicschematicsymbol.APUTalwaysseemstolookthewayI’vedrawnithere.PersonallyIthinkitwouldbeclearerifweaddedacirclearoundit,butnooneseemstodothat,soIwon’t,either.The2N6027isprobablythemostcommonPUT,andseemstobestandardizedinitspackagingandpin-outs.I’veonlyseenitinaplasticmoduleratherthanalittletincan.Figure2-100showsthefunctionsoftheleadsifyour2N6027ismanufacturedbyMotorolaorOnSemiconductor.Ifyouhaveonefromanothersource,youshouldcheckthedatasheet.Notethattheflatsideoftheplasticmodulefacestheoppositewayaroundcomparedwiththe2N2222bipolartransistor,whenthetwodevicesarefunctioningsimilarly.ThePUTblockscurrentuntilitsinternalresistancedropstoallowflowfromthe"anode"tothe"cathode."Inthisway,itseemsverysimilartoanNPNtransistor,butthere'sabigdifference.Whenthevoltageattheanodeincreasesbeyondathreshold,itforcesthePUTtoallowcurrenttoflow.(Thisthresholdisprogrammedbyvoltageonthegate.)Supposeyoustartwith,say,1voltattheanode.Slowly,youincreasethisvoltage.Thetransistorblocksituntiltheanodeisabove4volts.Suddenlythispressurebreaksdowntheresistanceandcurrentsurgesfromtheanodetothecathode.Ifthevoltagegoesbackdownagain,thetransistorrevertstoitsoriginalstateandblockstheflow.I’veincludedanotherversionofthe“fingeronthebutton”drawingtoconveythisconcept.Thevoltageontheanodeisitselfresponsibleforpushingthebuttonthatopensthepathwaytothecathode.SeeFigure2-101.
![Page 78: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/78.jpg)
Figure2-99.TheschematicsymbolforaPUT.
Figure2-100.InPUTsmanufacturedbyOnSemiconductorandMotorola,theleadshavethesefunctions.
ESSENTIALSAllaboutprogrammableunijunctiontransistors(continued)Thismaycauseyoutowonderwhatthefunctionofthegateis.Youcanthinkofitas“assisting”thefingeronthebutton.Infact,thegateisthe“programmable”partofaPUT.Bychoosingavoltageforthegate,youestablishthethresholdpointwhencurrentstartstoflow.Here’sasimpletake-homesummary:
Theanodehastobemorepositivethanthecathode,andthegateshouldbebetweenthosetwoextremes.Ifanodevoltageincreasesaboveathresholdpoint,currentburststhroughandflowsfromtheanodetothecathode.Ifanodevoltagedropsbackdownbelowthethreshold,thetransistorstopstheflow.Thevoltageyouapplytothegatedetermineshowhighthethresholdis.Thegatevoltageisadjustedwithtworesistors,shownasR1andR2inthesimpleschematicinFigure2-102.Typically,eachresistorisaround20K.ThePUTisprotectedfromfullpositivevoltagebyR3,whichcanhaveahighvalue,100Korgreater,becauseverylittlecurrentisneededtobiasthetransistor.Youaddyourinputsignalintheformofpositivevoltageattheanode.Whenitexceedsthethreshold,itflowsoutofthecathodeandcanworksomekindofoutputdevice.
TheonlyremainingquestionishowwemakeaPUToscillate,tocreateastreamofon/offpulses.TheansweristhecapacitorthatyouincludedinthecircuitthatyoubreadboardedatthebeginningofExperiment11.
Figure2-101.WhenvoltageattheanodeofaPUTcrossesathreshold(determinedbyapresetvoltageatthegate),currentbreaksthroughandsurgesfromtheanodetothecathode.Inthissense,theanodevoltageactsasifitpressesabuttonitselftoopenaconnectioninsidethePUT,with
someassistancefromcontrolvoltageatthegate.
Figure2-102.ThissimpleschematicshowshowaPUTisused.R1andR2determinethevoltageatthegate,whichsetsthethresholdpointfortheinputattheanode.Abovethethreshold,currentflowsfromanodetocathode.
Step1:Slow-SpeedOscillationFigure2-103isaschematicversionofthepreviousPUTbreadboardcircuitshowninFigure2-98,drawnsothatthelayoutlooksasmuchlikethebreadboardaspossible.
![Page 79: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/79.jpg)
Figure2-103.Thismakesiteasiertoseewhat’shappeninginthebreadboardversion.
The15Kresistorand27Kresistorestablishthevoltageatthegate.The470KresistorsuppliestheanodeofthePUT,butthePUTbeginsinits“off”condition,blockingthevoltage.Sothevoltagestartstochargethe2.2μFcapacitor.Youmayrememberthataresistorslowstherateatwhichacapacitoraccumulatesvoltage.Thebiggertheresistorand/orthelargerthecapacitor,thelongerthecapacitortakestoreachafullcharge.Inthiscircuit,thecapacitortakesaboutfivesecondstogetcloseto6volts.
THEORYCapacitorChargeTimeTheamountoftimeittakesforacapacitortoreachitsthresholdiscalculatedwith5RC,whereRistheresistance(inohms)oftheresistor,andCisthecapacitance(infarads)ofthecapacitor.Sointhiscase,you’dmultiply5by470,000by0.0000022,whichgivesus5.17seconds.
ButnoticethatthePUTisconnecteddirectlywiththecapacitor.Therefore,whatevervoltageaccumulatesonthecapacitorisalsoexperiencedbythePUT.Asthevoltagegraduallyincreases,finallyitreachesthethreshold,whichflipsthePUTintoits“on”state.ThecapacitorimmediatelydischargesitselfthroughthePUT,throughtheLED(whichflashes),andfromtheretothenegativesideofthepowersupply.Thesurgedepletesthecapacitor.Thevoltagedropsbackdown,andthePUTreturnstoitsoriginalstate.Nowthecapacitorhastorechargeitselfalloveragain,untilthewholeprocessrepeatsitself.Ifyousubstitutea22μFcapacitor,thecharge/dischargecycleshouldtakeabout10timesaslong,whichwillgiveyoutimetomeasureit.SetyourmetertomeasurevoltsDCandplaceitsprobesoneithersideofthecapacitor.Youcanactuallywatchthechargeincreasinguntilitreachesthethreshold,atwhichpointthecapacitordischargesandthevoltagedropsbackdownagain.Sonowwehaveanoscillator.What’snext?
Step2:BeyondthePersistenceofVisionIfyousubstituteamuchsmallercapacitor,itwillchargemuchmorequickly,andtheLEDwillflashfaster.Supposeyouuseacapacitorof0.0047μF(whichcanalsobeexpressedas4.7nanofarads,or4.7nF).Thisseemslikeanoddnumber,butit’sastandardvalueforacapacitor.Thiswillreducethecapacitancebyafactorofmorethan500,andthereforetheLEDshouldflashabout500timesasfast,whichshouldbeabout1,000timespersecond.Thehumaneyecannotdetectsuchrapidpulses.Thehumanear,however,canhearfrequenciesupto10,000persecondandbeyond.IfwesubstituteaminiatureloudspeakerfortheLED,weshouldbeabletoheartheoscillations.Figure2-104showshowI’dlikeyoutomakethishappen.Pleaseleaveyouroriginal,slow-flashingcircuituntouched,andmakeaduplicateofitfartherdownthebreadboard,changingacoupleofcomponentvaluesasindicated.IntheschematicinFigure2-105,thenewpartofthecircuitisinsolidblack,whiletheprevioussectionisingray.
Figure2-104.Theextracomponentswhichhavebeenaddedatthelowerhalfofthebreadboardhavethesamefunctionsasthecomponentsatthetop,butsomevaluesareslightlydifferent:
![Page 80: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/80.jpg)
R4:470KR5:33KR6:27KR7:100Ω
C2:0.0047μFQ2:2N6027
L1:8Ω1-inchloudspeaker
Figure2-105.Theprevioussectionthatyoubuiltisshowningray.Justaddthenewsectioninblack.
Iwantyoutokeeptheslow-flashingcircuitseparately,untouched,becauseIhaveanideatomakeuseofitalittlelater.YoucanleavetheLEDblinking.Theloudspeakershouldbewiredinserieswitha100ΩresistortolimitthecurrentthatflowsoutofthePUT.Theloudspeakerdoesn’thaveanypolarity,eventhoughitisfittedwitharedwireandablackwire.Youcanconnectiteitherwayaround.Initially,youmaybedisappointed,becausethecircuitwillnotseemtobedoinganything.However,ifyouplaceyourearvery,veryclosetotheloudspeaker,andifyouwiredthecircuitcorrectly,youshouldhearafaintbuzz,likeamosquito.Obviously,thisisn’tloudenoughtoserveanypracticalpurpose.Weneedtomakeitlouder.Inotherwords,weneedtoamplifyit.Maybeyourememberthatthe2N2222,whichyouplayedwithpreviously,canfunctionasanamplifier.Solet’stryusingthat.
Step3:AmplificationDisconnecttheloudspeakerandits100Ωseriesresistor.Thenaddthe2N2222,whichislinkedwiththeoutputfromthePUTviaa1Kresistortoprotectitfromexcessivecurrent.SeeFigure2-107.Theemitterofthe2N2222isconnectedtoground,andthecollectorissuppliedthroughtheloudspeakerandits100Ωseriesresistor.Thisway,smallfluctuationsintheoutputfromthePUTaresensedbythebaseofthe2N2222whichconvertsthemintobiggerfluctuationsbetweenthecollectorandtheemitter,whichdrawcurrentthroughtheloudspeaker.ChecktheschematicinFigure2-108.Nowthesoundshouldbelouderthananinsectbuzz,butstillnotreallyloudenoughtobeuseful.Whattodo?Well—howaboutifweaddanother2N2222?Bipolartransistorscanbeplacedinseries,sothattheoutputfromthefirstonegoestothebaseofthesecondone.The240:1amplificationofthefirstoneismultipliedbyanother240:1,givingatotalamplificationofmorethan50,000:1.Therearelimitstothistechnique.The2N2222canonlyconductsomuchcurrentbeforegettingoverloaded,andexcessamplificationcancausedistortion.ButwhenIbuiltthiscircuit,Iusedametertoverifythatwe’restillwithinthedesignlimitsofa2N2222,andforthisproject,Idon’tcarewhetherthesoundisslightlydistorted.
BACKGROUNDMountingaloudspeakerThediaphragmorconeofaloudspeakerisdesignedtoradiatesound,butasitoscillatestoandfro,itemitssoundfromitsbacksideaswellasitsfrontside.Becausethesoundsareoppositeinphase,theytendtocanceleachotherout.Theperceivedoutputfromaloudspeakercanincreasedramaticallyifyouaddahornarounditintheformofatubetoseparatetheoutputfromthefrontandbackofthespeaker.Foraminiature1-inchloudspeaker,youcanbendandtapeafilecardaroundit.SeeFigure2-106.Betterstill,mountitinaboxsothattheboxabsorbsthesoundfromtherearoftheloudspeaker.Forpurposesofthesesimpleexperiments,Iwon’tbothertogointothedetailsofventedenclosuresandbass-reflexdesigns.
Figure2-106.Aloudspeakeremitssoundfromitsbottomsurfaceaswellasitstopsurface.Toincreasetheperceivedaudiovolume,useacardboardtubetoseparatethetwosoundsources,ormountthespeakerinasmallbox.
![Page 81: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/81.jpg)
Figure2-107.Byaddinga2N2222general-purposetransistor,weamplifythesignalfromQ2:
R8:1KQ3:2N2222
Othercomponentsarethesameasinthepreviousstepinconstructingthiscircuit.
Figure2-108.
Addthesecond2N2222asshowninFigure2-109.InFigure2-110,onceagainthepreviouslywiredsectionisingray.Iftheaccumulationofelectricalcomponentsisbeginningtoseemconfusing,rememberthateachclusterofpartshasaseparatedefinedfunction.Wecandrawablockdiagramtoillustratethis,asinFigure2-112.Usingthesecond2N2222,youshouldfindthattheoutputismoreclearlyaudible,atleastwithinthelimitsofyourtiny1-inchloudspeaker.Cupyourhandsaroundittodirectthesound,andyou’llfindthatthevolumeseemstoincrease.Youcanalsotryusinga3-inchloudspeaker,whichwillcreateagenerallybetteraudiooutputwhilestillremainingwithinthelimitsofthelittle2N2222transistor.SeeFigure2-106,shownpreviously,andFigure2-111.
![Page 82: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/82.jpg)
Figure2-109.Q4isanother2N2222transistorthatfurtheramplifiesthesignal.ItreceivespowerthroughR9:2.2K.
Figure2-110.ThisschematiciscomparablewiththecomponentlayoutinFigure2-109.
Figure2-111.The2N2222transistorisquitecapableofdrivinga3-inchloudspeaker,whichwillcreatemuchbettersoundthana1-inchspeaker.
Step4:PulsedOutputIfyouwantedtousethisaudiosignalassomekindofanalarm,asteadydroningnoiseisnotverysatisfactory.Apulsingoutputwouldbeamuchbetterattention-getter.
![Page 83: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/83.jpg)
Figure2-112.Top:Thebasicfunctionsofthenoisemakingoscillatorcircuitshownasablockdiagram.Bottom:Thesamefunctionswithaslowoscillatoraddedtocontrolthefastoscillator.
Well,thefirstsectionofthecircuitthatyouassembledcreatedapulsingsignalabouttwicepersecond.YouusedittoflashanLED.MaybewecangetridoftheLEDandfeedtheoutputfromthefirstsectiontothesecondsection.ThelowerblockdiagraminFigure2-112explainsthisconcept.Canitreallybethatsimple?Well,yesandno.Thetrickistomaketheoutputfromthefirstsectioncompatiblewiththeinputtothesecondsection.IfyousimplyconnectawirefromthecathodeofthefirstPUTtotheanodeofthesecondPUT,that’snotgoingtowork,becausethesecondPUTisalreadyoscillatingnicelybetweenlowandhighvoltage,about1,000timeseachsecond.Addmorevoltage,andyouwilldisruptthebalancethatenablesoscillation.However,rememberthatthevoltageonthegateofaPUTaffectsitsthresholdforconductingelectricity.MaybeifweconnecttheoutputfromQ1tothegateofQ2,we’llbeabletoadjustthatthresholdautomatically.ThevoltagestillhastobeinarangethatthePUTfindsacceptable,though.Wecantryvariousresistorstoseewhichoneworkswell.Thissoundsliketrialanderror—andthat’sexactlywhatitis.Doingthemathtopredictthebehaviorofacircuitlikethisisfartoocomplicated—forme,anyway.Ijustlookedatthemanufacturer’sdatasheet,sawtherangeofresistorvaluesthatthePUTwouldtolerate,andchoseonethatseemedasifitshouldwork.IfyouremovetheLEDandsubstituteR10asshowninthebreadboarddiagraminFigure2-113,you’llfindthatthefluctuatingoutputfromQ1makesQ2emitatwo-tonesignal.Thisismoreinteresting,butstillnotwhatIwant.I’mthinkingthatifImakethepulsesoutofQ1lessabrupt,theresultcouldbebetter,andthewaytosmoothapulsingoutputistohookupanothercapacitorthatwillchargeatthebeginningofeachpulseandthenreleaseitschargeattheendofeachpulse.ThisisthefunctionofC3inFigure2-114,anditcompletesthecircuitsothatitmakesawhoopingsoundalmostlikea“real”alarm.Ifyoudon’tgetanyaudiooutput,checkyourwiringverycarefully.It’seasytomakeawrongconnectiononthebreadboard,especiallybetweenthethreelegsofeachtransistor.Useyourmeter,settoDCvolts,tocheckthateachsectionofthecircuithasapositivevoltagerelativetothenegativesideofthepowersupply.Figure2-115showshowyourcircuitshouldactuallylookonthebreadboard.
![Page 84: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/84.jpg)
Figure2-113.R10connectstheslow-runningoscillatoratthetopofthebreadboardtothegateofQ2,thePUTinthemiddleofthebreadboard.Thismodulatestheaudiooscillator,withadditionofasmoothingcapacitor.
Figure2-114.ThisschematicshowsthesamecircuitasinFigure2-113:
R10:10KC3:2.2μF
Figure2-115.Thisphotographshowsthecompletealarm-audiocircuitonabreadboard.
TweakingitThere’sstillalotofroomforcreativityhere:
Adjustthefrequencyofthesound:UseasmallerorlargercapacitorinsteadofC2(halfortwicethecurrentvalue).UseasmallerorlargervalueforR5.
![Page 85: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/85.jpg)
Adjustthepulsingfeature:UseasmallerorlargercapacitorinsteadofC1(halfortwicethecurrentvalue).UseasmallerorlargervalueforR2.Generalperformanceadjustments:tryalargervalueforR1.TrysmallerorlargervaluesforC3.Tryrunningthecircuitat7.5volts,10volts,and12volts.
Thecircuitsinthisbookaresuggestedasonlyastartingpoint.Youshouldalwaystrytotweakthemtomakethemyourown.AslongasyoufollowthegeneralruleofprotectingtransistorsandLEDswithresistors,andrespectingtheirrequirementsforpositiveandnegativevoltage,you’reunlikelytoburnthemout.Ofcourse,accidentswillhappen—Imyselftendtobecareless,andfriedacoupleofLEDswhileworkingonthiscircuit,justbecauseIconnectedthemthewrongwayaround.
Step5:EnhancementsAnoisemakingcircuitisjusttheoutputofanalarm.Youwouldneedseveralenhancementstomakeituseful:1.Somekindofanintrusionsensor.Maybemagneticswitchesforwindowsanddoors?2.Awaytostartthesoundifanyoneofthesensorsistriggered.Thewaythisisusuallydoneistorunaverysmallbutconstantcurrentthroughalloftheswitchesinseries.Ifanyoneswitchopens,orifthewireitselfisbroken,thisinterruptsthecurrent,whichstartsthealarm.Youcouldmakethishappenwithadouble-throwrelay,keepingtherelayenergizedallthetimeuntilthecircuitisbroken,atwhichpoint,therelayrelaxes,openingonepairofcontactsandclosingtheotherpair,whichcansendpowertothenoisemaker.Thetroubleisthatarelaydrawssignificantpowerwhileit’senergized,anditalsotendstogethot.Iwantmyalarmsystemtodrawverylittlecurrentwhileit’sin“ready”mode,sothatitcanbepoweredbyabattery.AlarmsystemsshouldneverdependentirelyonAChousecurrent.Ifwedon’tusearelay,canweuseatransistortoswitchontherestofthecircuitwhenthepowerisinterrupted?Absolutely;infact,onetransistorwilldoit.
3.Buthowdowearmthealarminthefirstplace?Really,weneedathree-stepprocedure.First,checkalittlelightthatcomesonwhenallthedoorsandwindowsareclosed.Second,pressabuttonthatstartsa30-secondcountdown,givingyoutimetoleave,ifthat’swhatyouwanttodo.Andthird,after30seconds,thealarmarmsitself.
4.Ifthealarmistriggered,whatthen?Ifsomeoneforcesopenawindow,shouldthealarmstopsoundingassoonasthewindowisclosedagain?No,thealarmshouldlockitselfon,untilyouturnitoff.
5.Howdoyouturnitoff?Somekindofsecret-codekeypadwouldbegood.6.Buttoavoiddrivingeveryonecrazyifthealarmistriggeredwhenyou’renotthere,itshouldeventuallystopitself,perhapsafterabout10minutes.AtthatpointitshouldremainquietbutshouldlightanLEDtotellyouwhathappened.YoucanthenpressaresetbuttontoswitchofftheLED.
ImplementingtheWishListI’vecompiledawishlistthatseemslikelytomaketheprojectatleastfivetimesascomplicatedasitisalready.Well,that’swhattendstohappenwhenyougobeyondlittledemocircuitsandtrytodesignsomethingthatwillbeusefulineverydaylife.Suddenlyyoufindyourselfhavingtoaccommodateallkindsofcircumstancesandsituations.Actually,Icanandwillshowyouhowtotakecareofalltheenhancementsonthewishlist,butI’mthinkingthattheywillrequireustogetalittlemoreseriousaboutelectronicsprojectsingeneralfirst.Ifyou’regoingtobuildsomethingambitious,you’llwanttomakeitmorepermanent,andprobablymorecompact,thanabreadboardwithcomponentspushedintoit.Youwillneedtoknowhowtoconnecteverythingpermanentlywithsolder,onapieceofperforatedboardthatyoucaninstallinaneatlittleprojectboxwithswitchesandlightsontheoutside.I’mgoingtodealwithsolderingandpackaginginthenextchapter.Afterthat,we’llgetbacktothealarmproject.
Largerversionsofallschematicsandbreadboardphotosareavailableonlineatthisbook'swebsite:http://cdn.makezine.com/make/books/MakeElectronics_figs.zip.
Largerversionsofallschematicsandbreadboardphotosareavailableonlineatthisbook'swebsite:http://oreilly.com/catalog/9780596153748.
Largerversionsofallschematicsandbreadboardphotosareavailableonlineatthisbook'swebsite:http://oreilly.com/catalog/9780596153748.
![Page 86: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/86.jpg)
3.GettingSomewhatMoreSeriousIdon’tknowhowfaryou’llwanttodelveintoelectronics,butIdoknowthatI’veshownyouaboutasmuchasIcanwithjustahandfulofcomponents,somewires,abreadboard,andafewtools.Tocontinue,you’llneed:
SomemoretoolsandsuppliesBasicsolderingskillsAdditionalknowledgeabout:IntegratedcircuitsDigitalelectronicsMicrocontrollersMotors
Thetoolsarenotparticularlyexoticorexpensive,andthesolderingskillsareeasilyacquired.Learningtojoinwireswithsolderisfareasierthanmasteringhigh-levelcraftssuchasjewelrymakingorwelding.Asforadditionalareasofknowledgeaboutelectronics,theyarenomorechallengingthanthosethatIhavecoveredalready.Bytheendofthissection,youshouldbeabletotransplantcomponentsfromabreadboardontoperforatedboard,whereyouwillsoldereverythingtogether,andthenmounttheboardinalittleboxwithswitchesandwarninglightsonthefront,foreverydayuse.
![Page 87: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/87.jpg)
ShoppingList:Experiments12Through15ToolsEachofthefollowingtoolsisratedEssential,Recommended,orOptional.TheEssentialtoolswilltakeyouthroughthischapterofthebook.IfyousupplementthemwiththeRecommendedtools,theyshouldbesufficienttogetyoutotheendofthebook.TheOptionaltoolswillmakeyourworkeasier,butwhetherthey’reworththemoneyisforyoutodecide.RememberthatURLsformanufacturersandsourcesofsupplyarealllistedintheappendix.Iamassumingthatyoualreadyhavesomecommonlyusedworkshopbasics,suchasanelectricdrill.Essential:Pencil-type15-wattsolderingiron
ExamplesareRadioShackpart64-2051,McMaster-Carrcatalogitem7016A34,orXytronicmodel252.SeeFigure3-1.Solderingironsratedat15wattsarelesscommonthanthosethatdeliver25wattsormore.Still,the15-wattsizeisdesirableforthesmall-scaleworkyou’llbedoing,andgreatlyreducestheriskofdamagingcomponentsbyinflictingexcessheat.
Figure3-1.Thelowwattageofthispencil-stylesolderingironenablesyoutouseitsafelyonsensitivecomponents,andthesharptiphelpstoapplyheatselectively.
Whencomparingprices,rememberthataplatedtip,whichcostsalittlemore,willlastlonger,willbeeasiertokeepclean,andwillconductheatmorereliablythanaplaincoppertip.Ifthemanufacturer’sspecificationdoesn’tmentionaplatedtip,thesolderingironprobablydoesn’thaveone.
Essential:General-dutysolderingiron,30to40wattsAlthoughmostoftheprojectsinthisbookentailsmall,heat-sensitivecomponentsandthinwire,atsomepointyou’relikelytowanttomakeasolderjointwithlargercomponentsand/orthickerwire.A15-wattsolderingironwillbeunabletodeliverenoughheat.Youshouldconsiderhavingalargersolderingironinreserve,especiallybecausetheyarerelativelyinexpensive.Personally,IliketheWellerTherma-Boost,showninFigure3-2,becauseithasanextrabuttonthatdeliversmoreheatondemand.Thisisusefulwhenyouwanttheirontogethotquickly,orifyouaretryingtosolderverythickwire,whichabsorbsalotofheat.
Figure3-2.Thishigher-wattagesolderingirondeliverstheadditionalheatnecessaryforthickerwireorlargercomponents.Thediscolorationquicklyoccursasaresultofeverydayuseandhasnoeffectonthecapabilityoftheiron,aslongasthetipofitisclean.
Ifyoucan’tfindordon’tliketheWeller,almostany30-wattor40-wattsolderingironwilldo.CheckeBayoryourlocalhardwarestore.
Essential:HelpinghandTheso-called“helpinghand”(or“thirdhand”)hastwoalligatorclipsthatholdcomponentsorpiecesofwirepreciselyinpositionwhileyoujointhemwithsolder.Someversionsofthe“helpinghand”alsofeatureamagnifyinglens,awirespiralinwhichyoucanrestyoursolderingiron,andalittlespongethatyouusetocleanthetipofyourironwhenitbecomesdirty.Theseadditionalfeaturesaredesirable.Helpinghandsareavailablefromallelectronicshobbysources.ExamplesarethecatalogitemHH55fromElencoormodel64-0079fromRadioShack.SeeFigure3-3.
Figure3-3.Thehelpinghandisfittedwithtwoalligatorclipstoholdyourwork.Themetalspiralisasafeplacetoholsterahotsolderingiron,andyouusethespongetowipeitstip.
Essential:MagnifyinglensNomatterhowgoodyoureyesare,asmall,handheld,powerfulmagnifyinglensisessentialwhenyouarecheckingsolderjointsonperforatedboard.Thethree-lenssetinFigure3-4isdesignedtobeheldclosetoyoureye,andismorepowerfulthanthelargelensona“helpinghand.”ThefoldinglensinFigure3-5standsonyourworkbenchforhands-freeoperation.BothareavailablefromRadioShackandsimilaritemsarestockedbyartsupplystoresandhobbyshops.Plasticlensesarequiteacceptableifyoutreatthemcarefully.
![Page 88: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/88.jpg)
Figure3-4.Aslongasyoutreatitcarefully,acheapsetofplasticmagnifyinglensesisperfectlyacceptable.Handheldmagnificationisessentialforinspectingthesolderjointsthatyoumakeonperforatedboard.
Figure3-5.Thiskindoffoldingmagnifiercanstandonyourdesktopandisusefulforcheckingpartnumbersontinycomponents.
Essential:Clip-onmetertestleadsTheprobesthatcamewithyourmultimeterrequireyoutoholdthemincontactwhileyoumakeareading.Thisrequiresbothhands,preventingyoufromdoinganythingelseatthesametime.Whenyouuseapairof“minigrabber”probeswithlittlespring-loadedclipsattheend,youcanattachtheCommon(negative)leadfromyourmetertothenegativesideofyourcircuitandleaveitthere,whileyoutouchorattachthepositiveprobeelsewhere.ThePomonamodel6244-48-0(showninFigure3-6)fromMeterSuperstoreandsomeothersuppliersiswhatyouneed.Ifyouhavetroublefindingitoryouobjecttothecost,youmayconsidermakingyourownbybuyingacoupleof“bananaplugs”(suchasRadioShackpart274-721)thatwillfitthesocketsonyourmeter,andthenuse16-gaugeorthickerstrandedwiretoconnecttheplugswithICtestclips,suchasKobiconn13IC331orRadioShack“minihookclips,”partnumber270-372.SeeFigures3-7and3-8.
Figure3-6.These“minigrabber”add-onsformeterleadsmakeitmucheasiertomeasurevoltageorcurrent.Pushthespring-loadedbutton,andalittlecopperhookslidesout.Attachittoawire,releasethebutton,andyouhaveyourhandsfreeforothertasks.It’samysterythatmetersarenotsupplied
withthesegrabbersasstandardequipment.
Figure3-7.Tomakeyourownminigrabbermeterleads,firstattachabananaplugtoawirebyslidingthewirethroughthecap,intotheplug,andoutthroughaholein
theside.
Figure3-8.Thenscrewacollarovertheprotrudingpieceofwire,andscrewonthecap.Theotherendofthewireissolderedtoaprobe.
Essential:HeatgunAfteryoujointwowireswithsolder,youoftenneedtoinsulatethem.Electricaltape,sometimescalledinsulatingtape,ismessyandtendstocomeunstuck.You’llbeusingheat-shrinktube,whichformsasafe,permanentsheatharoundabare-metaljoint.Tomakethetubeshrink,useaheatgun,whichislikeaverypowerfulhairdryer.They’reavailablefromanyhardwaresupplysource,andIsuggestyoubuythecheapestoneyoucanfind.SeeFigure3-9.
![Page 89: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/89.jpg)
Figure3-9.Likeanoverpoweredhairdryer,theheatgunisusedwithheat-shrinktubingtocreateasnug,insulatedsheatharoundbarewire.
Essential:SolderpumpThislittlegadgetsucksuphot,meltedsolderwhenyouaretryingtoremoveasolderjointthatyoumadeinthewrongplace.AvailablefromAllElectronics(catalogitemSSR-1)orRadioShack64-2086.SeeFigure3-10.
Essential:DesolderingwickAlsoknownasdesolderingbraid.SeeFigure3-11.Youusethistosoakupsolder,inconjunctionwiththeSolderPump.AvailablefromAllElectronics(catalogitemSWK)orRadioShack(part64-2090).
Essential:MiniaturescrewdriversetDinkylittleelectronicpartsoftenhavedinkylittlescrewsinthem,andifyoutrytousethewrongsizeofscrewdriver,you’lltendtomashtheheadsofthescrews.IliketheStanleyprecisionset,partnumber66-052,showninFigure3-12.ButanysetwilldoaslongasithasbothsmallPhillipsandstraight-bladescrewdrivers.
Recommended:SolderingstandLikeaholsterforagun,yourestyoursolderingironinthisstandwhentheironishotbutnotonuse.Examplesarecatalogitem50B-205fromAllElectronics,RadioShackmodel64-2078,orcheckeBay.SeeFigure3-13.Thisitemmaybebuiltintothehelpinghand,butyouneedanextraoneforyoursecondsolderingiron.
Figure3-10.Toremoveasolderjoint,youcanheatthesolderuntilit’sliquid,thensuckitupintothissqueezablerubberbulb.
Figure3-11.Anadditionaloptionforremovingliquidsolderistosoakitupinthiscopperbraid.
Figure3-12.Asetofsmallscrewdriversisessential.
Figure3-13.Asafeandsimpleadditionalstandforahotsolderingiron.
Recommended:MiniaturehandsawIassumethatyouwillwanttomountafinishedelectronicsprojectinadecent-lookingenclosure.Consequently,youarelikelytoneedtoolstocut,shape,andtrimthinplastic.Forexample,youmaywanttocutasquareholesothatyoucanmountasquarepowerswitchinit.Powertoolsarenotsuitableforthiskindofdelicatework.Aminiaturehandsaw(a.k.a.a“hobbysaw”)isidealfortrimmingthingstofit.X-Actomakesarangeoftinysawblades.Isuggestthe#15blade,plusthehandlethatitfitsin,showninFigure3-14.AvailableonlinefromTowerHobbies,Hobbylinc,ArtCity,andmanyotherarts/craftssources.AlsolookforthelargerX-Actosawblade,#234or#239,whichyoucanuseforcuttingperforatedboard.
![Page 90: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/90.jpg)
Figure3-14.X-Actomakesarangeofsmallsawbladesthatareidealforcuttingsquareholestomountcomponentsinplasticpanels.
Recommended:MiniatureviseAminiaturevisecandothingsthatthehelpinghandcannot.IuseminewhenI’msawingsmallpiecesofplasticandasadeadweighttoanchorapieceofperforatedboardwhileI’mworkingonit.SeeFigure3-15.
Figure3-15.Thisone-inchviseisavailablefromtheMcMaster-Carrcatalog.
Lookforacast-ironvisethatislistedasbeing1inchorslightlylarger,availablefromMegahobby,eBay,andotherarts/craftssources.AlsoconsiderthePanaVise,whichhasatiltingheadtoallowyoutoturnyourworktoanyangle.
Recommended:DeburringtoolAdeburringtoolinstantlysmoothesandbevelsanyroughedge(whenyouhavesawnordrilledapieceofplastic,forinstance)andalsocanenlargeholesslightly.Thismaybenecessarybecausesomecomponentsaremanufacturedtometricsizes,whichdon’tfitintheholesthatyoudrillwithAmericanbits.Yoursmalllocalhardwarestoremaynotstockdeburringtools,buttheyareveryinexpensivelyavailablefromSears,McMaster-Carr,KVMTools,orAmazon.SeeFigure3-16.
Figure3-16.Thiscunninglittleblade,safety-tippedwitharoundbumpontheend,removesroughedgesfromsawcutswithasinglestroke,andcanenlargeholesthatarealmostbigenough—butnotquite.
Optional:Hand-crankedcountersinkYouneedacountersinktobeveltheedgesofscrewholestoacceptflat-headedscrews.Ifyouuseacountersinkbitinanelectricdrill,itwon’tgiveyouprecisecontrolwhenyou’reworkingwiththin,softplastic.Handheldcountersinksthatyougraspandturnlikeascrewdriverareeasytofind,butMcMaster-Carr(catalogitem28775A61)istheonlysourceI’vefoundforahand-crankedtoolthatismuchquickertouse.Itcomeswithasetofbits,asshowninFigure3-17.
Optional:PickandhooksetMadebyStanley,partnumber82-115,availablefromAmazonandhardwarestores.Youcanfindimportedimitationsforafewdollarsless.SeeFigure3-18.
Optional:CalipersThesemayseemlikealuxury,butareusefulformeasuringtheexternaldiameterofaroundobject(suchasthescrewthreadonaswitchorapotentiometer)ortheinternaldiameterofahole(intowhichyoumaywantaswitchorpotentiometertofit).IlikeMitutoyocalipers,andthelow-endmodel505-611(showninFigure3-19)doeseverythingIneed.Youcanfindcheaperbrands,buteconomizingonprecisionmeasuringtoolsmaynotbeawisepolicyinthelongterm.Themanufacturer’ssitewillshowyoualltheiravailablemodels,afterwhichyoucanGoogle“Mitutoyo”tofindretailsources.
Figure3-17.Youspinthiscountersinktoollikeahandcranktoaddjusttherightamountofbeveltoahole,sothatitwillaccommodateaflat-headscrew.
![Page 91: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/91.jpg)
Figure3-18.Thispick-and-hooksetisusefulinmanyunexpectedways.
Figure3-19.Caliperscanbedigital(whichautomaticallyconvertfrommillimetersto1/64inchto1/1,000inch),oranaloglikethese(soyouneverneedtoworryaboutadeadbattery).
SuppliesSolder
Thisisthestuffthatyouwillmelttojoincomponentstogetheronapermanent(wehope)basis.Youneedsomeverythinsolder,size0.022inches,forverysmallcomponents,andthickersolder,0.05inches,forheavieritems.Avoidbuyingsolderthatisintendedforplumbers,orforcraftpurposessuchascreatingjewelry.ArangeofsolderthicknessesisshowninFigure3-20.Youwanttomakesuretogetlead-freesolder.
Figure3-20.Spoolsofsolderinvariousthicknesses.
Electronicssolderhasanonacidicrosincorethatisappropriateforelectroniccomponents.Rollsofsolderareavailablefromallhobby-electronicssourcesincludingAllElectronics,RadioShack,andJameco,orsearchfor“electronicsolder”onAmazon.
WireYou’llneedsomestrandedwiretomakeflexibleexternalconnectionswiththecircuitthatyou’llbebuilding.Lookfor22-gaugestrandedhookupwire,inred,black,andgreen,10feet(minimum)ofeach.IfyouwanttoinstalltheintrusionalarmaftercompletingthatprojectinExperiment15,you’llneedwhite-insulatedtwo-conductorwireofthetypesoldfordoorbellsorfurnacecontrols.ThisisavailablebythefootfromLowe’s,HomeDepot,AceHardware,andsimilarstores.You’lldecidehowmuchtobuyafteryoumeasurethedistancesbetweenthemagneticsensorswitchesthatyoudecidetoinstall.
Heat-shrinktubeForuseinconjunctionwithyourheatgun,describedpreviously.You’llneedarangeofsizesinanycolorsofyourchoice.SeeFigure3-21.CheckRadioShackpart278-1627,otherelectronicssuppliers,oryourlocalhardwarestore.Priceswillvarywidely.Youcanbuythecheapest.
CopperalligatorclipsTheseabsorbheatwhenyouaresolderingdelicatecomponents.TheMuellerBU-30Cisafull-sizesolidcopperalligatorclipformaximumheatabsorption.RadioShacksellssmallerclips(partnumber270-373,showninFigure3-22)thataresuitablefortinycomponents.
Figure3-21.Slideheat-shrinktubingoverabarejointandapplyheatfromaheatguntomakeatightinsulatingsealaroundthejoint.
![Page 92: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/92.jpg)
Figure3-22.Thesesmallclipsabsorbheattoprotectcomponentswhenyou’resolderingthem.
PerforatedboardWhenyou’rereadytomoveyourcircuitfromabreadboardtoamorepermanentlocation,you’llwanttosolderittoapieceofperforatedboard,oftenknownas“prototypingboard”butalsocalled“perfboard.”Youneedthetypethathascopperstripsetchedontotheback,inexactlythesame“breadboardlayout”astheconductorshiddeninsideabreadboard,sothatyoucanretainthesamelayoutofyourcomponentswhenyousolderthemintoplace.ExamplesareRadioShackpart276-150(showninFigure3-23)forsmallprojectsandpart276-170(inFigure3-24)forlargerprojects,suchasExperiment15.
Figure3-23.Thisperforatedboardhasapatternofcoppertracessimilartothepatterninsideabreadboard,sothatyoucanlayoutthecomponentswithminimalriskofwiringerrors,whenyou’rereadytocreateapermanentlysolderedversionofyourproject.
Forverysmallprojectsinwhichyouwillconnectcomponentsusingtheirwiresalone,youneedperfboardthatisn’tetchedwithcopperstripsconnectingtheholes.IliketheTwinIndustries7100range(availablefromMouser.com)orVectorboardfromNewarkElectronics,showninFigure3-25.Youuseasawtocutoutassmallapieceasyouneed.CheaperoptionsareRadioShackpart276-147(showninFigure3-26),orPC-1fromAllElectronics.Thesehavelittlecoppercirclesaroundeachholethatarenotnecessaryforourpurposes,butnotaproblem,either.
Figure3-24.Alargerexampleofperforatedboardwithbreadboardgeometry.
Figure3-25.Plainperforatedboard(withnocoppertraces)canbeusedformountingcomponentswhenyouwanttodopoint-to-pointwiring.
![Page 93: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/93.jpg)
Figure3-26.Asmallpieceofperforatedboardwithindividualcoppersolderpadstoassistyouinmountingcomponents.
PlywoodWhenyouuseasolderingiron,hotdropsofsoldertendtofallontoyourtableorworkbench.Thesoldersolidifiesalmostinstantly,canbedifficulttoremove,andwillleaveascar.Considerusinga2-footsquareofhalf-inchplywoodtoprovidedisposableprotection.YoucanbuyitprecutatHomeDepotorLowe’s.
MachinescrewsTomountcomponentsbehindapanel,youneedsmallmachinescrews(or“bolts”).Theylookniceiftheyhaveflatheadsthatfitflushagainstthepanel.Isuggeststainless-steelmachinescrews,#4size,in1/2-,5/8-,3/4-,and1-inchlengths,100ofeach,plus400washersand400#4locknutsofthetypethathavenyloninserts,sothattheywon’tworkloose.CheckMcMaster-Carrforalargeandreasonablypricedselection.
ProjectboxesAprojectboxisjustasmallbox(usuallyplastic)witharemovablelid.Youmountyourswitches,potentiometers,andLEDsinholesthatyoudrillthroughthebox,andyouattachyourcircuitonaperforatedboardthatgoesinsidethebox.SearchAllElectronicsfor“projectbox”orRadioShackfor“projectenclosure.”Youneedaboxmeasuringapproximately6incheslong,3incheswide,and2incheshigh,suchasRadioShackpart270-1805.Anythingsimilarwilldo.Isuggestyoubuyacoupleothersizesaswell,astheywillbeusefulinthefuture.
ComponentsPowerplugs,sockets,andbindingposts
Afteryoufinishaprojectandputitinabox,you’llneedaconvenientwaytosupplyitwithpower.Buyyourselfapairofinsulatedbindingposts,suchasRadioShackpart274-661,showninFigure3-27.Alsoobtainapanel-mountedpowerjack,sizeN,suchasRadioShackpart274-1583,andDCpowerplug,sizeN,suchasRadioShack274-1573.Theplug-and-socketpairispicturedinFigure3-28.Finally,youwillneedinterconnectsthataresizedtofitaperforatedboardthatisdrilledatintervalsof1/10inch.Sometimesknownas“singleinlinesocketsandheaders,”butalsoknownas“boardmountsocketsandpinstripheaders,”theycomeinstripsof36ormore,andyoucansnipoffasmanyasyouneed.ExamplesareMill-Maxpartnumbers800-10-064-10-001000and801-93-050-10-001000,or3Mpartnumbers929974-01-36-RKand929834-01-36-RK.Youcanbuythemfromtheusualelectronicssuppliers.Figure3-29showsheadersbeforeandafterbeingsnappedintosmallsections.Makesurethattheinterconnectshaveaterminalspacingof0.1inch.
Figure3-27.Theseterminals,alsoknownasbindingposts,enableasolderlessconnectionwithwiresthathavestrippedends.Alsoavailableinblack.
Figure3-28.Thesocketontherightcanbemountedinaprojectboxtoreceivepowerfromtheplugontheleft.
Figure3-29.Singleinlinesockets(top)andheaders(middle)allowyoutomakeverycompactplug-and-socketconnectionstoaPCboard.Theycanbesawn,cut,orsnappedintosmallersections(bottom).Theterminalsare0.1inchapart.
BatteryAfteryoucompleteExperiment15attheendofthissectionofthebook,ifyouwanttousetheprojectonapracticalbasis,you’llneeda12-voltbattery.Searchonlinefor“12vbattery”andyou’llfindmanysealed,rechargeablelead-acidbatteriesthataredesignedforalarmsystems,somemeasuringassmallas1×2×3-inchandcostingunder$10.Youneedachargerwithit,whichwillprobablycostyouabout$10.
SwitchesandrelaysYouwillneedthesameDPDTrelayandthesameSPDTtoggleswitchthatwerementionedinChapter2shoppinglist.ForExperiment15,you’llneedmagneticswitchesthatyoucanapplytodoorsorwindows,suchastheDirectedmodel8601,availablefromdozensofsourcesonline.AlsoyouwillneedaDPDTpushbuttonswitch,ON-(ON)type,withsolderterminals.ExamplesaremodelMPG206R04byTycoormodelMB2061SS1W01-RObyNKK(withoptionalcap).OrsearcheBayfor“DPDTpushbutton.”
DiodesBuyatleasthalf-a-dozenred5mmLEDsratedforapproximately2volts,suchastheOptekpartnumberOVLFR3C7,LumexpartnumberSSL-LX5093IT,orAvagopartHLMP-D155.Buyhalf-a-dozensimilargreenLEDsatthesametime.Inaddition,you’llneedasignaldiode,type1N4001(anybrandwilldo).Figure3-30showsanexample,highlymagnified.They’recheap,andlikelytobeusefulinthefuture,sobuy10ofthem.
![Page 94: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/94.jpg)
Figure3-30.This1N4001diodeisabout1/4inchlongandcanhandleupto50volts.
LoudspeakerTocompletetheprojectinExperiment15,you’llneedaloudspeakersmallenoughtofitinsideyourprojectboxbutlouderthanthe1-inchspeakerthatyouusedpreviously.Itshouldbe2inchesor2.5inches(50to60mm)indiameter.Ifyoucanfinda100Ωspeaker,itwillgiveyoumoreoutput,butan8Ωspeakerwillbeacceptable.
![Page 95: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/95.jpg)
Experiment12:JoiningTwoWiresTogetherYouradventureintosolderingbeginswiththeprosaictaskofjoiningonewiretoanother,butwillleadquicklytocreatingafullelectroniccircuitonperforatedboard.Solet’sgetstarted!Youwillneed:
30-wattor40-wattsolderingiron15-wattpencil-typesolderingironThinsolder(0.022inchesorsimilar)Mediumsolder(0.05inchesorsimilar)Wirestrippersandcutters“Helpinghand”gadgettoholdyourworkShrink-wraptubing,assortedHeatgunSomethingtoprotectyourworkareafromdropsofsolder
SolderingIronsGetHot!Pleasetakethesebasicprecautions:Useaproperstand(suchastheoneincorporatedinyourhelpinghands)toholdyoursolderingiron.Don’tleaveitlyingonaworkbench.Ifyouhaveinfantsorpets,rememberthattheymayplaywith,grab,orsnagthewiretoyoursolderingiron.Theycouldinjurethemselves(oryou).Becarefulnevertorestthehottipoftheirononthepowercordthatsupplieselectricitytotheiron.Itcanmelttheplasticinsecondsandcauseadramaticshortcircuit.Ifyoudropasolderingiron,don’tbeaheroandtrytocatchit.Mostlikelyyouwillgrabthehotpart,whichhurts.(Ispeakfromexperience.)Whenyouburnyourhand,youwillinstinctivelyletgooftheiron,soyoumayaswellletitdropfreelywithouttheintermediatestepofburningyourselfwhileit’sonitswaytothefloor.Naturally,youshouldpickitupquicklyafteritdoeshitthefloor,butbythenyouwillhavegainedthenecessarytimeinwhichtomakeasensibledecisiontograbitbythecoolend.Alwaysbearinmindthatothersinyourhomearemoreatriskofhurtingthemselvesonasolderingironthanyouare,becausetheywon’tknowthatit’shot.Mostsolderingironshavenowarninglightstotellyouthatthey’repluggedin.Asageneralrule,alwaysassumethatasolderingironishot,evenifit’sunplugged.Itmayretainsufficientheattoburnyouforlongerthanyouexpect.
YourFirstSolderJointWe’llstartwithyourgeneral-dutysolderingiron—theoneratedfor30or40watts.Plugitin,leaveitsafelyinitsholder,andfindsomethingelsetodoforfiveminutes.Ifyoutrytouseasolderingironwithoutgivingittimetogetfullyhot,youwillnotmakegoodjoints.Striptheinsulationfromtheendsoftwopiecesof22-gaugesolidwireandclamptheminyourhelpinghandsothattheycrosseachotherandtoucheachother,asshowninFigure3-31.Tomakesurethattheironisready,trytomelttheendofathinpieceofsolderonthetipoftheiron.Thesoldershouldmeltinstantly.Ifitmeltsslowly,theironisn’thotenoughyet.
Figure3-31.Ahelpinghandworkaidisshownhereholdingtwowireswiththeirstrippedendstouching.Themagnifyingglasshasbeenhingedoutoftheway.
Nowfollowthesesteps(showninFigures3-32through3-36):1.Makesurethetipofthesolderingironisclean(wipeitonthemoistenedspongeinthebaseofyourhelpinghandifnecessary),thentouchitagainsttheintersectionofthewiressteadilyforthreesecondstoheatthem.Ifyouhavehardtapwater,usedistilledwatertowetthespongetoavoidabuildupofmineraldepositsonthetipofyoursolderingiron.
2.Whilemaintainingtheironinthisposition,feedalittlesolderontotheintersectionofthewires,alsotouchingthetipofthesolderingiron.Thus,thetwowires,thesolder,andthetipoftheironshouldallcometogetheratonepoint.Thesoldershouldspreadoverthewireswithinanothertwoseconds.
3.Removetheironandthesolder.Blowonthejointtocoolit.Within10seconds,itshouldbecoolenoughtotouch.4.Unclampthewiresandtrytotugthemapart.Tughard!Iftheydefeatyourbestattemptstoseparatethem,thewiresareelectricallyjoinedandshouldstayjoined.Ifyoudidn’tmakeagoodjoint,youwillbeabletoseparatethewiresrelativelyeasily,probablybecauseyoudidn’tapplyenoughheatorenoughsoldertoconnectthem.
ThereasonIaskedyoutobeginbyusingthehigher-poweredsolderingironisthatitdeliversmoreheat,whichmakesiteasiertouse.
![Page 96: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/96.jpg)
Figure3-32.
Figure3-33.
Figure3-34.
Figure3-35.Thisandtheprecedingthreefiguresillustratefourstepstomakingasolderjoint:applyheattothewires,bringinthesolderwhilemaintainingtheheat,waitforthesoldertostarttomelt,andwaitamomentlongerforittoformacompletelymoltenbead.Thewholeprocessshould
takebetween4and6seconds.
Figure3-36.Thecompletedjointshouldbeshiny,uniform,androundedinshape.
BACKGROUNDSolderingmythsMyth#1:Solderingisverydifficult.
Millionsofpeoplehavelearnedhowtodoit,andstatistically,youareunlikelytobelesscoordinatedthanallofthem.Ihavealifelongproblemwithatremorinmyhandsthatmakesitdifficultformetoholdsmallthingssteadily.Ialsogetimpatientwithrepetitivedetailwork.IfIcansoldercomponents,almostanyoneshouldbeableto.
Myth#2:Solderinginvolvespoisonouschemicals.Modernsoldercontainsnolead.Youshouldavoidinhalingthefumesforprolongedperiods,butthatalsoappliestoeverydayproductssuchasbleachandpaint.Ifsolderingwasasignificanthealthhazard,weshouldhaveseenahighdeathrateamongelectronicshobbyistsdecadesago.
Myth#3:Solderingishazardous.Asolderingironislesshazardousthanthekindofironthatyoumightusetoironashirt,becauseitdeliverslessheat.Infact,inmyexperience,solderingissaferthanmostactivitiesinatypicalhomeorbasementworkshop.Thatdoesn’tmeanyoucanbecareless!
SolderingalternativesAsrecentlyasthe1950s,connectionsinsideelectronicappliancessuchasradiosetswerestillbeinghand-solderedbyworkersonproductionlines.Butthegrowthoftelephoneexchangescreatedaneedforafasterwaytomakelargenumbersofrapid,reliablepoint-to-pointwiringconnections,and“wirewrap”becameaviablealternative.Inawire-wrappedelectronicsproject,componentsaremountedonacircuitboardthathaslong,gold-plated,sharp-corneredsquarepinsstickingoutoftherear.Specialsilver-platedwireisused,withaninchofinsulationstrippedfromitsends.Amanualorpower-drivenwire-wraptooltwirlstheendofawirearoundoneofthepins,applyingsufficienttensionto“cold-weld”thesoftsilverplatingofthewiretothepin.Thewrappingprocessexertssufficientpressuretomakeaveryreliablejoint,especiallyas7to9turnsofwireareapplied,eachturntouchingallfourcornersofthepin.Duringthe1970sand1980s,thissystemwasadoptedbyhobbyistswhobuilttheirownhomecomputers.Awire-wrappedcircuitboardfromahand-builtcomputerisshowninFigure3-37.ThetechniquewasusedbyNASAtowirethecomputerintheApollospacecraftthatwenttothemoon,buttoday,wire-wrappinghasfewcommercialapplications.Thewidespreadindustrialuseof“through-hole”components,suchasthechipsonearlydesktopcomputers,encourageddevelopmentofwavesoldering,inwhichawaveorwaterfallofmoltensolderisappliedtotheundersideofapreheatedcircuitboardwherechipshavebeeninserted.Amaskingtechniquepreventsthesolderfromstickingwhereitisn’twanted.
![Page 97: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/97.jpg)
Today,surface-mountcomponents(whicharesignificantlysmallerthantheirthrough-holecounterparts)aregluedtoacircuitboardwithasolderpaste,andtheentireassemblyisthenheated,meltingthepastetocreateapermanentconnection.
Figure3-37.Thispictureshowssomeofthewire-wrappinginSteveChamberlin’scustom-built,retro8-bitCPUandcomputer.“Backintheday,”connectingsuchanetworkofwireswithsolderjointswouldhavebeenundulytime-consumingandpronetofaults.Photocredit:SteveChamberlin.
TOOLSEightmostcommonsolderingerrors1.Notenoughheat.ThejointlooksOK,butbecauseyoudidn’tapplyquiteenoughheat,thesolderdidn’tmeltsufficientlytorealignitsinternalmolecularstructure.Itremainedgranularinsteadofbecomingasolid,uniformblob,andyouendupwitha“dryjoint,”alsoknownasa“coldjoint,”whichwillcomeapartwhenyoupullthewiresawayfromeachother.Reheatthejointthoroughlyandapplynewsolder.Aleadingcauseofunderheatedsolderisthetemptationtousethesolderingirontocarrysoldertothejoint.Thisresultsinthecoldwiresreducingthetemperatureofthesolder.Whatyoushoulddoistouchthesolderingirontoheatthewiresfirst,andthenapplythesolder.Thisway,thewiresarehotandhelptomeltthesolder,whichwantstosticktothem.Becausethisissuchauniversalproblem,I’llrepeatmyself:Nevermeltsolderonthetipoftheironandthenuseittocarrythesoldertothejoint.Youdon’twanttoputhotsolderoncoldwires.Youwanttoputcoldsolderonhotwires.
2.Toomuchheat.Thismaynothurtthejoint,butcandamageeverythingaroundit.Vinylinsulationwillmelt,exposingthewireandraisingtheriskofshortcircuits.Youcaneasilydamagesemiconductors,andmayevenmelttheinternalplasticcomponentsofswitchesandconnectors.Damagedcomponentsmustbedesolderedandreplaced,whichwilltaketimeandtendstobeabighassle(see“Tools:Desoldering”onpage109foradvice).
3.Notenoughsolder.Athinconnectionbetweentwoconductorsmaynotbestrongenough.Whenjoiningtwowires,alwayschecktheundersideofthejointtoseewhetherthesolderpenetratedcompletely.
4.Movingthejointbeforethesoldersolidifies.Youmaycreateafracturethatyouwon’tnecessarilysee.Itmaynotstopyourcircuitfromworking,butatsomepointinthefuture,asaresultofvibrationorthermalstresses,thefracturecanseparatejustenoughtobreakelectricalcontact.Trackingitdownwillthenbeachore.Ifyouclampcomponentsbeforeyoujointhem,oruseperforatedboardtoholdthecomponentssteady,youcanavoidthisproblem.
5.Dirtorgrease.Electricalsoldercontainsrosinthatcleansthemetalthatyou’reworkingwith,butcontaminantscanstillpreventsolderfromsticking.Ifanycomponentlooksdirty,cleanitwithfinesandpaperbeforejoiningit.
6.Carbononthetipofyoursolderingiron.Theirongraduallyaccumulatesflecksofblackcarbonduringuse,andtheycanactasabarriertoheattransfer.Wipethetipoftheirononthelittlespongemountedinthebaseofyoursolderingironstandoryourhelpinghand.
7.Inappropriatematerials.Electronicsolderisdesignedforelectroniccomponents.Itwillnotworkwithaluminum,stainlesssteel,orvariousothermetals.Youmaybeabletomakeitsticktochrome-plateditems,butonlywithdifficulty.
8.Failuretotestthejoint.Don’tjustassumethatit’sOK.Alwaystestit,byapplyingmanualforceifyoucan(seeFigures3-38and3-39fortheidealprotocol)or,ifyoucan’tgetagriponthejoint,slipascrewdriverbladeunderitandflexitjustalittle,orusesmallplierstotrytopullitapart.Don’tbeconcernedaboutruiningyourwork.Ifyourjointdoesn’tsurviveroughtreatment,itwasn’tagoodjoint.
Oftheeighterrors,dry/coldjointsarebyfartheworst,becausetheyareeasytomakeandcanlookOK.
Figure3-38.Testresultofabadsolderjoint.
![Page 98: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/98.jpg)
Figure3-39.Testresultofagoodsolderjoint.
YourSecondSolderJointTimenowtotryyourpencil-stylesolderingiron.Onceagain,youmustleaveitpluggedinforagoodfiveminutestomakesureit’shotenough.Inthemeantime,don’tforgettounplugyourothersolderingiron,andputitsomewheresafewhileitcools.ThistimeI’dlikeyoutoalignthewiresparallelwitheachother.Joiningthemthiswayisalittlemoredifficultthanjoiningthemwhentheycrosseachother,butit’sanecessaryskill.Otherwise,youwon’tbeabletoslideheat-shrinktubingoverthefinishedjointtoinsulateit.Figures3-40through3-44showasuccessfuljointofthistype.Thetwowiresdonothavetomakeperfectcontactwitheachother;thesolderwillfillanysmallgaps.Butthewiresmustbehotenoughforthesoldertoflow,andthiscantakeanextrafewsecondswhenyouusethelow-wattagepencil-styleiron.Besuretofeedthesolderinasshowninthepictures.Remember:don’ttrytocarrythesoldertothejointonthetipoftheiron.Heatthewiresfirst,andthentouchthesoldertothewiresandthetipoftheiron,whilekeepingitincontactwiththewires.Waituntilthesolderliquifies,andyouwillseeitrunningeagerlyintothejoint.Ifthisdoesn’thappen,bemorepatientandapplytheheatforalittlelonger.
Figure3-40.
Figure3-41.
Figure3-42.
Figure3-43.Thisandtheprecedingthreefiguresshowhowjoiningtwowiresthatareparallelismoredifficult,andthelow-wattage,pencil-typesolderingironwillrequirelongertoheatthemsufficientlyforagoodjoint.Thinnersoldercanbeused.
Figure3-44.Thefinishedjointhasenoughsolderforstrength,butnotsomuchsolderthatitwillpreventheat-shrinktubingfromslidingoverit.
TOOLSDesolderingDesolderingismuch,muchharderthansoldering.Twosimpletoolsareavailable:
Suctionpump.First,youapplythesolderingirontomakethesolderliquid.Thenyouusethissimplegadgettotrytosuckup
![Page 99: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/99.jpg)
asmuchoftheliquidaspossible.Usuallyitwon’tremoveenoughmetaltoallowyoutopullthejointapart,andyouwillhavetotrythenexttool.ReferbacktoFigure3-10.Desolderingwickorbraid.Desolderingwick,alsoknownasbraid,isdesignedtosoakupthesolderfromajoint,butagain,itwon’tcleanthejointentirely,andyouwillbeintheawkwardpositionoftryingtousebothhandstopullcomponentsapartwhilesimultaneouslyapplyingheattostopthesolderfromsolidifying.ReferbacktoFigure3-11.
Idon’thavemuchadviceaboutdesoldering.It’safrustratingexperience(atleast,Ithinkso)andcandamagecomponentsirrevocably.
THEORYSolderingtheoryThebetteryouunderstandtheprocessofsoldering,theeasieritshouldbeforyoutomakegoodsolderjoints.Thetipofthesolderingironishot,andyouwanttotransferthatheatintothejointthatyouaretryingtomake.Inthissituation,youcanthinkoftheheatasbeinglikeafluid.Thelargertheconnectionisbetweenthesolderingironandthejoint,thegreaterthequantityofheat,persecond,thatcanflowthroughit.Forthisreason,youshouldadjusttheangleofthesolderingironsothatitmakesthewidestpossiblecontact.Ifittouchesthewiresonlyatatinypoint,you’lllimittheamountofheatflow.Figures3-45and3-46illustratethisconcept.Oncethesolderstartstomelt,itbroadenstheareaofcontact,whichhelpstotransfermoreheat,sotheprocessacceleratesnaturally.Initiatingitisthetrickypart.Theotheraspectofheatflowthatyoushouldconsideristhatitcansuckheatawayfromtheplaceswhereyouwantit,anddeliverittoplaceswhereyoudon’twantit.Ifyou’retryingtosolderaveryheavypieceofcopperwire,thejointmaynevergethotenoughtomeltthesolder,becausetheheavywireconductsheatawayfromthejoint.Youmayfindthatevena40-wattironisn’tpowerfulenoughtoovercomethisproblem,andifyouaredoingheavywork,youmayneedamorepowerfuliron.Asageneralrule,ifyoucan’tcompleteasolderjointin10seconds,youaren’tapplyingenoughheat.
Figure3-45.Withonlyasmallsurfaceareaofcontactbetweentheironandtheworkingsurface,aninsufficientamountofheatistransferred.
Figure3-46.Alargerareaofcontactbetweenthesolderingironanditstargetwillgreatlyincreasetheheattransfer.
AddingInsulationAfteryou’vesucceededinmakingagoodinlinesolderconnectionbetweentwowires,it’stimefortheeasypart.Choosesomeheat-shrinktubingthatisjustbigenoughtoslideoverthejointwithalittlebitofroomtospare.
Figure3-47.Othermembersofyourfamilyshouldunderstandthatalthoughaheatgunlookslikeahairdryer,appearancesmaybedeceptive.
HeatGunsGetHot,Too!Noticethechromedsteeltubeatthebusinessendofyourheatgun.Steelcostsmorethanplastic,sothemanufacturermusthaveputitthereforagoodreason—andthereasonisthattheairflowingthroughitbecomessohotthatitwouldmeltaplastictube.Themetaltubestayshotenoughtoburnyouforseveralminutesafteryou’veusedit.And,asinthecaseofsolderingirons,otherpeople(andpets)arevulnerable,becausetheywon’tnecessarilyknow
![Page 100: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/100.jpg)
thattheheatgunishot.Mostofall,makesurethatnooneinyourhomeevermakesthemistakeofusingaheatgunasahairdryer(Figure3-47).Thistoolisjustalittlemorehazardousthanitappears.
Slidethetubingalonguntilthejointiscenteredunderit,holditinfrontofyourheatgun,andswitchonthegun(keepingyourfingersawayfromtheblastofsuperheatedair).Turnthewiresothatyouheatbothsides.Thetubingshouldshrinktightaroundthejointwithinhalfaminute.Ifyouoverheatthetubing,itmayshrinksomuchthatitsplits,atwhichpointyoumustremoveitandstartover.Assoonasthetubingistightaroundthewire,yourjobisdone,andthere’snopointinmakingitanyhotter.Figures3-48through3-50showthedesiredresult.Iusedwhitetubingbecauseitshowsupwellinphotographs.Differentcolorsofheat-shrinktubingallperformthesameway.
Figure3-48.Slipthetubingoveryourwirejoint.
Figure3-49.Applyheattothetubing.
Figure3-50.Leavetheheatonthetubinguntilitshrinkstofirmlycoverthejoint.
Isuggestyounextpracticeyoursolderingskillsonacoupleofpracticalprojects.Inthefirstone,youcanaddcolor-coded,solid-corewirestoyourACadapter,andinthesecondone,youcanshortenthepowercordforalaptoppowersupply.Youcanuseyourlargersolderingironforbothofthesetasks,becauseneitheroftheminvolvesanyheat-sensitivecomponents.
ModifyinganACAdapterInthepreviouschapter,ImentionedtheirritationofbeingunabletopushthewiresfromyourACadapterintotheholesofyourbreadboard.So,let’sfixthisrightnow:1.Cuttwopiecesofsolid-conductor22-gaugewire—oneofthemred,theotherblackorblue.Eachshouldbeabout2incheslong.Stripaquarter-inchofinsulationfrombothendsofeachpieceofwire.
2.TrimthewirefromyourACadapter.Youneedtoexposesomefresh,cleancoppertomaximizeyourchanceofgettingthesoldertostick.Isuggestthatyoumakeoneconductorlongerthantheothertominimizethechanceofthebareendstouchingandcreatingashortcircuit.Useyourmeter,settoDCvolts,ifyouhaveanydoubtaboutwhichconductorispositive.
Solderthewiresandaddheat-shrinktubingasyoudidinthepracticesession.TheresultshouldlooklikeFigure3-51.
Figure3-51.Solid-corecolor-codedwires,solderedontothewiresfromanACadapter,provideaconvenientwaytofeedpowertoabreadboard.Notethatthewiresareofdifferinglengthstoreducetheriskofthemtouchingeachother.
ShorteningaPowerCordWhenItravel,Iliketominimizeeverything.Italwaysannoysmethatthepowercordforthepowersupplyofmylaptopis4feetlong.Thethinnerwirethatconnectsthepowersupplytothecomputerisalso4feetlong,andIjustdon’tneedthatmuchwire.AftersearchingexhaustivelyIcouldn’tfindanylaptoppowercablesshorterthan3feet,soIdecidedtoshortenonemyself.Ifyoufeelnoneedtodothis,youshouldtrythefollowingprocedureonanoldextensioncord,justasanexercise.Youdoneedtogothroughthesestepstoacquiresomepracticeinsolderingheavier,strandedwireandusingheat-shrinktubing:1.Useyourwirecutterstochopthewire,andthenautilityknifetosplitthetwoconductors,withoneshorterthantheother.Whensplicingapowercordorsimilarcablecontainingtwoormoreconductors,it’sgoodtoavoidhavingthejointsoppositeeachother.Theyfitmoresnuglyiftheyareoffset,andthere’slessriskofashortcircuitifajointfails.
![Page 101: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/101.jpg)
Figure3-52.
Figure3-53.
Figure3-54.
Figure3-55.
Figure3-56.
Figure3-57.
2.Stripoffaminimalamountofinsulation.One-eighthofaninch(3mm)issufficient.TheautomaticwirestrippersthatImentionedintheshoppinglistinChapter1areespeciallyconvenient,butregularwirestripperswilldothejob.
3.Cuttwopiecesofheat-shrinktubing,each1inchlong,bigenoughtoslideovertheseparateconductorsinyourcable.Cutaseparate2-inchpieceoflargertubingthatwillslideovertheentirejointwhenit’sdone.ThestepsdescribedsofarareillustratedinFigures3-52through3-58.
Figure3-58.Figures3-52through3-58illustratethesequenceofstepstoprepareformakingashortenedpowercordforalaptopcomputerpowersupply.
![Page 102: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/102.jpg)
4.Nowforthemostdifficultpart:activatingyourhumanmemory.Youhavetoremembertoslidethetubingontothewirebeforeyoumakeyoursolderjoint,becausetheplugsontheendsofthewireswillpreventyoufromaddinganyheat-shrinktubinglater.Ifyou’reasimpatientasIam,it’sverydifficulttoremembertodothiseverytime.
5.Useyourhelpinghandtoalignthefirstjoint.Pushthetwopiecesofwiretogethersothatthestrandsintermingle,andthensqueezethemtightbetweenfingerandthumb,sothattherearenolittlebitsstickingout.Astraystrandofwirecanpunctureheat-shrinktubingwhenthetubingishotandsoftandisshrinkingaroundthejoint.
6.Thewirethatyou’rejoiningismuchheavierthanthe22-gaugewirethatyouworkedwithpreviously,soitwillsuckupmoreheat,andyoumusttouchthesolderingirontoitforalongertime.Makesurethatthesolderflowsallthewayintothejoint,andchecktheundersideafterthejointiscool.Mostlikelyyou’llfindsomebarecopperstrandsthere.Thejointshouldbecomeanicesolid,rounded,shinyblob.Keeptheheat-shrinktubingasfarawayfromthejointaspossiblewhileyou’reusingthesolderingiron,sothatheatfromtheirondoesn’tshrinkthetubingprematurely,preventingyoufromslidingitoverthejointlater.
Figure3-59.
Figure3-60.
Figure3-61.
Figure3-62.
Figure3-63.
Figure3-64.
7.Whenthejointhascooled,slidetheheat-shrinktubingoverit,andapplytheheatgun.Nowrepeattheprocesswiththeotherconductor.Finally,slidethelargerpieceoftubingoverthejoint.Youdidremembertoputthelargetubingontothewireatthebeginning,didn’tyou?
![Page 103: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/103.jpg)
Figure3-65.Completionoftheshortenedpowercordforalaptoppowersupply.
Figures3-59through3-65showthestepsallthewaythroughtotheend.Ifyouhavecompletedthesolderingexercisessofar,younowhavesufficientbasicskillstosolderyourfirstelectroniccircuit.Butfirst,Iwantyoutoverifythevulnerabilityofcomponentstoheat.
![Page 104: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/104.jpg)
Experiment13:BroilanLEDInChapter1,yousawhowanLEDcanbedamagediftoomuchcurrentflowsthroughit.Theelectricitycausedheat,whichmeltedtheLED.Unsurprisingly,youcanjustaseasilymeltitbyapplyingtoomuchheattooneofitsleadswithasolderingiron.Thequestionis:howmuchheatistoomuch?Let’sfindout.Youwillneed:
30-wattor40-wattsolderingiron15-wattpencil-typesolderingironAcoupleofLEDs(thatareexpendable)680ΩresistorWirecuttersandsharp-nosedpliers“Helpinghand”gadgettoholdyourwork
Idon’twantyoutousealligatorclipstojointheLEDtoapowersupply,becausethealligatorclipwilldivertandabsorbsomeoftheheatfromyoursolderingiron.Instead,pleaseusesomesharp-nosedplierstobendeachoftheleadsfromanLEDintolittlehooks,anddothesamethingwiththewiresona680Ωloadresistor.FinallybendthenewwiresonyourACadaptersothatthey,too,aretinyhooks.Nowyoucanputthehookstogetherlikelinksinachain,asshowninFigure3-66.
Figure3-66.Byliterallyhookingtogethertheleadsfromaresistorandawhite-lightLED,weminimizepathwaysforheattoescapeduringthesubsequenttest.
GriptheplasticbodyoftheLEDinyourhelpinghand.Plasticisnotagoodthermalconductor,sothehelpinghandshouldn’tsiphontoomuchheatawayfromourtarget.TheresistorcandanglefromoneoftheleadsontheLED,andthewirefromtheACadaptercanhangfromthat,alittlefartherdown.Gravityshouldbesufficienttomakethiswork.SetyourACadaptertodeliver12voltsasbefore,plugitin,andyourLEDshouldbeshiningbrightly.IusedawhiteLEDinthisexperiment,becauseit’seasiertophotograph.Makesureyourtwosolderingironsarereallyhot.Theyshouldhavebeenpluggedinforatleastfiveminutes.Nowtakethepencil-styleironandholditstipfirmlyagainstoneoftheleadsonyourglowingLED,whileyoucheckthetimewithawatch.Figure3-67showsthesetup.
Figure3-67.Applyingheatwitha15-wattsolderingiron.AtypicalLEDshouldwithstandthistreatmentfortwoorthreeminutes,butifyousubstitutea30-wattsolderingiron,theLEDislikelytoburnoutinunder15seconds.
I’mbettingthatyoucansustainthiscontactforafullthreeminuteswithoutburningouttheLED.Thisiswhyyouusea15-wattsolderingironfordelicateelectronicswork—itdoesn’tendangerthecomponents.AllowyourLEDwiretocool,andthenapplyyourmorepowerfulsolderingirontothesamepieceofwireasbefore.Again,makesureitiscompletelyhot,andIthinkyou’llfindthattheLEDwillgodarkafteraslittleas10seconds(note,someLEDscansurvivehighertemperaturesthanothers).Thisiswhyyoudon’tusea30-wattsolderingironfordelicateelectronicswork.Thelargeirondoesn’tnecessarilyreachahighertemperaturethanthesmallone.Itjusthasalargerheatcapacity.Inotherwords,agreaterquantityofheatcanflowoutofit,atafasterrate.Throwawayyourburned-outLED.Substituteanewone,connectedasbefore,butaddafull-sizecopperalligatorcliptooneoftheleadsupnearthebodyoftheLED,asshowninFigure3-68.Pressthetipofyour30-wattor40-wattsolderingironagainsttheleadjustbelowthealligatorclip.Thistime,youshouldbeabletoholdthepowerfulsolderingironinplaceforafulltwominuteswithoutburningouttheLED.
![Page 105: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/105.jpg)
Figure3-68.Whenacopperalligatorclipisusedasaheatsink,youshouldbeabletoapplya30-wattsolderingiron(belowtheclip)withoutdamagingtheLED.
Imaginetheheatflowingoutthroughthetipofyoursolderingiron,intothewirethatleadstotheLED—exceptthattheheatmeetsthealligatorclipalongtheway,asshowninFigure3-69.Theclipislikeanemptyvesselwaitingtobefilled.ItoffersmuchlessresistancetoheatthantheremainderofthewireleadingtotheLED,sotheheatpreferstoflowintothecopperclip,leavingtheLEDunharmed.Attheendofyourexperiment,ifyoutouchtheclip,you’llfindthatit’shot,whiletheLEDremainsrelativelycooler.
Figure3-69.Theheatsinkinterceptstheheat,sucksitup,andprotectstheLEDfromdamage.
Thealligatorclipisknownasaheatsink,anditshouldbemadeofcopper,becausecopperisoneofthebestconductorsofheat.Becausethe15-wattsolderingironfailedtoharmtheLED,youmayconcludethatthe15-wattironiscompletelysafe,eliminatingallneedforaheatsink.Well,thismaybetrue.Theproblemis,youdon’treallyknowwhethersomesemiconductorsmaybemoreheat-sensitivethanLEDs.Becausetheconsequencesofburningoutacomponentaresoexasperating,Isuggestyoushouldplayitsafeanduseaheatsinkinthesecircumstances:
Ifyouapply15-wattironextremelyclosetoasemiconductorfor20secondsormore.Ifyouapplya30-wattironnearresistorsorcapacitorsfor10secondsormore.(Neveruseitnearsemiconductors.)Ifyouapplya30-wattironnearanythingmeltablefor20secondsormore.Meltableitemsincludeinsulationonwires,plasticconnectors,andplasticcomponentsinsideswitches.
RulesforHeatSinking1.Full-sizecopperalligatorclipsdoworkbetter.2.Clampthealligatorclipascloseaspossibletothecomponentandasfaraspossiblefromthejoint.(Youdon’twanttosucktoomuchheatawayfromthejoint.)
3.Makesurethereisametal-to-metalconnectionbetweenthealligatorclipandthewiretopromotegoodheattransfer.
FUNDAMENTALSAllaboutperforatedboardFortheremainderofthisbook,you’llbeusingperforatedboardwheneveryouwanttocreatepermanent,solderedcircuits.Therearethreewaystodothis:1.Point-to-pointwiring.Youuseperforatedboardthathasnoconnectionsbehindtheholes.Eithertheboardhasnocoppertracesonitatall,asinFigure3-70,oryouwillfindalittlecircularcoppercirclearoundeachhole,asinFigure3-71.Thesecirclesarenotconnectedwitheachotherandareusedonlytostabilizethecomponentsthatyouassemble.Point-to-pointwiringallowsyoutoplacethecomponentsinaconvenient,compactlayoutthatcanbeverysimilartoaschematic.Undertheboardyoubendthewirestolinkthecomponents,andsolderthemtogether,addingextralengthsofwireifnecessary.Theadvantageofthissystemisthatitcanbeextremelycompact.Thedisadvantageisthatthelayoutcanbeconfusing,leadingtoerrors.
Figure3-70.
![Page 106: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/106.jpg)
Figure3-71.EitherthistypeofperforatedboardorthetypeinFigure3-70canbeusedforpoint-to-pointwiringinExperiment14.
2.Breadboard-stylewiring.Useperforatedboardthatisprintedwithcoppertracesinexactlythesamepatternastheconductorsinsideabreadboard.Onceyourcircuitworksonthebreadboard,youmovethecomponentsovertotheperfboardonebyone,maintainingtheirexactsamepositionsrelativetoeachother.Yousolderthe“legs”ofthecomponentstothecoppertraces,whichcompletethecircuit.Thenyoutrimoffthesurpluswire.Theadvantageofthisprocedureisthatit’squick,requiresverylittleplanning,andminimizesthepossibilityforerrors.Thedisadvantageisthatittendstowastespace.AcheapexampleisshowninFigure3-72.
3.Youcanetchyourowncircuitboardwithcustomizedcoppertracesthatlinkyourcomponentsinapoint-to-pointlayout.Thisisthemostprofessionalwaytocompleteaproject,butitrequiresmoretime,trouble,andequipmentthanispracticalinthisbook.Point-to-pointwiringislikeworkingwithalligatorclips,onamuchsmallerscale.Thefirstsolderedprojectwillusethisprocedure.
Figure3-72.Perforatedboardetchedwithcopperinvariantsofabreadboardlayout.ThisexampleisappropriateforExperiment15.
![Page 107: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/107.jpg)
Experiment14:APulsingGlowYouwillneed:
Breadboard15-wattpencil-typesolderingironThinsolder(0.022inchesorsimilar)WirestrippersandcuttersPlainperforatedboard(nocopperetchingnecessary)SmallviseorclamptoholdyourperforatedboardResistors,variousCapacitors,electrolytic,100µFand220µF,oneofeachRedLED,5mm,ratedfor2voltsapproximately2N6027programmableunijunctiontransistor
YourfirstcircuitusingaPUTwasaslow-speedoscillatorthatmadeanLEDflashabouttwiceeachsecond.Theflasheslookedvery“electronic,”bywhichImeanthattheLEDblinkedonandoffwithoutagradualtransitionbetweeneachstate.I’mwonderingifwecanmodifythiscircuittomaketheLEDpulseinamoregentle,interestingway,likethewarninglightonanAppleMacBookwhenit’sin“sleep”mode.I’mthinkingthatsomethingofthissortmightbewearableasanornament,ifit’ssmallenoughandelegantenough.I’malsothinkingthatthisfirstsolderingprojectwillservethreepurposes.Itwilltestandrefineyourskillatjoiningwirestogether,willteachyoupoint-to-pointwiringwithperfboard,andwillgiveyousomeadditionalinsightintothewaythatcapacitorscanbeusedtoadjusttiming.LookbackattheoriginalcircuitinExperiment11,onpage82.Refreshyourmemoryaboutthewayitworked.ThecapacitorchargesthrougharesistoruntilithasenoughvoltagetoovercometheinternalresistanceinthePUT.ThenthecapacitordischargesthroughthePUTandflashestheLED.IfyoudrewagraphofthelightcomingoutoftheLED,itwouldbeathin,square-shapedpulse,asshowninFigure3-73.HowcanwefillitouttomakeitmorelikethecurveinFigure3-74,sothattheLEDfadesgentlyonandoff,likeaheartbeat?
Figure3-73.
Figure3-74.TheoriginalPUToscillatorcircuitinExperiment11madetheLEDemitsharp,shortflashes.Theuppergraphshowswhatwemightfindifwemeasuredlightoutputovertime.Thesecondgraphshowsagentleronsettoeachflash,followedbyaslowfade-out.Capacitorscanbeusedto
createthiseffect.
Onethingisobvious:theLEDisgoingtobeemittingagreatertotalamountoflightineachcycle.Therefore,it’sgoingtoneedmorepower.ThismeansthatC1,inFigure3-75,mustbealargercapacitor.Whenwehavealargercapacitor,ittakeslongertocharge.Tokeeptheflashesreasonablyfrequent,we’llneedalower-valueresistorforR1tochargethecapacitorquicklyenough.Inaddition,reducingthevaluesofR2andR3willprogramthePUTtoallowalongerpulse.Mostimportant,Iwanttodischargethecapacitorthrougharesistortomaketheonsetofthepulsegradualinsteadofsudden.Remember,whenyouhavearesistorinserieswithacapacitor,thecapacitornotonlychargesmoreslowly,butdischargesmoreslowly.Figure3-75showsthesefeatures.CompareitwithFigure2-103onpage85.R1isnow33Kinsteadof470K.R2andR3arereducedto1K.R4alsois1K,sothatthecapacitortakeslongertodischarge.AndC1isnow100µFinsteadof2.2µF.
![Page 108: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/108.jpg)
Figure3-75.ThefirststeptowardcreatingagentlerflashingeffectistousealargercapacitorforC1anddischargeitthrougharesistor,R4.Lower-valueresistorsarenecessarytochargethecapacitorrapidlyenough.
R1:33KR2:1KR3:1KR4:1K
C1:100µFelectrolyticQ1:2N6027
Assemblethiscircuitonabreadboard,andcomparetheresultswhenyouincludeR4orbypassitwithaplainpieceofjumperwire.Itsoftensthepulseabit,butwecanworkonitsomemore.OntheoutputsideofthePUT,wecanaddanothercapacitor.ThiswillchargeitselfwhenthepulsecomesoutofthePUT,andthendischargeitselfgraduallythroughanotherresistor,sothatthelightfromtheLEDdiesawaymoreslowly.Figure3-76showsthesetup.C2islarge—220µF—soitsucksupthepulsethatcomesoutofthePUT,andthengraduallyreleasesitthrough330ΩresistorR5andtheLED.You’llseethattheLEDbehavesdifferentlynow,fadingoutinsteadofblinkingoff.ButtheresistancesthatI’veaddedhavedimmedtheLED,andtobrightenit,youshouldincreasethepowersupplyfrom6voltsto9volts.Rememberthatacapacitorimposesasmoothingeffectonlyifonesideofitisgroundedtothenegativesideofthepowersupply.Thepresenceofthenegativechargeonthatsideofthecapacitorattractsthepositivepulsetotheotherside.Ilikethelookofthisheartbeateffect.Icanimagineapieceofwearableelectronicjewelrythatpulsesinthissensualway,verydifferentfromthehard-edged,sharp-on-and-offofasimpleoscillatorcircuit.Theonlyquestioniswhetherwecansqueezethecomponentsintoapackagethatissmallenoughtowear.
Figure3-76.Thesecondsteptowardagentlerflashingeffectistoaddanothercapacitor,C2,whichchargesquicklywitheachpulseandthendischargesslowlythroughR5andtheLEDbelowit.
Samecomponentsasbefore,plus:R5:330Ω
C2:220µFelectrolyticPowersupplyincreasedto9volts
Figure3-77.Onadarknightinaruralarea,theheartbeatflashermaybeattractiveinunexpectedways.
ResizingtheCircuitThefirststepistolookatthephysicalcomponentsandimaginehowtofitthemintoasmallspace.Figure3-78showsa3Dviewofacompactarrangement.Checkthiscarefully,tracingallthepathsthroughthecircuit,andyou’llseethatit’sthesameastheschematic.Thetroubleisthatifwesolderthecomponentstogetherlikethis,theywon’thavemuchstrength.Allthelittlewirescanbendeasily,andthere’snoeasywaytomountthecircuitinsomethingoronsomething.
Figure3-78.Thislayoutofcomponentsreplicatestheirconnectionsintheschematicdiagramwhilesqueezingthemintoaminimalamountofspace.
![Page 109: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/109.jpg)
Theansweristoputitonasubstrate,whichisoneofthosetermsthatpeopleintheelectronicsfieldliketouse,perhapsbecauseitsoundsmoretechnicalthan“perfboard.”Butperforatedboardiswhatweneed,andFigure3-79showsthecomponentstransferredontoapieceofboardmeasuringjust1inchby0.8inch.
Figure3-79.Perforatedboardcanbeusedtosupportthelayoutofcomponents.Theirleadsaresolderedtogetherundertheboardtocreatethecircuit.Themiddlediagramshowsthewiresundertheboardasdashedlines.Thebottomdiagramshowstheboardfromunderneath,flippedlefttoright.
Orangecirclesindicatewheresolderjointswillbenecessary.
Thecenterversionofthisdiagramusesdottedlinestoshowhowthecomponentswillbeconnectedwitheachotherunderneaththeboard.Mostlytheleadsthatstickoutfromunderneaththecomponentswillbelongenoughtomaketheseconnections.Finally,thebottomversionoftheperfboarddiagramshowstheperfboardflippedleft-to-right(noticetheLandtheRhavebeentransposedtoremindyou,andI’veusedadarkercolortoindicatetheundersideoftheboard).Orangecirclesindicatewheresolderjointswillbeneeded.TheLEDshouldbeunpluggable,becausewemaywanttorunitatsomedistancefromthecircuit.Likewisethepowersourceshouldbeunpluggable.Fortunatelywecanbuyminiatureconnectorsthatfitrightintotheperforatedboard.YoumayhavetogotolargeonlineretailsupplierssuchasMouser.comforthese.Somemanufacturerscallthem“singleinlinesocketsandheaders,”whileotherscallthem“boardmountsocketsandpinstripheaders.”ReferbacktoFigure3-29andchecktheshoppinglistformoredetails.Thisisaverycompactdesignthatwillrequirecarefulworkwithyourpencil-stylesolderingiron.Becauseapieceofperforatedboardassmallasthiswilltendtoskitteraround,Isuggestthatyouapplyyourminiaturevisetooneendtoanchoritwithsomeweightwhilestillallowingyoutoturniteasily.WhenI’mworkingonthiskindofproject,Iliketoplaceit(withtheviseattached)onasoftpieceofpolyurethanefoam—thekindofslabthatisnormallyusedtomakeachaircushion.Thefoamprotectsthecomponentsfromdamagewhentheboardisupside-down,andagainhelpstopreventtheworkfromslidingaroundunpredictably.
StepbyStepHere’sthespecificprocedureforbuildingthiscircuit:1.Cutthesmallpieceofperfboardoutofasheetthathasnocoppertracesonit.Youcancutthesectionusingyourminiaturehobbysaw,oryoumaybeabletosnaptheboardalongitslinesofholes,ifyou’recareful.Alternatively,useasmallready-cutpieceofperfboardwithcoppercirclesonitthatarenotconnectedtooneanother.You’llignorethecoppercirclesinthisproject.(Inthenextexperiment,you’lldealwiththeadditionalchallengeofmakingconnectionsbetweencomponentsandcoppertracesonperforatedboard.)
2.Gatherallthecomponentsandcarefullyinsertthemthroughholesintheboard,countingtheholestomakesureeverythingisintherightplace.Fliptheboardoverandbendthewiresfromthecomponentstoanchorthemtotheboardandcreateconnectionsasshown.Ifanyofthewiresisn’tlongenough,you’llhavetosupplementitwithanextrapieceof22-gaugewirefromyoursupply.Youcanremovealltheinsulation,aswe’llbemountingtheperfboardonapieceofinsulatingplastic.
3.Trimthewiresapproximatelywithyourwirecutters.4.Makethejointswithyourpencilsolderingiron.Notethatinthiscircuit,youarejustjoiningwirestoeachother.Thecomponentsaresoclosetogetherthatthey’llpreventeachotherfromwigglingaroundtoomuch.Ifyouareusingboardwithcopperpads(asIdid),andsomesolderconnectswiththem,that’sOK—aslongasitdoesn’tcreepacrosstotheneighboringcomponentandcreateashortcircuit.
5.Checkeachjointusingaclose-upmagnifyingglass,andwiggleitwithpointed-nosedpliers.Ifthereisn’tenoughsolderforareallysecurejoint,reheatitandaddmore.Ifsolderhascreatedaconnectionthatshouldn’tbethere,useautilityknifetomaketwoparallelcutsinthesolder,andscrapeawaythelittlesectionbetweenthem.
Generally,Iinsertthreeorfourcomponents,trimthewiresapproximately,solderthem,trimtheirwiresfinally,thenpausetocheckthejointsandtheplacement.IfIsoldertoomanycomponentsinsuccession,there’sagreaterriskofmissingabadjoint,andifImakeanerrorinplacingacomponent,undoingitwillbemuchmoreproblematicifIhavealreadyaddedawholelotmorecomponentsaroundit.Figures3-80and3-81showtheversionofthisprojectthatIconstructed,beforeItrimmedtheboardtotheminimumsize.
Figure3-80.Componentsmountedonapieceofperforatedboard.
![Page 110: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/110.jpg)
Figure3-81.Theassemblyseenfrombelow.Thecoppercirclesaroundtheholesarenotnecessaryforthisproject.Someofthemhavepickedupsomesolder,butthisisirrelevantaslongasnounintentionalshortcircuitsarecreated.
FlyingWireSegmentsThejawsofyourwirecuttersexertapowerfulforcethatpeaksandthenissuddenlyreleasedwhentheycutthroughwire.Thisforcecanbetranslatedintosuddenmotionofthesnippedwiresegment.Somewiresarerelativelysoft,anddon’tposearisk,butharderwirescanflyinunpredictabledirectionsathighspeed,andmayhityouintheeye.Theleadsoftransistorsareespeciallyhazardousinthisrespect.Ithinkit’sagoodideatowearsafetyglasseswhentrimmingwires.
FinishingtheJobIalwaysusebrightillumination.Thisisnotaluxury;itisanecessity.Buyacheapdesklampifyoudon’talreadyhaveone.Iuseadaylight-spectrumfluorescentdesklamp,becauseithelpsmeidentifythecoloredbandsonresistorsmorereliably.Notethatthistypeoffluorescentlampemitsquitealotofultravioletlight,whichisnotgoodforthelensinyoureye.Avoidlookingcloselyanddirectlyatthetubeinthelamp,andifyouwearglasses,theywillprovideadditionalprotection.Nomatterhowgoodyourclose-upvisionis,youneedtoexamineeachjointwiththatclose-upmagnifier.You’llbesurprisedhowimperfectsomeofthemare.Holdthemagnifierascloseaspossibletoyoureye,thenpickupthethingthatyouwanttoexamineandbringitcloseruntilitcomesintofocus.Finally,youshouldendupwithaworkingcircuit.Youcaninsertthewiresfromyourpowersupplyintotwoofthetinypowersockets,andplugaredLEDintotheremainingtwosockets.Rememberthatthetwocentersocketsarenegative,andthetwooutersocketsarepositive,becauseitwaseasiertowirethecircuitthisway.Youshouldcolor-codethemtoavoidmistakes.Sonowyouhaveatinycircuitthatpulseslikeaheartbeat.Ordoesit?Ifyouhavedifficultymakingitwork,retraceeveryconnectionandcompareitwiththeschematic.Ifyoudon’tfindanerror,applypowertothecircuit,attachtheblackleadfromyourmetertothenegativeside,andthengoaroundthecircuitwiththeredlead,checkingthepresenceofvoltage.Everypartofthiscircuitshouldshowatleastsomevoltagewhileit’sworking.Ifyoufindadeadconnection,youmayhavemadeabadsolderjoint,ormissedoneentirely.Whenyou’redone,nowwhat?Well,nowyoucanstopbeinganelectronicshobbyistandbecomeacraftshobbyist.Youcantrytofigureoutawaytomakethisthingwearable.Firstyouhavetoconsiderthepowersupply.BecauseofthecomponentsthatIused,wereallyneed9voltstomakethisworkwell.Howareyougoingtomakethis9-voltcircuitwearable,withabulky9-voltbattery?Icanthinkofthreeanswers:1.Youcanputthebatteryinapocket,andmounttheflasherontheoutsideofthepocket,withathinwirepenetratingthefabric.Notethatthetinypowerconnectorontheperforatedboardwillaccepttwo22-gaugewiresiftheyaresolidcore,oriftheyarestranded(likethewiresfroma9-voltbatteryconnector)buthavebeenthinlycoatedwithsolder.
2.Youcouldmountthebatteryinsidethecrownofabaseballcap,withtheflasheronthefront.3.Youcanputtogetherthree3-voltbuttonbatteriesinastack,heldinsomekindofplasticclip.Ifyoutrythisoption,itmaynotbeagoodideatotrytosolderwiretoabattery.Youwillheattheliquidstuffinsidethebattery,whichmaynotbegoodforit,andmaynotbegoodforyouiftheliquidstartsboilingandthebatteryburstsopen.Also,solderdoesn’tstickeasilytothemetallicfinishonmostbatteryterminals.
MostLEDscreateasharplydefinedbeamoflight,whichyoumaywanttodiffusetomakeitlooknicer.Onewaytodothisistouseapieceoftransparentacrylicplastic,atleast1/4inchthick,asshowninFigure3-82.Sandpaperthefrontoftheacrylic,ideallyusinganorbitalsanderthatwon’tmakeanobviouspattern.Sandingwillmaketheacrylictranslucentratherthantransparent.DrillaholeslightlylargerthantheLEDinthebackoftheacrylic.Don’tdrillallthewaythroughtheplastic.Removeallfragmentsanddustfromtheholebyblastingsomecompressedairintoit,orbywashingitifyoudon’thaveanaircompressor.Afterthecavityiscompletelydry,getsometransparentsiliconecaulkingormixsomeclearfive-minuteepoxyandputadropinthebottomofthehole.TheninserttheLED,pushingitinsothatitforcestheepoxytooozearoundit,makingatightseal.SeeFigure3-82.
Figure3-82.Thiscross-sectionalviewshowsasheetoftransparentacrylicinwhichaholehasbeendrilledpartofthewayfromthebacktowardthefront.Becauseadrillbitcreatesaholewithaconicalshapeatthebottom,andbecausetheLEDhasroundedcontours,transparentepoxyorsilicone
caulkingcanbeinjectedintotheholebeforemountingtheLED.
TryilluminatingtheLED,andsandtheacrylicsomemoreifnecessary.Finally,youcandecidewhethertomountthecircuitonthebackoftheacrylic,orwhetheryouwanttorunawiretoitelsewhere.BecausetheLEDwillflashataboutthespeedofahumanheartwhilethepersonisresting,itmaylookasifit’smeasuringyour
![Page 111: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/111.jpg)
pulse,especiallyifyoumountitonthecenterofyourchestorinastraparoundyourwrist.Ifyouenjoyhoaxingpeople,youcansuggestthatyou’reinsuchamazinglygoodshape,yourpulserateremainsconstantevenwhenyou’retakingstrenuousexercises.Tomakeagood-lookingenclosureforthecircuit,IcanthinkofoptionsrangingfromembeddingthewholethinginclearepoxytofindingaVictorian-stylelocket.I’llleaveyoutoconsideralternatives,becausethisisabookaboutelectronicsratherthanhandicrafts.However,Iwilladdressonefinalissue:howlongwillthisgadgetcontinueflashing?Ifyoucheckthefollowingsection“Essentials:Batterylife,”you’llfindthataregularalkaline9-voltbatteryshouldkeeptheLEDflashingforabout50hours.
ESSENTIALSBatterylifeAnytimeyoufinishacircuitthatyouintendtorunfromabattery,you’llwanttocalculatethelikelybatterylife.Thisiseasilydone,becausemanufacturersratetheirbatteriesaccordingtothe“amperehours”theycandeliver.Keepthefollowinginmind:
Theabbreviationforamp-hoursisAh,sometimesprintedasAH.Milliampere-hoursareabbreviatedmAh.Theratingofabatteryinamp-hoursisequaltothecurrent,inamps,multipliedbythenumberofhoursthatthebatterycandeliverit.
Thus,intheory1amp-hourcanmean1ampfor1hour,or0.1ampfor10hours,or0.01ampfor100hours—andsoon.Inreality,it’snotassimpleasthis,becausethechemicalsinsideabatterybecomedepletedmorequicklywhenyoudrawaheavycurrent,especiallyifthebatterygetshot.Youhavetostaywithinlimitsthatareappropriatetothesizeofthebattery.Forinstance,ifasmallbatteryisratedfor0.5amp-hours,youcan’texpecttodraw30amperesfromitfor1minute.Butyoushouldbeabletoget0.005amps(i.e.,5milliamps)for100hourswithoutanytrouble.Remember,though,thatthevoltagedeliveredbyabatterywillbegreaterthanitsratedvoltagewhenthebatteryisfresh,andwilldiminishbelowitsratedvoltagewhilethebatteryisdeliveringpower.AccordingtosometestdatathatItrust(Ithinktheyarealittlemorerealisticthantheestimatessuppliedbybatterymanufacturers),herearesomenumbersfortypicalbatteries:
Typical9voltalkalinebattery:0.3amp-hours,whiledelivering100mA.TypicalAAsize,1.5-voltalkalinebattery:2.2amp-hours,whiledelivering100mA.Rechargeablenickel-metalhydridebattery:abouttwicetheenduranceofacomparablysizedalkalinebattery.Lithiumbattery:maybethreetimestheenduranceofanalkalinebattery.
BACKGROUNDMaddenedbymeasurementThroughoutmostofthisbook,I’vemostlyusedmeasurementsininches,althoughsometimesI’vedigressedintothemetricsystem,aswhenreferringto“5-mmLEDs.”Thisisn’tinconsistencyonmypart;itreflectstheconflictedstateoftheelectronicsindustry,whereyou’llfindinchesandmillimetersbothindailyuse,oftenintheverysamedatasheet.TheUnitedStatesistheonlymajornationstillusingtheoldsystemofunitsthatoriginatedinEngland.(TheothertwoholdoutsareLiberiaandMyanmar,accordingtotheCIA’sWorldFactbook.)Still,theUnitedStateshasledmanyadvancesinelectronics,especiallythedevelopmentofsiliconchips,whichhavecontactsspaced1/10inchapart.Thesestandardsbecamefirmlyestablished,andshownosignofdisappearing.Tocomplicatemattersfurther,evenintheUnitedStates,youcanencountertwoincompatiblesystemsforexpressingfractionsofaninch.Drillbits,forinstance,aremeasuredinmultiplesof1/64inch,whilemetalthicknessesmaybemeasuredindecimalssuchas0.06inch(whichisapproximately1/16inch).ThemetricsystemisnotnecessarilymorerationalthantheU.S.system.Originally,whenthemetricsystemwasformallyintroducedin1875,themeterwasdefinedasbeing1/10,000,000ofthedistancebetweentheNorthPoleandtheequator,alongalinepassingthroughParis—aquixotic,Francocentricconceit.Sincethen,themeterhasbeenredefinedthreetimes,inaseriesofeffortstoachievegreateraccuracyinscientificapplications.Asfortheusefulnessofa10-basedsystem,movingadecimalpointiscertainlysimplerthandoingcalculationsin64thsofaninch,buttheonlyreasonwecountintensisbecausewehappentohaveevolvedwiththatnumberofdigitsonourhands.A12-basedsystemwouldreallybemoreconvenient,asnumberswouldbeevenlydivisibleby2and3.Aswe’restuckwiththewhimsicalaspectsoflengthmeasurement,I’vecreatedthechartsinFigures3-83and3-84toassistyouingoingfromonesystemtoanother.Fromtheseyouwillseethatwhenyouneedtodrillaholefora5mmLED,a3/16-inchdrillbitisaboutright.(Infact,itresultsinabetter,tighterfitthanifyoudrillanactual5mmhole.)
![Page 112: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/112.jpg)
Figure3-83.Becauseunitsofmeasurementarenotstandardizedinelectronics,conversionisoftennecessary.Thechartontherightisa5xmagnificationofthebottomsectionofthechartontheleft.
Figure3-84.Thischartallowsconversionbetweenhundredthsofaninch,conventionalU.S.fractionsofaninch,andfractionsexpressedinthousandthsofaninch.
![Page 113: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/113.jpg)
Experiment15:IntrusionAlarmRevisitedTimenowtoaddsomeoftheenhancementstotheintrusionalarmthatIdiscussedattheendofExperiment11.I’mgoingtoshowyouhowthealarmcanbetriggeredifyouinstallvariousdetectorsonwindowsanddoorsinyourhome.I’llalsoshowhowthealarmcanbewiredsothatitlocksitselfonandcontinuestomakenoiseevenafteradoororwindowisreclosed.Thisexperimentwilldemonstratetheprocedurefortransferringaprojectfromabreadboardtoapieceofperforatedboardthathascopperconnectionslaidoutidenticallytotheonesinsidethebreadboard,asshownearlierinFigure3-72.Andyou’llmountthefinishedcircuitinaprojectboxwithswitchesandconnectorsonthefront.Whenallissaidanddone,you’llbereadyforwholesalecircuitbuilding.Theexplanationsintherestofthisbookwillgetgraduallybriefer,andthepacewillincrease.Youwillneed:
15-wattpencil-typesolderingironThinsolder(0.022inchesorsimilar)WirestrippersandcuttersPerforatedboardetchedwithcopperinabreadboardlayoutSmallviseorclamptoholdyourperforatedboardThesamecomponentsthatyouusedinExperiment11,plus:2N2222NPNtransistor.Quantity:1.DPDTrelay.Quantity:1.SPDTtoggleswitch.Quantity:1.1N4001diode.Quantity:1.Redandgreen5mmLEDs.Quantity:1each.Projectbox,6×3×2inches.Powerjack,typeN,andmatchingpowersocket,typeN.Bindingposts.Stranded22-gaugewire,threedifferentcolors.Magneticsensorswitches,sufficientforyourhome.Alarmnetworkwiring,sufficientforyourhome.
MagneticSensorSwitchesAtypicalalarmsensorswitchconsistsoftwomodules:themagneticmoduleandtheswitchmodule,asshowninFigures3-85and3-86.Themagneticmodulecontainsapermanentmagnet,andnothingelse.Theswitchmodulecontainsa“reedswitch,”whichmakesorbreaksaconnection(likeacontactinsidearelay)undertheinfluenceofthemagnet.Whenyoubringthemagneticmoduleclosetotheswitchmodule,youmayfaintlyhearthereedswitchclickasitflipsfromonestatetotheother.
Figure3-85.Inthissimplealarmsensorswitch,thelowermodulecontainsamagnet,whichopensandclosesareedswitchsealedintotheuppermodule.
Likeallswitches,reedswitchescanbenormallyopenornormallyclosed.Forthisproject,youwantthekindofswitchthatisnormallyopen,andcloseswhenthemagneticmoduleisclosetoit.Attachthemagneticmoduletothemovingpartofadoororwindow,andattachtheswitchmoduletothewindowframeordoorframe.Whenthewindowordoorisclosed,themagneticmoduleisalmosttouchingtheswitchmodule.Themagnetkeepstheswitchcloseduntilthedoororwindowisopened,atwhichpointtheswitchopens.Theonlyquestionis:howdoweusethiscomponenttotriggerouralarm?Aslongasasmallcurrentflowsthroughallourmagneticsensorswitches,thealarmshouldbeoff,butiftheflowofcurrentstops,thealarmshouldswitchon.Wecouldusearelaythatis“alwayson”whilethealarmisarmed.Whenthecircuitisinterrupted,therelayrelaxesanditsotherpairofcontactscloses,whichcouldpowerupthealarmnoisemaker.ButIdon’tlikethisidea.Relaystakesignificantpower,andtheycangethot.Mostofthemarenotdesignedtobekept“always-on.”I’dprefertohandlethetaskusingatransistor.
Figure3-86.Thiscutawaydiagramshowsareedswitch(bottom)andthemagnetthatactivatesit(top),insideanalarmsensor.Theswitchcontainstwoflexiblemagnetizedstrips,theupperonewithitssouthpoleadjacenttoanelectricalcontact,theloweronewithitsnorthpoleadjacenttoanelectricalcontact.Whenthesouthpoleofthemagnetapproachestheswitch,themagneticforce(shownasdashedlines)repelsthesouthcontactandattractsthe
northcontact,causingthemtosnaptogether.Twoscrewsontheoutsideofthecasingareconnectedwiththestripsinside.
ABreak-to-MakeTransistorCircuitFirst,recallhowanNPNtransistorworks.Whenthebaseisnotsufficientlypositive,thetransistorblockscurrentbetweenitscollectorandemitter,butwhenthebaseisrelativelypositive,thetransistorpassescurrent.
![Page 114: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/114.jpg)
TakealookattheschematicinFigure3-87,whichisbuiltaroundouroldfriendthe2N2222NPNtransistor.Whentheswitchisclosed,itconnectsthebaseofthetransistortothenegativesideofthepowersupplythrougha1Kresistor.Atthesametime,thebaseisconnectedwiththepositivesideofthepowersupplythrougha10Kresistor.Becauseofthedifferenceinresistancesandtherelativelyhighturn-onvoltagefortheLED,thebaseisforcedbelowitsturn-onthreshold,andasaresult,thetransistorwillnotpassmuchcurrent.TheLEDwillglowdimlyatbest.
Figure3-87.Inthisdemonstrationcircuit,whentheswitchisopened,itinterruptsnegativevoltagetothebaseofthetransistor,causingthetransistortoloweritsresistance,allowingcurrenttoreachtheLED.Thus,whentheswitchisturnedoff,itturnsontheLED.
Nowwhathappenswhentheswitchisopened?Thebaseofthetransistorlosesitsnegativepowersupplyandhasonlyitspositivepowersupply.Itbecomesmuchmorepositive,abovetheturn-onthresholdforthetransistor,whichtellsthetransistortoloweritsresistanceandpassmorecurrent.TheLEDnowglowsbrightly.Thus,whentheswitchisturnedoffandbreakstheconnection,theLEDisturnedon.Thisseemstobewhatwewant.Imagineawholeseriesofswitchesinsteadofjustoneswitch,asshowninFigure3-88.Thecircuitwillstillworkthesameway,eveniftheswitchesarescatteredalloveryourhome,becausetheresistanceinthewiresconnectingtheswitcheswillbetrivialcomparedwiththeresistanceofthe1Kresistor.
Figure3-88.Anetworkofswitches,wiredinseries,canbesubstitutedforthesingleswitchinFigure3-87.Nowanyoneswitchwillbreakcontinuityandtriggerthetransistor.
Ihaveshowntheswitchesopen,becausethat’sthewaytheschematicforaswitchisdrawn,butimaginethemallclosed.Thebaseofthetransistorwillnowbesuppliedthroughthelongpieceofwireconnectingalltheclosedswitches,andtheLEDwillstaydark.Nowifjustoneswitchisopened,orifanyonetamperswiththewirelinkingthem,thebaseofthetransistorlosesitsconnectiontonegativepower,atwhichpointthetransistorconductspowerandtheLEDlightsup.Whilealltheswitchesremainclosed,thecircuitisdrawingverylittlecurrent—probablyabout1.1mA.Soyoucouldrunitfromatypical12-voltalarmbattery.NowsupposeweswapouttheLEDandputarelayinthereinstead,asshowninFigure3-89.Idon’tmindusingarelayinthislocation,becausetherelaywillnotbe“alwayson.”Itwillnormallybeoff,andwilldrawpoweronlywhenthealarmistriggered.
![Page 115: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/115.jpg)
Figure3-89.IftheLEDand680Ωresistorshowninareremoved,andarelaytakestheirplace,therelaywillbeactivatedwhenanyswitchinthesensornetworkisopened.
Tryoneofthe12-voltrelaysthatyouusedpreviously.Youshouldfindthatwhenyouopentheswitch,therelayisenergized.Whenyouclosetheswitch,therelaygoesbacktosleep.NotethatIeliminatedthe680Ωresistorfromthecircuit,becausetherelaydoesn’tneedanyprotectionfromthe12-voltpowersupply.
Self-LockingRelayThere’sonlyoneremainingproblem:wewantthealarmtocontinuemakingnoiseevenaftersomeonewhohasopenedadoororwindowclosesitagainquickly.Inotherwords,whentherelayisactivated,itmustlockitselfon.Onewaytodothiswouldbebyusingalatchingrelay.Theonlyproblemisthatwewouldthenneedanotherpieceofcircuitrytounlatchit.Iprefertoshowyouhowyoucanmakeanyrelaykeepitselfswitchedonafterithasreceivedjustonejoltofpower.Thisideawillbeusefultoyoulaterinthebookaswell.Thesecretistosupplypowertotherelaycoilthroughthetwocontactsinsidetherelaythatarenormallyopen.(Notethatthisisexactlyoppositetotherelayoscillator,whichsuppliedpowertoitscoilthroughthecontactsthatwerenormallyclosed.Thatsetupcausedtherelaytoswitchitselfoffalmostassoonasitswitcheditselfon.Thissetupcausestherelaytokeepitselfswitchedon,assoonasithasbeenactivated.)InFigure3-90,thefourschematicsillustratethis.Youcanimaginethemasbeinglikeframesinamovie,photographedmicrosecondsapart.Inthefirstpicture,theswitchisopen,therelayisnotenergized,andnothingishappening.Inthesecond,theswitchhasbeenclosedtoenergizethecoil.Inthethird,thecoilhaspulledthecontactinsidetherelay,sothatpowernowreachesthecoilviatwopaths.Inthefourth,theswitchhasbeenopened,buttherelayisstillpoweringitsowncoilthroughitscontacts.Itwillremainlockedinthisstateuntilthepowerisdisconnected.
Figure3-90.Thissequenceofschematicsshowstheeventsthatoccurwhenarelayisenergized.Initially,theswitchisopen.Thentheswitchisclosed,activatingtherelay.Therelaythenpowersitselfthroughitsowninternalcontacts.Therelayremainsenergizedevenaftertheswitchisopenedagain.
PowerswitchedbytherelaycanbetakenfromthecircuitatpointA.
Allweneedtodo,tomakeuseofthisidea,istosubstitutethetransistorfortheon/offswitch,andtapintothecircuitatpointA,runningawirefromtheretothenoisemakingmodule.Figure3-91showshowthatwouldwork.Whenthetransistorisactivatedbyanyofthenetworkofsensorswitches,aspreviouslyexplained,thetransistorconductspowertotherelay.Therelaylocksitselfon,andthetransistorbecomesirrelevant.
![Page 116: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/116.jpg)
Figure3-91.Theself-lockingrelaydepictedinFigure3-90hasbeenincorporatedinthealarmcircuit,sothatifanyswitchinthenetworkisopened,therelaywillcontinuetopowerthenoisemakereveniftheswitchisclosedagain.
BecauseI’vebeenaddingpiecestotheoriginalalarmnoisemakercircuit,I’veupdatedtheblockdiagramfromFigure2-112toshowthatwecanstillbreakthisdownintomoduleswithsimplefunctions.ThereviseddiagramisshowninFigure3-92.
Figure3-92.ThisblockdiagrampreviouslyshowninFigure2-112onpage90hasbeenupdatedtoincludethemagnetic-switchnetworkandlocking-relaycontrolsystem.
BlockingBadVoltageOnelittleproblemremains:inthenewversionofthecircuit,ifthetransistorgoesoffwhiletherelayisstillon,currentfromtherelaycanflowbackupthewiretotheemitterofthetransistor,whereitwilltrytoflowbackwardthroughthetransistortothebase,whichis“morenegative,”asitislinkedthroughallthemagneticswitchesandthe1Kresistortothenegativesideofthepowersupply.Applyingpowerbackwardthroughatransistorisnotanicethingtodo.Thereforethefinalschematicinthisseriesshowsonemorecomponent,whichyouhavenotseenbefore:adiode,labeledD1.SeeFigure3-93.ThediodelooksliketheheartofanLED,andindeed,that’sprettymuchwhatitis,althoughsomediodesaremuchmorerobust.Itallowselectricitytoflowinonlyonedirection,frompositivetonegative,asshownbyitsarrowsymbol.Ifcurrenttriestoflowintheoppositedirection,thediodeblocksit.Theonlypriceyoupayforthisserviceisthatthediodeimposesasmallvoltagedroponelectricityflowinginthe“OK”direction.Sonow,positiveflowcanpassfromthetransistor,throughthediode,totherelaycoil,togetthingsstarted.Therelaythensuppliesitselfwithpower,butthediodepreventsthepositivevoltagefromgettingbackintothetransistorthewrongway.PerhapsamoreelegantsolutiontotheproblemistoconnecttheNO(normallyopen)legoftherelayviaa10kresistortothebaseconnection.Whentherelayisnotenergized,theNOlegisinertandsimplybehavesasaparasiticcapacitanceonthenode.Whentherelaybecomesenergized,theNOlegshunts+12Vthroughthecommonterminalviaa10kresistorintothebaseofthetransistor.Inthiscircuitconfiguration,thetransistorisneverexposedtoapotentiallyharmfulvoltageandyouarenotdependingonleakagecurrentsofnon-idealelementstoprotectdevices.However,Ineededanopportunitytointroduceyoutotheconceptofdiodes.Youcancheckthefollowingsection“Essentials:Allaboutdiodes”tolearnmore.
![Page 117: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/117.jpg)
Figure3-93.DiodeD1hasbeenaddedtoprotecttheemitterofQ1frompositivevoltagewhentherelayisenergized.
ESSENTIALSAllaboutdiodesAdiodeisaveryearlytypeofsemiconductor.Itallowselectricitytoflowinonedirection,butblocksitintheoppositedirection.(Alight-emittingdiodeisamuchmorerecentinvention.)LikeanLED,adiodecanbedamagedbyreversingthevoltageandapplyingexcessivepower,butmostdiodesgenerallyhaveamuchgreatertoleranceforthisthanLEDs.Theendofthediodethatblockspositivevoltageisalwaysmarked,usuallywithacircularband,whiletheotherendremainsunmarked.Diodesareespeciallyusefulinlogiccircuits,andcanalsoconvertalternatingcurrent(AC)intodirectcurrent(DC).AZenerdiodeisaspecialtypethatwewon’tbeusinginthisbook.Itblockscurrentcompletelyinonedirection,andalsoblocksitintheotherdirectionuntilathresholdvoltageisreached—muchlikeaPUT.Signaldiodesareavailableforvariousdifferentvoltagesandwattages.The1N4001diodethatIrecommendforthealarmactivationcircuitiscapableofhandlingamuchgreaterloadatamuchhighervoltage,butIuseditbecauseithasalowinternalresistance.Iwantedthediodetoimposeaminimalvoltagedrop,sothattherelaywouldreceiveasmuchvoltageaspossible.It’sgoodpracticetousediodesatlessthantheirratedcapacity.Likeanysemiconductor,theycanoverheatandburnoutiftheyaresubjectedtomistreatment.Theschematicsymbolforadiodehasonlyonesignificantvariant:sometimesthetriangleisoutlinedinsteadoffilledsolidblack(seeFigure3-94).
Figure3-94.Eitheroftheseschematicsymbolsmaybeusedtorepresentadiode,buttheoneontherightismorecommonthantheoneontheleft.
CompletingtheBreadboardAlarmCircuitIt’stimenowtobreadboardthecontrolcircuitforyouralarmnoisemaker.Figure3-95showshowthiscanbedone.Iamassumingthatyoustillhavethenoisemaker,whichfunctionsasbefore.I’massumingthatyoustillhaveitsrelevantcomponentsmountedonthetophalfofthebreadboard.Tosavespace,I’mjustgoingtoshowtheadditionalcomponentsmountedonthebottomhalfofthesamebreadboard.It’simportanttorememberthatyouarenotsupplyingpowerdirectlytotheleftandright“rails”onthebreadboardanymore;youaresupplyingpowertotherelay-transistorsection,andwhentherelayclosesitscontacts,therelaysuppliespowertotherails.Thesethenfeedthepoweruptothetophalfofthebreadboard.SodisconnectyourpowersupplyfromthebreadboardrailsandreconnectitasshowninFigure3-95.
![Page 118: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/118.jpg)
Figure3-95.Theschematicthatwasdevelopedinthepreviouspagescanbeemulatedwithcomponentsonabreadboard,asshownhere.S1isaDPDTrelay.Wirestothesensorswitchnetworkandtothepowersupplymustbeaddedwhereshown.
Becauseit’sadouble-polerelay,Iamusingittoswitchnegativeaswellaspositive.Thismeansthatwhentherelaycontactsareopen,thenoisemakingsectionofthecircuitiscompletelyisolatedfromtherestoftheworld.ThebreadboardedrelaycircuitisexactlythesameastheschematicinFigure3-93.Thecomponentshavejustbeenrearrangedandsqueezedtogethersothattheywillfitalongsidetherelay.Twowiresatthelower-leftcornergotothenetworkofmagneticsensorswitchesthatwilltripthealarm;fortestingpurposes,youcanjustholdthestrippedendsofthesetwowirestogethertosimulatealltheswitchesbeingclosed,andseparatethewirestosimulateaswitchopening.Twomorewiresbringpowertothebreadboardoneithersideoftherelay.Thisiswhereyoushouldconnectyourpowersupplyduringtesting.Theoutputfromtherelay,throughitstoppairofcontacts,isconnectedwiththerailsofthebreadboardbyalittlejumperwireattopleft,andanotherattopright.Don’tforgettoincludethem!Onemorelittlewireatthelower-leftcorner(easilyoverlooked)connectsthelefthandsiderailtothelefthandcoilterminaloftherelay,sothatwhentherelayispoweringthenoisemakercircuit,itpowersitselfaswell.Whenyoumountthediode,rememberthattheendofitthatismarkedwithabandarounditistheendthatblockspositivecurrent.Inthiscircuit,that’sthelowerendofthediode.Tryittomakesurethatitworks.Shortthesensorwirestogetherandthenapplypower.Thealarmshouldremainsilent.Youcanuseyourmetertocheckthatnovoltageexistsbetweenthesiderails.Nowseparatethesensorwires,andtherelayshouldclick,supplyingpowertothesiderails,whichactivatesthenoisemaker.Evenifyoubringthesensorwiresbacktogether,therelayshouldremainlockedon.Theonlywaytounlockitistodisconnectthepowersupply.Whenthecircuitisactive,thetransistorfollowedbythediodedropsthevoltageslightly,butthe12-voltrelayshouldstillwork.Inmytestcircuit,tryingthreedifferentrelays,theydrewbetween27and40milliampsat9.6volts.Somecurrentstillleakedthroughthetransistorwhenitwasinits“off”mode,butonlyacoupleofmilliampsat0.5volts.Thislowvoltagewasfarbelowthethresholdrequiredtotriptherelay.
ReadyforPerfboardingIfthecircuitworks,thenextstepistoimmortalizeitonperforatedboard.Usethetypeofboardthathasabreadboardcontactpatternetchedonitincopper,asshowninFigure3-72onpage116.Checkthefollowingsection,“Essentials:Perfboardprocedure,”forguidanceonthebestwaytomakethisparticularkindofsolderjoint—andthesubsequentsectionforthemostcommonproblems.
ESSENTIALSPerfboardsolderingprocedureCarefullynotethepositionofacomponentonyourbreadboard,andthenmoveittothesamerelativepositionontheperfboard,pokingitswiresthroughthelittleholes.Turntheperfboardupsidedown,makesurethatit’sstable,andexaminetheholewherethewireispokingthrough,asshowninFigure3-96.Acoppertracesurroundsthisholeandlinksitwithothers.Yourtaskistomeltsoldersothatitstickstothecopperandalsotothewire,formingasolid,reliableconnectionbetweenthetwoofthem.Takeyourpencil-stylesolderingironinonehandandsomesolderinyourotherhand.Holdthetipoftheironagainstthewireandthecopper,andfeedsomethinsoldertotheirintersection.Aftertwotofourseconds,thesoldershouldstartflowing.
Figure3-96.
![Page 119: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/119.jpg)
Figure3-97.
Figure3-98.Toestablishaconnectionbetweenasectionofwireandacoppertraceonperforatedboard,thewireispushedthroughthehole,andsolder(showninpurewhiteforillustrativepurposes)completestheconnection.Thewirecanthenbesnippedshort.
Allowenoughsoldertoformaroundedbumpsealingthewireandthecopper,asshowninFigure3-97.Waitforthesoldertohardenthoroughly,andthengrabthewirewithpointed-nosedpliersandwiggleittomakesureyouhaveastrongconnection.Ifalliswell,sniptheprotrudingwirewithyourcutters.SeeFigure3-98.Becausesolderjointsaredifficulttophotograph,I’musingdrawingstoshowthewirebeforeandaftermakingareasonablygoodjoint,whichisshowninpurewhite,outlinedwithablackline.ActualsolderedperfboardisshowninthephotographsinFigures3-99and3-100.
Figure3-99.Thisphotographwastakenduringtheprocessoftransferringcomponentsfrombreadboardtoperforatedboard.Twoorthreecomponentsatatimeareinsertedfromtheothersideoftheboard,andtheirleadsarebentovertopreventthemfromfallingout.
Figure3-100.Aftersoldering,theleadsaresnippedshortandthejointsareinspectedunderamagnifyingglass.Anothertwoorthreecomponentscannowbeinserted,andtheprocesscanberepeated.
TOOLSFourmostcommonperfboardingerrors1.Toomuchsolder
Beforeyouknowit,soldercreepsacrosstheboard,touchesthenextcoppertrace,andstickstoit,asdepictedinFigure3-101.Whenthishappens,youhavetowaitforittocool,andthencutitwithautilityknife.Youcanalsotrytoremoveitwitharubberbulbandsolderwick,butsomeofitwilltendtoremain.Evenamicroscopictraceofsolderisenoughtocreateashortcircuit.Checkthewiringunderamagnifyingglasswhileturningtheperfboardsothatthelightstrikesitfromdifferentangles(oruseyoursolderwicktosuckitaway).
Figure3-101.Iftoomuchsolderisused,itmakesamessandcancreateanunwantedconnectionwithanotherconductor.
![Page 120: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/120.jpg)
2.NotenoughsolderIfthejointisthin,thewirecanbreakfreefromthesolderasitcools.Evenamicroscopiccrackissufficienttostopthecircuitfromworking.Inextremecases,thesolderstickstothewire,andstickstothecoppertracearoundthewire,yetdoesn’tmakeasolidbridgeconnectingthetwo,leavingthewireencircledbysolderyetuntouchedbyit,asshowninFigure3-102.Youmayfindthisundetectableunlessyouobserveitwithmagnification.Youcanaddmoresoldertoanyjointthatmayhaveinsufficientsolder,butbesuretoreheatthejointthoroughly.
Figure3-102.Toolittlesolder(orinsufficientheat)canallowasolderedwiretoremainseparatefromthesolderedcopperontheperforatedboard.Evenahair-thingapissufficienttopreventanelectricalconnection.
3.ComponentsincorrectlyplacedIt’sveryeasytoputacomponentoneholeawayfromthepositionwhereitshouldbe.It’salsoeasytoforgettomakeaconnection.Isuggestthatyouprintacopyoftheschematic,andeachtimeyoumakeaconnectionontheperforatedboard,youeliminatethatwireonyourhardcopy,usingahighlighter.
4.DebrisWhenyou’retrimmingwires,thelittlefragmentsthatyoucutdon’tdisappear.Theystarttoclutteryourworkarea,andoneofthemcaneasilygettrappedunderyourperforatedboard,creatinganelectricalconnectionwhereyoudon’twantit.Thisisanotherreasonforworkingwithsomethingsoft,suchaspolyurethanefoam,underyourproject.Ittendstoabsorborholdlittlepiecesofdebris,reducingtheriskofyoupickingthemupinyourwiring.Cleantheundersideofyourboardwithanold(dry)toothbrushbeforeyouapplypowertoit,andkeepyourworkareaasneataspossible.Themoremeticulousyouare,thefewerproblemsyou’llhavelater.Onceagain,besuretocheckeveryjointwithamagnifyingglass.
Transferringcomponentsfromthebreadboardtotheperforatedboardshouldbefairlysimple,aslongasyoudon’ttrytomovetoomanyatonce.Followthesuggestionsdescribedinprevioussection“Essentials:Perfboardprocedure,”andpausefrequentlytocheckyourconnections.Impatienceisalmostalwaysthecauseoferrorsinthiskindofwork.Figure3-103showsthenoisemakersectionofthecircuitonperfboard,withthecomponentspositionedtominimizewastedspace.Figure3-104showstheperfboardwiththerelayanditsassociatedcomponentsadded.Thetwoblackwireswillgototheloudspeaker,theblack-and-redpairofwireswillbringpowertotheboard,andthegreenwireswillgotothemagneticsensorswitches.Eachwirepenetratestheboard,anditsstrippedendissolderedtothecopperbeneath.
Figure3-103.Thenoisemakercircuithasbeentransplantedfrombreadboardtoperforatedboard,withnoadditionsorchanges.
Figure3-104.Therelay-transistorcontrolcircuithasbeenadded.Wirestoexternaldeviceshavebeenstrippedandpokedintotheperforatedboard,wheretheyaresolderedinplace.Thegreenwiresconnectwiththesensornetwork,theblackwiresgototheloudspeaker,andthered-and-blackwires
supplypower.
Testitnow,inthesamewaythatyoutestedthesamecircuitonthebreadboard.Ifitdoesn’twork,checkthefollowingsection,“Essentials:Real-worldfaulttracing.”Ifitdoeswork,you’rereadytotrimtheboardandmountitinaprojectbox.
ESSENTIALS
![Page 121: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/121.jpg)
Real-worldfaulttracingHere’sareal-lifedescriptionoftheprocedurefortracingafault.AfterIassembledtheperfboardversionofthecombinednoisemakerandrelaycircuit,Icheckedmywork,appliedpower—andalthoughtherelayclicked,nosoundcameoutoftheloudspeaker.Ofcourse,everythinghadworkedfineonthebreadboard.FirstIlookedatcomponentplacement,becausethisistheeasiestthingtoverify.Ifoundnoerrors.ThenIflexedtheboardgentlywhileapplyingpower—andtheloudspeakermadeabrief“beep.”Anytimethishappens,youcanbevirtuallycertainthatasolderjointhasatinycrackinit.Thenextstepwastoanchortheblackleadofmymetertothenegativesideofthepowersupply,andthenswitchonthepowerandgothroughthecircuitpointbypoint,fromtoptobottom,checkingthevoltageateachpointwiththeredleadofthemeter.Inasimplecircuitlikethis,everypartshouldshowatleastsomevoltage.ButwhenIgottothesecond2N2222transistor,whichpowerstheloudspeaker,itsoutputwascompletelydead.EitherIhadmeltedthetransistorwhilesolderingit(unlikely),ortherewasabadjoint.Icheckedtheperfboardbeneaththetransistorwiththemagnifyingglass,andfoundthatsolderhadflowedaroundoneoftheleadsofthetransistorwithoutactuallystickingtoit.Thegapmusthavebeenlessthanone-thousandthofaninch,butstill,thatwasenough.Probably,theproblemhadbeencausedbydirtorgrease.Thisisthekindofpatientinquiryyouneedtofollowwhenacircuitdoesn’twork.Checkwhetheryourcomponentsareplacedcorrectly,checkyourpowersupply,checkthepowerontheboard,checkthevoltageateachstage,andifyouarepersistent,you’llfindthefault.
SwitchesandInputsfortheAlarmNowyouneedtomakethesystemeasytouse.TheblockdiagraminFigure3-105showsoneadditionalboxnearthetopofthesequence:UserControls.Thesewillconsistofswitches,LEDs,andconnectionstotheoutsideworld.Toplanthispartofthejob,firstIhavetosummarizethewayinwhichouralarmsystemworksatthispointinitsevolution.
Figure3-105.Thefinalblockdiagramforthisphaseoftheprojectshowswhereusercontrolsfitintheseriesoffunctions.
Afull-featuredhomealarmsystemnormallyhastwomodes:in-homeandaway-from-home:
Usingthein-homemode,youswitchonthealarmwhileyouareathomesothatitwillalertyouifanintruderopensadoororwindow.Usingtheaway-from-homemode,typicallyyouenteracodenumber,afterwhichyouhave30secondstoleaveandclosethedoorbehindyou.Whenyoureturn,youtriggerthealarmbyopeningthedoor,butnowyouhave30secondstogotothecontrolpanelandenteryourcodenumberagaintostopthealarmfromsounding.
Sofar,thealarmsystemthatyou’vebeenbuildinghasonlyanin-homemode.Still,manypeoplefindthisfunctionusefulandreassuring.LaterinthebookI’llsuggestawayinwhichyoucanmodifyittoincorporateanaway-from-homemode,butfornow,makingitpracticalforin-homeuseisenoughofachallenge.Considerhowitshouldbeusedonaneverydaybasis.Itshouldhaveanon/offswitch,naturally.Whenit’son,anyofthemagneticsensorswitchesshouldtriggerthealarm.Butwhatifyouswitchitonwithoutrealizingthatyou’veleftawindowopen?Atthattimeitwon’tbeappropriateforthealarmtosound.Whatyoureallyneedisacircuit-testfeature,totellyouifallthedoorsandwindowsareclosed.Thenyoucanswitchonthealarm.Ithinkapushbuttonwouldbeusefultotestthealarmcircuit.Whenyoupressit,agreenLEDshouldlightuptoindicatethatthecircuitisgood.Afteryouseethegreenlight,youletgoofthepushbuttonandturnonthepowerswitch,whichilluminatesaredLED,toremindyouthatthealarmisnowarmedandready.Oneadditionalfeaturewouldbeuseful:analarmnoisemakertestfeature,sothatyoucanbesurethatthesystemiscapableofsoundingitsalertwhenrequiredtodoso.ThecircuitshowninFigure3-106incorporatesallofthesefeatures.S1isaSPDTswitch;S2isaDPDTmomentarypushbuttonofON-(ON)type.IsplicedS2intothecircuitbyfirstcuttingthetwogreenwiresthatconnectthesensorswitcheswiththerestoftherelaycircuit.IthenattachedonepairofthosewirestoonesideofS2andtheotherpairtotheotherside,asshowninthefigure.Theschematicshowsitinits“relaxed”mode,whenthebuttonisnotbeingpressed.D1isaredLED,D2isagreenLED,J1isapowerinputjack(tobeconnectedwithanexternal12-voltsupply),andR1isa680ΩresistortoprotecttheLEDs.NotethatJ1followstheusualpracticeofsupplyingpositivevoltageinitscentercontact,andnegativeinthecircularshellaroundthecenter.WhenS1isinitsOffposition,itstillsuppliespositivepowerthroughitsuppercontacttoS2,thepushbutton.Whenthepushbuttonispressed,sothatitgoesintoits“Test”position,thepoleofS2connectswiththepowerandsendsitoutthroughthesensorswitchesondoorsandwindows.Thewirestotheseswitcheswillbeattachedviaacoupleofbindingposts,shownhereastwocircles.Ifthesensorswitchesareallclosed,powerreturnsthroughthesecondbindingpost,passesthroughthelowersetofcontactsinS2,andlightsD2,thegreenLED.BecauseS1isnotsupplyingpowertothealarmcircuitboard,thealarmdoesnotsoundatthistime.
![Page 122: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/122.jpg)
Figure3-106.Thisschematicsuggestsaconvenientwaytoaddanon/offswitch,acontinuitytestingfeature,andanoisemakertestingfeaturetothealarm.
NowifS1isturnedtoitsOnposition,itsendspowertothecomponentsontheperforatedboard.TherelaysectionofthecircuitsendspoweroutalongthegreenwirestoS2,andaslongasthebuttonisnotbeingpressed,thepowergoesoutthroughtheswitchnetworkandbackthroughS2,totherelaysection,justasbeforeS2wassplicedin.Sothealarmremainssilent.Butassoonasasensorswitchisopened,thecircuitisbrokenandthealarmsounds.TheonlywaytostopitwillbebyswitchingS1intoitsOffposition.Finally,ifyoupressS2,thepushbutton,whileS1isinitsOnmode,youinterruptthenetworkofswitchesandactivatethenoisemaker.Inthisway,S2doesdualduty:whenS1isoff,pushbuttonS2teststhesensorswitchesforcontinuity.WhenS1ison,S2teststhenoisemakertomakesureitcreatesanoise.Ithinkthisisthesimplestpossiblewaytoimplementthesefeatures.
InstallingtheSwitchesIfyouboughtaprojectboxfromRadioShack,itmayhavecomewithtwooptionaltoppanels:onemadeofmetal,theothermadeofplastic.I’llassumethatyou’llusetheplasticone,asyou’llhavemoretroubledrillingholesinmetal.ThetypeofplasticusedbyRadioShackisABS,whichisveryeasytoshapewiththetoolsthatIhaverecommended.Youhavetochoosealayoutfortheswitchesandothercomponentsthatwillsharethetoppaneloftheprojectbox.Ilikealayouttobeneat,soItakethetroubletodrawitusingillustrationsoftware,butafull-sizepencilsketchisalmostasgood.Justmakesurethere’sroomforthecomponentstofittogether,andtrytoplacethemsimilarlytotheschematic,tominimizetheriskofconfusion.Tapeyoursketchtotheinsideofthetoppanel,asshowninFigure3-107,andthenuseasharppointedtool,suchasapick,topressthroughandmarktheplasticatthecenterofeachhole.Theindentationswillhelptocenteryourbitwhenyoudrilltheholes.Rememberthatyou’llneedtomakemultipleholestoventthesoundfromtheloudspeaker,whichwillbebeneaththetoppanelofthebox.TheresultisshowninFigure3-108.
Figure3-107.Aprintedlayoutfortheswitches,LEDs,andothercomponentshasbeentapedtotheundersideofthelidoftheprojectbox.Anawlispressedthroughthepapertomarkthecenterofeachholetobedrilledinthelid.
Figure3-108.Theexteriorofthepanelafterdrilling.Asmallhandheldcordlessdrillcancreateaneatresultiftheholesweremarkedcarefully.
Iplacedallthecomponentsonthetoppanel,withtheexceptionofthepowerinputjack,whichIpositionedatoneendofthebox.Naturally,eachholehastobesizedtofititscomponent,andifyouhavecalipers,they’llbeveryusefulfortakingmeasurementsandselectingtherightdrillbit.Otherwise,makeyourbestguess,toosmallbeingbetterthantoolarge.Adeburringtoolisidealforslightlyenlargingaholesothatacomponentfitssnugly.Thismaybenecessaryifyoudrill3/16-inchholesforyour5-inchmmLEDs.Fractionallyenlargeeachhole,andtheLEDsshouldpushinverysnugly.Ifyourloudspeakerlacksmountingholes,you’llhavetoglueitinplace.Iusedfive-minuteepoxytodothis.Becarefulnottousetoomuch.Youdon’twantanyofthegluetotouchthespeakercone.Drillinglargeholesinthethin,softplasticofaprojectboxcanbeaproblem.Thedrillbittendstodiginandcreateamess.Youcanapproachthisprobleminoneofthreeways:1.UseaForstnerdrillbitifyouhaveone.Itcreatesaverycleanhole.2.Drillaseriesofholesofincreasingsize.
![Page 123: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/123.jpg)
3.Drillasmallerholethanyouneed,andenlargeitwithadeburringtool.Regardlessofwhichapproachyouuse,you’llneedtoclamporholdthetoppaneloftheprojectboxwithitsoutsidesurfaceface-downonapieceofscrapwood.Thendrillfromtheinside,sothatyourbitwillpassthroughtheplasticandintothewood.Finally,mountthecomponentsinthepanel,asshowninFigure3-109,andturnyourattentiontotheunderneathpartofthebox.Thecircuitboardwillsitonthebottom,heldinplacewithfour#4-sizemachinescrews(bolts)withwashersandnylon-insertlocknuts.Youneedtouselocknutstoeliminatetheriskofanutworkinglooseandfallingamongcomponentswhereitcancauseashortcircuit.
Figure3-109.Componentshavebeenaddedtothecontrolpaneloftheprojectbox(seenfromtheunderside).Theloudspeakerhasbeengluedinplace.SparegluewasdabbedontotheLEDs,justincase.TheSPDTon/offswitchisatthetopright,theDPDTpushbuttonisattopleft,andthebindingposts,
whichwillconnectwiththenetworkofmagneticsensorswitches,areatthebottom.
You’llhavetocuttheperfboardtofit,takingcarenottodamageanyofthecomponentsonit.Alsochecktheundersidetheboardforloosefragmentsofcoppertracesafteryoufinishcutting.Drillboltholesintheboard,ifnecessary,takingcareagainnottodamageanycomponents.Thenmarkthroughtheholestotheplasticbottomofthebox,anddrillthebox.Countersinktheholes(i.e.,beveltheedgesofaholesothataflat-headedscrewwillfitintoitflushwiththesurroundingsurface),pushthelittleboltsupfromunderneath,andinstallthecircuitboard.Beextremelycarefulnottoattachthecircuitboardtootightlytotheprojectbox.Thiscanimposebendingstresses,whichmaybreakajointoracoppertraceontheboard.Iliketoincludeasoftpieceofplasticundertheboardtoabsorbanystresses.Becauseyou’reusinglocknuts,whichwillnotloosen,there’snoneedtomakethemespeciallytight.Testthecircuitagainaftermountingthecircuitboard,justincase.
SolderingtheSwitchesFigure3-110showshowthephysicalswitchesshouldbewiredtogether.RememberthatS1isatoggleswitchandS2isaDPDTpushbutton.Yourfirststepistodecidewhichwayuptheyshouldbe.Useyourmetertofindoutwhichterminalsareconnectedwhentheswitchisflipped,andwhenthebuttonispressed.You’llprobablywanttheswitchtobeonwhenthetoggleisflippedupward.Beespeciallycarefulwiththeorientationofthepushbutton,becauseifyouwireitupside-down,itwillconstantlyhavethealarmin“test”mode,whichisnotwhatyouwant.Remember,thecenterterminalofanydouble-throwswitchisalmostalwaysthepoleoftheswitch,connectingwiththeterminalsimmediatelyaboveitandbelowit.Strandedwireisappropriatetoconnectthecircuitboardwiththecomponentsinthetoppanel,becausethestrandsflexeasilyandimposelessstressonsolderjoints.Twistingeachpairofwirestogetherhelpstominimizethemess.RemembertoinstalltheLEDswiththeirshort,negativewiresconnectedwiththeresistor.Thiswillentailsomewire-to-wiresoldering.Youmaywanttoprotectsomeofthesebareleadsandjointswiththinheat-shrinktubing,tominimizetheriskofshortcircuitswhenyoupushallthepartsintothebox.Whenyouconnectwiresorcomponentswiththelugsontheswitches,yourpencil-stylesolderingironprobablywon’tdeliverenoughheattomakegoodjoints.Youcanuseyourhigher-poweredsolderingironintheselocations,butyouabsolutelymustapplyagoodheatsinktoprotecttheLEDswhenyouattachthem,anddon’tallowtheirontoremainincontactwithanythingformorethan10seconds.Itwillquicklymeltinsulation,andmayevendamagetheinternalpartsoftheswitches.Inprojectsthataremorecomplexthanthisone,itwouldbegoodpracticetolinkthetoppanelwiththecircuitboardmoreneatly.Multicoloredribboncableisidealforthispurpose,withplug-and-socketconnectorsthatattachtotheboard.Forthisintroductoryproject,Ididn’tbother.Thewiresjuststragglearound,asshowninFigure3-111.
Figure3-110.ThecomponentscanbewiredtogetherlikethistoreplicatethecircuitshowninTheredandgreencirclesareLEDs.Small,solidblackcirclesindicatewire-to-wiresolderjoints.
![Page 124: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/124.jpg)
Figure3-111.Thecircuitboardhasbeeninstalledinthebaseoftheprojectbox,andthepowerinputjackhasbeenscrewedintotheendofthebox.Twistedwire-pairshavebeenconnectedonapoint-to-pointbasis,withoutmuchconcernoverneatness,asthisisarelativelysmallproject.Thewhiteinsulationatthetop-rightcornerofthefrontpanelisheat-shrinktubethatenclosesasolderjointandthe680Ωloadresistor.Solderingwirestothe
pushbuttonswitchrequirescareandprecision,asthecontactsarecloselyspaced.
FinalTestWhenyou’vecompletedthecircuit,testit!Ifyoudon’thaveyournetworkofmagneticsensorswitchessetupyet,youcanjustuseapieceofwiretoconnectthetwobindingposts.MakesurethatS1isinitsOffposition,thensoldertheappropriateplugtoyour12-voltpowersource,andplugitintothepowerjack.Whenyoupressthebutton,thegreenLEDshouldlightuptoshowcontinuitybetweenthetwobindingposts.Nowdisconnectthewirebetweenthebindingposts,pressthebuttonagain,andthegreenLEDshouldremaindark.Reconnectthebindingposts,flipS1toitsOnposition,andtheredLEDshouldlightup.Pressthebutton,andthealarmshouldstart.ResetitbyturningS1offandthenonagain;thendisconnectthewirebetweenthebindingposts.Again,thealarmshouldstart,anditshouldcontinueevenifyoureconnectthewire.Ifeverythingworksthewayitshould,it’stimetoscrewthetopoftheboxinplace,pushingthewiresinside.Becauseyou’reusingalargebox,youshouldhavenoriskofmetalpartstouchingeachotheraccidentally,butstill,proceedcarefully.
AlarmInstallationBeforeyouinstallyourmagneticsensorswitches,youshouldtesteachonebymovingthemagneticmoduleneartheswitchmoduleandthenawayfromit,whileyouuseyourmetertotestcontinuitybetweentheswitchterminals.Theswitchshouldclosewhenit’snexttothemagnet,andopenwhenthemagnetisremoved.Nowdrawasketchofhowyou’llwireyourswitchestogether.Alwaysrememberthattheyhavetobeinseries,notinparallel!Figure3-112showstheconceptintheory.Thetwoterminalsarethebindingpostsontopofyourcontrolbox(whichisshowningreen),andthedarkredrectanglesarethemagneticsensorswitchesonwindowsanddoors.Becausethewireforthiskindofinstallationusuallyhastwoconductors,youcanlayitasI’veindicatedbutcutandsolderittocreatebranches.Thesolderjointsareshownasorangedots.Notehowcurrentflowsthroughalltheswitchesinseriesbeforeitgetsbacktothecontrolbox.
Figure3-112.Dual-conductor,whiteinsulatedwirecanbeusedtoconnecttheterminalsonthealarmcontrolboxwithmagneticsensors(shownindarkred).Becausethesensorsmustbeinseries,thewireiscutandjoinedatpositionsmarkedwithorangedots.
Figure3-113showsthesamenetworkasyoumightactuallyinstallitinasituationwhereyouhavetwowindowsandadoor.Thebluerectanglesarethemagneticmodulesthatactivatetheswitchmodules.
Figure3-113.Inaninstallationinvolvingtwowindowsandadoor,themagneticcomponentsofthesensors(bluerectangles)couldbeplacedasshown,whiletheswitches(darkred)arelocatedalongsidethem.
You’llneedalargequantityofwire,obviously.Thetypeofwhite,strandedwirethatissoldfordoorbellsorfurnacethermostatsisgood.Typically,itis20-gaugeorlarger.Afteryouinstallalltheswitches,clipyourmeterleadstothewiresthatwouldnormallyattachtothealarmbox.Setyourmetertotestcontinuity,andopeneachwindowordoor,oneatatime,tocheckwhetheryou’rebreakingthecontinuity.IfeverythingisOK,attachthealarmwirestothebindingpostsonyourprojectbox.Nowdealwiththepowersupply.UseyourACadapter,setto12volts,hookeduptoyourtypeNpowerplug,orattachthepowerplugtoa12-voltalarmbattery.Ifyouuseabattery,beespeciallycarefulthatthewireleadingtothecenterterminalofyourpowerplugispositive!A12-voltbatterycandeliversubstantialcurrent,whichcanfryyourcomponentsifyouconnectitthewrongwayaround.Itwouldbeashametodestroyyourentireprojectattheverylaststep.Theonlyremainingtaskistolabeltheswitch,button,powersocket,andbindingpostsonthealarmbox.Youknowthattheswitchturnsthepoweronandoff,andthebuttonteststhecircuitandthenoisemaker,butnooneelseknows,andyoumightwanttoallow
![Page 125: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/125.jpg)
aguesttouseyouralarmwhileyou’reaway.Forthatmatter,monthsoryearsfromnow,youmayforgetsomedetails.Willyourememberthatthepowersourceforthisunitshouldbe12volts?Labelingreallyisagoodidea.ButasyoucanseeinFigure3-114,Ihaven’tquitegottenaroundtoitfortheboxthatIbuilt.
Figure3-114.Theintrusionalarmcompletedandinitsprojectbox.
ConclusionThealarmprojecthastakenyouthroughthebasicstepsthatyouwillusuallyfollowanytimeyoudevelopsomething:1.Drawaschematicandmakesurethatyouunderstandit.2.Modifyittofitthepatternofconductorsonabreadboard.3.Installcomponentsonthebreadboardandtestthebasicfunctions.4.Modifyorenhancethecircuit,andretest.5.Transfertoperforatedboard,test,andtracefaultsifnecessary.6.Addswitches,buttons,powerjack,andplugsorsocketstoconnectthecircuitwiththeoutsideworld.7.Mounteverythinginabox(andaddlabeling).
Whilegoingthroughthissequence,Ihopeyou’velearnedthebasicsofelectricity,alongwithsomesimpleelectricaltheory,andfundamentalsaboutelectroniccomponents.Thisknowledgeshouldenableyoutomoveontothemuchmorepowerfulrealmofintegratedcircuit—whichI’llcoverinChapter4.
ChoosetheRightTubingIfyouuseheat-shrinktubingon110vACcord,asisbeingdoneinthisexperiment,makesureyouusetubingthat’sbeenratedfor110vuse.
![Page 126: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/126.jpg)
4.Chips,Ahoy!
BeforeIgetintothefascinatingtopicofintegratedcircuit(IC)chips,Ihavetomakeaconfession:someofthethingsIaskedyoutodoinChapter3couldhavebeendoneabitmoresimply.Doesthismeanyouhavebeenwastingyourtime?No,Ifirmlybelievethatbybuildingcircuitswithold-fashionedcomponents—capacitors,resistors,andtransistors—youacquirethebestpossibleunderstandingoftheprinciplesofelectronics.Still,youaregoingtofindthatintegratedcircuitchips,containingdozens,hundreds,oreventhousandsoftransistorjunctions,willenablesomeshortcuts.
![Page 127: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/127.jpg)
ShoppingList:Experiments16Through24ToolsTheonlynewtoolthatIrecommendusinginconjunctionwithchipsisalogicprobe.Thistellsyouwhetherasinglepinonachiphasahighorlowvoltage,whichcanbehelpfulinfiguringoutwhatyourcircuitisdoing.TheprobehasamemoryfunctionsothatitwilllightitsLED,andkeepitlit,inresponsetoapulsethatmayhavebeentooquickfortheeyetosee.Searchonlineandbuythecheapestlogicprobeyoucanfind.Idon’thaveanyspecificbrandrecommendations.TheoneshowninFigure4-1isfairlytypical.
Figure4-1.Alogicprobedetectsthehighorlowvoltageoneachpinofachip,andrevealspulsesthatmayoccurtooquicklyforyoutoperceivethemwiththeunaidedeye.
SuppliesIntegratedcircuitchips
Ifyoubuyeverythingonthisshoppinglist,andyouboughtbasicpartssuchasresistorsandcapacitorsthatwerelistedpreviously,youshouldhaveeverythingyouneedforalltheprojectsinthischapter.Aschipsarequitecheap(currentlyaround50centsapiece),Isuggestyoubuyextras.Thisway,ifyoudamageone,you’llhavesomeinreserve.You’llalsohaveastockforfutureprojects.Pleasereadthenextsection,“Fundamentals:Choosingchips,”beforeyoubeginchip-shopping.Chipsshouldbeeasilyobtainablefromallthemajorelectronicsretailsuppliers,andsometimesarefoundoneBayshops.LookintheappendixforacompletelistofURLs.
FUNDAMENTALSChoosingchipsFigure4-2showswhatisoftenreferredtoasanintegratedcircuit(IC).Thecircuitisactuallyetchedontoatinywaferor“chip”ofsilicon,embeddedinablackplasticbody,whichisproperlyreferredtoasthe“package.”Tinywiresinsidethepackagelinkthecircuitwiththerowsofpinsoneitherside.Throughoutthisbook,Iwillusetheword“chip”torefertothewholeobject,includingitspins,asthisisthemostcommonusage.
Figure4-2.AnintegratedcircuitchipinPlasticDual-InlinePinpackage,abbreviatedPDIP,or,moreoften,DIP.
Thepinsaremountedatintervalsof1/10inchintworowsspaced3/10inchapart.ThisformatisknownasaPlasticDualInlinePackage,abbreviatedPDIP,or,moreoften,justDIP.Thechipinthephotographhasfourpinsineachrow;othersmayhavemanymore.Thefirstthingyouneedtoknow,whenshoppingforchips,isthatyou’llonlybeusingtheDIPpackage.Thisbookwillnotbefeaturingthemoremoderntype,knownas“surface-mount,”becausethey’remuchsmaller,moredifficulttohandle,andrequirespecialtoolsthatarerelativelyexpensive.Figure4-3showsasizecomparisonbetweena14-pinDIPpackageanda14-pinsurface-mountpackage.Manysurface-mountchipsareevensmallerthantheoneshown.Justabouteverychiphasapartnumberprintedonit.InFigure4-2,thepartnumberisKA555.InFigure4-3,theDIPchip’spartnumberisM74HC00B1,andthesurface-mountchipisa74LVC07AD.Youcanignorethesecondlineofnumbersand/orlettersoneachchip,astheyarenotpartofthepartnumber.NoticeinFigure4-3thateventhoughthechipslookquitedifferentfromeachother,theybothhave“74”intheirpartnumbers.Thisisbecausebothofthemaremembersofthe“7400”familyoflogicchips,whichoriginallyhadpartnumbersfrom7400andupward(7400,7401,7402,7403,andsoon).Oftentheyarenowreferredtoas“74xx”chips,where“xx”includesallthemembersofthefamily.I’llbeusingthisfamilyalot,soyouneedtoknowhowtobuythem.I’llgiveyousomeadviceonthatwithoutgoingintodetailsyetaboutwhatthechipsactuallydo.
Figure4-3.TheDIPchip,attherear,haspinsspaced1/10inchapart,suitableforinsertioninabreadboardorperforatedboard.Itcanbesolderedwithoutspecialtools.Thesmall-outlineintegratedcircuit(SOIC)surface-mountchip(foreground)hassoldertabsspacedat1/20inch.Othersurface-mountchipshavepinsspacedat1/40inchorevenless(thesedimensionsareoftenexpressedinmillimeters).Surface-mountchipsare
![Page 128: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/128.jpg)
designedprimarilyforautomatedassemblyandaredifficulttoworkwithmanually.Inthisphoto,theyellowlinesare1inchaparttogiveyouanideaofthescale.
TakealookatFigure4-4,whichshowshowtointerpretatypicalpartnumberina74xxfamilymember.Theinitiallettersidentifythemanufacturer(whichyoucanignore,asitreallymakesnodifferenceforourpurposes).Skipthelettersuntilyougettothe“74.”Afterthat,youfindtwomoreletters,whichareimportant.The74xxfamilyhasevolvedthroughmanygenerations,andtheletter(s)insertedafterthe“74”tellyouwhichgenerationyou’redealingwith.Somegenerationshaveincluded:
74L74LS74C74HC74AHC
Andtherearemore.Generallyspeaking,subsequentgenerationstendtobefasterormoreversatilethanpreviousgenerations.Inthisbook,forreasonsI’llexplainlater,wearemostlyusingtheHCgeneration.
FUNDAMENTALSChoosingchips(continued)Afterthelettersidentifyingthegeneration,you’llfindtwo(sometimesmore)numerals.Theseidentifythespecificfunctionofthechip.Youcanignoreanyremaininglettersandnumerals.LookingbackatFigure4-3,theDIPchippartnumber,M74HC00B1tellsyouthatitisachipinthe74xxfamily,HCgeneration,withitsfunctionidentifiedbynumerals00.Thesurface-mountchipnumber,74LVC07AD,tellsyouthatitisinthe74xxfamily,LVCgeneration,withfunctionidentifiedbynumerals07.Forconveniencewecouldrefertothefirstchipasa“74HC00”andthesecondchipasa“74LVC07”because,regardlessoftheirdifferentmanufacturersandpackagesizes,thefundamentalbehaviorofthecircuitinsideremainsthesame.Thepurposeofthislongexplanationistoenableyoutointerpretcataloglistingswhenyougochipshopping.Youcansearchfor“74HC00”andtheonlinevendorsareusuallysmartenoughtoshowyouappropriatechipsfrommultiplemanufacturers,eventhoughtherearelettersprecedingandfollowingthetermthatyou’researchedfor.Supposeacircuitrequiresa74HC04chip.Ifyousearchfor“74HC04”onthewebsiteofapartssupplier,youmayfindversionssuchastheCD74HC04M96byTexasInstruments,the74HC04NbyNXPSemiconductors,orMM74HC04NbyFairchildSemiconductor.Becausetheyallhave“74HC04”inthemiddle,anyofthemwillwork.JustbecarefulthatyoubuythelargerDIP-stylepackage,notthesurface-mountpackage.Ifthepartnumberhasan“N”ontheend,youcanbesurethatit’saDIPpackage.Ifthereisno“N”ontheend,itmayormaynotbeaDIPpackage,andyouwillhavetocheckaphotooradditionaldescriptiontomakesure.IfthepartnumberbeginswithSS,SO,orTSS,it’sabsolutelydefinitelysurface-mount,andyoudon’twantit.Manycatalogsshowphotographsofthechipstoassistyouinbuyingtherightpackagestyle.
Figure4-4.Lookforthechipfamily(74xx,inthiscase)withthecorrectgeneration(HC,inthiscase)embeddedinthenumber.MakesureyoubuytheDIPversion,notthesurface-mountversion.Themanufacturerisunimportant.
Here’syourchiplist:
555Timer.STMicroelectronicsSA555N,FairchildNE555D,RadioShackTLC555(partnumber276-1723),orsimilar.Donotgetthe“CMOS”versionofthischip,oranyfancyversionssuchasthoseofhighprecision.Buythecheapestyoucanfind.Quantity:10.ThechipinFigure4-2isa555timer.Logicchipstypes74HC00,74HC02,74HC04,74HC08,74HC32,and74HC86.ActualpartnumberscouldbeM74HC00B1,M74HC02B1,M74HC04B1,andsoon,bySTMicroelectronics,orSN74HC00N,SN74HC02N,SN74HC04N,andsoon,byTexasInstruments.Anyothermanufacturersareacceptable.Remember,eachpartnumbershouldhave“HC”inthemiddleofit,andyouwanttheDIPorPDIPpackage,notsurface-mount.Quantityofeach:Atleast4.4026DecadeCounter(achipthatcountsintens).TexasInstrumentsCD4026BEorsimilar.Quantity:4(you’llneed3,butbecausethisisaCMOSchipsensitivetostaticelectricity,youshouldhaveatleastoneinreserve).Anychipwith“4026”initspartnumbershouldbeOK.74LS92counterchip,74LS06open-collectorinverterchip,and74LS27triple-inputNORchip.Quantity:2ofeach.Notethe“LS”inthesepartnumbers!TherewillbeoneexperimentinwhichIwantyoutousetheLSgenerationinsteadoftheHCgeneration.
ICsocketsIsuggestthatyouavoidsolderingchipsdirectlyontoperforatedboard.Ifyoudamagethem,they’redifficulttoremove.BuysomeDIPsockets,solderthesocketsontotheboard,andthenplugthechipsintothesockets.Youcanusethecheapestsocketsyoucanfind(youdon’tneedgold-platedcontactsforourpurposes).Youwillneed8-pin,14-pin,and16-pinDIPsockets,suchasparts276-1995,276-1999,and276-1998fromRadioShack.SeeFigure4-5.Quantityofeach:5minimum.
![Page 129: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/129.jpg)
Figure4-5.Whenyou’resolderingacircuitontoperforatedboard,socketseliminatetheriskofoverheatingintegratedcircuitchipsandreducetheriskofzappingthemwithstaticelectricity,andenableeasyreplacement.
Low-powerLEDsThelogicchipsthatyou’llbeusingarenotdesignedtodeliversignificantpower.You’llneedtoaddtransistorstoamplifytheiroutputifyouwanttodrivebrightLEDsorrelays.Becauseaddingtransistorsisahassle,Isuggestanalternative:Speciallow-powerLEDsthatwilldrawaslittleas1mA,suchastheEverlightmodelT-100LowCurrentRed,partnumberHLMPK150.Figure4-6showsasizecomparisonwitharegular5mmLED.Quantity:10(ataminimum).
Figure4-6.AnHCserieslogicchipisratedtodeliveronly4mAateachpin.Thisisinadequatetodriveatypical5mmLED(right),whichisratedfor20mAforwardcurrent.Miniature,low-currentLEDs(left)willuseaslittleas1mAinserieswithasuitableresistor,andareidealfortestcircuitsin
whichyouwanttoseetheoutputwithaminimumofhassle.
LEDnumericdisplaysInatleastoneofourprojects,you’llwanttoilluminatesomeseven-segmentLEDnumerals.You’llneedeitherthreeindividualnumerals,oronepackagecontainingthreenumerals,suchastheKingbrightHighEfficiencyRedDiffused,partnumberBC56-11EWA,whichwillbespecificallyreferredtoinschematicsinthisbook.Ifyoubuyadifferentseven-segmentdisplay,itmustbeanLEDwitha“commoncathode.”(Don’tbuyliquid-crystalLCDnumerals;theyrequiredifferentelectronicstodrivethem.)Ifyouhaveachoiceofpowerconsumption,buywhicheverproductconsumestheleastcurrent.SeeFigure4-7.
Figure4-7.Seven-segmentdisplaysarethesimplestwaytoshowanumericoutputandcanbedrivendirectlybysomeCMOSchips.Forfinishedprojects,theyaretypicallymountedbehindtransparentredacrylicplasticpanels.
Signaldiode1N4148orsimilar.Quantity:5minimum.
LatchingrelaysYou’regoingtoneeda5-voltlatchingrelaythathastwocoils,insteadofone.Thefirstcoilflipstherelayoneway;thesecondcoilflipsitback.Therelayconsumesnoadditionalpowerwhileremainingpassivelyineachstate.IsuggestthePanasonicDS2E-SL2-DC5Vrelay.Ifyoubuyadifferentrelay,itmustbedual-coillatchingtorunoff5voltsDC,switchingatleast1amp,ina“2formC”package,tofityourbreadboard.
PotentiometersYou’llneed5K,10K,and100Klinearpotentiometers(oneofeach).Also,a10Ktrimmerpotentiometer(whichyoumayfinddescribedjustasa“trimmer”).Themanufacturerisunimportant.Atrimmerpotentiometermaycloselyresembleafull-sizepotentiometer,exceptthatitisminiaturized,withascrewheadinthecenter,insteadofashaft.However,manytrimmersprovidegreateraccuracybyusingaside-mountedscrewthatturnsaconcealedinternalreductiongear.ThistypeisshowninFigure5-117.Youcanuseeithertypefortheexperimentsinthisbook,andthepinstendtobearrangedsimilarly,withthecenterpinprovidingavariableresistancebetweenthepinsateithersideofit.
VoltageregulatorsBecausemanylogicchipsrequireprecisely5voltsDC,youneedavoltageregulatortodeliverthis.TheLM7805doesthejob.Hereagain,thechipnumberwillbeprecededorfollowedwithanabbreviationidentifyingthemanufacturerandpackagestyle,asintheLM7805CTfromFairchild.Anymanufacturerwilldo,butthepackageshouldlookliketheoneinFigure4-8,andifyouhaveachoice,buyaregulatorthatcandeliveratleast1amp.
Figure4-8.Manyintegratedcircuitchipsrequireacontrolledpowersupplyof5volts,whichcanbedeliveredbythisregulatorwhenyouapply7.5to9voltstoit.Thelefthandpinisforpositiveinput,thecenterpinisacommonground,andtherighthandpinisthe5Voutput.Forcurrentsexceeding
250mA,youshouldbolttheregulatortoametalheatsinkusingtheholeatthetop.
TactileswitchesTheseareSPSTpushbuttons(momentaryswitches),usuallywithfourlegs.LookfortheALPSpartnumberSKHHAKA010oranysimilaritemthathaspinstofityourbreadboardorperforatedboard.SeeFigure4-9.
![Page 130: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/130.jpg)
Figure4-9.Atactileswitchdeliverstactilefeedbackthroughyourfingertipwhenyoupressit.TheyarealmostalwaysSPSTpushbuttonsdesignedformountingincircuitboardswithstandard1/10-inchholespacing.
12-keynumerickeypadVelleman“12keyskeyboardwithcommonoutput”(nopartnumber,buthasbeenavailablethroughAllElectronicsundercatalogcodeKP-12).Quantity:1.Thistypeofkeypadhasthesamelayoutasanold-fashionedtouchtonephone.Itshouldhaveatleast13pinsorcontacts,12ofwhichconnectwithindividualpushbuttons,thethirteenthconnectingwiththeothersideofallthepushbuttons.Inotherwords,thelastpinis“common”toallofthem,andthistypeofkeypadisoftendescribedashavinga“commonoutput.”Thetypeofkeypadthatyoudon’twantis“matrix-encoded,”withfewerthan13contacts,requiringadditionalexternalcircuitry.SeeFigures4-10and4-11.Ifyoucan’tfindtheVellemankeypadthatIsuggest,lookcarefullyatkeypaddescriptionsandphotographstomakesurethattheoneyoubuyisnotmatrix-encodedandhasacommonterminal.Alternatively,youmaysubstitute12cheapSPSTNOpushbuttonsandmounttheminasmallprojectbox.
Figure4-10.Whenshoppingforanumerickeypad,itshouldhave12keysin“touchtonephone”layout,andshouldhaveatleast13contactsforinput/output.Thecontactsarevisibleherealongthefrontedge.
Figure4-11.Thiskeypadhasinsufficientpinsandwillnotworkinthecircuitinthisbook.
BACKGROUNDHowchipscametobeTheconceptofintegratingsolid-statecomponentsintoonelittlepackageoriginatedwithBritishradarscientistGeoffreyW.A.Dummer,whotalkedaboutitforyearsbeforeheattempted,unsuccessfully,tobuildonein1956.Thefirsttrueintegratedcircuitwasn’tfabricateduntil1958byJackKilby,workingatTexasInstruments.Kilby’sversionusedgermanium,asthiselementwasalreadyinuseasasemiconductor.(You’llencounteragermaniumdiodewhenIdealwithcrystalradiosinthenextchapterofthisbook.)ButRobertNoyce,picturedinFigure4-12,hadabetteridea.Bornin1927inIowa,inthe1950sNoycemovedtoCalifornia,wherehefoundajobworkingforWilliamShockley.ThiswasshortlyafterShockleyhadsetupabusinessbasedaroundthetransistor,whichhehadcoinventedatBellLabs.NoycewasoneofeightemployeeswhobecamefrustratedwithShockley’smanagementandlefttoestablishFairchildSemiconductor.WhilehewasthegeneralmanagerofFairchild,Noyceinventedasilicon-basedintegratedcircuitthatavoidedthemanufacturingproblemsassociatedwithgermanium.Heisgenerallycreditedasthemanwhomadeintegratedcircuitspossible.Earlyapplicationswereformilitaryuse,asMinutemanmissilesrequiredsmall,lightcomponentsintheirguidancesystems.Theseapplicationsconsumedalmostallchipsproducedfrom1960through1963,duringwhichtimetheunitpricefellfromaround$1,000to$25each,in1963dollars.Inthelate1960s,medium-scaleintegrationchipsemerged,eachcontaininghundredsoftransistors.Large-scaleintegrationenabledtensofthousandsoftransistorsononechipbythemid-1970s,andtoday’schipscancontainasmanyasseveralbilliontransistors.RobertNoyceeventuallycofoundedIntelwithGordonMoore,butdiedunexpectedlyofaheartattackin1990.Youcanlearnmoreaboutthefascinatingearlyhistoryofchipdesignandfabricationathttp://www.siliconvalleyhistorical.org.
Figure4-12.ThispictureofRobertNoyce,lateinhiscareer,isfromtheWikimediaCommons.
![Page 131: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/131.jpg)
![Page 132: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/132.jpg)
Experiment16:EmittingaPulseI’mgoingtointroduceyoutothemostsuccessfulchipevermade:the555timer.Asyoucanfindnumerousguidestoitonline,youmightquestiontheneedtodiscussithere,butIhavethreereasonsfordoingso:1.It’sunavoidable.Yousimplyhavetoknowaboutthischip.Somesourcesestimatethatmorethan1billionarestillbeingmanufacturedannually.Itwillbeusedinonewayoranotherinmostoftheremainingcircuitsinthisbook.
2.Itprovidesaperfectintroductiontointegratedcircuits,becauseit’srobust,versatile,andillustratestwofunctionsthatwe’llbedealingwithlater:comparatorsandaflip-flop.
3.Afterreadingalltheguidestothe555thatIcouldfind,beginningwiththeoriginalFairchildSemiconductordatasheetandmakingmywaythroughvarioushobbytexts,Iconcludedthatitsinnerworkingsareseldomexplainedveryclearly.Iwanttogiveyouagraphicunderstandingofwhat’shappeninginsideit,becauseifyoudon’thavethis,youwon’tbeinagoodpositiontousethechipcreatively.
Youwillneed:
9-voltpowersupply.Breadboard,jumperwires,andmultimeter.5Klinearpotentiometer.Quantity:1.555timerchip.Quantity:1.Assortedresistorsandcapacitors.SPSTtactileswitches.Quantity:2.LED(anytype).Quantity:1.
ProcedureThe555chipisveryrobust,butstill,intheory,youcanzapitwithajoltofstaticelectricityandkillit.Therefore,tobeonthesafeside,youshouldgroundyourselfbeforehandlingit.Seethe“Groundingyourself”warningonpage172fordetails.AlthoughthiswarningprimarilyreferstothetypeofchipsknownasCMOS,whichareespeciallyvulnerable,groundingyourselfisalwaysasensibleprecaution.Lookforasmallcircularindentation,calledthedimple,moldedintothebodyofthechip,andturnthechipsothattheindentationisatthetop-leftcornerwiththepinspointingdown.Alternatively,ifyourchipisofthetypewithanotchatoneend,turnthechipsothatthenotchisatthetop.Thepinsonchipsarealwaysnumberedcounterclockwise,startingfromthetop-leftpin(nexttothedimple).SeeFigure4-13,whichalsoshowsthenamesofthepinsonthe555timer,althoughyoudon’tneedtoknowmostofthemjustyet.
Figure4-13.The555timerchip,seenfromabove.Pinsonchipsarealwaysnumberedcounterclockwise,fromthetop-leftcorner,withanotchinthebodyofthechipuppermost,oracircularindentationattop-left,toremindyouwhichendisup.
Insertthechipinyourbreadboardsothatitspinsstraddlethechanneldownthecenter.Nowyoucaneasilyfeedvoltagestothepinsoneitherside,andreadsignalsoutofthem.SeeFigure4-14forapreciseguidetoplacement,inthefirstproject.Thetimerisidentifiedas“IC1,”because“IC”isthecustomaryabbreviationfor“IntegratedCircuit.”
Figure4-14.Thiscircuitallowsyoutoexplorethebehaviorofthe555timerchip.Useyourmetertomonitorthevoltageonpin2asshown.TherearenoresistorslabeledR1,R2,orR3andnocapacitorslabeledC1orC2,becausethey’llbeaddedinalaterschematic.Componentvaluesinthis
schematic:
R4:100KR5:2K2R6:10KR7:1K
R8:5KlinearpotentiometerC3:100µFelectrolyticC4:47µFelectrolyticC5:0.1µFceramicIC1:555timer
S1,S2:SPSTtactileswitches(pushbuttons)D1:GenericLED
![Page 133: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/133.jpg)
R5holdsthetrigger(pin2)positiveuntilS1ispressed,whichlowersthevoltagedependingonthesettingofpotentiometerR8.Whenthetriggervoltagefallsbelow1/3ofthepowersupply,thechip’soutput(pin3)goeshighforaperioddeterminedbythevaluesofR4andC4.S2resets(zeros)thetimer,byreducingthevoltagetopin4,theReset.C3smoothesthepowersupply,andC5isolatespin5,thecontrol,sothatitwon’tinterferewiththe
functioningofthistestcircuit.(We’llusethecontrolpininafutureexperiment.)
Allintegratedcircuitchipsrequireapowersupply.The555ispoweredwithnegativevoltageappliedtopin1andpositivetopin8.Ifyoureversethevoltageaccidentally,thiscanpermanentlydamagethechip,soplaceyourjumperwirescarefully.Setyourpowersupplytodeliver9volts.Itwillbeconvenientforthisexperimentifyousupplypositivedowntherighthandsideandnegativedownthelefthandsideofthebreadboard,assuggestedinFigure4-14.C3isalargecapacitor,atleast100µF,whichisplacedacrossthepowersupplytosmoothitoutandprovidealocalstoreofchargetofuelfast-switchingcircuits,aswellastoguardagainstothertransientdipsinvoltage.Althoughthe555isn’tespeciallyfast-switching,otherchipsare,andyoushouldgetintothehabitofprotectingthem.Beginwiththepotentiometerturnedallthewaycounterclockwisetomaximizetheresistancebetweenthetwoterminalsthatwe’reusing,andwhenyouapplytheprobefromyourmetertopin2,youshouldmeasureabout6voltswhenyoupressS1.NowrotatethepotentiometerclockwiseandpressS1again.IftheLEDdoesn’tlightup,keepturningthepotentiometerandpressingandreleasingthebutton.Whenyou’veturnedthepotentiometerabouttwo-thirdsoftheway,youshouldseetheLEDlightupforjustover5secondswhenyoupressandreleasethebutton.Herearesomefactsthatyoushouldcheckforyourself:
TheLEDwillkeepglowingafteryoureleasethebutton.Youcanpressthebuttonforanylengthoftime(lessthanthetimer’scycletime)andtheLEDalwaysemitsthesamelengthofpulse.Thetimeristriggeredbyafallinvoltageonpin2.Youcanverifythiswithyourmeter.TheLEDiseitherfullyonorfullyoff.Youcan’tseeafaintglowwhenit’soff,andthetransitionfromofftoonandontooffisverycleanandprecise.
CheckFigure4-16toseehowthecomponentsshouldlookonyourbreadboard,andthenlookattheschematicinFigure4-15tounderstandwhat’shappening.Iwillbeaddingmorecomponentslater,whichIwillbelabelingR1,R2,C1,andC2tobeconsistentwithdatasheetsthatyoumayseeforthe555timer.Therefore,inthisinitialcircuittheresistorsarelabeledR4andup,andcapacitorsC3andup.
Figure4-15.AschematicviewofthecircuitshowninFigure4-14.Throughoutthischapter,theschematicswillbelaidouttoemulatethemostlikelyplacementofcomponentsonabreadboard.Thisisnotalwaysthesimplestlayout,butwillbeeasiestforyoutobuild.RefertoFigure4-14forthevalues
ofthecomponents.
Figure4-16.Thisishowthecomponentslookwheninstalledonthebreadboard.Thealligatorclipsareattachedtoapatchcordthatlinksthe100µFcapacitortothepotentiometer.Thepowersupplyinputisnotshown.
WhenS1(thetactileswitch)isopen,pin2ofthe555timerreceivespositivepowerthroughR5,whichis2K2.Becausetheinputresistanceofthetimerisveryhigh,thevoltageonpin2isalmostthefull9volts.Whenyoupressthebutton,itconnectsnegativevoltagethroughR8,the5Kpotentiometertopin2.Thus,R8andR5formavoltagedividerwithpin2inthemiddle.Youmayrememberthisconceptfromwhenyouweretestingtransistors.Thevoltagebetweentheresistanceswillchange,dependingonthevaluesoftheresistances.IfR8isturnedupabouthalfway,itisapproximatelyequaltoR5,sothemidpoint,connectedtopin2,hasabouthalfthe9-voltpowersupply.Butwhenyouturnthepotentiometersothatitsresistancefallsfarther,thenegativevoltageoutweighsthepositivevoltage,sothevoltageonpin2graduallydrops.Ifyouhaveclipsonyourmeterleads,youcanhookthemontothenearestjumperwiresandthenwatchthemeterwhileyouturnthepotentiometerupanddownandpressthebutton.ThegraphsinFigure4-17illustratewhatishappening.Theuppergraphshowsthevoltageappliedtopin2byrandombutton-presses,withthepotentiometerturnedtovariousvalues.Thelowergraphshowsthatthe555istriggeredif,andonlyif,thevoltageonpin2activelydropsfromabove3voltstobelow3volts.What’ssospecialabout3volts?It’sone-thirdofour9-voltpowersupply.Here’sthetake-homemessage:
Theoutputofthe555(pin3)emitsapositivepulsewhenthetrigger(pin2)dropsbelowone-thirdofthesupplyvoltage.The555deliversthesamedurationofpositivepulseeverytime(solongasyoudon’tsupplyaprolongedlowvoltageonpin2).AlargervalueforR4orforC4willlengthenthepulse.Whentheoutput(pin3)ishigh,thevoltageisalmostequaltothesupplyvoltage.Whentheoutputgoeslow,it’salmostzero.
The555convertstheimperfectworldarounditintoapreciseanddependableoutput.Itdoesn’tswitchonandoffabsolutelyinstantly,butisfastenoughtoappearinstant.Nowhere’sanotherthingtotry.TriggerthetimersothattheLEDlightsup.Whileitisilluminated,pressS2,thesecondbutton,
![Page 134: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/134.jpg)
whichgroundspin4,thereset.TheLEDshouldgooutimmediately.Whentheresetvoltageispulledlow,theoutputgoeslow,regardlessofwhatvoltageyouapplytothetrigger.There’soneotherthingIwantyoutonoticebeforewestartusingthetimerformoreinterestingpurposes.IincludedR5andR6sothatwhenyoufirstswitchonthetimer,itisnotemittingapulse—butisreadytodoso.Theseresistorsapplyapositivevoltagetothetriggerandtheresetpin,tomakesurethatthe555timerisreadytorunwhenyoufirstapplypowertoit.Aslongasthetriggervoltageishigh,thetimerwillnotemitapulse.(Itemitsapulsewhenthetriggervoltagedrops.)Aslongastheresetvoltageishigh,thetimerisabletoemitapulse.(Itshutsdownwhentheresetvoltagedrops.)R5andR6areknownas“pull-upresistors”becausetheypullthevoltageup.Youcaneasilyoverwhelmthembyaddingadirectconnectiontothenegativesideofthepowersupply.Atypicalpull-upresistorforthe555timeris10K.Witha9-voltpowersupply,itonlypasses0.9mA(byOhm’sLaw).Finally,youmaybewonderingaboutthepurposeofC5,attachedtopin5.Thispinisknownthe“control”pin,whichmeansthatifyouapplyavoltagetoit,youcancontrolthesensitivityofthetimer.I’llgettothisinmoredetailalittlelater.Becausewearenotusingthisfunctionrightnow,it’sgoodpracticetoputacapacitoronpin5toprotectitfromvoltagefluctuationsandpreventitfrominterferingwithnormalfunctioning.Makesureyoubecomefamiliarwiththebasicfunctioningofthe555timerbeforeyoucontinue.
Figure4-17.Thetopgraphshowsvoltageonthetrigger(pin2)whenthepushbuttonispressed,fordifferentintervals,atdifferentsettingsofthepotentiometer.Thelowergraphshowstheoutput(pin3),whichrisesuntilitisalmostequaltothepowersupply,whenthevoltageonpin2dropsbelow
1/3thefullsupplyvoltage.
FUNDAMENTALSThefollowingtableshows555pulsedurationinmonostablemode:
Durationisinseconds,roundedtotwofigures.Thehorizontalscaleshowscommonresistorvaluesbetweenpin7andpositivesupplyvoltage.Theverticalscaleshowscommoncapacitorvaluesbetweenpin6andnegativesupplyvoltage.
Tocalculateadifferentpulseduration,multiplyresistance×capacitance×0.0011whereresistanceisinkilohms,capacitanceisinmicrofarads,anddurationisinseconds.
47µF 0.05 0.11 0.24 0.52 1.10 2.40 5.20 11.00 24.00 52.00
22µF 0.02 0.05 0.11 0.24 0.53 1.10 2.40 05.30 11.00 24.00
10µF 0.01 0.02 0.05 0.11 0.24 0.52 1.10 02.40 05.20 11.00
04.7µF 0.01 0.02 0.05 0.11 0.24 0.52 01.10 02.40 05.20
02.2µF 0.01 0.02 0.05 0.11 0.24 00.53 01.10 02.40
01.0µF 0.01 0.02 0.05 0.11 00.24 00.52 01.10
00.47µF 0.01 0.02 0.05 00.11 00.24 00.52
00.22µF 0.01 0.02 00.05 00.11 00.24
00.1µF 0.01 00.02 00.05 00.11
00.047µF 00.01 00.02 00.05
00.022µF 00.01 00.02
00.01µF 00.01
1K 2K2 4K7 10K 22K 47K 100K 220K 470K 1M
THEORYInsidethe555timer:monostablemodeTheplasticbodyofthe555timercontainsawaferofsilicononwhichareetcheddozensoftransistorjunctionsinapatternthatisfartoocomplextobeexplainedhere.However,Icansummarizetheirfunctionbydividingthemintogroups,asshowninFigure4-18.Anexternalresistorandtwoexternalcapacitorsarealsoshown,labeledthesamewayasinFigure4-15.Thenegativeandpositivesymbolsinsidethechiparepowersourceswhichactuallycomefrompins1and8,respectively.Iomittedtheinternalconnectionstothosepinsforthesakeofclarity.Thetwoyellowtrianglesare“comparators.”Eachcomparatorcomparestwoinputs(atthebaseofthetriangle)anddeliversanoutput(fromtheapexofthetriangle)dependingonwhethertheinputsaresimilarordifferent.We’llbeusingcomparatorsforotherpurposeslaterinthisbook.
![Page 135: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/135.jpg)
Figure4-18.Insidethe555timer.Whitelinesindicateconnectionsinsidethechip.AandBarecomparators.FFisaflip-flopwhichcanrestinonestateortheother,likeadouble-throwswitch.Adropinvoltageonpin2isdetectedbycomparatorA,whichtriggerstheflip-flopintoits“down”positionandsendsapositivepulseoutofpin3.WhenC4chargesto2/3ofsupplyvoltage,thisisdetectedbycomparatorB,whichresetstheflip-
floptoits“up”position.ThisdischargesC4throughpin7.
THEORYInsidethe555timer:monostablemode(continued)Thegreenrectangle,identifiedas“FF,”isa“flip-flop.”IhavedepicteditasaDPDTswitch,becausethat’showitfunctionshere,althoughofcourseitisreallysolid-state.Initiallywhenyoupowerupthechip,theflip-flopisinits“up”positionwhichdeliverslowvoltagethroughtheoutput,pin3.Iftheflip-flopreceivesasignalfromcomparatorA,itflipstoits“down”state,andflopsthere.WhenitreceivesasignalfromcomparatorB,itflipsbacktoits“up”state,andflopsthere.The“UP”and“DOWN”labelsonthecomparatorswillremindyouwhateachonedoeswhenitisactivated.Flip-flopsareafundamentalconceptindigitalelectronics.Computerscouldn’tfunctionwithoutthem.Noticetheexternalwirethatconnectspin7withcapacitorC4.Aslongastheflip-flopis“up,”itsinksthepositivevoltagecomingthroughR4andpreventsthecapacitorfromchargingpositively.Ifthevoltageonpin2dropsto1/3ofthesupply,comparatorAnoticesthis,andflipstheflip-flop.Thissendsapositivepulseoutofpin3,andalsodisconnectsthenegativepowerthroughpin7.SonowC4canstartchargingthroughR4.Whilethisishappening,thepositiveoutputfromthetimercontinues.Asthevoltageincreasesonthecapacitor,comparatorBmonitorsitthroughpin6,knownasthethreshold.Whenthecapacitoraccumulates2/3ofthesupplyvoltage,comparatorBsendsapulsetotheflip-flop,flippingitbackintoitsoriginalstate.Thisdischargesthecapacitorthroughpin7,appropriatelyknownasthedischargepin.Also,theflip-flopendsthepositiveoutputthroughpin3andreplacesitwithanegativevoltage.Thisway,the555returnstoitsoriginalstate.I’llsumupthissequenceofeventsverysimply:1.Initially,theflip-flopgroundsthecapacitorandgroundstheoutput(pin3).2.Adropinvoltageonpin2to1/3thesupplyvoltageorlessmakestheoutput(pin3)positiveandallowscapacitorC4tostartchargingthroughR4.3.Whenthecapacitorreaches2/3ofsupplyvoltage,thechipdischargesthecapacitor,andtheoutputatpin3goeslowagain.Inthismode,the555timeris“monostable,”meaningthatitjustgivesonepulse,andyouhavetotriggeritagaintogetanother.YouadjustthelengthofeachpulsebychangingthevaluesofR4andC4.Howdoyouknowwhichvaluestochoose?Checkthetableonpage157,whichgivesanapproximateideaandalsoincludesaformulasothatyoucancalculatevaluesofyourown.Ididn’tbothertoincludepulsesshorterthan0.01secondinthetable,becauseasinglepulseofthislengthisusuallynotveryuseful.AlsoIroundedthenumbersinthetableto2significantfigures,becausecapacitorvaluesareseldommoreaccuratethanthat.
BACKGROUNDHowthetimerwasbornBackin1970,whenbarelyahalf-dozencorporateseedlingshadtakenrootinthefertilegroundofSiliconValley,acompanynamedSigneticsboughtanideafromanengineernamedHansCamenzind.Itwasn’tahugebreakthroughconcept—just23transistorsandabunchofresistorsthatwouldfunctionasaprogrammabletimer.Thetimerwouldbeversatile,stable,andsimple,butthesevirtuespaledincomparisontoitsprimarysellingpoint.Usingtheemergingtechnologyofintegratedcircuits,Signeticscouldreproducethewholethingonasiliconchip.
![Page 136: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/136.jpg)
Figure4-19.HansCamenzind,inventoranddeveloperofthe555timerchipforSignetics.
Thisentailedsometrialanderror.Camenzindworkedalone,buildingthewholethinginitiallyonalargescale,usingoff-the-shelftransistors,resistors,anddiodesonabreadboard.Itworked,sothenhestartedsubstitutingslightlydifferentvaluesforthevariouscomponentstoseewhetherthecircuitwouldtoleratevariationsduringproductionandotherfactorssuchaschangesintemperaturewhenthechipwasinuse.Hemadeatleast10differentversionsofthecircuit.Ittookmonths.Nextcamethecraftswork.CamenzindsatatadraftingtableandusedaspeciallymountedX-Actoknifetoscribehiscircuitintoalargesheetofplastic.Signeticsthenreducedthisimagephotographicallybyaratioofabout300:1.Theyetcheditintotinywafers,andembeddedeachoftheminahalf-inchrectangleofblackplasticwiththeproductnumberprintedontop.Thus,the555timerwasborn.Itturnedouttobethemostsuccessfulchipinhistory,bothinthenumberofunitssold(tensofbillionsandcounting)andthelongevityofitsdesign(unchangedinalmost40years).The555hasbeenusedineverythingfromtoystospacecraft.Itcanmakelightsflash,activatealarmsystems,putspacesbetweenbeeps,andcreatethebeepsthemselves.Today,chipsaredesignedbylargeteamsandtestedbysimulatingtheirbehaviorusingcomputersoftware.Thus,chipsinsideacomputerenablethedesignofmorechips.TheheydayofsolodesignerssuchasHansCamenzindislonggone,buthisgeniuslivesinsideevery555timerthatemergesfromafabricationfacility.(Ifyou’dliketoknowmoreaboutchiphistory,seehttp://www.semiconductormuseum.com/Museum_Index.htm.)
FUNDAMENTALSWhythe555isusefulInitsmonostablemode(whichiswhatyoujustsaw),the555willemitasinglepulseoffixed(butprogrammable)length.Canyouimaginesomeapplications?Thinkintermsofthepulsefromthe555controllingsomeothercomponent.Amotionsensoronanoutdoorlight,perhaps.Whenaninfra-reddetector“sees”somethingmoving,thelightcomesonforaspecificperiod—whichcanbecontrolledbya555.Anotherapplicationcouldbeatoaster.Whensomeonelowersasliceofbread,aswitchwillclosethattriggersthetoastingcycle.Tochangethelengthofthecycle,youcoulduseapotentiometerinsteadofR4andattachittotheexternalleverthatdetermineshowdarkyouwantyourtoast.Attheendofthetoastingcycle,theoutputfromthe555wouldpassthroughapowertransistor,toactivateasolenoid(whichislikearelay,exceptthatithasnoswitchcontacts)toreleasethetoast.Intermittentwindshieldwiperscouldbecontrolledbya555timer—andonearliermodelsofcars,theyactuallywere.AndwhatabouttheburglaralarmthatwasdescribedattheendofChapter3?OneofthefeaturesthatIlisted,whichhasnotbeenimplementedyet,isthatitshouldshutitselfoffafterafixedinterval.Wecanusethechangeofoutputfroma555timertodothat.Theexperimentthatyoujustperformedseemedtrivial,butreallyitimpliesallkindsofpossibilities.
555timerlimits1.Thetimercanrunfromastablevoltagesourcerangingfrom5to15volts.2.Mostmanufacturersrecommendarangefrom1Kto1Mfortheresistorattachedtopin7.3.Thecapacitorvaluecangoashighasyoulike,ifyouwanttotimereallylongintervals,buttheaccuracyofthetimerwilldiminish.4.Theoutputcandeliverasmuchas100mAat9volts.Thisissufficientforasmallrelayorminiatureloudspeaker,asyou’llseeinthenextexperiment.
BewareofPin-Shuffling!Inalloftheschematicsinthisbook,I’llshowchipsasyou’dseethemfromabove,withpin1attopleft.Otherschematicsthatyoumaysee,onwebsitesorinotherbooks,maydothingsdifferently.Forconvenienceindrawingcircuits,peopleshufflethepinnumbersonachipsothatpin1isn’tnecessarilyshownadjacenttopin2.LookattheschematicinFigure4-20andcompareitwiththeoneinFigure4-15.Theconnectionsarethesame,buttheoneinFigure4-20groupspinstoreducetheapparentcomplexityofthewiring.
Figure4-20.Manypeopledrawschematicsinwhichthepinnumbersonachipareshuffledaroundtomaketheschematicsmallerorsimpler.Thisisnothelpfulwhenyoutrytobuildthecircuit.TheschematichereisforthesamecircuitasinFigure4-15.Thisversionwould
![Page 137: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/137.jpg)
behardertorecreateonabreadboard.
“Pinshuffling”iscommonbecausecircuit-drawingsoftwaretendstodoit,andonlargerchips,itisnecessaryforfunctionalclarityoftheschematic(i.e.,logicalgroupingsofpinnamesversusphysicalgroupingsonmemorychips,forexample).Whenyou’refirstlearningtousechips,Ithinkit’seasiertounderstandaschematicthatshowsthepinsintheiractualpositions.Sothat’sthepracticeIwillbeusinghere.
![Page 138: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/138.jpg)
Experiment17:SetYourToneI’mgoingtoshowyoutwootherwaysinwhichthe555timercanbeused.YouwillneedthesameitemsasinExperiment16,plus:
Additional555timerchip.Quantity:1.Miniatureloudspeaker.Quantity:1.100Klinearpotentiometer.Quantity:1.
ProcedureLeavethecomponentsfromExperiment16wheretheyareonthebreadboard,andaddthenextsectionbelowthem,asshowninFigures4-21and4-22.ResistorR2isinsertedbetweenpins6and7,insteadofthejumperwirethatshortedthepinstogetherinthepreviouscircuit,andthere’snoexternalinputtopin2anymore.Instead,pin2isconnectedviaajumperwiretopin6.Theeasiestwaytodothisisbyrunningthewireacrossthetopofthechip.IhaveomittedthesmoothingcapacitorfromtheschematicinFigure4-22,becauseI’massumingthatyou’rerunningthiscircuitonthesamebreadboardasthefirst,wheretheprevioussmoothingcapacitorisstillactive.Aloudspeakerinserieswitha100Ωresistor(R3)hasbeensubstitutedfortheLEDtoshowtheoutputfromthechip.Pin4,thereset,isdisabledbyconnectingittothepositivevoltagesupply,asI’mnotexpectingtousetheresetfunctioninthiscircuit.Nowwhathappenswhenyouapplypower?Immediately,youshouldhearnoisethroughtheloudspeaker.Ifyoudon’thearanything,youalmostcertainlymadeawiringerror.Noticethatyoudon’thavetotriggerthechipwithapushbuttonanymore.ThereasonisthatwhenC1chargesanddischarges,itsfluctuatingvoltageisconnectedviaajumperwireacrossthetopofthechiptopin2,thetrigger.Inthisway,the555timernowtriggersitself.I’lldescribethisinmoredetailinthenextsection“Theory:Insidethe555timer:astablemode,”ifyouwanttoseeexactlywhatisgoingon.Inthismode,thechipis“astable,”meaningthatitisnotstable,becauseitflipstoandfroendlessly,sendingastreamofpulsesforaslongasthepowerisconnected.Thepulsesaresorapidthattheloudspeakerreproducesthemasnoise.Infact,withthecomponentvaluesthatIspecifiedforR1,R2,andC1,the555chipisemittingabout1,500pulsespersecond.Inotherwords,itcreatesa1.5KHztone.Checkthetableonpage166toseehowdifferentvaluesforR2andC1cancreatedifferentpulsefrequencieswiththechipinthisastablemode.Notethatthetableassumesafixedvalueof1KforR1!
Figure4-21.ThesecomponentsshouldbeaddedonthesamebreadboardbelowthecomponentsshowninFigure4-14.Usethefollowingvaluestotestthe555timerinitsastablemode:
R1:1KR2:10KR3:100Ω
C1:0.047µFceramicorelectrolyticC2:0.1µFceramicIC2:555timer
Figure4-22.ThisistheschematicversionofthecircuitshowninFigure4-21.Thecomponentvaluesarethesame.
![Page 139: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/139.jpg)
THEORYInsidethe555timer:astablemodeHere’swhatishappeningnow,illustratedinFigure4-23.Initially,theflip-flopgroundsC1asbefore.Butnowthelowvoltageonthecapacitorisconnectedfrompin6topin2throughanexternalwire.Thelowvoltagetellsthechiptotriggeritself.Theflip-flopobedientlyflipstoits“on”positionandsendsapositivepulsetotheloudspeaker,whileremovingthenegativevoltagefrompin6.
Figure4-23.Whenthe555timerisusedinastablemode,resistorR2isplacedbetweenpin6andpin7,andpin6isconnectedviaanexternalwiretopin2,sothatthetimertriggersitself.
NowC1startscharging,asitdidwhenthetimerwasinmonostablemode,exceptthatitisbeingchargedthroughR1+R2inseries.Becausetheresistorshavelowvalues,andC1isalsosmall,C1chargesquickly.Whenitreaches2/3fullvoltage,comparatorBtakesactionasbefore,dischargingthecapacitorandendingtheoutputpulsefrompin3.Thecapacitortakeslongertodischargethanbefore,becauseR2hasbeeninsertedbetweenitandpin7,thedischargepin.Whilethecapacitorisdischarging,itsvoltagediminishes,andisstilllinkedtopin2.Whenthevoltagedropsto1/3offullpowerorless,comparatorAkicksinandsendsanotherpulsetotheflip-flop,startingtheprocessalloveragain.Summingup:1.Inastablemode,assoonaspowerisconnected,theflip-floppullsdownthevoltageonpin2,triggeringcomparatorA,whichflipstheflip-floptoits“down”position.2.Pin3,theoutput,goeshigh.ThecapacitorchargesthroughR1andR2inseries.3.Whenthecapacitorreaches2/3ofsupplyvoltage,theflip-flopgoes“up”andtheoutputatpin3goeslow.ThecapacitorstartstodischargethroughR2.4.Whenthechargeonthecapacitordiminishesto1/3offullvoltage,thepull-downonpin2flipstheflip-flopagainandthecyclerepeats.
Unequalon/offcyclesWhenthetimerisrunninginastablemode,C1chargesthroughR1andR2inseries.ButwhenC1discharges,itdumpsitsvoltagethroughR2only.Thismeansthatthecapacitorchargesmoreslowlythanitdischarges.Whileitischarging,theoutputonpin3ishigh;whileitisdischarging,theoutputonpin3islow.Consequentlythe“on”cycleisalwayslongerthanthe“off”cycle.Figure4-24showsthisasasimplegraph.Ifyouwanttheonandoffcyclestobeequal,orifyouwanttoadjusttheonandoffcyclesindependently(forexample,becauseyouwanttosendaverybriefpulsetoanotherchip,followedbyalongergapuntilthenextpulse),allyouneedtodoisaddadiode,asshowninFigure4-25.NowwhenC1charges,theelectricityflowsthroughR1asbeforebuttakesashortcutaroundR2,throughdiodeD1.WhenC1discharges,thediodeblockstheflowofelectricityinthatdirection,andsothedischargegoesbackthroughR2.
THEORYInsidethe555timer:astablemode(continued)R1nowcontrolsthechargetimeonitsown,whileR2controlsthedischargetime.Theformulaforcalculatingthefrequencyisnow:
Frequency=1.44/((R1+R2)×C1)orFrequency=1.4/((R1+R2)×C1)IfyousetR1=R2,youshouldgetalmostequalon/offcycles(“almost”becausethediodeitselfimposesasmallinternalvoltagedropofabout0.6V).Theexactvaluedependsprimarilyonthemanufacturingprocessusedtomakethediode.
Figure4-24.Initsusualastableconfiguration,thetimerchargesacapacitorthroughR1+R2anddischargesthecapacitorthroughR2only.Thereforeitsoutputoncyclesarelongerthanitsoutputoffcycles.
![Page 140: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/140.jpg)
Figure4-25.ThisisamodificationoftheschematicshowninFigure4-22.Byaddingadiodetoa555timerrunninginastablemode,weeliminateR2fromthechargingcycleofcapacitorC1.NowwecanadjusttheoutputoncyclewiththevalueofR1,andtheoutputoffcyclewiththevalueof
R2,sothattheonandoffdurationsareindependentofeachother.
FUNDAMENTALSThefollowingtableshows555timerfrequencyinastablemode:
Frequencyisinpulsespersecond,roundedtotwofigures.ThehorizontalscaleshowscommonresistorvaluesforR2.TheverticalscaleshowscommoncapacitorvaluesforC1.ResistorR1isassumedtobe1K.ResistorR1isassumedtobe1K.
Tocalculateadifferentfrequency:doubleR2,addtheproducttoR1,multiplythesumbyC1,anddividetheresultinto1440.Likethis:Frequency=1440/((R1+2R2)×C1)cyclespersecond
Inthisformula,R1andR2areinkilohms,C1isinmicrofarads,andthefrequencyisinhertz(cyclespersecond).Notethatthefrequencyismeasuredfromthestartofonepulsetothestartofthenext.Thedurationofeachpulseisnotthesameasthelengthoftimebetweeneachpulse.Thisissueisdiscussedintheprevioussection.
47µF 10 5.7 3.0 1.5 0.7 0.3 0.2 0.1
22µF 22 12.0 6.3 3.1 1.5 0.7 0.3 0.2 0.1
10µF 48 27.0 14.0 6.9 3.2 1.5 0.7 0.3 0.2 0.1
04.7µF 100 57.0 30.0 15.0 6.8 3.2 1.5 0.7 0.3 0.2
02.2µF 220 120.0 63.0 31.0 15.0 6.9 3.3 1.5 0.7 0.3
01.0µF 480 270.0 140.0 69.0 32.0 15.0 7.2 3.3 1.5 0.7
00.47µF 1,000 570.0 300.0 150.0 68.0 32.0 15.0 7.0 3.3 1.5
00.22µF 2,200 1,200.0 630.0 310.0 150.0 69.0 33.0 15.0 7.0 3.3
00.1µF 4,800 2,700.0 1,400.0 690.0 320.0 150.0 72.0 33.0 15.0 7.2
00.047µF 10,000 5,700.0 3,000.0 1,500.0 680.0 320.0 150.0 70.0 33.0 15.0
00.022µF 22,000 12,000.0 6,300.0 3,100.0 1,500.0 690.0 330.0 150.0 70.0 33.0
00.01µF 48,000 27,000.0 14,000.0 6,900.0 3,200.0 1,500.0 720.0 330.0 150.0 72.0
1K 2K2 4K7 10K 22K 47K 100K 220K 470K 1M
AstableModificationsInthecircuitsshowninFigures4-22or4-25,ifyousubstitutea100KpotentiometerforR2,youcanadjustthefrequencyupanddownbyturningtheshaft.Anotheroptionisto“tune”thetimerbyusingpin5,thecontrol,asshownintheFigure4-26.Disconnectthecapacitorthatwasattachedtothatpinandsubstitutetheseriesofresistorsshown.R9andR11areboth1Kresistors,eithersideofR10,whichisa100Kpotentiometer.Theyensurethatpin5alwayshasatleast1Kbetweenitandthepositiveandnegativesidesofthepowersupply.Connectingitdirectlytothepowersupplywon’tdamagethetimer,butwillpreventitfromgeneratingaudibletones.Asyouturnthepotentiometertoandfro,thefrequencywillvaryoverawiderange.Ifyouwanttogenerateaveryspecificfrequency,atrimmerpotentiometercanbeusedinstead.Aprimaryadvantageofusingpin5toadjustfrequencyisthatyoucancontrolitremotely.Taketheoutputfrompin3ofanother555timerrunningslowlyinastablemode,andpipeitthrougha2K2resistortopin5.Nowyougetatwo-tonesireneffect,asonetimercontrolstheother.If,inaddition,youadda100µFcapacitorbetweenpin5andground,thecharginganddischargingofthecapacitorwillmakethetoneslideupanddowninsteadofswitchingabruptly.I’lldescribethisinmoredetailshortly.Thisleadsmetothewholetopicofonechipcontrollinganotherchip,whichwillbeourlastvariationonthisexperiment.
![Page 141: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/141.jpg)
Figure4-26.Thecontrol(pin5)isseldomusedbutcanbeuseful.Varyingthevoltageonitwilladjustthespeedofthetimer.Thiscircuitenablesyoutotestthebehaviorofit.Componentvalues:
R1:1KR2:10K
R3:100ohmsR9,R11:1K
R10:100KlinearpotentiometerC1:0.047µF
ChainingChipsGenerallyspeaking,chipsaredesignedsothattheycantalktoeachother.The555couldn’tbeeasierinthisrespect:
Pin3,theoutput,fromone555canbeconnecteddirectlytopin2,thetrigger,ofasecond555.Alternatively,theoutputcanbesufficienttoprovidepowertopin8ofasecond555.Theoutputisappropriatetocontrolorpowerothertypesofchipstoo.
Figure4-27showstheseoptions.Whentheoutputfromthefirst555goeshigh,itisabout70to80%ofitssupplyvoltage.Inotherwords,whenyou’reusinga9Vsupply,thehighoutputvoltageisatleast6volts.Thisisstillabovetheminimumof5Vthatthesecondchipneedstotriggeritscomparator,sothere’snoproblem.
Figure4-27.Threewaystochain555timerstogether.TheoutputofIC1canpowerasecondtimer,oradjustitscontrolvoltage,oractivateitstriggerpin.
Youcanchaintogetherthetwo555timersthatyoualreadyhaveonyourbreadboard.Figure4-28showshowtoconnectthetwocircuitsthatwereshownpreviouslyinFigures4-15and4-22.Runawirefrompin3(theoutput)ofthefirstchiptopin8(thepositivepowersupply)ofthesecondchip,anddisconnecttheexistingwireconnectingpin8toyourpowersupply.Thenewwireisshowninred.Nowwhenyoupressthebuttontoactivatethefirstchip,itsoutputpowersthesecondchip.
Figure4-28.YoucancombinethetwocircuitsshowninFigures4-15and4-22simplybydisconnectingthewirethatprovidespowertopin8ofthesecondtimer,andrunningasubstitutewire(showninred).
Youcanalsousetheoutputfromonechiptotriggeranother(i.e.,youcanconnectpin3fromthefirstchiptopin2ofthesecond).Whentheoutputfromthefirstchipislow,it’slessthanhalfavolt.Thisiswellbelowthethresholdthatthesecondchiprequirestobeactivated.Whywouldyouwanttodothis?Well,youmightwanttohavebothtimersrunninginmonostablemode,sothattheendofahighpulsefromthefirstonetriggersthestartofahighpulseinthesecondone.Infact,youcouldchaintogetherasmanytimersasyoulikeinthisway,withthelastonefeedingbackandtriggeringthefirstone,andtheycouldflashaseriesofLEDsinsequence,likeChristmaslights.Figure4-29showsfourtimerslinkedthisway,wiredpoint-to-pointonperforatedboard.Eachoutputnumbered1through4coulddriveupto10LEDs,usingrelativelyhighloadresistorstolimittheircurrent.Thefourcapacitorsaroundtheedgesoftheschematicshouldbe0.1uF,toisolateeachtimerfromthenextwhileallowingatriggeringpulsetopassthrough.
![Page 142: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/142.jpg)
Figure4-29.Four555timers,chainedtogetherinacircle,canflashaseriesoffoursetsofLEDsinsequence,likeChristmaslightsoramoviemarquee.
Incidentally,youcanreducethechipcount(thenumberofchips)byusingtwo556timersinsteadoffour555timers.The556containsapairof555timersinonepackage.Butbecauseyouhavetomakethesamenumberofexternalconnections(otherthanthepowersupply),Ihaven’tbotheredtousethisvariant.Youcanevengeta558timerthatcontainsfour555circuits,allpresettofunctioninastablemode.Idecidednottousethischip,becauseitsoutputbehavesdifferentlyfromanormal555timer.Butyoucanbuya558timerandplaywithitifyouwish.Itisidealfordoingthe“chainoffourtimers”thatIsuggestedpreviously.Thedatasheetevensuggeststhis.Lastly,goingbacktotheideaofmodifyingthefrequencyofa555timerinastablemode,youcanchaintwotimers,asshowninFigure4-30.Theredwireshowstheconnectionfromtheoutputofthefirsttimertothecontrolpinofthesecond.Thefirsttimerhasnowbeenrewiredinastablemode,sothatitcreatesanoscillatingon/offoutputaroundoncepersecond.ThisoutputflashestheLED(togiveyouavisualcheckofwhat’sgoingon)andfeedsthroughR7tothecontrolpinofthesecondtimer.ButC2isalargecapacitor,whichtakestimetochargethroughR7.Whilethishappens,thevoltagedetectedbypin5slowlyrises,sothatthetonegeneratedbyIC2graduallylowersinpitch.ThenIC1reachestheendofitsoncycleandswitchesitselfoff,atwhichpointC2dischargesandthepitchofthesoundgeneratedbyIC2fallsagain.Youcantweakthiscircuittocreateallkindsofsounds,muchmorecontrollablythenwhenyouwereusingPUTtransistorstodothesamekindofthing.Herearesomeoptionstotry:
DoubleorhalvethevalueofC2.OmitC2completely,andexperimentwiththevalueofR7.Substitutea10KpotentiometerforR7.ChangeC4toincreaseordecreasethecycletimeofIC1.HalvethevalueofR5whiledoublingthevalueofC4,sothatthecycletimeofIC1staysaboutthesame,buttheOntimebecomessignificantlylongerthantheOfftime.Changethesupplyvoltageinthecircuitfrom9voltsto6voltsor12volts.
Remember,youcan’tdamagea555timerbymakingchangesofthiskind.Justmakesurethatthenegativesideofyourpowersupplygoestopin1andthepositivesidetopin8.
Figure4-30.Whenbothtimersareastable,butIC1runsmuchmoreslowlythanIC2,theoutputfromIC1canbeusedtomodulatethetonegeneratedbyIC2.Notethatasthisisasubstantialmodificationtothepreviousschematics,severalcomponentshavebeenrelabeled.Toavoiderrors,youmay
needtoremovetheoldcircuitfromyourbreadboardandbuildthisversionfromscratch.Trythesevaluesinitially:
R1,R4,R6,R7:1KR2,R5:10KR3:100ohmsC1:0.047µFC2,C3:100µF
C4:68µFC5:0.1µF
![Page 143: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/143.jpg)
Experiment18:ReactionTimerBecausethe555caneasilyrunatthousandsofcyclespersecond,wecanuseittomeasurehumanreactions.Youcancompetewithfriendstoseewhohasthefastestresponse—andnotehowyourresponsechangesdependingonyourmood,thetimeofday,orhowmuchsleepyougotlastnight.Beforegoinganyfurther,Ihavetowarnyouthatthiscircuitwillhavemoreconnectionsthanothersyou’vetackledsofar.It’snotconceptuallydifficult,butrequiresalotofwiring,andwillonlyjustfitonabreadboardthathas63rowsofholes.Still,wecanbuilditinaseriesofphases,whichshouldhelpyoutodetectanywiringerrorsasyougo.Youwillneed:
4026chip.Quantity:4(reallyyouneedonly3,butgetanotheroneincaseyoudamagetheothers).555timers.Quantity:3.Tactileswitches(SPSTmomentaryswitches).Quantity:3.ThreenumericLEDs,orone3-digitLEDdisplay(seetheshoppinglistatthebeginningofthischapter).Quantity:1.Breadboard,resistors,capacitors,andmeter,asusual.
Step1:DisplayYoucanusethreeseparateLEDnumeralsforthisproject,butIsuggestthatyoubuytheKingbrightBC56-11EWAontheshoppinglistatthebeginningofthischapter.Itcontainsthreenumeralsinonebigpackage.Youshouldbeabletoplugitintoyourbreadboard,straddlingthecenterchannel.Putitallthewaydownatthebottomofthebreadboard,asshowninFigure4-31.Don’tputanyothercomponentsonthebreadboardyet.Nowsetyourpowersupplyto9volts,andapplythenegativesideofittotherowofholesrunningupthebreadboardontherighthandside.Inserta1Kresistorbetweenthatnegativesupplyandeachofpins18,19,and26oftheKingbrightdisplay,whicharethe“commoncathode,”meaningthenegativeconnectionsharedbyeachsetofLEDsegmentsinthedisplay.(ThepinnumbersofthechipareshowninFigure4-33.Ifyou’reusinganothermodelofdisplay,you’llhavetoconsultadatasheettofindwhichpin(s)aredesignedtoreceivenegativevoltage.)Switchonthepowersupplyandtouchthefreeendofthepositivewiretoeachrowofholesservingthedisplayonitsleftandrightsides.Youshouldseeeachsegmentlightup,asshowninFigure4-31.
Figure4-31.Afterputtinga1Kresistorbetweenthecommoncathodeofthedisplayandthenegativesupplyvoltage,youcanusethepositivesupplyvoltagetoilluminateeachsegmentinturn.
Eachnumeralfrom0to9isrepresentedbyagroupofthesesegments.Thesegmentsarealwaysidentifiedwithlowercaselettersathroughg,asshowninFigure4-32.Inaddition,thereisoftenadecimalpoint,andalthoughwewon’tbeusingit,I’veidentifieditwiththeletterh.
Figure4-32.ThemostbasicandcommondigitalnumeralconsistsofsevenLEDsegmentsidentifiedbyletters,asshownhere,plusanoptionaldecimalpoint.
CheckFigure4-33showingtheKingbrightdisplay,andyou’llseeIhaveannotatedeachpinwithitsfunction.Youcanstepdownthedisplaywiththepositivewirefromyourpowersupply,makingsurethateachpinlightsanappropriatesegment.
![Page 144: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/144.jpg)
Figure4-33.ThisKingbrightunitincorporatesthreeseven-segmentnumericdisplaysinonepackage,andcanbedrivenbythreechained4026decadecounters.Thepinnumbersareshownclosetothechip.Segmentsathroughgofnumeral1areidentifiedas1athrough1g.Segmentsathroughgof
numeral2areidentifiedas2athrough2g.Segmentsathroughgofnumeral3areidentifiedas3athrough3g.
Incidentally,thisdisplayhastwopins,numbered3and26,bothlabeledtoreceivenegativevoltageforthefirstofthedigits.Whytwopinsinsteadofone?Idon’tknow.Youneedtouseonlyone,andasthisisapassivechip,itdoesn’tmatterifyouleavetheunusedoneunconnected.Justtakecarenottoapplypositivevoltagetoit,whichwouldcreateashortcircuit.Anumericdisplayhasnopowerorintelligenceofitsown.It’sjustabunchoflight-emittingdiodes.It’snotmuchuse,really,untilwecanfigureoutawaytoilluminatetheLEDsinappropriategroups—whichwillbethenextstep.
Step2:CountingFortunately,wehaveachipknownasthe4026,whichreceivespulses,countsthem,andcreatesanoutputdesignedtoworkwithaseven-segmentdisplaysothatitshowsnumbers0–9.Theonlyproblemisthatthisisaratherold-fashionedCMOSchip(meaning,ComplementaryMetalOxideSemiconductor)andisthussensitivetostaticelectricity.Checkthecautiononpage172beforecontinuing.Switchoffyourpowersupplyandconnectitswirestothetopofthebreadboard,notingthatforthisexperiment,we’regoingtoneedpositiveandnegativepoweronbothsides.SeeFigure4-34fordetails.Ifyourbreadboarddoesnotalreadyhavethecolumnsofholescolor-coded,IsuggestyouuseSharpiemarkerstoidentifythem,toavoidpolarityerrorsthatcanfryyourcomponents.
Figure4-34.Whenbuildingcircuitsaroundchips,it’sconvenienttohaveapositiveandnegativepowersupplydowneachsideofyourbreadboard.Forthereactiontimercircuit,a9Vsupplywitha100µFsmoothingcapacitorcanbesetuplikethis.Ifyourbreadboarddoesn’tcolor-codethecolumnsof
holesontheleftandrightsides,Isuggestyoudothatyourselfwithapermanentmarker.
The4026counterchipisbarelypowerfulenoughtodrivetheLEDsinourdisplaywhenpoweredby9volts.Makesureyouhavethechiptherightwayup,andinsertitintothebreadboardimmediatelyaboveyourthree-digitdisplay,leavingjustonerowofholesbetweenthemempty.TheschematicinFigure4-35showshowthepinsofthe4026chipshouldbeconnected.Thearrowstellyouwhichpinsonthedisplayshouldbeconnectedwithpinsonthecounter.Figure4-36showsthe“pinouts”(i.e.,thefunctionsofeachpin)ofa4026counterchip.YoushouldcomparethiswiththeschematicinFigure4-35.Includeatactileswitchbetweenthepositivesupplyandpin1ofthe4026counter,witha10Kresistortokeeptheinputtothe4026counternegativeuntilthebuttonispressed.Makesureallyourpositivesandnegativesarecorrect,andturnonthepower.Youshouldfindthatwhenyoutapthetactileswitchlightly,thecounteradvancesthenumericdisplayfrom0through9andthenbeginsalloveragainfrom0.Youmayalsofindthatthechipsometimesmisinterpretsyourbutton-presses,andcountstwooreventhreedigitsatatime.I’lldealwiththisproblemalittlefurtheron.TheLEDsegmentswillnotbeglowingverybrightly,becausethe1Kseriesresistorsdepriveofthemofthepowertheywouldreallyliketoreceive.Thoseresistorsarenecessarytoavoidoverloadingtheoutputsfromthecounter.
GroundingYourselfToavoidthefrustrationthatoccurswhenyoupowerupacircuitandnothinghappens,besuretotaketheseprecautionswhenyouusetheoldergenerationofCMOSchips(whichoftenhavepartnumbersfrom4000upward,suchas4002,4020,andsoon):Chipsareoftenshippedwiththeirlegsembeddedinblackfoam.Thisiselectricallyconductivefoam,andyoushouldkeepthechipsembeddedinituntilyouarereadytousethem.Ifthechipsaresuppliedtoyouinplastictubes,youcantakethemoutandpoketheirlegsintopiecesofconductivefoamor,ifyoudon’thaveany,usealuminumfoil.Theideaistoavoidonepinonachipacquiringanelectricpotentialthatismuchhigherthananotherpin.WhilehandlingCMOScomponents,groundingyourselfisimportant.Ifindthatindryweather,Iaccumulateastaticchargemerelybywalkingacrossaplasticfloor-protectingmatinsocksthatcontainsomesyntheticfibers.Youcanbuyawriststraptokeepyourselfgrounded,orsimplytoucha
![Page 145: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/145.jpg)
largemetalobject,suchasafilecabinet,beforeyoutouchyourcircuitboard.Iaminthehabitofworkingwithmysockedfoottouchingafilecabinet,whichtakescareoftheproblem.NeversolderaCMOSchipwhilethereispowerappliedtoit.Groundingthetipofyoursolderingironisagoodidea.Betterstill,don’tsolderCMOSchipsatall.Whenyou’rereadytoimmortalizeaprojectbymovingitfromabreadboardintoperforatedboard,solderasocketintoyourperforatedboard,thenpushthechipintothesocket.Ifthere’saprobleminthefuture,youcanunplugthechipandpluginanother.Useagrounded,conductivesurfaceonyourworkbench.Thecheapestwaytodothisistounrollsomealuminumfoilandgroundit(withanalligatorclipandalengthofwire)toaradiator,awaterpipe,oralargesteelobject.Iliketouseanareaofconductivefoamtocovermyworkbench—thesametypeoffoamthatisusedforpackagingchips.However,thisfoamisquiteexpensive.
Figure4-35.IC3isa4026counter.IC4isatripleseven-segmentdisplaychip.ThearrowstellyouwhichpinsontheLEDdisplayshouldbeconnectedtothepinsonthecounter.
Figure4-36.The4026decadecounterisaCMOSchipthatacceptsclockpulsesonpin1,maintainsarunningtotalfrom0to9,andoutputsthistotalviapinsdesignedtointerfacewithaseven-segmentLEDnumericdisplay.
FUNDAMENTALSCountersandseven-segmentdisplaysMostcountersacceptastreamofpulsesanddistributethemtoaseriesofpinsinsequence.The4026decadecounterisunusualinthatitappliespowertoitsoutputpinsinapatternthatisjustrighttoilluminatethesegmentsofa7-segmentnumericdisplay.Somecounterscreatepositiveoutputs(they“source”current)whileotherscreatenegativeoutputs(they“sink”current).Someseven-segmentdisplaysrequirepositiveinputtolightupthenumbers.Theseareknownas“commoncathode”displays.Othersrequirenegativeinputandareknownas“commonanode”displays.The4026deliverspositiveoutputsandrequiresacommoncathodedisplay.Checkthedatasheetforanycounterchiptofindouthowmuchpoweritrequires,andhowmuchitcandeliver.CMOSchipsarebecomingdated,buttheyareveryusefultohobbyists,becausetheywilltolerateawiderangeofsupplyvoltage—from5to15voltsinthecaseofthe4026.Othertypesofchipsaremuchmorelimited.Mostcounterscansourceorsinkonlyafewmilliampsofoutputpower.Whenthe4026isrunningona9-voltpowersupply,itcansourceabout4mAofpowerfromeachpin.Thisisbarelyenoughtodriveaseven-segmentdisplay.Youcaninsertaseriesresistorbetweeneachoutputpinofthecounterandeachinputpinofthenumericdisplay,butasimpler,quickeroptionistousejustoneseriesresistorforeachnumeral,betweenthenegative-powerpinandground.TheexperimentthatI’mdescribingusesthisshortcut.Itsdisadvantageisthatdigitsthatrequireonlyacoupleofsegments(suchasnumeral1)willappearbrighterthanthosethatusemanysegments(suchasnumeral8).Ifyouwantyourdisplaytolookbrightandprofessional,youreallyneedatransistortodriveeachsegmentofeachnumeral.Analternativeistouseachipcontainingmultiple“opamps”toamplifythecurrent.Whenadecadecounterreaches9androllsoverto0,itemitsapulsefromits“carry”pin.Thiscandriveanothercounterthatwillkeeptrackoftens.Thecarrypinonthatcountercanbechainedtoathirdcounterthatkeepstrackofhundreds,andsoon.Inadditiontodecadecounters,therearehexadecimalcounters(whichcountin16s),octalcounters(in8s),andsoon.Whywouldyouneedtocountinanythingotherthantens?Considerthatthefournumeralsonadigitalclockeachcountdifferently.Therightmostdigitrollsoverwhenitreaches10.Thenextdigittotheleftcountsinsixes.Thefirsthoursdigitcountsto10,givesacarrysignal,countsto2,andgivesanothercarrysignal.Theleftmosthoursdigitiseitherblankor1,whendisplayingtimein12-hourformat.
![Page 146: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/146.jpg)
Naturallytherearecountersspecificallydesignedtodoallthis.Countershavecontrolpinssuchas“clockdisable,”whichtellsthecountertoignoreitsinputpulsesandfreezethedisplay,“enabledisplay,”whichenablestheoutputfromthechip,and“reset,”whichresetsthecounttozero.The4026requiresapositiveinputtoactivateeachcontrolpin.Whenthepinsaregrounded,theirfeaturesaresuppressed.Tomakethe4026countanddisplayitsrunningtotalyoumustgroundthe“clockdisable”and“reset”pins(tosuppresstheirfunction)andapplypositivevoltagetothe“enabledisplay”pin(toactivatetheoutput).SeeFigure4-36toseethesepinsidentified.
Assumingthatyousucceedingettingyourcountertodrivethenumericdisplay,you’rereadytoaddtwomorecounters,whichwillcontroltheremainingtwonumerals.Thefirstcounterwillcountinones,thesecondintens,andthethirdinhundreds.InFigure4-37,I’vecontinuedtousearrowsandnumberstotellyouwhichpinsofthecountersshouldbeconnectedtowhichpinsofthenumericdisplay.Otherwise,theschematicwouldbeaconfusingtangleofwirescrossingeachother.Atthispoint,youcangiveupindismayatthenumberofconnections—butreally,usingabreadboard,itshouldn’ttakeyoumorethanhalfanhourtocompletethisphaseoftheproject.Isuggestyougiveitatry,becausethere’ssomethingmagicalaboutseeingadisplaycountfrom000through999“allbyitself,”andIchosethisprojectbecauseitalsohasalotofinstructionalvalue.
Figure4-37.Thistestcircuit,laidoutasyouwouldbelikelytoplaceitonabreadboard,allowsyoutotriggeracountermanuallytoverifythatthedisplayincrementsfrom000upwardto999.
Componentvalues:
Allresistorsare1K.S1,S2,S3:SPSTtactileswitches,normallyopen
IC1,IC2,IC3:4026decadecounterchipsIC4:Kingbright3-digitcommon-cathodedisplayC1:100µF(minimum)smoothingcapacitor
WiretheoutputpinsonIC1,IC2,andIC3tothepinsonIC4,accordingtothenumbersprecededbyarrows.Theactualwireshavebeenomittedforclarity.CheckforthepinoutsofIC4.
S1isattachedtothe“clockdisable”pinofIC1,sothatwhenyouholddownthisbutton,itshouldstopthatcounterfromcounting.BecauseIC1controlsIC2,andIC2controlsIC3,ifyoufreezeIC1,theothertwowillhavetowaitforittoresume.Thereforeyouwon’tneedtomakeuseoftheir“clockdisable”features.S2isconnectedtothe“reset”pinsofallthreecounters,sothatwhenyouholddownthisbutton,itshouldsetthemalltozero.S3sendspositivepulsesmanuallytothe“clockinput”pinofthefirstcounter.S1,S2,andS3areallwiredinparallelwith1Kresistorsconnectedtothenegativesideofthepowersupply.Theideaisthatwhenthebuttonsarenotbeingpressed,the“pull-down”resistorskeepthepinsnearground(zero)voltage.Whenyoupressoneofthebuttons,itconnectspositivevoltagedirectlytothechip,andeasilyoverwhelmsthenegativevoltage.Thisway,thepinsremaineitherinadefinitelypositiveordefinitelynegativestate.Ifyoudisconnectoneofthesepull-downresistorsyouarelikelytoseethenumericdisplay“flutter”erratically.(Thenumericdisplaychiphassomeunconnectedpins,butthiswon’tcauseanyproblem,becauseitisapassivechipthatisjustacollectionofLEDsegments.)
AlwaysconnectinputpinsofaCMOSchipsothattheyareeitherpositiveornegative.Seethe“NoFloatingPins”warningonthenextpage.
Isuggestthatyouconnectallthewiresshownintheschematicfirst.Thencutlengthsof22-gaugewiretojointheremainingpinsofthesocketsfromIC1,IC2,andIC3toIC4.SwitchonthepowerandpressS2.You’llseethreezerosinyournumericdisplay.EachtimeyoupressS3,thecountshouldadvanceby1.IfyoupressS2,thecountshouldresettothreezeros.IfyouholddownS1whileyoupressS3repeatedly,thecountersshouldremainfrozen,ignoringthepulsesfromS3.
FUNDAMENTALSSwitchbounce
![Page 147: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/147.jpg)
WhenyouhitS3,Ithinkyou’llfindthatthecountsometimesincreasesbymorethan1.Thisdoesnotmeanthatthere’ssomethingwrongwithyourcircuitoryourcomponents;youarejustobservingaphenomenonknownas“switchbounce.”Onamicroscopiclevel,thecontactsinsideapushbuttonswitchdonotclosesmoothly,firmly,anddecisively.Theyvibrateforafewmicrosecondsbeforesettling;thecounterchipdetectsthisvibrationasaseriesofpulses,notjustone.Variouscircuitsareavailableto“debounce”aswitch.Thesimplestoptionistoputasmallcapacitorinparallelwiththeswitch,toabsorbthefluctuations;butthisislessthanideal.I’llcomebacktothetopicofdebouncinglaterinthebook.Switchbounceisnotaconcerninthiscircuit,becausewe’reabouttogetridofS3andsubstitutea555timerthatgeneratesnicecleanbouncelesspulses.
PulseGenerationA555timerisidealfordrivingacounterchip.You’vealreadyseenhowtowirea555tocreateastreamofpulsesthatmadenoisethroughaloudspeaker.I’mreproducingthesamecircuitinFigure4-38insimplifiedform,usingthepositiveandnegativesupplyconfigurationinthecurrentproject.AlsoI’mshowingtheconnectionbetweenpins2and6inthewaythatyou’remostlikelytomakeit,viaawirethatloopsoverthetopofthechip.Forthecurrentexperiment,I’msuggestinginitialcomponentvaluesthatwillgenerateonlyfourpulsespersecond.Anyfasterthanthat,andyouwon’tbeabletoverifythatyourcountersarecountingproperly.InstallIC5anditsassociatedcomponentsonyourbreadboardimmediatelyaboveIC1.Don’tleaveanygapbetweenthechips.DisconnectS3andR3andconnectawiredirectlybetweenpin3(output)ofIC5andpin1(clock)ofIC1,thetopmostcounter.Powerupagain,andyoushouldseethedigitsadvancingrapidlyinasmooth,regularfashion.PressS1,andwhileyouholdit,thecountshouldfreeze.ReleaseS1andthecountwillresume.PressS2andthecountershouldreset,evenifyouarepressingS1atthesametime.
Figure4-38.Abasicastablecircuittodrivethedecadecounterinthepreviousschematic.Outputisapproximately4pulsespersecond.
R7:1KR8:2K2C2:68µFC3:0.1µF
IC5:555timer
NoFloatingPins!ACMOSchipishypersensitive.Anypinthatisnotwiredeithertothesupplyvoltageortogroundissaidtobe“floating”andmayactlikeanantenna,sensitivetothesmallestfluctuationsintheworldaroundit.The4026counterchiphasapinlabeled“clockdisable.”Themanufacturer’sdatasheethelpfullytellsyouthatifyougivethispinapositivevoltage,thechipstopscountingandfreezesitsdisplay.Asyoudon’twanttodothat,youmayjustignorethatpinandleaveitunconnected,atleastwhileyoutestthechip.Thisisaverybadidea!Whatthedatasheetdoesn’tbothertotellyou(presumablybecause“everyoneknows”suchthings)isthatifyouwanttheclocktorunnormally,theclock-disablefeatureitselfhastobedisabled,bywiringittonegative(ground)voltage.Ifyouleavethepinfloating(andIspeakfromexperience),thechipwillbehaveerraticallyanduselessly.Allinputpinsmustbeeitherpositivelyornegativelywired,unlessotherwisespecified.
RefinementsNowit’stimetorememberthatwhatwereallywantthiscircuittodoistestaperson’sreflexes.Whentheuserstartsit,wewantaninitialdelay,followedbyasignal—probablyanLEDthatcomeson.Theuserrespondstothesignalbypressingabuttonasquicklyaspossible.Duringthetimeittakesforthepersontorespond,thecounterwillcountmilliseconds.Whenthepersonpressesthebutton,thecounterwillstop.Thedisplaythenremainsfrozenindefinitely,displayingthenumberofpulsesthatwerecountedbeforethepersonwasabletoreact.Howtoarrangethis?Ithinkweneedaflip-flop.Whentheflip-flopgetsasignal,itstartsthecounterrunning—andkeepsitrunning.Whentheflip-flopgetsanothersignal(fromtheuserpressingabutton),itstopsthecounterrunning,andkeepsitstopped.Howdowebuildthisflip-flop?Believeitornot,wecanuseyetanother555timer,inanewmannerknownasbistablemode.
FUNDAMENTALSThebistable555timerFigure4-39showstheinternallayoutofa555timer,asbefore,buttheexternalcomponentsontherighthandsidehavebeeneliminated.Instead,I’mapplyingaconstantnegativevoltagetopin6.Canyouseetheconsequences?Supposeyouapplyanegativepulsetothetrigger(pin2).Normallywhenyoudothisandthe555startsrunning,itgeneratesapositiveoutputwhilechargingacapacitorattachedto
![Page 148: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/148.jpg)
pin6.Whenthecapacitorreaches2/3ofthefullsupplyvoltage,thistellsthe555toendsitspositiveoutput,anditflipsbacktonegative.Well,ifthere’snocapacitor,there’snothingtostopthetimer.Itspositiveoutputwilljustcontinueindefinitely.However,pin4(thereset)canstilloverrideeverything,soifyouapplynegativevoltagetopin4,itflipstheoutputtonegative.Afterthat,theoutputwillstaynegativeindefinitely,asitusuallydoes,untilyoutriggerthetimerbydroppingthevoltagetopin2again.Thiswillflipthetimerbacktogeneratingitspositiveoutput.Here’saquicksummaryofthebistableconfiguration:
Anegativepulsetopin2turnstheoutputpositive.Anegativepulsetopin4turnstheoutputnegative.Thetimerisstableineachofthesestates.Itsrun-timehasbecomeinfinite.
It’sOKtoleavepins5and7ofthetimerunconnected,becausewe’repushingitintoextremestateswhereanyrandomsignalsfromthosepinswillbeignored.
Figure4-39.Inthebistableconfiguration,pin6ofa555timerisperpetuallynegative,sothetimercycleneverends,unlessyouforceittodosobyapplyinganegativepulsetopin4(thereset).
Inbistablemode,the555hasturnedintoonebigflip-flop.Toavoidanyuncertainty,wekeeppins2and4normallypositiveviapull-upresistors,butnegativepulsesonthosepinscanoverwhelmthemwhenwewanttoflipthe555intoitsoppositestate.Theschematicforrunninga555timerinbistablemode,controlledbytwopushbuttons,isshowninFigure4-40.Youcanaddthisaboveyourexistingcircuit.Becauseyou’regoingtoattachtheoutputfromIC6topin2ofIC1,thetopmostcounter,youcandisconnectS1andR1fromthatpin.SeeFigure4-41.Now,powerupthecircuitagain.Youshouldfindthatitcountsinthesamewayasbefore,butwhenyoupressS4(inFigure4-40),itfreezes.Thisisbecauseyourbistable555timerissendingitspositiveoutputtothe“clockdisable”pinonthecounter.Thecounterisstillreceivingastreamofpulsesfromtheastable555timer,butaslongaspin2ispositiveonthecounter,thecountersimplyignoresthepulses.NowpressS5,whichflipsyourbistable555backtodeliveringanegativeoutput,atwhichpointthecountresumes.We’regettingclosetoafinalworkingcircuithere.Wecanresetthecounttozero(withS3),startthecount(withS5),andwaitfortheusertostopthecount(withS4).Theonlythingmissingisawaytostartthecountunexpectedly.
Figure4-40.Addingabistable555timertothereflextesterwillstopthecounterwithatouchofabutton,andkeepitstopped.
R9,R10:1KIC6:555timer
TheDelaySupposewesetupyetanother555inmonostablemode.Triggeritspin2withanegativepulse,andthetimerdeliversapositiveoutputthatlastsfor,say,4seconds.Attheendofthattime,itsoutputgoesbacktobeingnegative.Maybewecanhookthatpositive-to-negativetransitiontopin4ofIC6.WecanusethisinsteadofswitchS5,whichyouwerepressingpreviouslytostartthecount.
![Page 149: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/149.jpg)
CheckthenewschematicinFigure4-41whichaddsanother555timer,IC7aboveIC6.WhentheoutputfromIC7goesfrompositivetonegative,itwilltriggertheresetofIC6,flippingitsoutputnegative,whichallowsthecounttobegin.SoIC7hastakentheplaceofthestartswitch,S4.YoucangetridofS4,butkeepthepull-upresistor,R9,sothattheresetofIC6remainspositivetherestofthetime.
Figure4-41.Thecompletedcontrolsectionofthecircuit,tobeaddedabovethesetimers.
R7,R9,R12:1KR10(both):10K
R8:2K2R11:330KC1:100µFC2:68µF
C3,C4,C6:0.1µFC5:10µF
S1,S2,S3:tactileswitchesIC5,IC6,IC7:555timers
ThisarrangementworksbecauseIhaveusedacapacitor,C4,toconnecttheoutputofIC7totheresetofIC6.ThecapacitorblocksDCvoltagefromIC7untilpin3transitionsfromhightolow,atwhichpointthistransitionispassedthroughasapulsetopin4ofIC6.ThefinalschematicinFigure4-41showsthethree555timersalllinkedtogether,asyoushouldinsertthemabovethetopmostcounter,IC1.IalsoaddedanLEDtosignaltheuser.Figure4-42isaphotographofmyworkingmodelofthecircuit.
Figure4-42.Thecompletereaction-timercircuitbarelyfitsona63-rowbreadboard.
Becausethiscircuitiscomplicated,I’llsummarizethesequenceofeventswhenit’sworking.RefertoFigure4-41whilefollowingthesesteps:1.UserpressesStartDelaybuttonS4,whichtriggersIC7.2.IC7outputgoeshighforafewsecondswhileC5charges.3.IC7outputdropsbacklow.4.IC7communicatesapulseoflowvoltagethroughC4toIC6,pin4.5.IC6outputflipstolowandflopsthere.6.LowoutputfromIC6sinkscurrentthroughLEDandlightsit.7.LowoutputfromIC6alsogoestopin2ofIC1.8.Lowvoltageonpin2ofIC1allowsIC1tostartcounting.9.UserpressesS3,the“stop”button.10.S3connectspin2ofIC6toground.11.IC6outputflipstohighandflopsthere.12.HighoutputfromIC6turnsofftheLED.13.HighoutputfromIC6alsogoestopin2ofIC1.14.Highvoltageonpin2ofIC1stopsitfromcounting.15.Afterassessingtheresult,userpressesS2.16.S2appliespositivevoltagetopin15ofIC1,IC2,IC3.17.Positivevoltageresetscounterstozero.18.Theusercannowtryagain.19.Meanwhile,IC5isrunningcontinuouslythroughout.Incaseyoufindablockdiagrameasiertounderstand,I’veincludedthat,too,inFigure4-43.
![Page 150: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/150.jpg)
Figure4-43.Thefunctionsofthereflextester,summarizedasablockdiagram.
UsingtheReflexTesterAtthispoint,youshouldbeabletotestthecircuitfully.Whenyoufirstswitchiton,itwillstartcounting,whichisslightlyannoying,buteasilyfixed.PressS3tostopthecount.PressS2toresettozero.NowpressS4.Nothingseemstohappen—butthat’sthewholeidea.Thedelaycyclehasbeguninstealthmode.Afterafewseconds,thedelaycycleends,andtheLEDlightsup.Simultaneously,thecountbegins.Asquicklyaspossible,theuserpressesS3tostopthecount.Thenumeralsfreeze,showinghowmuchtimeelapsed.There’sonlyoneproblem—thesystemhasnotyetbeencalibrated.Itisstillrunninginslow-motionmode.YouneedtochangetheresistorandcapacitorattachedtoIC5tomakeitgenerate1,000pulsespersecondinsteadofjustthreeorfour.Substitutea10KtrimmerpotentiometerforR8anda0.1µFcapacitorforC2.Thiscombinationwillgenerateabout690pulsespersecondwhenthetrimmerispresentingmaximumresistance.Whenyouturnthetrimmerdowntodecreaseitsresistance,somewherearounditshalfwaymarkthetimerwillberunningat1,000pulsespersecond.Howwillyouknowexactlywherethispointis?Ideally,youwouldattachanoscilloscopeprobetotheoutputfromIC5.But,mostlikely,youdon’thaveanoscilloscope,sohereareacoupleothersuggestions.Firstremovethe1µFcapacitoratC2andsubstitutea10µFcapacitor.Becauseyouaremultiplyingthecapacitanceby10,youwillreducethespeedby10.Theleftmostdigitinyourdisplayshouldnowcountinseconds,reaching9androllingoverto0every10seconds.Youcanadjustyourtrimmerpotentiometerwhiletimingthedisplaywithastopwatch.Whenyouhaveitright,removethe10µFcapacitorandreplacethe1µFcapacitoratC2.Theonlyproblemis,thevaluesofcapacitorsmaybeoffbyasmuchas10%.Ifyouwanttofine-tuneyourreflextimer,youcanproceedasfollows.Disconnectthewirefrompin5ofIC3,andsubstituteanLEDwitha1Kseriesresistorbetweenpin5andground.Pin5isthe“carry”pin,whichwillemitapositivepulsewheneverIC3countsupto9androllsovertostartat0again.BecauseIC3iscountingtenthsofasecond,youwantitscarryoutputtooccuroncepersecond.Nowrunthecircuitforafullminute,usingyourstopwatchtoseeiftheflashingLEDdriftsgraduallyfasterorslowerthanoncepersecond.Ifyouhaveacamcorderthathasatimedisplayinitsviewfinder,youcanusethattoobservetheLED.IftheLEDflashestoobrieflytobeeasilyvisible,youcanrunawirefrompin5toanother555timerthatissetupinmonostablemodetocreateanoutputlastingforaround1/10ofasecond.TheoutputfromthattimercandriveanLED.
EnhancementsItgoeswithoutsayingthatanytimeyoufinishaproject,youseesomeopportunitiestoimproveit.Herearesomesuggestions:1.Nocountingatpower-up.Itwouldbeniceifthecircuitbeginsinits“ready”state,ratherthanalreadycounting.Toachievethisyouneedtosendanegativepulsetopin2ofIC6,andmaybeapositivepulsetopin15ofIC1.Maybeanextra555timercoulddothis.I’mgoingtoleaveyoutoexperimentwithit.
2.AudiblefeedbackwhenpressingtheStartbutton.Currently,there’snoconfirmationthattheStartbuttonhasdoneanything.AllyouneedtodoisbuyapiezoelectricbeeperandwireitbetweentherighthandsideoftheStartbuttonandthepositivesideofthepowersupply.
3.Arandomdelayintervalbeforethecountbegins.Makingelectroniccomponentsbehaverandomlyisverydifficult,butonewaytodoitwouldbetorequiretheusertoholdhisfingeronacoupleofmetalcontacts.TheskinresistanceofthefingerwouldsubstituteforR11.Becausethefingerpressurewouldnotbeexactlythesameeachtime,thedelaywouldvary.You’dhavetoadjustthevalueofC5.
SummingUpThisprojectdemonstratedhowacounterchipcanbecontrolled,howcounterchipscanbechainedtogether,andthreedifferentfunctionsfor555timers.Italsoshowedyouhowchipscancommunicatewitheachother,andintroducedyoutothebusinessofcalibratingacircuitafteryou’vefinishedbuildingit.Naturally,ifyouwanttogetsomepracticalusefromthecircuit,youshouldbuilditintoanenclosurewithheavier-dutypushbuttons—especiallythebuttonthatstopsthecount.You’llfindthatwhenpeople’sreflexesarebeingtested,theyareliabletohitthestopbuttonquitehard.Becausethiswasamajorproject,I’llfollowitupherewithsomequicker,easieronesaswemoveintothefascinatingworldofanotherkindofintegratedcircuit:logicchips.
![Page 151: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/151.jpg)
Experiment19:LearningLogicYouwillneed:
Assortedresistorsandcapacitors.74HC00quad2-inputNANDchip,74HC08quad2-inputANDchip,andLM7805voltageregulator.Quantity:1ofeach.Signaldiode,1N4148orsimilar.Quantity:1.Low-currentLED.Quantity:1.SPSTtactileswitches.Quantity:2.
You’regoingtobeenteringtherealmofpuredigitalelectronics,using“logicgates”thatarefundamentalineveryelectroniccomputingdevice.Whenyoudealwiththemindividually,they’reextremelyeasytounderstand.Whenyoustartchainingthemtogether,theycanseemintimidatinglycomplex.Solet’sstartwiththemoneatatime.Logicgatesaremuchfussierthanthe555timerorthe4026counterthatyouusedpreviously.Theydemandanabsolutelyprecise5voltsDC,withnofluctuationsor“spikes”intheflowofcurrent.Fortunately,thisiseasytoachieve:justsetupyourbreadboardwithanLM7805voltageregulator,asshownintheschematicinFigure4-44andthephotographinFigure4-45.Theregulatorreceives9voltsfromyourusualvoltagesupply,andreducesitto5volts,withthehelpofacoupleofcapacitors.Youapplythe9voltstotheregulator,anddistributethe5voltsdownthesidesofyourbreadboardinsteadoftheunregulatedvoltagethatyouusedpreviously.Useyourmetertoverifythevoltage,andmakesureyouhavethepolarityclearlymarked.
Figure4-44.Thissimplecircuitisessentialtoprovidearegulated5VDCsupplyforlogicchips.
Figure4-45.Thevoltageregulatoranditstwocapacitorscanfitsnuglyatthetopofabreadboard.Remembertoapplythe9Vinputvoltageattheleftpinoftheregulator,anddistributethe5Voutputdownthesidesofthebreadboard.
Afterinstallingyourregulator,takeacoupleoftactileswitches,two10Kresistors,alow-currentLED,anda1Kresistor,andsetthemarounda74HC00logicchipasshowninFigure4-46.Youmaynoticethatmanyofthepinsofthechipareshortedtogetherandconnectedtothenegativesideofthepowersupply.I’llexplainthatinamoment.
Figure4-46.ByobservingtheLEDwhenyoupresseither,both,orneitherofthebuttons,youcaneasilyfigureoutthelogicalfunctionoftheNANDgate.
FUNDAMENTALSVoltageregulatorsThesimplestversionsoftheselittlesemiconductorsacceptahigherDCvoltageononepinanddeliveralowerDCvoltageonanotherpin,withathirdpin(usuallyinthemiddle)servingasacommonnegative,orground.Youshouldalsoattachacoupleofcapacitorstosmooththecurrent,asshowninFigure4-46.Typicallyyoucanputa7.5-voltor9-voltsupplyonthe“input”sideofa5-voltregulator,anddrawaprecise5voltsfromthe“output”side.Ifyou’rewonderingwheretheextravoltagegoes,theansweris,theregulatorturnstheelectricityintoheat.Forthisreason,smallregulators(suchastheoneinFigure4-8)oftenhaveametalbackwithaholeinthetop.Itspurposeistoradiateheat,whichitwilldomore
![Page 152: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/152.jpg)
effectivelyifyouboltittoapieceofaluminum,sincealuminumconductsheatveryeffectively.Thealuminumisknownasaheatsink,andyoucanbuyfancyonesthathavemultiplecoolingfins.Forourpurposes,wewon’tbedrawingenoughcurrenttorequireaheatsink.
Whenyouconnectpower,theLEDshouldlightup.Pressoneofthetactileswitches,andtheLEDremainsilluminated.Presstheothertactileswitch,andagaintheLEDstayson.Nowpressbothswitches,andthelightshouldgoout.Pins1and2arelogicinputsforthe74HC00chip.Initiallytheywereheldatnegativevoltage,beingconnectedtothenegativesideofthepowersupplythrough10Kresistors.Buteachpushbuttonoverridesitspull-downresistorandforcestheinputpintogopositive.Thelogicoutputfromthechip,asyousaw,isnormallypositive—butnotifthefirstinputandthesecondinputarepositive.Becausethechipdoesa“NotAND”operation,it’sknownasaNANDlogicgate.YoucanseethebreadboardlayoutinFigure4-47.Figure4-48isasimplifiedversionofthecircuit.TheU-shapedthingwithacircleatthebottomisthelogicsymbolforaNANDgate.Nopowersupplyisshownforit,butinfactalllogicchipsrequireapowersupply,whichenablesthemtoputoutmorecurrentthantheytakein.Anytimeyouseeasymbolforalogicchip,trytorememberthatithastohavepowertofunction.
Figure4-47.ThisbreadboardlayoutisexactlyequivalenttotheschematicinFigure4-46.
Figure4-48.ThestructureandfunctionoftheNANDgateiseasiertovisualizewiththissimplifiedschematicthatomitsthepowersupplyforthechipanddoesn’tattempttoplacethewirestofitabreadboardlayout.
The74HC00actuallycontainsfourNANDgates,eachwithtwologicalinputsandoneoutput.TheyarearrayedasshowninFigure4-49.Becauseonlyonegatewasneededforthesimpletest,theinputpinsoftheunusedgateswereshortedtothenegativesideofthepowersupply.Pin14suppliespositivepowerforthechip;pin7isitsgroundpin.Almostallthe7400familyoflogicchipsusethesamepinsforpositiveandnegativepower,soyoucanswapthemeasily.Infact,let’sdothatrightnow.First,disconnectthepower.Carefullypulloutthe74HC00andputitawaywithitslegsembeddedinconductivefoam.Substitutea74HC08chip,whichisanANDchip.Makesureyouhaveittherightwayup,withitsnotchatthetop.Reconnectthepowerandusethepushbuttonsasyoudidbefore.Thistime,youshouldfindthattheLEDcomesonifthefirstinputANDthesecondinputarebothpositive,butitremainsdarkotherwise.Thus,theANDchipfunctionsexactlyoppositetotheNANDchip.ItspinoutsareshowninFigure4-50.Youmaybewonderingwhythesethingsareuseful.Soonyou’llseethatwecanputlogicgatestogethertodothingssuchascreateanelectroniccombinationlock,orapairofelectronicdice,oracomputerizedversionofaTVquizshowwhereuserscompetetoansweraquestion.Andifyouwerereallyinsanelyambitious,youcouldbuildanentirecomputeroutoflogicgates.
Figure4-49.Thepinoutsofthelogicgatesina74HC00chip.
![Page 153: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/153.jpg)
Figure4-50.Thepinoutsofthelogicgatesina74HC08chip.
BACKGROUNDFromBooletoShannonGeorgeBoolewasaBritishmathematician,bornin1815,whodidsomethingthatfewpeopleareeverluckyenoughorsmartenoughtodo:heinventedanentirelynewbranchofmathematics.Interestingly,itwasnotbasedonnumbers.Boolehadarelentlesslylogicalmind,andhewantedtoreducetheworldtoaseriesoftrue-or-falsestatementswhichcouldoverlapininterestingways.Forinstance,supposethereisacouplenamedAnnandBobwhohavesolittlemoney,theyonlyownonehat.Clearly,ifyouhappentorunintoAnnandBobwalkingdownthestreet,therearefourpossibilities:neitherofthemmaybewearingahat,Annmaybewearingit,orBobmaybewearingit,buttheycannotbothbewearingit.ThediagraminFigure4-51illustratesthis.Allthestatesarepossibleexcepttheonewherethecirclesoverlap.(ThisisknownasaVenndiagram.Ileaveittoyoutosearchforthistermifitinterestsyouandyou’dliketolearnmore.)Booletookthisconceptmuchfurther,andshowedhowtocreateandsimplifyextremelycomplexarraysoflogic.
Figure4-51.ThisslightlyfrivolousVenndiagramillustratesthevariouspossibilitiesfortwopeople,AnnandBob,whoownonlyonehat.
Anotherwaytosummarizethehat-wearingsituationistomakethe“truthtable”showninFigure4-52.Therightmostcolumnshowswhethereachcombinationofpropositionscanbetrue.NowcheckthetableinFigure4-53.It’sthesametablebutusesdifferentlabels,whichdescribethepatternyouhaveseenwhileusingtheNANDgate.Boolepublishedhistreatiseonlogicin1854,longbeforeitcouldbeappliedtoelectricalorelectronicdevices.Infact,duringhislifetime,hisworkseemedtohavenopracticalapplicationsatall.ButamannamedClaudeShannonencounteredBooleanlogicwhilestudyingatMITinthe1930s,andin1938hepublishedapaperdescribinghowBooleananalysiscouldbeappliedtocircuitsusingrelays.Thishadimmediatepracticalapplications,astelephonenetworksweregrowingrapidly,creatingcomplicatedswitchingproblems.
BACKGROUNDFromBooletoShannon(continued)
Figure4-52.Thehat-wearingpossibilitiescanbeexpressedina“truthtable.”
![Page 154: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/154.jpg)
Figure4-53.Thetruth-tablefromFigure4-52canberelabeledtodescribetheinputsandoutputsofaNANDgate.
Averysimpletelephoneproblemcouldbeexpressedlikethis.Supposetwocustomersinaruralareashareonetelephoneline.Ifoneofthemwantstousetheline,ortheotherwantstouseit,orneitherofthemwantstouseit,there’snoproblem.Buttheycannotbothuseitatonce.Youmaynoticethatthisisexactlythesameasthehat-wearingsituationforAnnandBob.Wecaneasilydrawacircuitusingtwonormallyclosedrelaysthatcreatesthedesiredoutcome(seeFigure4-54),butifyouimagineatelephoneexchangeservingmanythousandsofcustomers,thesituationbecomesverycomplicatedindeed.Infact,inShannon’stime,nologicalprocessexistedtofindthebestsolutionandverifythatitusedfewercomponentsthansomeothersolution.
Figure4-54.Thisrelaycircuitcouldillustratethedesiredlogicfortwotelephonecustomerswantingtoshareoneline,anditsbehaviorisalmostidenticaltothatoftheNANDschematicshowninFigure4-48.
ShannonsawthatBooleananalysiscouldbeusedforthispurpose.Also,ifyouusedan“on”conditiontorepresentnumeral1andan“off”conditiontorepresentnumeral0,youcouldbuildasystemofrelaysthatcouldcount.Andifitcouldcount,itcoulddoarithmetic.Whenvacuumtubesweresubstitutedforrelays,thefirstpracticaldigitalcomputerswerebuilt.Transistorstooktheplaceofvacuumtubes,andintegratedcircuitchipsreplacedtransistors,leadingtothedesktopcomputersthatwenowtakeforgrantedtoday.Butdeepdown,atthelowestlevelsoftheseincrediblycomplexdevices,theystillusethelawsoflogicdiscoveredbyGeorgeBoole.Today,whenyouuseasearchengineonline,ifyouusethewordsANDandORtorefineyoursearch,you’reactuallyusingBooleanoperators.
ESSENTIALSLogicgatebasicsTheNANDgateisthemostfundamentalbuildingblockofdigitalcomputers,because(forreasonswhichIdon’thavespacetoexplainhere)itenablesdigitaladdition.Ifyouwanttoexploremoretrysearchingonlinefortopicssuchas“binaryarithmetic”and“half-adder.”
Figure4-55.AnnandBobattempttoovercomethelimitationsofBooleanlogic.
Generally,thereareseventypesoflogicgates:
ANDNANDORNORXORXNORNOT
Ofthesixtwo-inputgates,theXNORishardlyeverused.TheNOTgatehasasingleinput,andsimplygivesanegativeoutputwhentheinputispositiveorapositiveoutputwhentheinputisnegative.TheNOTismoreoftenreferredtoasan“Inverter.”ThesymbolsforallsevengatesareshowninFigure4-56.
Figure4-56.Americansymbolsforthesixtypesoftwo-inputlogicgates,andthesingle-inputinverter.
I’veshowntheAmericansymbols.OthersymbolshavebeenadoptedinEurope,butthetraditionalsymbolsshownherearetheonesthatyouwillusuallyfind,evenbeingusedbyEuropeans.Ialsoshowthetruthtables,inFigure4-57,illustratingthelogicaloutput(highorlow)foreachpairofinputsofeachtypeofgate.
![Page 155: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/155.jpg)
Figure4-57.Inputsandcorrespondingoutputsforthesixtypesoflogicgates(notethattheXNORgateisseldomused).Theminussignsindicatelowvoltage,closetogroundpotential.Theplussignsindicatehighervoltage,closetothepositivepotentialofthepowersupplyinthecircuit.The
exactvoltageswillvarydependingonothercomponentsthatmaybeactivelyconnected.
ESSENTIALSLogicgatebasics(continued)Ifyouhavedifficultyvisualizinglogicgates,amechanicalcomparisonmayhelp.Youcanthinkofthemasbeinglikeslidingplateswithholesinthem,inabubblegummachine.Twopeople,AandB,canpushtheplates.Thesepeoplearethetwoinputs,whichareconsideredpositivewhentheyaredoingsomething.(Negativelogicsystemsalsoexist,butareuncommon,soI’monlygoingtotalkaboutpositivesystemshere.)Theflowofbubblegumrepresentsaflowofpositivecurrent.ThefullsetofpossibilitiesisshowninFigures4-58through4-63.
Figure4-58.
Figure4-59.
ESSENTIALSLogicgatebasics(continued)
![Page 156: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/156.jpg)
Figure4-60.
Figure4-61.
ESSENTIALSLogicgatebasics(continued)
Figure4-62.
BACKGROUNDTheconfusingworldofTTLandCMOS
![Page 157: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/157.jpg)
Backinthe1960s,thefirstlogicgateswerebuiltwithTransistor-TransistorLogic,abbreviatedTTL,meaningthattinybipolartransistorswereetchedintoasinglewaferofsilicon.Soon,thesewerefollowedbyComplementaryMetalOxideSemiconductors,abbreviatedCMOS.Eachofthesechipswasacollectionofmetal-oxidefield-effecttransistors(knownasMOSFETs).The4026chipthatyouusedearlierisanoldCMOS.Youmayrememberthatbipolartransistorsamplifycurrent.TTLcircuitsaresimilar:theyaresensitivetocurrent,ratherthanvoltage.Thustheyrequireasignificantflowofelectricity,tofunction.ButCMOSchipsareliketheprogrammableunijunctiontransistorthatIfeaturedpreviously.Theyarevoltage-sensitive,enablingthemtodrawhardlyanycurrentwhiletheyarewaitingforasignal,orpausingafteremittingasignal.ThetwofamiliesnamedTTLandCMOSstillexisttoday.ThetableinFigure4-64summarizestheirbasicadvantagesanddisadvantages.TheCMOSseries,withpartnumbersfrom4000upward,wereeasilydamagedbystaticelectricitybutwerevaluablebecauseoftheirmeagerpowerconsumption.TheTTLseries,withpartnumbersfrom7400upward,usedmuchmorepowerbutwerelesssensitiveandveryfast.So,ifyouwantedtobuildacomputer,youusedtheTTLfamily,butifyouwantedtobuildalittlegizmothatwouldrunforweeksonasmallbattery,youusedtheCMOSfamily.Fromthispointoneverythingbecameextremelyconfusing,becauseCMOSmanufacturerswantedtograbmarketsharebyemulatingtheadvantagesofTTLchips.NewergenerationsofCMOSchipsevenchangedtheirpartnumberstobeginwith“74”toemphasizetheircompatibility,andthefunctionsofpinsonCMOSchipswereswappedaroundtomatchthefunctionsofpinsonTTLchips.Consequently,thepinoutsofCMOSandTTLchipsareusuallynowidentical,butthemeaningof“high”and“low”stateschangedineachnewgeneration,andthemaximumsupplyvoltagesforCMOSchipswerereviseddownward.NoteIhaveincludedquestionmarksbesidetwocategoriesintheCMOScolumn,asmodernCMOSchipshaveovercomethosedisadvantages—atleasttosomeextent.Here’saquicksummary,whichwillbeusefultoyouifyoulookatacircuitthatyoufindonline,andyouwonderaboutthechipsthathavebeenspecified.Whereyouseealetter“x,”itmeansthatvariousnumbersmayappearinthatlocation.Thus“74xx”includesthe7400NANDgate,the7402NORgate,the7415016-bitdataselector,andsoon.Acombinationoflettersprecedingthe“74”identifiesthechipmanufacturer,whilelettersfollowingthepartnumbermayidentifythestyleofpackage,mayindicatewhetheritcontainsheavymetalsthatareenvironmentallytoxic,andotherdetails.
Figure4-64.Thebasicdifferencesbetweenthetwofamiliesoflogicchips.Insuccessivegenerations,thesedifferenceshavegraduallydiminished.
TTLfamily:74xx
Theoldoriginalgeneration,nowobsolete.74Sxx
Higherspeed“Schottky”series,nowobsolete.74LSxx
LowerpowerSchottkyseries,stillusedoccasionally.74ALSxx
Advancedlow-powerSchottky.74Fxx
FasterthantheALSseries.
BACKGROUNDTheconfusingworldofTTLandCMOS(continued)CMOSfamily:40xx
Theoldoriginalgeneration,nowobsolete.40xxB
The4000Bserieswasimprovedbutstillsusceptibletodamagefromstaticelectricity.ManyhobbycircuitsstillusethesechipsbecausetheywillrunfromrelativelyhighvoltagesandcanpowerLEDsandevensmallrelaysdirectly.
74HCxxHigher-speedCMOS,withpartnumbersmatchingtheTTLfamily,andpinoutsmatchingtheTTLfamily,butinputandoutputvoltagesnotquitethesameastheTTLfamily.I’veusedthisgenerationextensivelyinthisbook,becauseit’swidelyavailable,andthecircuitsherehavenoneedforgreaterspeedorpower.
74HCTxxLiketheHCseriesbutmatchingtheTTLvoltages.
74ACxxAdvancedversionofHCseries.Faster,withhigheroutputcapacity.
74ACTxxLiketheACseriesbutwiththesamepinfunctionsandvoltagesasTTL.
74AHCxxAdvancedhigher-speedCMOS.
74AHCTxxLiketheAHCseriesbutwiththesamepinfunctionsandvoltagesasTTL.
![Page 158: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/158.jpg)
74LVxxLowervoltage(3.3v)versions,includingLV,LVC,LVT,andALVCseries.
Asyoucansee,thesedaysyouhavetointerpretpartnumbersverycarefully.Butwhichfamilyandgenerationofchipsshouldyouuse?Well,thatdepends!Followingaresomeguidelines.Whatyoudon’tneed:1.Speeddifferencesareirrelevantfromourpointofview,aswe’renotgoingtobebuildingcircuitsrunningatmillionsofcyclespersecond.2.Pricedifferencesaresosmallastobeinconsequential.3.Lower-voltage(LV)CMOSchipsarenotveryinterestingforoursmallexperimentalcircuits.4.Trytoavoidmixingdifferentfamilies,anddifferentgenerationsofthesamefamily,inthesamecircuit.Theymaynotbecompatible.5.Somemodernchipvarietiesmaybeonlyavailableinthesurface-mountpackageformat.Becausethey’resomuchmoredifficulttodealwith,andtheironlymajoradvantageisminiaturization,Idon’trecommendthem.6.IntheTTLfamily,theLSandALSseriescannothandleasmuchoutputcurrentastheSseriesandtheFseries.Youdon’tneedthem.Whatyoushoulduse:1.Theold74LSxxseriesofTTLchipswassopopular,you’llstillfindschematicsthatspecifythesechips.Youshouldstillbeabletobuythemfromsourcesonline,butifnot,youcansubstitutethe74HCTxxchips,whicharedesignedtofunctionidentically.
2.Theold4000BseriesofCMOSchipsarestillusedbyhobbyistsbecausetheirwillingnesstotoleratehighvoltagesisconvenient.WhileTTLorTTL-compatiblechipsrequireacarefullyregulated5volts,the4000Bchipswouldhandle15volts—andalsodeliveredenoughpowertoenergizeLEDsorevenverysmallrelays.Somehobbyistsalsohaveanostalgicaffectionforthe74Cxxseriesofchips,whichhadthesamepinconnectionsastheTTLchipsbutcouldstilltoleratehighervoltagesandhigheroutputcurrent.Thetroubleis,someofthe74Cxxchipsarealmostextinct,andwhilethe4000Bchipsarestillavailable,theyareconsideredalmostobsolete.
BACKGROUNDTheconfusingworldofTTLandCMOS(continued)Bottomline:Isuggestyouusethe4000Bchipsonlyifyouwanttoreplicateanoldcircuit,orifamodernequivalentisunavailable(whichiswhyIspecifiedthe4026Bchipforthereactiontimer—Icouldnotfindamodernequivalentthatwilldriveseven-segmentnumericdisplaysdirectly,andIdidn’twantyoutohavetodealwithmorepartsthannecessary).IfyoucheckonlinesupplierssuchasMouser.comyou’llfindthattheHCfamilyisbyfarthemostpopularrightnow.Theyareallavailableinthrough-holeformat(tofityourbreadboardandperforatedboard).TheyhavethehighinputimpedanceofCMOS(whichisuseful)andtheyhavethesamepinidentitiesastheold74LSxxseries.
AbbreviationsWhenlookingatdatasheets,youarelikelytoencountersomeoralloftheseabbreviations:
VOHmin:MinimumoutputvoltageinhighstateVOLmax:MaximumoutputvoltageinlowstateVIHmin:MinimuminputvoltagetoberecognizedashighVILmax:Maximuminputvoltagerecognizedaslow
BACKGROUNDLogicgateoriginsThe7400familyofintegratedcircuitswasintroducedbyTexasInstruments,beginningwiththe7400NANDgatein1962.Othercompanieshadsoldlogicchipspreviously,butthe7400seriescametodominatethemarket.TheApollolunarmissionsusedacomputerbuiltwith7400chips,andtheywereamainstayofminicomputersduringthe1970s.RCAintroducedits4000seriesoflogicchipsin1968,builtaroundCMOStransistors;TexasInstrumentshadchosenTTL.TheCMOSchipsusedlesspower,thusgeneratingmuchlessheatandenablingflexiblecircuitdesign,aseachchipcouldpowermanyothers.CMOSwasalsotolerantofwidevoltageranges(from3to15volts)butprohibitedswitchingspeedsfasterthanaround1MHz.TTLwas10timesfaster.DesigntweaksgraduallyeradicatedthespeedpenaltyforCMOS,andTTLchipshavebecomerelativelyrare.Still,somepeopleretainaspecialnostalgicloyaltyto“thelogicgatesthatwenttothemoon.”AhardcoreenthusiastnamedBillBuzbeehasbuiltanentirewebserverfromTTL-type7400chips,currentlyonlineathttp://magic-1.org.Figure4-65showsjustoneofthehandmadecircuitboardsthatBillassembledtorunhiscomputer.
Figure4-65.HobbyistBillBuzbeebuilthimselfawebserverentirelyfrom7400serieslogicchips,theoldestofwhichwasfabricatedbackin1969.Thewebservercanbefoundonlineathttp://magic-1.org,displayingpicturesofitselfanddetailsofitsconstruction.ThepictureherethatBilltook
showsjustoneofthecircuitboardsofthisremarkableproject.
FUNDAMENTALSCommonpartnumbersEach14-pinchipcancontainfour2-inputgates,three3-inputgates,two4-inputgates,one8-inputgate,orsixsingle-inputinverters,asshowninthefollowingtable.
2INPUT 3INPUT 4INPUT 8INPUT
![Page 159: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/159.jpg)
AND 7408 7411 7421
NAND 7400 7410 7420 7430
OR 7432 744078*
NOR 7402 7427 744078*
XOR 7486
XNOR 747266
Inverter (1input)7404
*The744078hasanORoutputandaNORoutputonthesamechip.
Figures4-66through4-74showtheinternalconnectionsofthelogicchipsthatyouaremostlikelytouse.Notethatthe7402NORgatehasitslogicalinputsandoutputsarrangeddifferentlyfromalltheotherchips.
Figure4-66.Figures4-66through4-74showpinoutsforsomeofthemostwidelyusedlogicchips.Notethattheinputsofthe7402arereversedcomparedwiththeotherchips.
Figure4-67.
Figure4-68.
Figure4-69.
Figure4-70.
![Page 160: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/160.jpg)
Figure4-71.
Figure4-72.
Figure4-73.
Figure4-74.
FUNDAMENTALSRulesforconnectinglogicgatesPermitted:
Youcanconnecttheinputofagatedirectlytoyourregulatedpowersupply,eitherpositivesideornegativeside.Youcanconnecttheoutputfromonegatedirectlytotheinputofanothergate.Theoutputfromonegatecanpowertheinputsofmanyothergates(thisisknownas“fanout”).Theexactratiodependsonthechip,butyoucanalwayspoweratleastteninputswithonelogicoutput.Theoutputfromalogicchipcandrivethetrigger(pin2)ofa555timer.Theoutputfromthetimercanthendeliver100mA,easilyenoughforhalf-a-dozenLEDsorasmallrelay.Lowinputdoesn’thavetobezero.A74HCxxlogicgatewillrecognizeanyvoltageupto1voltas“low.”Highinputdoesn’thavetobe5volts.A74HCxxlogicgatewillrecognizeanyvoltageabove3.5voltsas“high.”
SeeFigures4-75and4-76foracomparisonofpermittedvoltagesontheinputandoutputsideof74HCxxand74LSxxchips.
![Page 161: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/161.jpg)
Figure4-75.Eachfamilyoflogicchips,andeachgenerationineachfamily,hasdifferentstandardsforinputandoutputminimumandmaximumvoltages.ThisdiagramshowsthestandardsusedbytheHCgenerationoftheCMOSfamily,whichwaschosenformostoftheprojectsinthisbook.Notethatthecurrentrequiredforinputisminimalcomparedwiththecurrentavailableforoutput.Thepowersupplytothechipmakesupthe
difference.
Figure4-76.BecausetheLSgenerationoftheTTLfamilyhassuchdifferenttolerancesforinputvoltagesanddifferentstandardsforoutputvoltages,theLSgenerationofTTLchipsshouldnotbemixedinthesamecircuitastheHCgenerationofCMOSchips,unlesspull-upresistorsare
usedtobringtheLSchipsintoconformancewithstandardsexpectedbytheHCchips.SeeExperiment21foracasestudyinusingLSchips.
FUNDAMENTALSRulesforconnectinglogicgates(continued)Notpermitted:
Nofloating-inputpins!OnCMOSchipssuchastheHCfamily,youmustalwaysconnectallinputpinswithaknownvoltage,eveniftheysupplyagateonthechipthatyou’renotusing.WhenyouuseaSPSTswitchtocontrolaninput,rememberthatinits“off”position,itleavestheinputunconnected.Useapull-uporpull-downresistortopreventthissituation.SeeFigure4-77.
Figure4-77.BecauseaCMOSchipissosensitivetoinputfluctuations,alogicalinputshouldneverbeleft“floating,”orunattachedtoadefinedvoltagesource.Thismeansthatanysingle-throwswitchorpushbuttonshouldbeusedwithapull-uporpull-downresistor,sothatwhenthecontactsareopen,theinputisstilldefined.
Don’tuseanunregulatedpowersupply,ormorethan5volts,topower74HCxxor74LSxxlogicgates.Becarefulwhenusingtheoutputfromalogicgatetopowerevenalow-currentLED.Checkhowmanymilliampsarebeingdrawn.Alsobecarefulwhen“sharing”theoutputfromalogicgatewiththeinputofanothergate,atthesametimethatitisdrivinganLED.TheLEDmaypulldowntheoutputvoltage,toapointwheretheothergatewon’trecognizeit.Alwayscheckcurrentsandvoltageswhenmodifyingacircuitordesigninganewone.Neverapplyasignificantvoltageorcurrenttotheoutputpinofalogicgate.Inotherwords,don’tforceaninputintoan
![Page 162: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/162.jpg)
output.Neverlinktheoutputsfromtwoormorelogicgates.Iftheymustshareacommonoutputwire,usediodestoprotectthemfromeachother.SeeFigure4-78.
Figure4-78.Theoutputfromonelogicgatemustnotbeallowedtofeedbackintotheoutputfromanotherlogicgate.Diodescanbeusedtoisolatethem,ortheycanbelinkedviaanothergate.
Inthe74HCxxlogicfamily,eachinputofalogicgateconsumesjustamicroamp,whiletheoutputcansource4milliamps.Thisseemsparadoxical:howcanthechipgiveoutmorethanittakesin?Theansweristhatitalsoconsumespowerfromthepowersupplyattachedtopins7and14.That’swheretheadditionalelectricitycomesfrom.Becausethelogicaloutputfromachipcanbegreaterthanthelogicalinput,wecanputthechipinastatewhereitkeepsitself“switchedon”inawaywhichissimilartothewaytherelayinthealarmprojectwaswiredtolockitselfon.Thesimplestwaytodothisinalogicchipisbyfeedingsomeoftheoutputbacktooneoftheinputs.Figure4-79showsanANDgatewithoneofitsinputswiredtopositiveanditsotherinputheldlowbyapull-downresistor,withapushbuttonthatcanmaketheinputhigh.Asignaldiodeconnectstheoutputofthechipbacktothepushbutton-controlledinput.Rememberthatthediodehasamarkonitindicatingtheendwhichshouldbeconnectedtothenegativesideofthepowersupply,whichinthiscasewillbetheendofthe10Kresistor.
Figure4-79.Usingadiode,thelogicaloutputfromagatecanbeallowedtofeedbacktooneofitsinputs,sothatthegatelatchesafterreceivingabrieflogicalinputpulse.
TheschematicinFigure4-79showshowthecircuitshouldlookinbreadboardformat.Figure4-80showsitinasimplerformat.
Figure4-80.Thebreadboard-formatschematicinissimplifiedheretoshowmoreclearlythewayinwhichagatecanlatchitselfafterreceivinganinputpulse.
Fromthispointon,Iwon’tbothertoshowthepowerregulatorandthecapacitorsassociatedwithit.Justremembertoincludethemeverytimeyouseethepowersupplylabeledas“5VDCRegulated.”
Whenyouswitchonthepower,theLEDisdark,asbefore.TheANDgateneedsapositivevoltageonbothofitslogicalinputs,tocreateapositiveoutput,butitnowhaspositivevoltageonlyononeofitsinputs,whiletheotherinputispulleddownbythe10Kresistor.Nowtouchthepushbutton,andtheLEDcomeson.Letgoofthepushbutton,andtheLEDstayson,becausethepositiveoutputfromtheANDgatecirculatesbackthroughthediodeandishighenoughtoovercomethenegativevoltagecomingthroughthepull-downresistor.TheoutputfromtheANDgateispoweringitsowninput,sotheLEDwillstayonuntilwedisconnectit.Thisarrangementisasimplekindof“latch,”andcanbeveryusefulwhenwewantanoutputthatcontinuesaftertheuserpressesandreleasesabutton.Youcan’tjustconnecttheoutputfromthegatetooneofitsinputsusinganordinarypieceofwire,becausethiswouldallowpositivevoltagefromthetactileswitchtoflowaroundandinterferewiththeoutputsignal.Remember,youmustneverapplyvoltagetothe
![Page 163: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/163.jpg)
outputpinofalogicgate.Thediodepreventsthisfromhappening.Ifyou’vegraspedthebasicsoflogicgates,you’rereadynowtocontinuetoourfirstrealproject,whichwillusealltheinformationthatI’vesetoutsofar.
![Page 164: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/164.jpg)
Experiment20:APowerfulCombinationSupposeyouwanttopreventotherpeoplefromusingyourcomputer.Icanthinkoftwowaystodothis:usingsoftware,orusinghardware.Thesoftwarewouldbesomekindofstartupprogramthatinterceptsthenormalbootsequenceandrequestsapassword.Youcouldcertainlydoitthatway,butIthinkitwouldbemorefun(andmorerelevanttothisbook)todoitwithhardware.WhatI’mimaginingisanumerickeypadrequiringtheusertoenterasecretcombinationbeforethecomputercanbeswitchedon.
TheWarrantyIssueIfyoufollowthisprojectallthewaytoitsconclusion,you’llopenyourdesktopcomputer,cutawire,andsawaholeinthecabinet.Withoutadoubt,thiswillvoidyourwarranty.Ifthismakesyounervous,herearethreeoptions:1.Breadboardthecircuitforfun,andleaveitatthat.2.Usethenumerickeypadonsomeotherdevice.3.Useitonanoldcomputer.
Youwillneed:
Numerickeypad.Asspecifiedintheshoppinglistatthebeginningofthischapter,itmusthavea“commonterminal”or“commonoutput.”TheschematicinFigure4-82showswhatImean.Insidethekeypad,oneconductor(whichIhavecoloredredtodistinguishitfromtheothers)connectswithonesideofeverypushbutton.Thisconductoris“common”toallofthem.Itemergesfromthekeypadonanedgeconnectororsetofpinsatthebottom,whichI’vecoloredyellow.
Figure4-81.Caution:Thisjustmightvoidyourwarranty.
Figure4-82.AkeypadofthetyperequiredforExperiment20incorporatesacommonterminalconnectedtoonesideofeachofthe12pushbuttons.Thewirefromthecommonterminalisshownred,here,tomakeitmoreeasilyidentifiable.
Keypadsthatuse“matrixencoding”won’tworkwiththecircuitthatI’mgoingtodescribe.IftheVellemankeypad,whichIrecommend,isunavailable,andyoucan’tfindanotherlikeit,youcanuse12separateSPSTpushbuttons.Ofcourse,thatwillcostalittlemore.74HC08logicchipcontainingfourANDgates.Quantity:1.74HC04logicchipcontainingsixinverters.Quantity:1.555timerchip.Quantity:1.Latchingrelay,5volt,DPSTorDPDT,“2formC”package,PanasonicDS2E-SL2-DC5Vorsimilar.Musthavetwoseparatecoils(onetolatch,onetounlatch)withseparateinputs.Quantity:1.LEDs,5mmgeneric,yourchoiceofcolors.Quantity:3.Ribboncable,withsixconductorsminimum,ifyouwanttodoareallyneatjob.Youcanuseacableofthetypesoldforharddrives,andsplitoffthesixconductorsthatyouneed,orshoparoundoneBay.Toolstoopenyourcomputer,drillfourholes,andmakesawcutsbetweentheholes,tocreatearectangularopeningforthekeypad(ifyouwanttotakethisprojecttoitsconclusion).Also,foursmallboltstoattachthekeypadtothecomputercabinetafteryoucreatetheopeningforit.
TheSchematicThistimeI’dlikeyoutostudytheschematicbeforebuildinganything.Let’sstartwiththesimplifiedversion,showninFigure4-83.
![Page 165: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/165.jpg)
Figure4-83.Asimplifiedschematicshowingthebasicstructureofthecombinationlockcircuit.
Iwantthistobeabattery-poweredcircuit,sothatyoudon’thavetorunaseparatepowersupplytoitor(worse)trytotapintoyourcomputer’s5-voltbus.Batterypowermeansthatthecircuithastobe“off”mostofthetime,topreventthebatteryfromrunningdown.Becausethekeypadhastwosparebuttons(theasteriskandthepoundsign),I’mgoingtousetheasteriskasthe“poweron”button.Whenyoupressit,theLEDatthetopoftheschematiclightsuptoconfirmthateverything’sworking,andthebuttonsendspowertothetwologicchipsandthe555timer.Youhavetoholddowntheasteriskbuttonwhileyoupunchinathree-digitcodetounlockthecomputer.Arbitrarily,I’vechosen1-4-7asthethree-digitcode.Let’strackwhathappenswhenyouenterthissequence.(Naturally,ifyoubuildthecircuit,youcanwireittochooseanythreedigitsyouprefer.)Pressingthe1buttonsendspositivepowertoonelogicalinputofthefirstANDgate.Theotherlogicalinputofthisgateisalsopositive,becauseaninverterissupplyingit,andtheinputoftheinverterisbeingheldnegativebyapull-downresistor.Whenaninverterhasanegativeinput,itgivesapositiveoutput,sopressingthe1buttonactivatestheANDgate,andmakesitsoutputpositive.TheANDgatelocksitselfon,asitsoutputcyclesbacktoitsswitchedinputviaadiode.Sothegateoutputremainshighevenafteryouletgoofthe1button.TheoutputfromthefirstANDgatealsosuppliesonelogicalinputofthesecondANDgate.Whenyoupressthe4button,yousendpositivevoltagetotheotherlogicalinputofthisANDgate,soitsoutputgoeshigh,anditlocksitselfon,justasthefirstgatedid.ThesecondANDgatefeedsthethirdANDgate,sowhenyoupressthe7button,thethirdANDgatechangesitsoutputfromlowtohigh.Thispassesthroughaninverter,sotheoutputfromtheinvertergoesfromhightolow.Thisinturngoestothetriggerofa555timerwiredinmonostablemode.Whenthetriggerofa555timergoesfromhightolow,thetimeremitsapositivepulsethroughitsoutput,pin3.Thisrunsdowntotheuppercoilofthelatchingrelay,andalsoflashesanLEDtoconfirmthatthecodehasbeenacceptedandtherelayhasbeenactivated.Twoofthecontactsintherelayarewiredintothepower-upbuttonofyourcomputer.AlittlelaterinthisdescriptionI’llexplainwhythisshouldbesafewithanymoderncomputer.Becausewe’reusingalatchingrelay,itflipsintoits“on”stateandremainsthere,evenwhenthepowerpulsefromthetimerends.Sonowyoucanletgooftheasteriskbuttontodisconnectthebatterypowertoyourcombinationlock,andpressthepower-upbuttonthatswitchesonyourcomputer.Attheendofyourworksession,youshutdownyourcomputerasusual,thenpressthepoundbuttononyourkeypad,whichflipstherelayintoitsotherposition,reactivatingthecombinationlock.
IncorrectInputsWhathappensifyouenterthewrongcode?Ifyoupressanybuttonotherthan1,4,or7,itsendspositivevoltagetotheinverternearthetopoftheschematic.Thepositivevoltageoverwhelmsthenegativevoltagebeingappliedtotheinverterthroughapull-downresistor,andcausestheinvertertooutputanegativevoltage,whichitappliestooneofthelogicalinputsofthefirstANDgate.IftheANDgatewaslockedon,thenegativeinputwillswitchitoff.IfitwassupplyingthesecondANDgate,it’llswitchthatoneofftoo.Thus,anyerrorwhenenteringthefirst,second,orthirddigitofthesecretcodewillresettheANDgates,forcingyoutobeginthesequencealloveragain.Whatifyouenter1,4,and7outoftheircorrectsequence?Thecircuitwon’trespond.ThethirdANDgateneedsahighinputsuppliedbythesecondANDgate,andthesecondANDgateneedsahighinputsuppliedbythefirstANDgate.SoyouhavetoactivatetheANDgatesinthecorrectsequence.
QuestionsWhydidIusea555timertodeliverthepulsetotherelay?BecausethelogicaloutputfromanANDgatecannotdeliversufficientpower.Icouldhavepasseditthroughatransistor,butIlikedtheideaofapulseofafixedlengthtofliptherelayandilluminateanLEDforabout1second,regardlessofhowbrieflytheuserpressesthe7button.WhydoIneedthreeLEDs?Becausewhenyou’repunchingbuttonstounlockyourcomputer,youneedtoknowwhat’sgoingon.ThePowerOnLEDreassuresyouthatyourbatteryisn’tdead.TheRelayActiveLEDtellsyouthatthesystemisnowunlocked,incaseyouareunabletoheartherelayclick.TheSystemRelockedLEDreassuresyouthatyouhavesecuredyourcomputer.BecausealltheLEDsaredriveneitherdirectlyfromthe5-voltsupplyorfromtheoutputofthe555timer,theydon’thavetobelow-currentLEDsandcanbeusedwith330Ωseriesresistors,sothey’llbeniceandbright.Howdoyouconnectthekeypadwiththecircuit?That’swhereyourribboncablecomesin.Youcarefullystripinsulationfromeachoftheconductors,andsolderthemtothecontactstriporedgeconnectoronyourkeypad.Pushtheconductorsontheotherendofthecableintoyourbreadboard(whenyou’retest-buildingthecircuit)orsolderthemintoperforatedboard(whenyou’rebuildingitpermanently).Findaconvenientspotinsideyourcomputercasewhereyoucanattachtheperforatedboard,withdouble-sided
![Page 166: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/166.jpg)
adhesiveorsmallboltsorwhateverisconvenient.Includea9-voltbatterycarrier,anddon’tforgetyourpowerregulatortostepthevoltagedownto5volts.
BreadboardingNodoubtyouhaverealizedbynowthatbreadboardsareveryconvenientasaquickwaytopushinsomecomponentsandcreateconnections,butthelayoutoftheirconductorsforcesyoutoputcomponentsinunintuitiveconfigurations.Still,ifyoucarefullycomparethebreadboardschematicinFigure4-84withthesimplifiedschematicinFigure4-83,you’llfindthattheconnectionsarethesame.Tohelpitmakesense,I’veshownthelogicgatesthatexistinsidethechips.I’vealsocoloredthepowersupplywires,asbefore,toreducetheriskofconfusion.Thepositivesideofthesupplygoesonlytothecommonterminalonyourkeypad,andyouhavetopresstheasteriskkeytosendthepowerbackdowntheribboncable,tosupplythechips.
Ifyoubuildthecircuitandyoucan’tunderstandwhyeverything’sdead,it’smostlikelybecauseyouforgottoholddowntheasteriskbutton.
Notethatthe“wrong”numbersonthekeypadareallshortedtogether.Thiswillcreatesomeinconvenienceifyouwanttochangethecombinationinthefuture.I’llsuggestadifferentoptioninthe“enhancements”sectionthatfollows.Fornow,ideally,youshouldrunawirefromeverycontactonyourkeypad,downtoyourcircuitonitsbreadboard,andshortthe“wrong”keypadnumberstogetherwithjumperwiresonthebreadboard.AlsonotethatifyouuseametertotesttheinputstotheANDgates,andyoutouchyourfingeragainstthemeterprobewhiledoingso,thiscanbesufficienttotriggerthesensitiveCMOSinputsandgiveafalsepositive.
Figure4-84.Thecombinationlockschematicredrawntoshowhowthecomponentscanbelaidoutonabreadboard.
OneLittleDetail:TheComputerInterfaceOldcomputersusedtohaveabigswitchattheback,attachedtotheheavymetalboxinsidethecomputer,thattransformedhousecurrenttoregulatedvoltagesthatthecomputerneeds.Mostmoderncomputersarenotdesignedthisway;youleavethecomputerpluggedin,andyoutouchalittlebuttononthebox(ifit’saWindowsmachine)orthekeyboard(ifit’saMac),whichsendsalow-voltagepulsetothemotherboard.Thisisidealfromourpointofview,becausewedon’thavetomesswithhighvoltages.Don’teventhinkofopeningthatmetalboxwiththefanmountedinit,containingthecomputerpowersupply.Justlookforthewire(usuallycontainingtwoconductors,onaWindowsmachine)thatrunsfromthe“powerup”buttontothemotherboard.Tocheckthatyoufoundtherightone,makesurethatyourcomputerisunplugged,groundyourself(becausecomputerscontainCMOSchipsthataresensitivetostaticelectricity)andverycarefullysnipjustoneofthetwoconductorsinthewire.Nowpluginyourcomputerandtrytousethe“powerup”button.Ifnothinghappens,you’veprobablycuttherightwire.Evenifyoucutthewrongwire,itstillpreventedyourcomputerfrombooting,whichiswhatyouwant,soyoucanuseitanyway.Remember,wearenotgoingtointroduceanyvoltagetothiswire.We’rejustgoingtousetherelayasaswitchtoreconnecttheconductorthatyoucut.Youshouldhavenoproblemifyoumaintainacoolandcalmdemeanor,andlookforthatsinglewirethatstartseverything.Checkonlineforthemaintenancemanualforyourcomputerifyou’rereallyconcernedaboutmakinganerror.Afteryoufindthewireandcutjustoneofitsconductors,unplugyourcomputeragain,andkeepitunpluggedduringthenextsteps.Findwherethewireattachestothemotherboard.Usuallythere’sasmallunpluggableconnector.First,markitsothatyouknowhowtoplugitbackintherightwayaround,andthendisconnectitwhileyoufollowthenextcoupleofsteps.Stripinsulationfromthetwoendsofthewirethatyoucut,andsolderanadditionalpieceoftwo-conductorwire,asshowninFigure4-85,withheat-shrinktubetoprotectthesolderjoints.(Thisisveryimportant!)Runyournewpieceofwiretothelatchingrelay,makingsureyouattachittothepairofcontactswhichclose,insidetherelay,
![Page 167: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/167.jpg)
whenitisenergizedbytheunlockingoperation.Youdon’twanttomakethemistakeofunlockingyourcomputerwhenyouthinkyou’relockingit,andviceversa.Reconnecttheconnectorthatyoudisconnectedfromyourmotherboard,pluginyourcomputer,andtrytopoweritup.Ifnothinghappens,thisisprobablygood!Nowenterthesecretcombinationonyourkeypad(whileholdingdowntheasteriskbuttontoprovidebatterypower)andlistenfortheclickastherelaylatches.Nowtrythe“powerup”buttonagain,andeverythingshouldwork.
Figure4-85.Thecombinationlockprojectcanbeinterfacedwithatypicaldesktopcomputerbycuttingoneconductorinthewirefromthe“powerup”pushbutton,solderinganextension,andcoveringthejointswithheat-shrinktube.
EnhancementsAttheendofanyproject,there’salwaysmoreyoucando.Tomakethissetupmoresecure,youcouldremovetheusualscrewsthatsecurethecaseofthecomputer,andreplacethemwithtamper-proofscrews.Checkanyonlinesourcefor“tamper-proofscrews,”suchashttp://www.mcmaster.com.Naturally,youwillalsoneedthespecialtoolthatfitsthescrews,sothatyoucaninstallthem(orremovethem,ifyoursecuritysystemmalfunctionsforanyreason).Anotherenhancementcouldbeanadditional555timerthatisactivatedbytheasteriskbutton,anddeliverspowertotheotherchipsfor,say,alimitedperiodof30seconds,allowingyouthatmuchtimetounlockthesystem.Thiswouldeliminatetheneedtoholddowntheasteriskbuttonwhileyouentertheunlockingcode.A555timercansupplypowertoalltheotherchips,becausetheydon’tuseverymuch.Iomittedthisfeatureforthesakeofsimplicity.Yetanotherenhancement,ifyouaresecurity-crazed,istogoforafour-buttoncode.Afterall,the74HC08chipstillhasoneunusedANDgate.YoucouldinsertthatintothechainoftheexistingANDgatesandwireittoanotherkeypadbuttonofyourchoice.Stillanotherenhancementwouldbeawaytochangethecodewithoutunsolderingandresolderingwires.YoucanusetheminiaturesocketsthatIsuggestedintheheartbeatflasherproject.Theseshouldenableyoutoswaparoundtheendsofyourwiresfromthekeypad.Andforthosewhoareabsolutely,positively,totallyparanoid,youcouldfixthingssothatenteringawrongcodeflipsasecondhigh-amperagerelaywhichsuppliesamassivepoweroverload,meltingyourCPUandsendingabigpulsethroughamagneticcoilclampedtoyourharddrive,instantlyturningthedatatogarbage(Figure4-86).Really,ifyouwanttoprotectinformation,messingupthehardwarehasmajoradvantagescomparedwithtryingtoerasedatausingsoftware.It’sfaster,difficulttostop,andtendstobepermanent.So,whentheRecordIndustryAssociationofAmericacomestoyourhomeandaskstoswitchonyourcomputersothattheycansearchforillegalfilesharing,justaccidentallygivethemanincorrectunlockingcode,sitback,andwaitforthepungentsmellofmeltinginsulation.Ifyoupursuethisoption,Idefinitelytakenoresponsibilityfortheconsequences.
Figure4-86.Forthosewhoareabsolutely,positively,totallyparanoid:ameltdown/self-destructsystemcontrolledbyasecretkeycombinationprovidesenhancedprotectionagainstdatatheftorintrusionsbyRIAAinvestigatorsaskingannoyingquestionsaboutfilesharing.
Onamorerealisticlevel,nosystemistotallysecure.Thevalueofahardwarelockingdeviceisthatifsomeonedoesdefeatit(forinstance,byfiguringouthowtounscrewyourtamper-proofscrews,orsimplyrippingyourkeypadoutofthecomputercasewithmetalshears),atleastyou’llknowthatsomethinghappened—especiallyifyouputlittledabsofpaintoverthescrewstorevealwhetherthey’vebeenmessedwith.Bycomparison,ifyouusepassword-protectionsoftwareandsomeonedefeatsit,youmayneverknowthatyoursystemhasbeencompromised.
![Page 168: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/168.jpg)
Experiment21:RacetoPlaceThenextprojectisgoingtogetusdeeperintotheconceptoffeedback,wheretheoutputispipedbacktoaffecttheinput—inthiscase,blockingit.It’sasmallproject,butquitesubtle,andtheconceptswillbeusefultoyouinthefuture.Youwillneed:
74HC32chipcontainingfourORgates.Quantity:1.555timers.Quantity:2.SPDTswitch.Quantity:1.SPSTtactileswitches.Quantity:2.Variousresistors.5Vsupplyusingpowerregulatorasbefore.
TheGoalOnquizshowssuchasJeopardy,contestantsracetoanswereachquestion.Thefirstpersonwhohitshisanswerbuttonautomaticallylocksouttheothercontestants,sothattheirbuttonsbecomeinactive.Howcanwemakeacircuitthatwilldothesamething?Ifyousearchonline,you’llfindseveralhobbysiteswhereotherpeoplehavesuggestedcircuitstoworkthisway,buttheylacksomefeaturesthatIthinkarenecessary.TheapproachI’mgoingtousehereisbothsimplerandmoreelaborate.It’ssimplerbecauseithasaverylowchipcount,butit’smoreelaborateinthatitincorporates“quizmastercontrol”tomakeamorerealisticgame.I’llsuggestsomeinitialideasforatwo-playerversion.AfterIdevelopthatidea,I’llshowhowitcouldbeexpandedtofourorevenmoreplayers.
AConceptualExperimentIwanttoshowhowthiskindofprojectgrowsfromanideatothefinishedversion.Bygoingthroughthestepsofdevelopingacircuit,I’mhopingImayinspireyoutodevelopideasofyourowninthefuture,whichismuchmorevaluablethanjustreplicatingsomeoneelse’swork.Sojoinmeinaconceptualexperiment,thinkingourwayfromaproblemtoasolution.Firstconsiderthebasicconcept:twopeoplehavetwobuttons,andwhoevergoesfirstlocksouttheotherperson.IalwaysfindithelpsmetovisualizethiskindofthingifIdrawasketch,sothat’swhereI’llbegin.InFigure4-87,thesignalfromeachbuttonpassesthroughacomponentthatI’llcalla“buttonblocker,”activatedbytheotherperson’sbutton.I’mnotexactlysurewhatthebuttonblockerwillbeorhowitwillwork,yet.
Figure4-87.Thebasicconceptofthequizprojectisthattheoutputfromonebuttonshouldfeedbacktointercepttheoutputofanotherbutton.Atthispoint,thewayinwhichthe“buttonblocker”circuitworkshasnotbeenfiguredout.
NowthatI’mlookingatit,Iseeaproblemhere.IfIwanttoexpandthistothreeplayers,itwillgetcomplicated,becauseeachplayermustactivatethe“buttonblockers”oftwoopponents.Figure4-88showsthis.AndifIhavefourplayers,it’sgoingtogetevenmorecomplicated.AnytimeIseethiskindofcomplexity,Ithinktherehastobeabetterway.Also,there’sanotherproblem.Afteraplayerletshisfingeroffthebutton,theotherplayers’buttonswillbeunblockedagain.Ineedalatchtoholdthesignalfromthefirstplayer’sbuttonandcontinuetoblocktheotherplayers.
Figure4-88.Thequizconceptbecomesmorecomplicatedwhenanadditionalpushbuttonisadded.Noweachbuttonmustblocktwootherbuttons.Ifafourthbuttonisadded,thecircuitwillbecomeunmanageablycomplex.Therehastobeabetterway.
Thisnowsoundsevenmorecomplicated.Butwaitaminute,ifIhavealatchwhichallowsthewinningplayertotakehisfingeroffhisbutton,Idon’tcareifanyofthebuttonsarebeingpressedanymore—includingthebuttonofthewinningplayer.Assoonashissignalislatched,allthebuttonscanbeblocked.Thismakesthingsmuchsimpler.Icansummarizeitasasequenceofevents:1.Firstplayerpresseshisbutton.2.Thesignalislatched.3.Thelatchedsignalfeedsbackandblocksallthebuttons.ThenewsketchinFigure4-89showsthis.Nowtheconfigurationismodular,andcanbeexpandedtoalmostanynumberofplayers,justbyaddingmoremodules.There’ssomethingimportantmissing,though:aresetswitch,toputthesystembacktoitsstartingmodeaftertheplayershavehadtimetopresstheirbuttonsandseewhowon.Also,Ineedawaytopreventplayersfrompressingtheirbuttonstoosoon,beforethequizmasterhasfinishedaskingthequestion.MaybeIcancombinethisfunctioninjustoneswitch,whichwillbeunderthe
![Page 169: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/169.jpg)
quizmaster’scontrol.InitsResetposition,theswitchcanresetthesystemandremovepowertothebuttons.InitsPlayposition,theswitchstopsholdingthesysteminresetmode,andprovidespowertothebuttons.Figure4-90showsthis.I’vegonebacktoshowingjusttwoplayers,tominimizetheclutteroflinesandboxes,buttheconceptisstilleasilyexpandable.
Figure4-89.Ifalatchisaddedbeloweachbutton,itcanretainoneinputandthenblockallinputsfromallbuttons.Thissimplifiestheconcept.
Figure4-90.Aquizmasterswitchwillbeneededtoactivatethebuttonsinitiallyandthenresetthecircuitafterawinninginputhasbeenrecorded.
NowIhavetodealwithalogicprobleminthediagram.ThewayI’vedrawnit,aftertheoutputfromthelefthandlatchgoesuptothe“buttonblockers,”itcanalsorundownthewiretotheotherhalfofthecircuit(againstthedirectiontothearrows),becauseeverythingisjoinedtogether.Inotherwords,ifthelefthandLEDlightsup,therighthandLEDwilllightup,too.HowcanIstopthisfromhappening?Well,Icouldputdiodesinthe“up”wirestoblockcurrentfromrunningdownthem.ButIhaveamoreelegantidea:I’lladdanORgate,becausetheinputstoanORgateareseparatedfromeachotherelectrically.Figure4-91showsthis.
Figure4-91.Topreventtheoutputfromonelatchfeedingbackaroundthecircuittotheoutputfromanotherlatch,theoutputscanbecombinedinanORgate.
UsuallyanORgatehasonlytwologicalinputs.Willthispreventmefromaddingmoreplayers?No,becauseyoucanactuallybuyanORthathaseightinputs.Ifanyoneofthemishigh,theoutputishigh.Forfewerthaneightplayers,Icanshorttheunusedinputstoground,andignorethem.LookingagainatFigure4-91,I’mgettingaclearerideaofwhatthethingI’vecalleda“buttonblocker”shouldactuallybe.Ithinkitshouldbeanotherlogicgate.Itshouldsay,“Ifthere’sonlyoneinput,fromabutton,I’llletitthrough.ButifthereisasecondinputfromtheORgate,Iwon’tletitthrough.”ThatsoundslikeaNANDgate,butbeforeIstartchoosingchips,Ihavetodecidewhatthelatchwillbe.Icanbuyanoff-the-shelfflip-flop,whichflips“on”ifitgetsonesignaland“off”ifitgetsanother,butthetroubleis,chipscontainingflip-flopstendtohavemorefeaturesthanIneedforasimplecircuitlikethis.ThereforeI’mgoingtouse555timersagain,inflip-flopmode.Theyrequireveryfewconnections,workverysimply,andcandeliveragoodamountofcurrent.Theonlyproblemwiththemisthattheyrequireanegativeinputatthetriggerpintocreateapositiveoutput.ButIthinkIcanworkwiththat.Sonow,finally,here’sasimplifiedschematic,inFigure4-92.Iliketoshowthepinsofthe555timersintheircorrectpositions,soIhadtomovethecomponentsaroundalittletominimizewirecrossovers,butyoucanseethatlogically,it’sthesamebasicidea.
![Page 170: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/170.jpg)
Figure4-92.Nowthatthebasicconceptofthequizcircuithasbeenroughedout,specificcomponentscanbeinserted,withcompatibleinputsandoutputs.
Beforeyoutrytobuildit,justrunthroughthetheoryofit,becausethat’sthefinalstep,tomakesuretherearenomistakes.Theimportantthingtobearinmindisthatbecausethe555needsanegativeinputonitstriggerpintocreateitsoutput,whenanyoftheplayerspressesabutton,thebuttonhastocreateanegative“flow”throughthecircuit.Thisisabitcounterintuitive,soI’mincludingathree-stepvisualizationinFigure4-93,showinghowitwillwork.InStep1,thequizmasterhasaskedaquestionandflippedhisswitchtotheright,tosupply(negative)powertotheplayers’buttons.Solongasnoonepressesabutton,thepull-upresistorssupplypositivevoltagetoOR2andOR3.AnORgatehasapositiveoutputifithasanypositiveinput,soOR2andOR3keepthetriggerinputsofthe555timerspositive.Theiroutputsremainlow,andnothingishappeningyet.InStep2,thelefthandplayerhaspressedhisbutton.NowOR2hastwonegativeinputs,soitsoutputhasgonelow.ButIC1hasn’treactedyet.InStep3,justamicrosecondlater,IC1hassensedthelowvoltageonitstrigger,soitsoutputfrompin3hasgonehigh,lightingtheLED.Remember,this555timerisinflip-flopmode,soitlocksitselfintothisstateimmediately.MeanwhileitshighoutputalsofeedsbacktoOR1.BecauseOR1isanORgate,justonehighinputisenoughtomakeahighoutput,soitfeedsthisbacktoOR2andOR3.Andnowthattheyhavehighinputs,theiroutputsalsogohigh,andwillstayhigh,regardlessofanyfuturebutton-presses.
Figure4-93.Thesethreeschematicsshowtheprevalenceofhigherandlowervoltages(redandbluelines)throughthequizcircuitwhenapushbuttonispressed.
BecauseOR2andOR3nowhavehighinputsandoutputs,IC1andIC2cannotbetriggered.ButIC1isstilllockedintoits“on”state,keepingtheLEDilluminated.TheonlywaytochangeIC1isifthequizmasterflipshisswitchbacktotheleft.Thatappliesnegativepowertotheresetpinsofboththetimers.Consequentlytheiroutputsgolow,theLEDgoesout,andthecircuitgoesbackintothesamestateaswhereitstarted.Havingresetit,thequizmastercanaskanotherquestion,buttheplayers’buttonsarenotactivateduntilthequizmasterflipstheswitchbacktotherightagain.There’sonlyonesituationthatIhaven’taddressed:whatifbothplayerspresstheirbuttonsabsolutelysimultaneously?Intheworldofdigitalelectronics,thisishighlyunlikely.Evenadifferenceofamicrosecondshouldbeenoughtimeforthecircuittoreactandblockthesecondbutton.Butifsomehowbothbuttonsarepressedatthesameinstant,bothofthetimersshouldreact,andbothoftheLEDswilllightup,showingthattherehasbeenatie.Incaseyoufeelalittleuncertainaboutthewayinwhichatwo-playercircuitcanbeupgradedtohandleextraplayers,I’veincludedasimplifiedthree-playerschematicinFigure4-94.
Figure4-94.Thetwo-playerschematicincanbeeasilyupgradedtoathree-playerversion,asshownhere,providedthefirstORgatecanhandlethree
![Page 171: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/171.jpg)
inputs.
BreadboardingItNowit’stimetocreateaschematicthat’sasclosetothebreadboardlayoutaspossible,sothatyoucanbuildthisthingeasily.TheschematicisshowninFigure4-95andtheactualcomponentsonabreadboardareinFigure4-96.BecausetheonlylogicgatesthatI’veusedareORgates,andthereareonlythreeofthem,Ijustneedonelogicchip:the74HC32,whichcontainsfour2-inputORgates.(I’vegroundedtheinputstothefourth).ThetwoORgatesontheleftsideofthechiphavethesamefunctionsasOR2andOR3inmysimplifiedschematic,andtheORgateatthebottom-rightsideofthechipworksasOR1,receivinginputfrompin3ofeach555timer.Ifyouhaveallthecomponents,youshouldbeabletoputthistogetherandtestitquitequickly.YoumaynoticethatI’vemadeonemodificationofthepreviousschematic.A0.01µFcapacitorhasbeenaddedbetweenpin2ofeach555timer(theInput)andnegativeground.Why?BecausewhenItestedthecircuitwithoutthecapacitors,sometimesIfoundthatoneorbothofthe555timerswouldbetriggeredsimplybyflippingS1,thequizmasterswitch,withoutanyonepressingabutton.Atfirstthispuzzledme.Howwerethetimersgettingtriggered,withoutanyonedoinganything?Maybetheywererespondingto“bounce”inthequizmasterswitch.Sureenough,thesmallcapacitorssolvedtheproblem.Theymayalsoslowtheresponseofthe555timersfractionally,butnotenoughtointerferewithslowhumanreflexes.Asforthebuttons,itdoesn’tmatterifthey“bounce,”becauseeachtimerlocksitselfonattheveryfirstimpulseandignoresanyhesitationsthatfollow.Youcanexperimentbuildingthecircuit,disconnectingthe0.01µFcapacitors,andflippingS1toandfroadozentimes.Ifyouhaveahigh-qualityswitch,youmaynotexperienceanyproblem.Ifyouhavealower-qualityswitch,youmayseeanumberof“falsepositives.”I’mgoingtoexplainmoreabout“bounce,”andhowtogetridofit,inthenextexperiment.
Figure4-95.Applyingthesimplifiedschematictoabreadboardinevitablyentailsawiringlayoutthatislessintuitivelyobviousandappearsmorecomplex.Theconnectionsarethesame,though.
Figure4-96.Thequizschematicappliedtoabreadboard,totesttheconceptpriortofull-scaleimplementation.
EnhancementsAfteryoubreadboardthecircuit,ifyouproceedtobuildapermanentversion,Isuggestthatyouexpanditsothatatleastfourplayerscanparticipate.ThiswillrequireanORgatecapableofreceivingfourinputs.The74HC4078istheobviouschoice,asitallowsuptoeight.Justconnectanyunusedinputstonegativeground.Alternatively,ifyoualreadyhaveacoupleof74HC32chipsandyoudon’twanttobotherorderinga74HC4078,youcangangtogetherthreeofthegatesinsideasingle74HC32sothattheyfunctionlikeafour-inputOR.LookatthesimplelogicdiagraminFigure4-97showingthreeORs,andrememberthattheoutputfromeachORwillgohighifatleastoneinputishigh.
![Page 172: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/172.jpg)
Figure4-97.Althoughafour-inputORgateisnotmanufactured,itsfunctionalitycanbeachievedeasilybylinkingthree2-inputORgatestogether.
Andwhileyou’rethinkingaboutthis,seeifyoucanfigureouttheinputsandoutputofthreeANDsinthesameconfiguration.Forafour-playergame,you’llalsoneedtwoadditional555timers,ofcourse,andtwomoreLEDs,andtwomorepushbuttons.Asforcreatingaschematicforthefour-playergame—I’mgoingtoleavethattoyou.Beginbysketchingasimplifiedversion,justshowingthelogicsymbols.Thenconvertthattoabreadboardlayout.Andhere’sasuggestion:pencil,paper,andanerasercanstillbequicker,initially,thancircuit-designsoftwareorgraphic-designsoftware,inmyopinion.
![Page 173: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/173.jpg)
Experiment22:FlippingandBouncingImentionedinthepreviousexperimentthat“bounce”fromthebuttonsinthecircuitwouldn’tbeaproblem,becausethebuttonswereactivating555timersthatwerewiredinbistable,flip-flopmode.Assoonasthetimerreceivestheveryfirstpulse,itflipsintoitsnewstateandflopsthere,ignoringanyadditionalnoiseinthecircuit.Socanwedebounceaswitchorabuttonusingaflip-flop?Andassome74HCxxchipsareavailablecontainingflip-flops,canweusethem?Theanswersareyes,andyes,althoughit’snotquiteassimpleasitsounds.Youwillneed:
74HC02logicchipcontaining4NORgates.74HC00logicchipcontaining4NANDgates.Quantity:1ofeach.SPDTswitch.Quantity:1.LEDs,low-current.Quantity:2.10Kresistorsand1Kresistors.Quantity:2ofeach.
Assemblethecomponentsonyourbreadboard,followingtheschematicshowninFigure4-98.Whenyouapplypower(throughyourregulated5-voltsupply),oneoftheLEDsshouldbelit.
Figure4-98.AsimplecircuittotestthebehavioroftwoNORgateswiredasasimpleflip-flopthatretainsitsstateafteraninputpulseceases.
NowIwantyoutodosomethingodd.PleasedisconnecttheSPDTswitchbytakingholdofthewirethatconnectsthepositivepowersupplytothepoleoftheswitch,andpullingtheendofthewireoutofthebreadboard.Whenyoudothis,youmaybesurprisedtofindthattheLEDremainslit.Pushthewirebackintothebreadboard,fliptheswitch,andthefirstLEDshouldgoout,whiletheotherLEDshouldbecomelit.Onceagain,pulloutthewire,andonceagain,theLEDshouldremainlit.Here’sthetake-homemessage:
Aflip-floprequiresonlyaninitialpulse.Afterthat,itignoresitsinput.
HowItWorksTwoNORgatesortwoNANDgatescanfunctionasaflip-flop:
UseNORgateswhenyouhaveapositiveinputfromadouble-throwswitch.UseNANDgateswhenyouhaveanegativeinputfromadouble-throwswitch.
Eitherway,youhavetouseadouble-throwswitch.I’vementionedthedouble-throwswitchthreetimes(actually,fourtimesifyoucountthissentence!)becauseforsomestrangereason,mostintroductorybooksfailtoemphasizethispoint.WhenIfirststartedlearningelectronics,IwentcrazytryingtounderstandhowtwoNORsortwoNANDscoulddebounceasimpleSPSTpushbutton—untilfinallyIrealizedthattheycan’t.Thereasonisthatwhenyoupowerupthecircuit,theNORgates(orNANDgates)needtobetoldinwhichstatetheyshouldbegin.Theyneedaninitialorientation,whichcomesfromtheswitchbeinginonestateortheother.Soithastobeadouble-throwswitch.(NowI’vementioneditfivetimes.)I’musinganothersimplifiedmultiple-stepschematic,Figure4-99,toshowthechangesthatoccurastheswitchflipstoandfrowithtwoNORgates.Torefreshyourmemory,I’vealsoincludedatruthtableshowingthelogicaloutputsfromNORgatesforeachcombinationofinputs.
Figure4-99.UsingtwoNORgatesinconjunctionwithapositiveinputthroughaSPDTswitch,thissequenceoffourdiagramsshowshowaflip-flopcircuitresponds.
Supposethattheswitchisturnedtotheleft.Itsendspositivecurrenttothelefthandsideofthecircuit,overwhelmingthenegativesupplyfromthepull-downresistor,sowecanbesurethattheNORgateonthelefthasonepositivelogicalinput.BecauseanypositivelogicalinputwillmaketheNORgiveanegativeoutput(asshowninthetruthtable),thenegativeoutputcrossesovertotherighthandNOR,sothatitnowhastwonegativeinputs,whichmakeitgiveapositiveoutput.ThiscrossesbacktothelefthandNORgate.So,inthisconfigurationeverythingisstable.Nowcomesthecleverpart.Supposethatyoumovetheswitchsothatitdoesn’ttoucheitherofitscontacts.(Orsupposethattheswitchcontactsarebouncing,andfailingtomakeagoodcontact.Orsupposeyoudisconnecttheswitchentirely.)Withoutapositivesupplyfromtheswitch,thelefthandinputoftheleftNORgategoesfrompositivetonegative,asaresultofthepull-downresistor.Buttherighthandinputofthisgateisstillpositive,andonepositiveisallittakestomaketheNORmaintainitsnegativeoutput,sonothingchanges.Inotherwords,thecircuithas“flopped”inthisstate.NowiftheswitchturnsfullytotherightandsuppliespositivepowertotherighthandpinoftherightNORgate,quickasaflash,that
![Page 174: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/174.jpg)
NORrecognizesthatitnowhasapositivelogicalinput,soitchangesitslogicaloutputtonegative.ThatgoesacrosstotheotherNORgate,whichnowhastwonegativeinputs,soitsoutputgoespositive,andrunsbacktotherightNOR.Inthisway,theoutputstatesofthetwoNORgateschangeplaces.Theyflip,andthenflopthere,eveniftheswitchbreakscontactorisdisconnectedagain.ThesecondsetofdrawingsinFigure4-100showsexactlythesamelogic,usinganegativelypoweredswitchandtwoNANDgates.Youcanuseyour74HC00chip,specifiedinthepartslistforthisexperiment,totestthisyourself.
Figure4-100.TheschematicfromFigure4-99canberewiredwithNANDgatesandanegativeswitchedinput.
Bothoftheseconfigurationsareexamplesofajam-typeflip-flop,socalledbecausetheswitchforcesittorespondimmediately,andjamsitintothatstate.Youcanusethiscircuitanytimeyouneedtodebounceaswitch(aslongasit’sadouble-throwswitch).Amoresophisticatedversionisaclockedflip-flop,whichrequiresyoutosetthestateofeachinputfirstandthensupplyaclockpulsetomaketheflip-floprespond.Thepulsehastobecleanandprecise,whichmeansthatifyousupplyitfromaswitch,theswitchmustbedebounced—probablybyusinganotherjam-typeflip-flop!Considerationsofthistypehavemademereluctanttouseclockedflip-flopsinthisbook.Theyaddalayerofcomplexity,whichIprefertoavoidinanintroductorytext.Whatifyouwanttodebounceasingle-throwbuttonorswitch?Well,youhaveaproblem!Onesolutionistobuyaspecial-purposechipsuchasthe4490“bounceeliminator,”whichcontainsdigitaldelaycircuitry.AspecificpartnumberistheMC14490PGfromOnSemiconductor.Thiscontainssixcircuitsforsixseparateinputs,eachwithaninternalpull-upresistor.It’srelativelyexpensive,however—morethan10timesthepriceofa74HC02containingNORgates.Really,itmaybesimplertousedouble-throwswitchesthatareeasilydebouncedasdescribedpreviously.
![Page 175: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/175.jpg)
Experiment23:NiceDiceThisistheoneexperimentwhereIwantyoutousethe74LSxxgenerationoftheTTLlogicfamily,insteadofthe74HCxxfamilyofCMOS.Tworeasons:first,Ineedtousethe7492counter,whichisunavailableintheHCfamily.Andsecond,youshouldknowthebasicfactsabouttheLSseriesofTTLchips,astheystillcropupincircuitsthatyou’llfindinelectronicsbooksandonline.Inaddition,you’lllearnabout“opencollector”TTLchipssuchasthe74LS06inverter,whichcanbeaconvenientsubstitutefortransistorswhenyouwanttodeliverasmuchas40mAofcurrent.Theideaofthiscircuitissimpleenough:runa555timersendingveryfastpulsestoacounterthatcountsinsixes,drivingLEDsthatareplacedtoimitatethespotsonadie.(Notethattheword“die”isthesingularof“dice.”)Thecounterrunssofast,thedie-spotsbecomeablur.Whentheuserpressesabutton,thecounterstopsarbitrarily,displayinganunpredictablespotpattern.Dicesimulationshavebeenaroundformany,manyyears,andyoucanevenbuykitsonline.Butthisonewilldosomethingmore:itwillalsodemonstratetheprinciplesofbinarycode.So,ifyou’rereadyforthetriplethreatofTTLchips,opencollectors,andbinary,let’sbegin.Youwillneed:
74LS92countersuchasSN74LS92NbyTexasInstruments.Quantity:1ifyouwanttocreateonedie,2tomaketwodice.74LS27three-inputNORgatesuchasSN74LS27NbyTexasInstruments.Quantity:1.555timers.Quantity:1ifyouwanttomakeonedie,2tomaketwodice.Signaldiodes,1N4148orsimilar.Quantity:4,or8tomaketwodice.
SeeingBinaryThecounterthatwedealtwithbeforewasunusual,inthatitsoutputsweredesignedtodriveseven-segmentnumerals.Amorecommontypehasoutputsthatcountinbinarycode.The74LS92pinoutsareshowninFigure4-101.PlugthechipintoyourbreadboardandmakeconnectionsasshowninFigure4-102.Initially,the555timerwilldrivethecounterinslow-motion,ataround1steppersecond.Figure4-103showstheactualcomponentsonabreadboard.Notethatthecounterhasunusualpowerinputs,onpins5and10insteadofatthecorners.Alsofourofitspinsarecompletelyunused,anddonotconnectwithanythinginsidethechip.Therefore,youdon’tneedtoattachanywiretothemontheoutside.
Figure4-101.Theunusualpinassignmentsincludefourthathavenoconnectionofanykindinsidethechip,andcanbeleftunattached.
Figure4-102.Thissimplecircuitusesa555timerrunningslowlytocontrolthe74LS92binarycounteranddisplaythesuccessionofhighstatesfromitsoutputs.
![Page 176: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/176.jpg)
Figure4-103.ThebreadboardversionoftheschematicinFigure4-102todisplaytheoutputsfroma74LS92counter.
Nowwecometothefirstnewanddifficultfactaboutthe74LSxxgenerationofTTLchipsthatmakesthemlessdesirable,forourpurposes,thanthe74HCxxgenerationofCMOSchipsthatIhaverecommendedinpreviousprojects.ThemodernandcivilizedHCchipswillsource4mAorsink4mAateachlogicaloutput,buttheolderLSgenerationisfussier.Itwillsinkaround8mAintoeachoutputpinfromapositivesource,butwhenitsoutputishigh,ithardlygivesyouanythingatall.Thisisaverybasicprinciple:
OutputsfromTTLlogicchipsaredesignedtosinkcurrent.Theyarenotdesignedtosourcesignificantcurrent.
Infact,the74LS92isratedtodeliverlessthanhalfamilliamp.Thisisquiteacceptablewhenyou’rejustconnectingitwithanotherlogicchip,butifyouwanttodriveanexternaldevice,itdoesn’tprovidemuchtoworkwith.Thepropersolutionistosaytothechip,“Allright,we’lldoityourway,”andsetthingsupwithapositivesourcethatflowsthroughaloadresistortotheLEDthatyouwanttouse,andfromthereintotheoutputfromthechip.Thisisthe“better”optionshowninFigure4-104.
Figure4-104.MostTTLchips,includingthoseintheLSgeneration,areunabletosourcemuchcurrentfromtheirlogicaloutputpins(left)andshouldusuallybewiredtosinkcurrentfromapositivesource(right).
TheonlyproblemisthatnowtheLEDlightsupwhenthecounter’soutputislow.Butthecounterisdesignedtodisplayitsoutputinhighpulses.SoyourLEDisnowoffwhenitshouldbeon,andonwhenitshouldbeoff.Youcanfixthisbypassingthesignalthroughaninverter,butalreadyI’mgettingimpatientwiththisinconvenience.Mywayaroundtheproblem,atleastfordemopurposes,istousethe“Notsogood”optioninFigure4-104andmakeitworkbyconnectingavery-low-currentLEDwithalarge4K7loadresistor.Thiswillenableusto“see”theoutputfromthecounterwithoutaskingittogivemorethanitsratedlimit,andifyouwanttocreateamorevisiblypowerfuldisplayforafinishedversionofthedicecircuit,I’lldealwiththatlater.Accordingtomymeter,the4K7resistorholdsthecurrentbetween0.3mAand0.4mA,whichisthecounter’sratedmaximum.SetupyourinitialversionofthecircuitasshowninFigures4-102and4-103.Becarefulwhenyouwirethepositiveandnegativepowersupplytothecounterchip,withitsnonstandardpinassignments.The555willruninastablemode,atabout1pulsepersecond.Thisbecomestheclocksignalforthecounter.ThefirstthreebinaryoutputsfromthecounterthendrivethethreeLEDs.Thecounteradvanceswhentheinputsignalgoesfromhightolow.SowhentheLEDbesidethe555timergoesout,that’swhenthecounteradvances.Ifyoustareatthepatterngeneratedbytheoutputsforlongenough,youmaybeabletoseethelogictoit,bearinginmindthatitszerostateiswhentheyarealloff,anditcountsupthroughfivemorestepsbeforeitrepeats.ThediagraminFigure4-105showsthissequence.Ifyouwanttoknowwhythepatternworksthisway,checkthefollowingsection,“Theory:Binaryarithmetic.”
Figure4-105.Thethreeoutputpinsofthe74LS92counterhavehighstatesshownbytheredcirclesasthecounterstepsfrom000to101inbinarynotation.
![Page 177: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/177.jpg)
THEORYBinaryarithmeticTheruleforbinarycountingisjustavariationoftherulethatwenormallyuseforeverydaycounting,probablywithoutthinkingmuchaboutit.Ina10-basedsystem,wecountfrom0to9,thencarry1overtothenextpositionontheleft,andgofrom0to9againintheright-mostposition.Werepeatthisprocedureuntilwegetto99,thencarrya1overtoanewpositiontomake100,andcontinuecounting.Inbinarywedothesamething,exceptthatwerestrictourselvestodigits0and1only.Sobeginwith0intherightmostposition,andcountupto1.As1isourlimit,tocontinuecountingwecarry1overtothenextplaceontheleft,andstartagainfrom0intheright-mostposition.Countupto1,thenadd1tothenextplaceontheleft—but,italreadyhasa1init,soitcan’tcountanyhigher.So,carry1fromthereonespacefurther,tothenextplacebesidethat—andsoon.IfaglowingLEDrepresentsa1,andadarkLEDrepresentsa0,thediagraminFigure4-105showshowthe74LS92countsupfrom0to(decimal)5or(binary)101initsinimitablefashion.I’vealsoincludedadiagraminFigure4-106showinghowacounterwithfourbinaryoutputswoulddisplaydecimalnumbersfrom0through15,againusingtheLEDstorepresent1sand0s.
Figure4-106.Ahexadecimal(16-based)binarycounterwouldgeneratethissuccessionofhighstatesfromitsfouroutputpinsasitcountsfrom0through15indecimalnotation.
Here’saquestionforyou:howmanyLEDswouldyouneedtorepresentthedecimalnumber1024inbinary?Andhowmanyfor1023?Obviouslybinarycodeisideallysuitedtoamachinefulloflogiccomponentsthateitherhaveahighoralowstate.Soitisthatalldigitalcomputersusebinaryarithmetic(whichtheyconverttodecimal,justtopleaseus).
Gettingbacktoourproject:Iwanttotakethethreebinaryoutputsandmakethemcreatepatternslikethespotsonadie.HowcanIdothis?Quiteeasily,asitturnsout.I’massumingthatI’llusesevenLEDstosimulatethepatternsofspotsonadie.Thesepatternscanbebrokendownintogroups,whichIhaveassignedtothethreeoutputsfromthecounterinFigure4-108.Thefirstoutput(farthesttotheright)candriveanLEDrepresentingthedotatthecenterofthedieface.Thesecond(middle)outputcandrivetwomorediagonalLEDs.ThethirdoutputmustswitchonallfourcornerLEDs.Thiswillworkforpatterns1through5,butwon’tdisplaythediepatternfora6.SupposeItapintoallthreeoutputsfromthecounterwithathree-inputNORgate.Ithasanoutputthatgoeshighonlywhenallthreeofitsinputsarelow,soitwillonlygiveahighoutputwhenthecounterisbeginningwithall-lowoutputs.Icantakeadvantageofthistomakea6pattern.Notethatit’sbadpracticetomixtheLSgenerationofTTLchipswiththeHCgenerationofCMOSchips,astheirinputandoutputrangesaredifferent;so,theNORchiphastobea74LS27,nota74HC27.We’rereadynowforasimpleschematic.InFigure4-107I’vecoloredsomeofthewiresjusttomakeiteasierforyoutodistinguishthem.Thecolorshavenoothersignificance.
Figure4-107.Asimplifiedschematicshowshowoutputsfromthe74LS92countercanbecombined,withsignaldiodesandasinglethree-inputNORgate,togeneratethespotpatternsonadie.Thewirecolorshavenospecialmeaningandareusedjusttodistinguishthemfromeachother.
![Page 178: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/178.jpg)
Figure4-108.Binaryoutputsfromthe74LS92countercanbeusedtopowerLEDsarrayedingroupstosimulatethepatternofspotsonadie.
EachoftheLEDsisgroundedthroughaseparate4K7loadresistor.Unfortunately,thismeansthatwhentheyaredisplayingthepatternfora6,allofthemarerunninginparallelfromtheoutputoftheNORgate,whichoverloadsit.Aslongasyoudon’tleavethedisplayinthismodeforverylongperiods,itshouldn’tcauseaproblem.Youcouldcompensatebyincreasingtheloadresistors,orbyrunningpairsoftheLEDsthroughoneresistor,butthiswillmakethemsodimthatthey’llbedifficulttosee,asthey’resoclosetotheirlowerlimitforcurrentalready.NoticehowIhaveaddedfoursignaldiodes,D1throughD4.WhenOutputCgoeshigh,ithastoilluminateallfourcornerLEDs,andsoitspowergoesintothebrownwireaswellasthegraywire.Butwemustneverallowoneoutputtofeedbackintoanother,soD4isneededtoprotectOutputBwhenOutputCishigh.BecausethereisnowaconnectionbetweenBandC,weneedD2toprotectOutputCwhenOutputBishigh.AndbecauseOutputBmustonlyfeedtwoofthecornerLEDs,wealsoneedD3tostopitfromilluminatingtheothertwo.And,wehavetoprotecttheoutputfromtheNORgatewheneitherOutputCorOutputBishigh.ThisrequiresD1.Figure4-109showseverythingthatI’vedescribedsofarassembledinbreadboardformat,whileFigure4-110showsthetestversionthatIbuilt.Notethattheunusedlogicalinputsonthe74LS27chipareshortedtogetherandconnectedtothepositivesideofthepowersupply.Here’stherule:
WhenusingCMOSchips(suchastheHCseries),connectunusedlogicalinputstothenegativesideofthepowersupply.WhenusingTTLchips(suchastheLSseries),connectunusedlogicalinputstothepositivesideofthepowersupply.
Figure4-109.Withsomeextracomponents,theschematicsfromFigures4-102and4-107canbecombinedtomaketheworkingdicesimulation.
IassumethatyouhavehadenoughfunwatchingtheLEDscountslowly,soI’vechangedthecapacitorandresistorvaluesforthe555toincreaseitsspeedfromapproximately1pulsepersecondtoabout50,000pulsespersecond.Thecountercouldrunmuchfasterthanthis,butIjustwantittocyclefastenoughsothatwhentheuserpressesandreleasesabutton,thecountwillstopatanunforeseeablenumber.Thebuttonstartsandstopsthe555timerbyapplyingandreleasingpowertothetimingcircuitonly.Thisistheequivalentofshakingandthenthrowingthedie.Whilethecounterisrunningfast,theLEDsareflashingsofastthatallofthemwillseemtobeonatonce.Atthesametime,thecircuitchargesanew68µFcapacitor,whichIhaveaddedbetweenthepushbuttonandground.Whenyoureleasethebutton,thiscapacitordischargesitselfthroughthe1Ktimingresistor.Asthechargedissipates,thetimingcapacitorwilltakelongerandlongertocharge,anddischarge,andthefrequencyofthe555willgraduallydiminish.ConsequentlytheLEDdisplaywillalsoflashslower,likethereelonaLasVegasslotmachinegraduallycomingtoastop.Thisincreasesthetensionasplayerscanseethediedisplaycountingtothenumberthatthey’rehopingfor—andmaybegoingonestepbeyondit.Notethattomaximizethiseffect,thebuttonhastobehelddownforafullsecondormore,sothatthe68µFcapacitorbecomesfullychargedbeforethebuttonisreleased.
![Page 179: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/179.jpg)
Figure4-110.Theelectronicdiceschematicappliedtoabreadboard,withapushbuttonatthetoptostartandstopthecounter,and7LEDsatthebottomtodisplaytheoutput.
So,thiscircuitnowfulfillstheoriginalgoal.Butcanitbebetter?Ofcourseitcan.
EnhancementsThemainthingIwanttoimproveisthebrightnessoftheLEDs.Icouldaddatransistortoamplifythecurrenttoeachone,butthere’sasimpleralternative:aTTL“opencollector”inverter.IwanttouseaninverterbecauseintheworldofTTL,asImentionedearlier,wecansinkmuchmorepowerintotheoutputpinofachipthanwecansourcefromit.So,I’mgoingtoturneachLEDtheotherwayaroundandconnecttheirloadresistorstothepositivesideofthepowersupply.Thisway,they’llsinktheirpowerintotheoutputsoftheinverter.Andthegreatadvantageofan“opencollector”versionoftheinverterchipisthatitisdesignedtosinkmuchmorecurrentthananormalTTLlogicchip.Itisratedfor40mAperpin.Theonlydisadvantageisthatitcannotsourceanycurrentatall;insteadofitsoutputgoinghigh,itjustbehaveslikeanopenswitch.Butthat’sOKforthiscircuit.Sothenextandfinalschematic,inFigure4-111,includesthe74LS06inverter,whichhasalsobeenaddedtothebreadboardedversionshowninFigure4-112.Isuggestthatyouputasidethelittlelow-currentLEDsandsubstitutesomenormal-sizeones.UsingKingbright“standard”WP15031D5mmLEDs,Ifindthateachdrawsalmostexactly20mAwithavoltagedropofabout2Vwitha120ohmseriesresistor.Becauseeachoutputpinfromthe74LS06inverterpowersnomorethantwoLEDsatatime,thisisexactlywithinitsspecification.Isuggestthatifyoubuildthiscircuit,youchecktheconsumptionofyourparticularchoiceofLEDsandadjusttheresistorsifnecessary.Remember:tomeasurethevoltagedropacrossanLED,simplytouchtheprobesofyourmeteracrossitwhileitisilluminated.Tomeasurethecurrent,disconnectonesideoftheLEDandinsertthemeter,inmilliampmode,betweenthelegoftheLEDandthecontactthatitnormallymakesinthecircuit.Forareallydramaticdisplay,youcangetsome1cmdiameterLEDs(Figure4-113).Checkthespecification,andyoushouldfindthatmanyofthesedon’tusemorepowerthantheusual5mmtype.Butwhateverkindyouuse,don’tforgettoturnthemaroundsothattheirnegativesidesfacetowardtheinverter,andtheirpositivesidesfacetheresistors,whichareconnectedtothepositivesideofthepowersupply.Onelastdetail:Ihadtoaddtwo10Kresistorstothisversionofthecircuit.Canyouseewhy?DiodesD1throughD4aredesignedtotransmitpositivevoltagethroughtotheinverterwhenappropriate,buttheypreventtheinputsoftheinverterfrom“seeing”thenegativesideofthepowersupplywhenthecounteroutputsarelow.Theseinverterinputsrequirepull-downresistorstopreventthemfrom“floating”andproducingerroneousresults.
![Page 180: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/180.jpg)
Figure4-111.Ifopen-collectorinvertersareaddedtothediceschematic,itcandrivefull-sizeLEDswithupto40mA,aslongastheLEDsareturnedaroundtosinkcurrentintotheTTLoutputstageinsteadoftryingtosourcecurrentfromit.
Figure4-112.Thecompletedcircuitusinganopen-collectorinvertertodrivefull-sizeLEDs.
Thefinalenhancementsareuptoyou.Mostobviously,youcanaddaseconddie,asmanygamesrequiretwodice.The74LS27chip
![Page 181: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/181.jpg)
stillhasacoupleofspareNORgatesinit,oneofwhichyoucanmakeuseof,butyouwillneedanadditional555timer,runningatasignificantlydifferentspeedtoensurerandomness,anditwillhavetodriveasecondcounter.Afteryougetyourdiceupandrunning,youmaywanttotestthemforrandomness.Becausethepulsesfroma555timerareofequallength,everynumberhasanequalchanceofcomingup;butthelongeryouholddowntheStartbutton,thebetteryouroddsareofinterruptingthecountingprocessatatrulyrandommoment.Anyoneusingyourelectronicdiceshouldbetoldthat“shaking”themforafullsecondismandatory.Ofcourse,Icouldhavesimulateddicemoreeasilybywritingafewlinesofsoftwaretogeneraterandomnumbersonascreen,butevenafancyscreenimagecannothavethesameappealasawell-madepieceofhardware.Figure4-113showswhite1cmLEDsmountedinasandedpolycarbonateenclosurefordramaticeffect.Mostofall,Iderivedsatisfactionfromusingsimple,dedicatedchipsthatdemonstratethebinaryarithmeticthatisfundamentalineverycomputer.
Figure4-113.Theopen-collectorinverterchipinthedicecircuitissufficientlypowerfultodrive1-cmwhiteLEDsthatdrawabout20mAeach,usingapotentialof2V.Inthisfinishedversion,theLEDswereembeddedincavitiesdrilledfromtheundersideofhalf-inchpolycarbonate,whichhasbeen
treatedwithanorbitalsandertocreateatranslucentfinish.
![Page 182: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/182.jpg)
Experiment24:IntrusionAlarmCompletedNowletmesuggesthowyoucanapplytheknowledgefromthischapterofthebooktoupgradetheburglaralarmprojectthatwaslastmodifiedinExperiment15.You’llprobablyneedtocheckChapters2and3torefamiliarizeyourselfwithsomefeaturesofthealarm.
Upgrade1:DelayedActivationThebiggestflawinthealarmwasthatassoonasitwasactivated,itwouldimmediatelyrespondtoanysignalfromthedoorandwindowsensors.Itneededafeaturetodelayactivationtogiveyouachancetoexitfromthebuildingbeforethealarmarmeditself.A555timercanprovidethisfunctionality,probablyinconjunctionwitharelay.Thepowertothealarmshouldpassthroughthecontactsoftherelay,whicharenormallyclosed.Whenyoupressabuttononthetimer,itsendsapositivepulsetotherelaylastingforaround30seconds,holdingtherelayopenforthatperiod.Youcouldmountthetimerinitsownlittleboxwithabuttononit,whichyoupresswhenyou’rereadytoleavethebuilding.The12-voltpowersupplytotheburglaralarmpassesthroughtheboxcontainingthedelaycircuit.For30seconds,the555interruptspowertothealarm,andthenrestoresit,readyforaction.
Upgrade2:KeypadDeactivationThisisnowreallysimple.Youcansubstitutealatchingrelayinsteadoftheswitch,S1,onthealarmbox(showninFigure3-110),anduseakeypadtosetandresettherelayinexactlythesamewayasinthecombinationlockinExperiment20.You’llhavetorunanadditionalthreewiresfromtherelay,outofthealarmbox,tothekeypad(onesupplyingpowertothe“on”relaycoil,anothersupplyingpowertothe“off”coil,thethirdbeingacommonground).Youcaneitherusea9-voltbatterytopowertheelectronicsinassociationwiththekeypad,orrunanadditionalfourthwirefromthealarmbox,tocarrypositivepowertothelogicchips,bearinginmindthatyouhavetoinsertavoltageregulatoratsomepoint,todropthe12voltsthatthealarmusestothe5voltsthatthelogicgatesrequire.Asthegatesconsumesolittlepower,the12-to-5dropshouldbeOKforthevoltageregulator;itwon’thavetodissipatetoomuchheat.Withthisadditionalfeature,youcanusethealarmlikethis:
Pressthepoundkeyonthekeypadtoflipthelatchingrelayintoits“on”mode,sothatitpassespowertothealarmbox,whichisnowarmed.Ifyouwanttoleavethehouse,pushthebuttononthedelayunittogiveyou30secondsinwhichtodoso.Ifthealarmistriggered,enteryoursecretcodeonthekeypadtodeactivateitbyflippingthelatchingrelaytoits“off”positionandcuttingpowertothealarmbox.
ThesemodificationsaresosimplethatIthinktheblockdiagraminFigure4-114shouldbeallyouneed.Idon’tthinkIneedtogiveyouanyschematics.Theonlychangeyouhavetomaketotheexistingalarmistosubstitutethelatchingrelayfortheon/offswitch.But,thereisstilloneobviousnecessaryenhancementneeded:howcanyougetbackintothehousewithoutinstantlytriggeringthealarm?
Figure4-114.Thisblockdiagramshowstherelativeplacementoftheoldandnewcomponents.Thepushbuttonpowerinterrupt(whichallowsyoutoleavethehousebeforethealarmswitchesitselfbackon)goesbetweenthepowersupplyandeverythingelse.
ThelatchingrelaysubstitutesfortheDPDTswitchonthepreviousversionofthealarm.Thetransistorandself-lockingrelay,connectedwiththedoorandwindowmagneticswitches,remainunchanged.Thenewdelaycircuitisinsertedbetweentheself-lockingrelayandthenoisemaker.Thetestbutton
iswiredwiththelatchingrelayinthesamewaythatitwaswiredpreviouslywiththeDPDTswitch.
Upgrade3:DelayBeforeDeactivationTypically,alarmsincludeanotherdelayfeature.Whenyouopenadooronyourwayintothebuildingandittriggersthealarm,youhave30secondstodeactivateit,beforeitstartsmakinganoise.Howcanweimplementthisdelayfeature?IfItrytouseanother555timertogenerateapulsetoinhibitthenoise,thatwon’twork,becausetheoutputfromeitherthetransistorortherelaycancontinueindefinitely.Therelaylocksitselfon,andthetransistorcancontinuepassingvoltageforaslongassomeoneleavesadooropen.Ifeitherofthesesignalsactivatesatimerinmonostablemode,thepulsefromthetimerwillneverend,anditwillsuppressthealarmindefinitely.IthinkwhatIhavetodoisusearesistorandacapacitortocreateadelay.I’llpowerthemthroughtheexistingrelay,sothatIcanbesurethatthey’llreceivethefullvoltageofthepowersupply,afterbeginningfromzero.Graduallythecapacitorwillacquirevoltage—butIcan’tconnectthisdirectlytothenoisemaker,becausethenoisemakerwillgraduallygetlouderasthevoltage
![Page 183: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/183.jpg)
increases.Ihavetoinsertadevicethatwillbetriggeredtogivefullvoltagewhentheinputrisespastacertainpoint.Todothis,I’llusea555timerthat’swiredinbistablemode.Thiskindofmodificationisgenerallyknownasa“kludge,”becauseit’snotelegant,usestoomanycomponents,anddoesnotusethemappropriately.WhatIreallyneedisacomparator,butIdon’thavespacetogetintothattopic.So,usingtheknowledgethatyouhavesofar,theschematicinFigure4-115showshowadelaycanbeaddedtothealarm—notelegantly,butreliably.Theonlyproblemisthatifyoupowerupa555timerinbistablemode,there’sa50-50chancethatthetimerstartsitselfwithitsoutputhighorlow.SoIneedtopullthevoltagelowontheresetpin(tostartthetimerwithitsoutputinhibited)andgraduallyletitbecomepositive(topermittheoutput).Atthesametime,Iwanttostartwiththevoltagehighonthetriggerpinandgraduallylowerit,untilitfallsbelow1/3ofthepowersupplyandtriggerstheoutput.Sotherearetwotimingcircuits.Theonefortheresetpinworksfasterthantheoneonthetriggerpin,sothatatthepointwhenthetimeristriggered,theresetwon’tstopit.Theschematicshowscomponentvaluesthatwilldothis.The10µFcapacitorstartslowbutischargedthroughthe10Kresistorinacoupleofseconds.Thetimerisnowreadytobetriggered.Butthe68µFcapacitorstartshigh(beingconnectedwiththepositivesideofthepowersupply)andtakesafullminutetobepulleddownto1/3ofsupplyvoltagethroughthe1Mresistor.Atthatpoint,itsvoltageislowenoughtotriggerthe555.Thetimeroutputgoeshighandsuppliesthenoisemaker.Youshouldbeabletoinsertthislittledelaymoduleinyouralarmbox,betweentheoutputfromtherelayandtheinputtothenoisemakerwithouttoomuchtrouble.Andifyouwanttoadjustthedelay,justuseahigherorlowervalueresistorthan1M.
Figure4-115.Thisadditiontotheoriginalalarmcircuitimposesaone-minutedelaybeforethealarmsounds.The555timer(wiredinbistablemode)receivespowerthroughrelayR1.Thelowertimingcircuitinitiallyappliesnegativevoltagetothereset,ensuringthatthe555powersupwithitsoutput
suppressed.Thisvoltagequicklyrises.Meanwhiletheuppertimingcircuitappliesavoltagetothetriggerthatgraduallydiminishesasthe68µFcapacitorequalizesitschargethroughthe1Mresistor.Whenthevoltagediminishesto1/3ofthesupply,thetimer’soutputgoeshighandstartsthenoisemaker.Ifthepowertothecircuitisinterruptedatanytimebeforethis,therelayrelaxes,thecapacitorsgraduallydischarge,andthealarmdoes
notsound.
TheWrap-UpIfyouaddthesethreeenhancements,youralarmwillhaveallthefeaturesonmyoriginalwishlist.Ofcourse,ifIweredesigningitfromscratch,withalltheinformationthathasbeenaddedinthischapterofthebook,itcouldbemoreelegant.Butthemodificationshavenotentailedmakingdestructivechangestoouroriginalproject,andallthedesigngoalshavebeenmet.
![Page 184: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/184.jpg)
5.WhatNext?Atthispoint,wecanbranchoutinnumerousdirections.Herearesomepossibilities:Audioelectronics
Thisisafieldinitself,includinghobbyprojects,suchassimpleamplifiersand“stompboxes,”tomodifyguitarsound.Radio-frequencydevices
Anythingthatreceivesortransmitsradiowaves,fromanultra-simpleAMradiotoremotecontrollers.Motors
Thefieldofroboticshasencouragedthegrowthofmanyonlinesitessellingsteppermotors,gearmotors,synchronousmotors,servomotors,andmore.
ProgrammablemicrocontrollersThesearetinycomputersonasinglechip.Youwritealittleprogramonyourdesktopcomputer,whichwilltellthechiptofollowaseriesofprocedures,suchasreceivinginputfromasensor,waitingforafixedperiod,andsendingoutputtoamotor.Thenyoudownloadyourprogramontothechip,whichstoresitinnonvolatilememory.PopularcontrollersincludethePICAXE,BASICStamp,Arduino,andmanymore.Thecheapestonesretailforamere$5each.
Obviously,Idon’thavespacetodevelopallofthesetopicsfully,sowhatI’mgoingtodoisintroduceyoutothembydescribingjustoneortwoprojectsineachcategory.Youcandecidewhichinterestsyouthemost,andthenproceedbeyondthisbookbyreadingotherguidesthatspecializeinthatinterest.I’malsogoingtomakesomesuggestionsaboutsettingupaproductiveworkarea,readingrelevantbooks,catalogs,andotherprintedsources,andgenerallyproceedingfurtherintohobbyelectronics.
![Page 185: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/185.jpg)
ShoppingList:Experiments25Through36ToolsYouwon’tneedanynewtoolsforthissectionofthebook.
SuppliesandComponentsAswehaveprogressedtothepointwhereyoumaywanttopickandchoosewhichprojectsyouattempt,Iwilllistthesuppliesandcomponentsatthebeginningofeachexperiment.
![Page 186: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/186.jpg)
CustomizingYourWorkAreaAtthispoint,ifyou’regettinghookedonthefunofcreatinghardwarebuthaven’tallocatedapermanentcornertoyournewhobby,Ihavesomesuggestions.Havingtriedmanydifferentoptionsovertheyears,mymainpieceofadviceisthis:don’tbuildaworkbench!Manyhobbyelectronicsbookswantyoutogoshoppingfor2×4sandplywood,asifaworkbenchhastobecustom-fabricatedtosatisfystrictcriteriaaboutsizeandshape.Ifindthispuzzling.Tome,theexactsizeandshapeofabenchisnotveryimportant.Ithinkthemostimportantissueisstorage.Iwanttoolsandpartstobeeasilyaccessible,whetherthey’retinytransistorsorbigspoolsofwire.Icertainlydon’twanttogodiggingaroundonshelvesthatrequiremetogetupandwalkacrosstheroom.
Figure5-1.Theidealworkarea:surroundedbystorage.Neveragainwillyouneedtogetoutofyourchair!
Thisleadsmetotwoconclusions:1.Youneedstorageabovetheworkbench.2.Youneedstoragebelowtheworkbench.
ManyDIYworkbenchprojectsallowlittleornostorageunderneath.Or,theysuggestopenshelves,whichwillbevulnerabletodust.Myminimumconfigurationwouldbeapairoftwo-drawerfilecabinetswithaslabof3/4-inchplywoodoraFormica-cladkitchencountertopplacedacrossthem.Filecabinetsareidealforstoringallkindsofobjects,notjustfiles.OfalltheworkbenchesI’veused,theoneIlikedbestwasanold-fashionedsteelofficedesk—thekindofmonsterthatdatesbacktothe1950s.They’redifficulttomove(becauseoftheirweight)anddon’tlookbeautiful,butyoucanbuythemcheaplyfromusedofficefurnituredealers,they’regenerousinsize,theywithstandabuse,andtheylastforever.Thedrawersaredeepandusuallyslideinandoutsmoothly,likegoodfile-cabinetdrawers.Bestofall,thedeskhassomuchsteelinitthatyoucanuseittogroundyourselfbeforetouchingcomponentsthataresensitivetostaticelectricity.Ifyouuseanantistaticwriststrap,youcansimplyattachittoasheet-metalscrewthatyoudriveintoonecornerofthedesk.Whatwillyouputinthedeepdrawersofyourdeskorfilecabinets?Somepaperworkmaybeuseful,perhapsincludingthefollowingdocuments:
ProductdatasheetsPartscatalogsSketchesandplansthatyoudrawyourself
Theremainingcapacityofeachdrawercanbefilledwithplasticstorageboxes.Theboxescancontaintoolsthatyoudon’tusesooften(suchasaheatgunorahigh-capacitysolderingiron),andlarger-sizedcomponents(suchasloudspeakers,ACadapters,projectboxes,andcircuitboards).Youshouldlookforstorageboxesthatmeasurearound11incheslong,8incheswide,and5inchesdeep,withstraightsides.BoxesthatyoucanbuyatWal-Martwillbecheaper,buttheyoftenhavetaperingsides(whicharenotspace-efficient).TheboxesthatIlikebestareAkro-Grids,madebyAkro-Mils(seeFigures5-2and5-3).Theseareveryrugged,straight-sided,withoptionaltransparentsnap-onlids.YoucandownloadthefullAkro-Millscatalogfromhttp://www.akro-mils.comandthensearchonlineforretailsuppliers.You’llfindthatAkro-Milsalsosellsanincrediblevarietyofpartsbins,butIdon’tlikeopenbinsbecausetheircontentsarevulnerabletodustanddirt.
Figure5-2.Akro-Gridboxescontaingroovesallowingthemtobepartitionedintonumerouscompartmentsforconvenientpartsstorage.
Figure5-3.LidsaresoldseparatelyforAkro-Gridboxestokeepthecontentsdust-free.TheheightoftheboxinFigure5-2allowsthreetobestackedinatypicalfile-cabinetdrawer.Theboxshownhereallowstwotobestacked.
![Page 187: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/187.jpg)
Formedium-sizecomponents,suchaspotentiometers,powerconnectors,controlknobs,andtoggleswitches,Ilikestoragecontainersmeasuringabout11incheslong,8incheswide,and2inchesdeep,dividedintofourtosixsections.YoucanbuythesefromMichaels(thecraftstore),butIprefertoshoponlineforthePlanobrand,astheyseemmoredurablyconstructed.ThePlanoproductsthataremostsuitableformedium-sizeelectronicpartsareclassifiedasfishing-tackleboxes,andyou’llseethemathttp://www.planomolding.com/tackle/products.asp.Forundivided,flat-formatstorageboxes,theProlatch23600-00isideallysizedtofitafile-cabinetdrawer,andthelatchesaresufficientlysecurethatyoucouldstackaseriesofthemontheirlongedges.SeeFigure5-4.
Figure5-4.ThisPlanobrandboxisundivided,makingitusefulforstoringspoolsofwireormedium-sizetools.Whenstackeduprightonitslongedge,threewillfitpreciselyinafile-cabinetdrawer.
Planoalsosellssomereallynicelydesignedtoolboxes,oneofwhichyoucanplaceonyourdesktop.Itwillhavesmalldrawersforeasyaccesstoscrewdrivers,pliers,andotherbasics.Becauseyouneedaworkareathat’sonlyaboutthreefeetsquareformostelectronicsprojects,surrenderingsomedeskspacetoatoolboxisnotabigsacrifice.Ifyouhaveasteeldeskwithrelativelyshallowdrawers,oneofthemcanbeallocatedforprintedcatalogs.Don’tunderratetheusefulnessofhardcopy,justbecauseyoucanbuyeverythingonline.TheMousercatalog,forinstance,hasanindex,whichisbetterinsomewaysthantheironlinesearchfeature,andthecatalogisdividedintohelpfulcategories.ManytimesI’vefoundusefulpartsthatIneverknewexisted,justbybrowsing,whichismuchquickerthanflippingthroughPDFpagesonline,evenwithabroadbandconnection.Currently,Mouserisstillquitegenerousaboutsendingouttheircatalogs,whichcontainover2,000pages.McMaster-Carrwillalsosendyouacatalog,butonlyafteryou‘veorderedfromthem,andonlyonceayear.Now,thebigquestion:howtostoreallthosedinkylittleparts,suchasresistors,capacitors,andchips?I’vetriedvarioussolutionstothisproblem.Themostobviousistobuyacaseofsmalldrawers,eachofwhichisremovable,soyoucanplaceitonyourdeskwhileyouaccessitscontents.ButIdon’tlikethissystem,fortworeasons.First,forverysmallcomponents,youneedtosubdividethedrawers,andthedividersareneversecure.Andsecond,theremovabilityofthedrawerscreatestheriskofaccidentallyemptyingthecontentsonthefloor.Maybeyou’retoocarefultoallowthistohappen,butI’mnot!MypersonalpreferenceistouseDariceMini-Storageboxes,showninFigure5-5.YoucanfindtheseatMichaelsinsmallquantities,orbuythemmoreeconomicallyinbulkonlinefromsupplierssuchashttp://www.craftamerica.com.Theblueboxesaresubdividedintofivecompartmentsthatareexactlytherightsizeandshapeforresistors.Theyellowboxesaresubdividedintotencompartments,whichareidealforsemiconductors.Thepurpleboxesaren’tdividedatall,andtheredboxeshaveamixofdivisions.
Figure5-5.DariceMini-Storageboxesareidealforcomponentssuchasresistors,capacitors,andsemiconductors.Theboxescanbestackedstablyorstoredonshelves,withtheirendslabeled.Thebrandstickeriseasilyremovedafterbeingwarmedwithaheatgun.
Thedividersaremoldedintotheboxes,soyoudon’thavetheannoyanceassociatedwithremovabledividersthatslipoutofposition,allowingcomponentstomixtogether.Theboxlidsfittightly,sothatevenifyoudroponeoftheboxes,itprobablywon’topen.Thelidshavemetalhinges,andaridgearoundtheedgethatmakestheboxessecurelystackable.Ikeepmylittlestorageboxesonasetofshelvesabovethedesk,withagapof3inchesbetweenoneshelfandthenext,allowingtwoboxestobestackedoneachshelf.IfIwanttoworkwithaparticularsubsetofboxes,Ishiftthemontothedesktopandstackthemthere.
LabelingNomatterwhichwayyouchoosetostoreyourparts,labelingthemisessential.Anyink-jetprinterwillproduceneat-lookinglabels,andifyouusepeelable(nonpermanent)labels,you’llbeabletoreorganizeyourpartsinthefuture,asalwaysseemstobecomenecessary.Iusecolor-codedlabelsformycollectionofresistors,sothatIcancomparethestripesonaresistorwiththecodeonthelabel,andseeimmediatelyiftheresistorhasbeenputinthewrongplace.SeeFigure5-6.
Figure5-6.Tocheckthatresistorsarenotplacedinthewrongcompartments,printthecolorcodeoneachlabel.
Evenmoreimportant:youneedtoplaceasecond(non-adhesive)labelinsideeachcompartmentwiththecomponents.Thislabeltellsyouthemanufacturer’spartnumberandthesource,sothatreorderingiseasy.IbuyalotofitemsfromMouser,andwheneverIopentheirlittleplasticbagsofparts,Isnipoutthesectionofthebagthathastheidentifyinglabelonit,andslideitintothecompartmentofmypartsboxbeforeIputthepartsontopofit.Thissavesfrustrationlater.IfIwerereallywellorganized,IwouldalsokeepadatabaseonmycomputerlistingeverythingthatIbuy,includingthedate,thesource,thetypeofcomponent,andthequantity.ButI’mnotthatwellorganized.
OntheBench
![Page 188: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/188.jpg)
Someitemsaresoessentialthattheyshouldsitonthebenchordesktoponapermanentbasis.Theseincludeyoursolderingiron(s),helpinghandswithmagnifier,desklamp,breadboard,powerstrip,andpowersupply.Foradesklamp,Ipreferthetypethathasadaylight-spectrumfluorescentbulb,becauseitspreadsauniformlightandhelpsmetodistinguishcolorsofadjacentstripesonresistors.Thepowersupplyisamatterofpersonalpreference.Ifyou’reseriousaboutelectronics,youcanbuyaunitthatdeliversproperlysmoothedcurrentatavarietyofproperlyregulatedandcalibratedvoltages.Yourlittlewall-plugunitfromRadioShackcannotdoanyofthesethings,anditsoutputmayvarydependingonhowheavilyyouloadit.Still,asyou’veseen,itissufficientforbasicexperiments,andwhenyou’reworkingwithlogicchips,youneedtomounta5-voltregulatoronyourbreadboardanyway.Overall,Iconsideragoodpowersupplyoptional.Anotheroptionalitemisanoscilloscope.Thiswillshowyou,graphically,theelectricalfluctuationsinsideyourwiresandcomponents,andbyapplyingprobesatdifferentpoints,youcantrackdownerrorsinyourcircuit.It’saneatgadgettoown,butitwillcostafewhundreddollars,andforourtaskssofar,ithasnotbeennecessary.Ifyouplantogetseriouslyintoaudiocircuits,anoscilloscopebecomesfarmoreimportant,becauseyou’llwanttoseetheshapesofthewaveformsthatyougenerate.YoucantrytoeconomizeonanoscilloscopebybuyingaunitthatplugsintotheUSBportofyourcomputerandusesyourcomputermonitortodisplaythesignal.Ihavetriedoneofthese,andwasnotentirelyhappywiththeresults.Itworked,butdidnotseemaccurateorreliableforlow-frequencysignals.MaybeIwasunlucky;Idecidednottotryanyotherbrands.Thesurfaceofyourdeskorworkbenchwillundoubtedlybecomescarredbyrandomscuffs,cutmarks,anddropsofmoltensolder.Iuseapieceofhalf-inchplywood,twofeetsquare,toprotectmyprimaryworkarea,andIclampaminiaturevisetoitsedge.Toreducetheriskofstaticelectricitywhenworkingwithsensitivecomponents,Icovertheplywoodwithasquareofconductivefoam.Thisisnotcheap,butoffersadvantagesinadditiontoprotectingchipsfrombeingzapped.Insteadofscatteringstraycomponents,Icanstickthemintothefoam,likeplantsgrowinginagarden.Andlikeagarden,Icandivideitintosections,withresistorsononeside,capacitorsontheother,andchipsstraightahead.Inevitably,duringyourworkyou’llcreateamess.Littlepiecesofbentwire,strayscrews,fasteners,andfragmentsofstrippedinsulationtendtoaccumulate,andcanbealiability.Ifmetalpartsorfragmentsgetintoaprojectthatyou’rebuilding,theycancauseshortcircuits.Soyouneedatrashcontainer.Butithastobeeasytouse.Iuseafull-sizegarbagepail,becauseit’ssobigthatIcan’tmissitwhenIthrowsomethingtowardit,andIcanneverforgetthatit’sthere.Last,butmostessential:acomputer.Nowthatalldatasheetsareavailableonline,andallcomponentscanbeorderedonline,andmanysamplecircuitsareplacedonlinebyhobbyistsandeducators,Idon’tthinkanyonecanworkefficientlywithoutquickInternetaccess.Toavoidwastingspace,Isuggestyouuseasmall,cheaplaptopthathasaminimalfootprint.Apossibleworkbenchconfiguration,usingasteeldesk,isshowninFigure5-7.
Figure5-7.Anoldsteelofficedeskcanbeasgoodas,ifnotbetterthan,aconventionalworkbenchwhenbuildingsmallelectronicsprojects.Itprovidesalargeworkareaandamplestorage,andhassufficientmassforyoutogroundyourselfwhendealingwithcomponentsthataresensitivetostatic
electricity.
![Page 189: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/189.jpg)
ReferenceSourcesOnlineMyfavoriteeducationalandreferencesiteisDoctronics(http://www.doctronics.co.uk).Ilikethewaytheydrawtheirschematics,andIlikethewaytheyincludemanyillustrationsofcircuitsonbreadboards(whichmostsitesdon’tbothertodo).Theyalsosellkits,ifyou’rewillingtopayandwaitforshippingfromtheUK.PartofapagefromthedoctronicswebsiteisreproducedinFigure5-8.
Figure5-8.Asamplepagefromhttp://www.doctronics.co.ukshowstheirdetailedinstructionalapproach.Thisisavaluablefreeonlineresource.
MynextfavoritehobbysiteisalsoBritish-based:theElectronicsClub(http://www.kpsec.freeuk.com).It’snotascomprehensiveasDoctronics,butveryfriendlyandeasytounderstand.Foramoretheory-basedapproach,tryhttp://www.electronics-tutorials.ws.ThiswillgoalittlefartherthanthetheorysectionsI’veincludedhere.Foranidiosyncraticselectionofelectronicstopics,tryDonLancaster’sGuru’sLair(http://www.tinaja.com).LancasterwroteTheTTLCookbookmorethan30yearsago,whichopenedupelectronicstoatleasttwogenerationsofhobbyistsandexperimenters.Heknowswhathe’stalkingabout,andisn’tafraidofgettingintosomefairlyambitiousareassuchaswritinghisownPostScriptdriversandcreatinghisownserial-portconnections.You’llfindalotofideasthere.
BooksYes,youdoneedbooks.Asyou’realreadyreadingthisone,Iwon’trecommendotherbeginners’guides.Instead,inkeepingwiththeorientationofthischapter,I’llsuggestsometitlesthatwilltakeyoufartherinvariousdirections,andcanbeusedforreference.Iownallofthesemyself,andfindthemvaluable:PracticalElectronicsforInventors,byPaulScherz(McGraw-Hill,SecondEdition,2007)
Thisisamassive,comprehensivebook,wellworththe$40coverprice.Despiteitstitle,youwon’tneedtoinventanythingtofindituseful.It’smyprimaryreferencesource,coveringawiderangeofconcepts,fromthebasicpropertiesofresistorsandcapacitorsallthewaytosomefairlyhigh-endmath.Ifyoubuyonlyonebook(inadditiontothisone,ofcourse!),thiswouldbemyrecommendation.
GettingStartedwithArduino,byMassimoBanzi(Make:Books,2009)IfyouenjoythesimplicityandconvenienceofthePICAXEprogrammablemicrocontrollerthatIdescribelaterinthischapter,you’llfindthattheArduinocandoalotmore.GettingStartedisthesimplestintroductionaround,andwillhelptofamiliarizeyouwiththeProcessinglanguageusedinArduino(similartotheClanguage,notmuchliketheversionofBASICusedbythePICAXE).
MakingThingsTalk,byTomIgoe(Make:Books,2007)ThisambitiousandcomprehensivevolumeshowshowtomakethemostoftheArduino’sabilitytocommunicatewithitsenvironment,evengettingittoaccesssitesontheInternet.
TTLCookbook,byDonLancaster(HowardW.Sams&Co,1974)The1974copyrightdateisnotamisprint!Youmaybeabletofindsomelatereditions,butwhicheveroneyoubuy,itwillbesecondhandandpossiblyexpensive,asthistitlenowhascollectiblevalue.Lancasterwrotehisguidebeforethe7400seriesofchipswasemulatedonapin-for-pinbasisbyCMOSversions,butit’sstillagoodreference,becausetheconceptsandpartnumbershaven’tchanged,andhiswritingissoaccurateandconcise.
CMOSSourcebook,byNewtonC.Braga(SamsTechnicalPublishing,2001)Thisbookisentirelydevotedtothe4000seriesofCMOSchips,notthe74HC00seriesthatI’vedealtwithprimarilyhere.The4000seriesisolderandmustbehandledmorecarefully,becauseit’smorevulnerabletostaticelectricitythanthegenerationsthatcamelater.Still,thechipsremainwidelyavailable,andtheirgreatadvantageistheirwillingnesstotolerateawidevoltagerange,typicallyfrom5to15volts.Thismeansyoucansetupa12-voltcircuitthatdrivesa555timer,anduseoutputfromthetimertogostraightintoCMOSchips(forexample).Thebookiswellorganizedinthreesections:CMOSbasics,functionaldiagrams(showingpinoutsforallthemainchips),andsimplecircuitsshowinghowtomakethechipsperformbasicfunctions.
TheEncyclopediaofElectronicCircuits,byRudolfF.Graf(TabBooks,1985)Atotallymiscellaneouscollectionofschematics,withminimalexplanations.Thisisausefulbooktohavearoundifyouhaveanideaandwanttoseehowsomeoneelseapproachedtheproblem.Examplesareoftenmorevaluablethangeneralexplanations,andthisbookisamassivecompendiumofexamples.Manyadditionalvolumesintheserieshavebeenpublished,butstartwiththisone,andyoumayfindithaseverythingyouneed.
TheCircuitDesigner’sCompanion,byTimWilliams(Newnes,SecondEdition,2005)Muchusefulinformationaboutmakingthingsworkinpracticalapplications,butthestyleisdryandfairlytechnical.Maybeusefulifyou’reinterestedinmovingyourelectronicsprojectsintotherealworld.
TheArtofElectronics,byPaulHorowitzandWinfieldHill(CambridgeUniversityPress,SecondEdition,1989)Thefactthatthisbookhasbeenthrough20printingstellsyoutwothings:(1)Manypeopleregarditasafundamentalresource;(2)Secondhandcopiesshouldbewidelyavailable,whichisanimportantconsideration,asthelistpriceisover$100.It’swrittenbytwoacademics,andhasamoretechnicalapproachthanPracticalElectronicsforInventors,butIfinditusefulwhenI’mlookingforbackupinformation.
GettingStartedinElectronics,byForrestM.MimsIII(MasterPublishing,FourthEdition,2007)Althoughtheoriginaldatesbackto1983,thisisstillafunbooktohave.IthinkIhavecoveredmanyofitstopicshere,butyou
![Page 190: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/190.jpg)
maybenefitbyreadingexplanationsandadvicefromacompletelydifferentsource,anditgoesalittlefartherthanIhaveintosomeelectricaltheory,onaneasy-to-understandbasis,withcutedrawings.Bewarnedthatit’sabriefbookwitheclecticcoverage.Don’texpectittohavealltheanswers.
Figure5-9.ThesebooksfromMAKEprovideguidanceifyouwanttogobeyondbasicmicrocontrollersintothemoreexoticrealmsoftheArduinochip.
Figure5-10.Asun-damagedcopyoftheDonLancaster’sclassicTTLCookbook,a2,000-pagecatalogfromtheMouserElectronicssupplycompany,andtwocomprehensivereferencebooksthatcanprovideyearsofadditionalguidanceinallareasofelectronics.
![Page 191: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/191.jpg)
Experiment25:MagnetismThisexperimentshouldbeapartofanyschoolscienceclass,butevenifyourememberdoingit,Isuggestthatyoudoitagain,becausesettingituptakesonlyamatterofmoments,andit’sgoingtobeourentrypointtoawholenewtopic:therelationshipbetweenelectricityandmagnetism.Quicklythiswillleadusintoaudioreproductionandradio,andI’lldescribethefundamentalsofself-inductance,whichisthethirdandfinalbasicpropertyofpassivecomponents(resistanceandcapacitancebeingtheothertwo).Ileftself-inductanceuntillastbecauseit’snotveryrelevanttotheexperimentsthatyou’vedonesofar.Butassoonaswestartdealingwithanalogsignalsthatfluctuate,itbecomesessential.Youwillneed:
Largescrewdriver.22-gaugewire(orthinner).Quantity:6feet.AAbattery.
FUNDAMENTALSAtwo-wayrelationshipEveryelectricmotorthatwasevermadeusessomeaspectoftherelationshipbetweenelectricityandmagnetism.It’sabsolutelyfundamentalintheworldaroundus.Rememberthatelectricitycancreatemagnetism:Whenelectricityflowsthroughawire,itcreatesamagneticforcearoundthewire.Theprincipleworksinreverse:magnetismcancreateelectricity.Whenawiremovesthroughamagneticfield,itcreatesaflowofelectricityinthewire.Thissecondprincipleisusedinpowergeneration.Adieselengine,orawater-poweredturbine,orawindmill,orsomeothersourceofenergyeitherturnscoilsofwirethroughapowerfulmagneticfield,orturnsmagnetsamidsomemassivecoilsofwire.Electricityisinducedinthecoils.Inthenextexperiment,you’llseeadramaticmini-demoofthiseffect.
ProcedureThiscouldn’tbesimpler.Windthewirearoundtheshaftofthescrewdriver,nearitstip.Theturnsshouldbeneatandtightandcloselyspaced,andyou’llneedtomake100ofthem,withinadistanceofnomorethan2inches.Tofitthemintothisspace,you’llhavetomaketurnsontopofpreviousturns.Ifthefinalturntendstounwinditself(whichwillhappenifyou’reusingstrandedwire),secureitwithapieceoftape.SeeFigure5-11.
Figure5-11.AnyonewhosomehowmissedthismostbasicchildhooddemoofelectromagnetismshouldtryitjustforthefunofprovingthatasingleAAbatterycanmoveapaperclip.
Nowapplyabattery,asshowninFigure5-12.Atfirstsight,thislookslikeaverybadidea,becauseyou’regoingtoshortoutyourbatteryjustasyoudidinExperiment2.Butbypassingthecurrentthroughawirethat’scoiledinsteadofstraight,we’llgetsomeworkoutofitbeforethebatteryexpires.Putasmallpaperclipnearthescrewdriverblade,onasoft,smoothsurfacethatwillnotpresentmuchfriction.Atissueworkswell.Becausemanyscrewdriversarealreadymagnetic,youmayfindthatthepaperclipisnaturallyattractedtothetipoftheblade.Ifthishappens,movetheclipjustoutsidetherangeofattraction.Nowapplythe1.5voltstothecircuit,andtheclipshouldjumptothetipofthescrewdriver.Congratulations:youjustmadeanelectromagnet.
Figure5-12.Aschematiccan’tgetmuchsimplerthanthis.
THEORYInductanceWhenelectricityflowsthroughawire,itcreatesamagneticfieldaroundthewire.Becausetheelectricity“induces”thiseffect,itisknownasinductance.TheeffectisillustratedinFigure5-13.
Figure5-13.Whentheflowofelectricityisfromlefttorightalongthisconductor,itinducesamagneticforceshownbythegreenarrows.
![Page 192: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/192.jpg)
Thefieldaroundastraightwireisveryweak,butifwebendthewireintoacircle,themagneticforcestartstoaccumulate,pointingthroughthecenterofthecircle,asshowninFigure5-14.Ifweaddmorecircles,toformacoil,theforceaccumulatesevenmore.Andifweputamagneticobject(suchasascrewdriver)inthecenterofthecoil,theeffectivenessincreasesfurther.
Figure5-14.Whentheconductorisbenttoformacircle,thecumulativemagneticforceactsthroughthecenterofthecircle,asshownbythelargearrow.
Here’sanapproximatedformulashowingtherelationshipbetweenthediameterofthecoil,thewidthofthecoilfromendtoend,thenumberofturns,anditsinductance.TheletterListhesymbolforinductance,eventhoughtheunitistheHenry,namedafteranAmericanelectricalpioneernamedJosephHenry:
L(inmicroHenrys)=[(D×D)×(NxN)]/[(18×D)+(40×W)](Approximately)
Inthisformula,Disthediameterofthecoil,Nisthenumberofturns,andWisthewidthofthecoilfromendtoend.SeeFigure5-15.Herearethreesimpleconclusionsfromthisformula:
Inductanceincreaseswiththediameterofthecoil.Inductanceincreaseswiththesquareofthenumberofturns.(Inotherwords,threetimesasmanyturnscreateninetimestheinductance.)Ifthenumberofturnsremainsthesame,inductanceislowerifyouwindthecoilsothatit’sslenderandlong,butishigherifyouwinditsothatit’sfatandshort.
Figure5-15.Theinductanceofacoilincreaseswithitsdiameterandwiththesquareofitsnumberofturns.Ifallotherparametersremainthesame,reducingthewidth(thedistancefromendtoend)bypackingtheturnsmoretightlywillincreasetheinductance.
FUNDAMENTALSCoilschematicsandbasicsChecktheschematicsymbolsforcoilsinFigure5-16.Notethatifacoilhasanironcore,thisisshownwithanextracoupleoflines(sometimesonlyoneline).Ifithasaferritecore,thelineissometimesshownwithdashes.Anironcorewilladdtotheinductanceofacoil,becauseitincreasesthemagneticeffect.Acoilinisolationdoesnotgenerallyhaveanypolarity.Youcanconnectiteitherwayaround,butthemagneticforcewillbereversedaccordingly(coilsthatinteractwithstuff—suchasintransformersandsolenoids—dohavepolarity).Perhapsthemostwidespreadapplicationofcoilsisintransformers,wherealternatingcurrentinonecoilinducesalternatingcurrentinanother,oftensharingthesameironcore.Iftheprimary(input)coilhashalfasmanyturnsasthesecondary(output)coil,thevoltagewillbedoubled,athalfthecurrent—assuminghypotheticallythatthetransformeris100%efficient.
Figure5-16.Schematicdiagramsrepresentcoils.Atfarleftistheolderstyle.Thethirdandfourthsymbolsindicatethatthecoiliswoundaroundasolidorpowderedmagneticcore,respectively.
BACKGROUNDJosephHenryBornin1797,JosephHenrywasthefirsttodevelopanddemonstratepowerfulelectromagnets.Healsooriginatedtheconceptof“self-inductance,”meaningthe“electricalinertia”thatisapropertyofacoilofwire.HenrystartedoutasthesonofadaylaborerinAlbany,NewYork.Heworkedinageneralstorebeforebeingapprenticedtoawatchmaker,andwasinterestedinbecominganactor.FriendspersuadedhimtoenrollattheAlbanyAcademy,whereheturnedouttohaveanaptitudeforscience.In1826,hewasappointedProfessorofMathematicsandNaturalPhilosophyattheAcademy,eventhoughhewasnotacollegegraduateanddescribedhimselfasbeing“principallyself-educated.”MichaelFaradaywasdoingsimilarworkinEngland,butHenrywasunawareofit.
![Page 193: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/193.jpg)
HenrywasappointedtoPrincetonin1832,wherehereceived$1,000peryearandafreehouse.WhenMorseattemptedtopatentthetelegraph,Henrytestifiedthathewasalreadyawareofitsconcept,andindeedhadriggedasystemonsimilarprinciplestosignalhiswife,athome,whenhewasworkinginhislaboratoryatthePhilosophicalHall.Henrytaughtchemistry,astronomy,andarchitecture,inadditiontophysicalscience,andbecausesciencewasnotdividedintostrictspecialtiesasitisnow,heinvestigatedphenomenasuchasphosphorescence,sound,capillaryaction,andballistics.In1846,heheadedthenewlyfoundedSmithsonianInstitutionasitssecretary.
Figure5-17.JosephHenrywasanAmericanexperimenterwhopioneeredtheinvestigationofelectromagnetism.ThisphotographisarchivedinWikimediaCommons.
![Page 194: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/194.jpg)
Experiment26:TabletopPowerGenerationIfyouhavejustthreecomponents,youcanseemagnetismgeneratingelectricityrightinfrontofyou,rightnow.Youwillneed:
Cylindricalneodymiummagnet,3/4-inchdiameter,axiallymagnetized.Quantity:1.(Obtainableonlineatsitessuchashttp://www.kjmagnetics.com.)Spoolofhookupwire,26-gauge,100feet.Quantity:1.Spoolofmagnetwire,quarter-pound,26-gauge,about350feet.Quantity:1.(Searchonlineforsourcesfor“magnetwire.”)GenericLED.Quantity:1.100μFelectrolyticcapacitor.Quantity:1.Signaldiode,1N4001orsimilar.Quantity:1.Jumperwireswithalligatorclipsontheends.Quantity:2.
ProcedureYoumaybeabletomakethisexperimentworkwiththespoolofhookupwire,dependingonthesizeofthespoolrelativetothesizeofyourmagnet,butastheresultsaremorelikelytobebetterwiththemagnetwire,I’llassumethatyou’reusingthat—initially,atleast.Theadvantageofthemagnetwireisthatitsverythininsulationallowsthecoilstobecloselypacked,increasingtheirinductance.Firstpeekintothehollowcenterofthespooltoseeiftheinnerendofthewirehasbeenleftaccessible,asisvisibleinFigures5-18and5-19.Ifithasn’t,youhavetounwindthewireontoanylarge-diametercylindricalobject,thenrewinditbackontothespool,thistimetakingcaretoleavetheinnerendstickingout.
Figure5-18.Aneveryday100-footspoolofhookupwireiscapableofdemonstratingtheinductivepowerofacoil.
Figure5-19.Magnetwirehasthinnerinsulationthanhookupwire,allowingtheturnstobemoredenselypacked,inducingamorepowerfulmagneticfield.
Scrapethetransparentinsulationoffeachendofthemagnetwirewithautilityknifeorsandpaper,untilbarecopperisrevealed.Tocheck,attachyourmeter,settomeasureohms,tothefreeendsofthewire.Ifyoumakeagoodcontact,youshouldmeasurearesistanceof30ohmsorless.Placethespoolonanonmagnetic,nonconductivesurfacesuchasawooden,plastic,orglass-toppedtable.AttachtheLEDbetweentheendsofthewireusingjumperwires.Thepolarityisnotimportant.NowtakeacylindricalneodymiummagnetofthetypeshowninFigure5-20andpushitquicklydownintothehollowcore,thenpullitquicklybackout.SeeFigure5-21.YoushouldseetheLEDblink,eitheronthedownstrokeortheupstroke.Thesamethingmayormaynothappenifyouuse100feetof26-gaugehookupwire.Ideally,yourcylindricalmagnetshouldfitfairlycloselyinthehollowcenterofthespool.Ifthere’sabigairgap,thiswillgreatlyreducetheeffectofthemagnet.Notethatifyouuseaweaker,old-fashionedironmagnetinsteadofaneodymiummagnet,youmaygetnoresultatall.
Figure5-20.Threeneodymiummagnets,1/4-,1/2-,and3/4-inchindiameter.Iwouldhavepreferredtophotographthemstandinghalf-an-inchapart,buttheyrefusedtopermitit.
![Page 195: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/195.jpg)
Figure5-21.Bymovingamagnetvigorouslyupanddownthroughthecenterofacoil,yougenerateenoughpowertomaketheLEDflashbrightly.
BloodBlistersandDeadMediaNeodymiummagnetscanbehazardous.They’rebrittleandcanshatteriftheyslamagainstapieceofmagneticmetal(oranothermagnet).Forthisreason,manymanufacturersadviseyoutoweareyeprotection.Becauseamagnetpullswithincreasingforceasthedistancebetweenitandanotherobjectgetssmaller,itclosesthefinalgapverysuddenlyandpowerfully.Youcaneasilypinchyourskinandgetbloodblisters.Ifthere’sanobjectmadeofironorsteelanywherenearaneodymiummagnet,themagnetwillfinditandgrabit,withresultsthatmaybeunpleasant,especiallyiftheobjecthassharpedgesandyourhandsareinthevicinity.Whenusingamagnet,createaclearareaonanonmagneticsurface,andwatchoutformagneticobjectsunderneaththesurface.Mymagnetsensedasteelscrewembeddedintheundersideofakitchencountertop,andslammeditselfintocontactwiththecountertopunexpectedly.Beawarethatmagnetscreatemagnets.Whenamagneticfieldpassesacrossanironorsteelobject,theobjectpicksupsomemagnetismofitsown.Becarefulnottomagnetizeyourwatch!Don’tusemagnetsanywherenearacomputer,adiskdrive,creditcardswithmagneticstripes,cassettesofanytype,andothermedia.AlsokeepmagnetswellawayfromTVscreensandvideomonitors(especiallycathode-raytubes).Lastbutnotleast,powerfulmagnetscaninterferewiththenormaloperationofcardiacpacemakers.
Here’sanotherthingtotry.DisconnecttheLEDandconnecta100μFelectrolyticcapacitorinserieswithsignaldiode,asshowninFigure5-23.Attachyourmeter,measuringvolts,acrossthecapacitor.Ifyourmeterhasamanualsettingforitsrange,setitto20VDC.Makesurethepositive(unmarked)sideofthediodeisattachedtothenegative(marked)sideofthecapacitor,sothatpositivevoltagewillpassthroughthecapacitorandthenthroughthediode.Nowmovethemagnetvigorouslyupanddowninthecoil.Themetershouldshowthatthecapacitorisaccumulatingcharge,uptoabout10volts.Whenyoustopmovingthemagnet,thevoltagereadingwillgraduallydecline,mostlybecausethecapacitordischargesitselfthroughtheinternalresistanceofyourmeter.Thisexperimentismoreimportantthanitlooks.Bearinmindthatwhenyoupushthemagnetintothecoil,itinducescurrentinonedirection,andwhenyoupullitbackoutagain,itinducescurrentintheoppositedirection.Youareactuallygeneratingalternatingcurrent.Thediodeonlyallowscurrenttoflowonewaythroughthecircuit.Itblockstheoppositeflow,whichishowthecapacitoraccumulatesitscharge.Ifyoujumptotheconclusionthatdiodescanbeusedtochangealternatingcurrenttodirectcurrent,you’reabsolutelycorrect.Wesaythatthediodeis“rectifying”theACpower.Experiment25showedthatvoltagecancreateamagnet.Experiment26hasshownthatamagnetcancreatevoltage.We’renowreadytoapplytheseconceptstothedetectionandreproductionofsound.
Figure5-22.Becauseinductanceincreaseswiththediameterofacoilandwiththesquareofthenumberofturns,yourpoweroutputfrommovingamagnetthroughthecoilcanincreasedramaticallywithscale.Thosewishingtolive“offthegrid”mayconsiderthissteam-poweredconfiguration,
suitableforpoweringathree-bedroomhome.
![Page 196: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/196.jpg)
Figure5-23.Usingadiodeinserieswithacapacitor,youcanchargethecapacitorwiththepulsesofcurrentthatyougeneratebymovingthemagnetthroughthecenterofthecoil.Thisdemoillustratestheprincipleofrectifyingalternatingcurrent.
![Page 197: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/197.jpg)
Experiment27:LoudspeakerDestructionI’dlikeyoutosacrificea2-inchloudspeaker,eventhoughitmeanswastingthe$5orsothatitprobablycosts.Actually,Idon’tconsiderthisawaste,becauseifyouwanttolearnhowacomponentworks,there’snosubstituteforactuallyseeinginsideit.Youmightalsohavesuchaspeakeralready,partofapieceofcast-offpersonalelectronicsortoyyouhaveinyourbasement.Youwillneed:
Cheapestpossible2-inchloudspeaker.Quantity:1.Figure5-24showsatypicalexample.
Figure5-24.A2-inchloudspeakercanbeinstructivelydestroyedwithautilityknifeorX-Actoblade.
ProcedureTurntheloudspeakerface-up(asshowninFigure5-25)andcutaroundtheedgeofitsconewithasharputilityknifeorX-Actoblade.Thencutaroundthecircularcenterandremovetheringofblackpaperthatyou’vecreated.TheresultshouldlooklikeFigure5-26:youshouldseetheflexibleneckoftheloudspeaker,whichisusuallymadefromayellowweave.Ifyoucutarounditsedge,youshouldbeabletopullupthehiddenpapercylinder,whichhasthecoppercoiloftheloudspeakerwoundaroundit.InFigure5-27,I’veturneditoversothatitiseasilyvisible.Thetwoendsofthiscoppercoilnormallyreceivepowerthroughtwoterminalsatthebackofthespeaker.Whenitsitsinthegroovevisiblebetweentheinnermagnetandtheoutermagnet,thecoilreactstovoltagefluctuationsbyexertinganup-and-downforceinreactiontothemagneticfield.Thisvibratestheconeoftheloudspeakerandcreatessoundwaves.Largeloudspeakersinyourstereosystemworkexactlythesameway.Theyjusthavebiggermagnetsandcoilsthatcanhandlemorepower(typically,asmuchas100watts).WheneverIopenupasmallcomponentlikethis,I’mimpressedbytheprecisionanddelicacyofitsparts,andthewayitcanbemass-producedforsuchalowcost.Iimaginehowastonishedthepioneersofelectricaltheory(suchasFaradayandHenry)wouldbe,iftheycouldseethecomponentsthatwetakeforgrantedtoday.Henryspentdaysandweekswindingcoilsbyhandtocreateelectromagnetsthatwerefarlessefficientthanthischeaplittleloudspeaker.
Figure5-25.Loudspeakerreadyforcreativedestruction.
Figure5-26.Theconehasbeenremoved.
Figure5-27.Theneckoftheconehasbeenpulledout.Notethecoilofcopperwire,whichfitspreciselyinthegroovebetweentwomagnetsinthebaseofthespeaker.
BACKGROUNDOriginsofloudspeakersLoudspeakersutilizethefactthatifyourunavaryingelectricalcurrentthroughacoilsituatedinamagneticfield,thecoilwillmoveinresponsetothecurrent.Thisideawasintroducedin1874byErnstSiemens,aprolificGermaninventor.(Healsobuilttheworld’sfirstelectricallypoweredelevatorin1880.)Today,SiemensAGisoneofthelargestelectronicscompaniesintheworld.WhenAlexanderGrahamBellpatentedthetelephonein1876,heusedSiemen’sconcepttocreateaudiblefrequenciesintheearpiece.Fromthatpointon,sound-reproductiondevicesgraduallyincreasedinqualityandpower,untilChesterRiceandEdwardKelloggatGeneralElectricpublishedapaperin1925establishingbasicprinciplesthatarestillusedinloudspeakerdesigntoday.Athttp://www.radiolaguy.com/Showcase/Gallery-HornSpkr.htmyou’llfindphotographsofverybeautifulearlyloudspeakers,whichusedahorndesigntomaximizeefficiency.Assoundamplifiersbecamemorepowerful,speakerefficiencybecamelessimportantcomparedwithqualityreproductionandlowmanufacturingcosts.Today’sloudspeakersconvertonlyabout1%ofelectricalenergyintoacousticalenergy.
![Page 198: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/198.jpg)
Figure5-28.ThisbeautifulAmplionAR-114xillustratestheeffortsofearlydesignerstomaximizeefficiencyinanerawhenthepowerofaudioamplifierswasverylimited.Photosby“Sonny,theRadiolaGuy.”Manyearlyspeakersareillustratedatwww.radiolaguy.com.Someareforsale.
THEORYSound,electricity,andsoundTimenowtoestablishaclearideaofhowsoundistransformedintoelectricityandbackintosoundagain.Supposesomeonebangsagongwithastick.Theflatmetalfaceofthegongvibratesinandout,creatingsoundwaves.Asoundwaveisapeakofhigherairpressure,followedbyatroughoflowerairpressure.Thewavelengthofthesoundisthedistance(usuallyrangingfrommeterstomillimeters)betweenonepeakofpressureandthenextpeak.Thefrequencyofthesoundisthenumberofwavespersecond,usuallyexpressedashertz.Supposeweputaverysensitivelittlemembraneofthinplasticinthepathofthepressurewaves.Theplasticwillflutterinresponsetothewaves,likealeafflutteringinthewind.Supposeweattachatinycoilofverythinwiretothebackofthemembranesothatitmoveswiththemembrane,andlet’spositionastationarymagnetinsidethecoilofwire.Thisconfigurationislikeatiny,ultra-sensitiveloudspeaker,exceptthatinsteadofelectricityproducingsound,itisconfiguredsothatsoundproduceselectricity.Soundpressurewavesmakethemembranemovetoandfroalongtheaxisofthemagnet,andthemagneticfieldcreatesafluctuatingvoltageinthewire.Thisisknownasamoving-coilmicrophone.Thereareotherwaystobuildamicrophone,butthisistheconfigurationthatiseasiesttounderstand.Ofcourse,thevoltagethatitgeneratesisverysmall,butwecanamplifyitusingatransistor,oraseriesoftransistors.Thenwecanfeedtheoutputthroughthecoilaroundtheneckofaloudspeaker,andtheloudspeakerwillrecreatethepressurewavesintheair.Figures5-29through5-32illustratethissequence.
Figure5-29.Step1intheprocessofconvertingsoundtoelectricity,andbackagain.Whenthehammerhitsthegong,thefaceofthegongvibrates,creatingpressurewavesthattravelthroughtheair.
THEORYSound,electricity,andsound(continued)Somewherealongtheway,wemaywanttorecordthesoundandthenreplayit.Buttheprincipleremainsthesame.Thehardpartisdesigningthemicrophone,theamplifier,andtheloudspeakersothattheyreproducethewaveformsaccuratelyateachstep.It’sasignificantchallenge,whichiswhyaccuratesoundreproductioncanbeelusive.Timenowtothinkaboutwhathappensinsidethewirewhenitgeneratesamagneticfield.Obviously,someofthepowerinthewireisbeingtransformedintomagneticforce.Butjustwhatexactlyisgoingon?
Figure5-30.Step2:thepressurewavespenetratetheperforatedshellofamicrophoneandcauseadiaphragmtovibrateinsympathy.Thediaphragmhasacoilattachedtoit.Whenthecoilvibratestoandfro,amagnetatitscenterinducesalternatingcurrent.
![Page 199: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/199.jpg)
Figure5-31.Step3:thetinysignalsfromthemicrophonepassthroughanamplifier,whichenlargestheiramplitudewhileretainingtheirfrequencyandtheshapeoftheirwaveform.
Figure5-32.Step4:theamplifiedelectricalsignalispassedthroughacoilaroundtheneckofaloudspeakercone.Themagneticfieldinducedbythecurrentcausestheconetovibrate,reproducingtheoriginalsound.
![Page 200: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/200.jpg)
Experiment28:MakingaCoilReactAcapacitorwillabsorbsomeDCcurrentuntilitisfullycharged,atwhichpointitblockstheflow.There’sanotherphenomenonthatIhaven’tmentionedsofar,whichistheexactoppositeofcapacitance.It’sknownasself-inductance,andyoufinditinanycoilofwire.InitiallyitblocksDCcurrent(itreactsagainstit),butthenitsoppositiongraduallydisappears.Hereareafewdefinitions:Resistance
Constrainscurrentflowanddropsvoltage.Capacitance
Allowscurrenttoflowinitiallyandthenblocksit.Thisbehaviorisproperlyknownascapacitivereactance.Self-Inductance
Blockstheflowofcurrentinitiallyandthenallowsit.Thisisalsooftenreferredtoasinductivereactance.Infact,youmayfindtheterm“reactance”usedasifitmeansthesamething,butsinceself-inductanceisthecorrectterm,I’llbeusingithere.
Inthisexperiment,you’llseeself-inductanceinaction.Youwillneed:
LEDs,low-currenttype.Quantity:2.Spoolofhookupwire,26-gauge,100feet.Quantity:1.Resistor,220Ω,rated1/4wattorhigher.Quantity:1.Capacitor,electrolytic,2,000μForlarger.Quantity:1.SPSTtactileswitch.Quantity:1.
ProcedureTakealookattheschematicinFigure5-33.Atfirstitmaynotmakemuchsense.Thecurlysymbolisacoilofwire—nothingmorethanthat.Soapparentlythevoltagewillpassthroughthe220Ωresistor,andthenthroughthecoil,ignoringthetwoLEDs,becausethecoilobviouslyhasamuchlowerresistancethaneitherofthem(andoneofthemisupside-downanyway).
Figure5-33.Inthisdemonstrationofself-inductance,D1andD2arelight-emittingdiodes.Whentheswitchisclosed,D1flashesbrieflybecausethecoilobstructstheinitialflowofelectricity.Whentheswitchisopened,D2flashesasthecollapsingmagneticfieldinducedbythecoilreleasesanothershort
burstofcurrent.
Isthatwhatwillhappen?Let’sfindout.Thecoilcanbeaspoolof100feetof26-gauge(orsmaller)hookupwire,althoughthespoolofmagnetwirelistedinExperiment25willworkbetter,ifyouhavethat.Onceagain,youwillneedaccesstobothendsofthewire,andiftheinnerendisinaccessible,you’llneedtorewindthecoil,leavingtheendstickingout.Nowthatyouhaveacoil,youcanhookituponyourbreadboardasshowninFigure5-34,wherethegreencircleisatactileswitchandthetwocircularredobjectsareLEDs.Makesurethatyouuselow-currentLEDs(otherwise,youmaynotseeanything)andmakesurethatoneofthemisnegative-side-up,positive-side-downandtheotherispositive-side-up,negative-side-down.Also,the220Ωresistorshouldberatedat1/4wattorhigher,ifpossible(seethefollowingcaution).
HotResistorsYou’llbepassingabout50mAthroughthe220Ωresistor,whilethecurrentisflowing.At12volts,thisworksoutat0.6watts.Ifyouusea1/8-wattresistor,youwillbeoverloadingit,anditwillgetquitehotandmayburnout.Ifyouusea1/4-wattresistor,itwillstillgethot,butisunlikelytoburnout,aslongasyoudon’tpressthebuttonformorethanasecondortwo.Don’trunthecircuitwithoutthecoilofwire;you’llbetryingtopassmorethan50mAthroughtheLEDs.
![Page 201: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/201.jpg)
Figure5-34.ThebreadboardedversionoftheschematicinFigure5-33showsasimplewaytosetitupforaquickdemo.Thegreenbuttonisatactileswitch.ThetworedLEDsshouldbeplacedsothatthepolarityofoneisoppositetothepolarityoftheother.
Whenyoupressthebutton,oneLEDshouldflashbriefly.Whenyoureleasethebutton,theotherLEDshouldflash.What’shappeninghere?Thecoilpossessesself-inductance,whichmeansthatitreactsagainstanysuddenchangeintheflowofelectricity.Firstitfightsit,andduringthatbriefmoment,itblocksmostofthecurrent.Consequently,thecurrentlooksforanalternativepathandflowsthroughD1,thelefthandLEDintheschematic.(D2doesn’trespond,becauseitcanpasscurrentonlyintheoppositedirection.)Meanwhile,thevoltagepressureovercomesthecoil’sself-inductance.Whentheself-inductancedisappears,theresistanceofthecoilisnomorethan10ohms—sonowtheelectricityflowsmostlythroughthecoil,andbecausetheLEDreceivessolittle,itgoesdark.Whenyoudisconnectthepower,thecoilreactsagain.Itfightsanysuddenchanges.Aftertheflowofelectricitystops,thecoilstubbornlysustainsitforamoment,becauseasthemagneticfieldcollapses,itisturnedbackintoelectricity.ThisresidualflowofcurrentdepletesitselfthroughD2,theLEDontheright.Inotherwords,thecoilstoressomeenergyinitsmagneticfield.Thisissimilartothewayacapacitorstoresenergybetweentwometalplates,exceptthatthecoilblocksthecurrentinitiallyandthenletsitbuildup,whereasthecapacitorsucksupcurrentinitially,andthenblocksit.Themoreturnsofwireyouhaveinyourcoil,themoreself-inductancethecoilwillhave,causingyourLEDstoflashmorebrightly.Here’sonelastvariationonthisexperimenttotestyourunderstandingofelectricalfundamentals.Removethe220Ωresistor,andsubstitutea1Kresistor(toprotectyourLEDfromsustainedcurrent).Removethecoil,andsubstituteaverylargecapacitor—ideally,about4,700μF.(Becarefultogetitspolaritytherightwayaround.)Whatwillyouseewhenyoupressthebutton?Notethatyouwillhavetoholditdownforacoupleofsecondstogetaresult.Andwhatwillyouseewhenyoureleasethebutton?Remember:thebehaviorofcapacitanceisoppositetothebehaviorofself-inductance.
THEORYAlternatingcurrentconceptsHere’sasimplethoughtexperiment.Supposeyousetupa555timertosendastreamofpulsesthroughacoil.Thisisaprimitiveformofalternatingcurrent.Wemightimaginethattheself-inductanceofthecoilwillinterferewiththestreamofpulses,dependinghowlongeachpulseis,andhowmuchinductancethecoilhas.Ifthepulsesaretooshort,theself-inductanceofthecoilwilltendtoblockthem.Maybeifwecantimethepulsesexactlyright,they’llsynchronizewiththetimeconstantofthecoil.Inthisway,wecan“tune”acoiltoallowa“frequency”topassthroughit.Whathappensifwesubstituteacapacitor?Ifthepulsesaretoolong,comparedwiththetimeconstantofthecapacitor,itwilltendtoblockthem,becauseitwillhaveenoughtimetobecomefullycharged.Butifthepulsesareshorter,thecapacitorcanchargeanddischargeinrhythmwiththepulses,andwillseemtoallowthemthrough.Idon’thavespaceinthisbooktogetdeeplyintoalternatingcurrent.It’savastandcomplicatedfieldwhereelectricitybehavesinstrangeandwonderfulways,andthemathematicsthatdescribeitcanbecomequitechallenging,involvingdifferentialequationsandimaginarynumbers.However,wecaneasilydemonstratetheaudiofilteringeffectsofaloudspeakerandacoil.
![Page 202: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/202.jpg)
Experiment29:FilteringFrequenciesInthisexperiment,you’llseehowself-inductanceandcapacitancecanbeusedtofilteraudiofrequencies.You’regoingtobuildacrossovernetwork:asimplecircuitthatsendslowfrequenciestooneplaceandhighfrequenciestoanother.Youwillneed:
Loudspeaker,8Ω,5inchesindiameter.Quantity:1.Figure5-35showsatypicalexample.Audioamplifier,STMicroelectronicsTEA2025Borsimilar.Quantity:1.SeeFigure5-36.
Figure5-35.Toheartheeffectsofaudiofiltersusingcoilsandcapacitors,you’llneedaloudspeakercapableofreproducinglowerfrequencies.This5-inchmodelistheminimumrequired.
Figure5-36.Thissinglechipcontainsastereoamplifiercapableofdeliveringatotalof5wattsintoan8Ωspeakerwhenthetwochannelsarecombined.
Figure5-37.Anonpolarizedelectrolyticcapacitor,alsoknownasabipolarcapacitor,looksjustlikeanelectrolyticcapacitor,exceptthatitwillhave“NP”or“BP”printedonit.
Nonpolarizedelectrolyticcapacitors(alsoknownasbipolar).100μF.Quantity2,and10μF,Quantity1.AsampleisshowninFigure5-37.Theyshouldhave“NP”or“BP”printedonthemtoindicate“nonpolarized”or“bipolar.”(Becauseyou’llbeworkingwithaudiosignalsthatalternatebetweenpositiveandnegative,youcan’tusetheusualpolarizedelectrolyticcapacitors.Ifyouwanttoavoidthetroubleandexpenseoforderingnonpolarizedcapacitors,youcansubstitutetworegularelectrolyticsinseries,facinginoppositedirections,withtheirnegativesidesjoinedinthemiddle.Justrememberthatwhenyouputcapacitorsinseries,theirtotalcapacitanceishalfthatofeachindividualcomponent.Therefore,youwouldneedtwo220μFelectrolyticsinseriestocreate110μFofcapacitance.SeeFigure5-38.)Regularelectrolyticcapacitors.100uF.Quantity:3.
Figure5-38.Youcanmakeanonpolarizedelectrolyticcapacitorbyputtingtworegularelectrolyticsinseries.(Infact,that’swhatyou’dfindifyouopenedarealnonpolarizedcapacitor.)Thesymbolatthebottomisroughlyequivalenttothepairofsymbolsatthetop;bearinmindthattwocapacitorsinserieshaveatotalcapacitancethatishalfthatof
eachofthem.
Coil,forcrossovernetwork.Quantity:1.YoucansearchasourcesuchaseBayforkeywords“crossover”and“coil,”butifyoucan’tfindoneatareasonableprice,youcanmakedowithaspoolof100feetof20-gaugehookupwire.Plasticshoebox.Quantity:1.
ProcedureThepurposeoftheaudioamplifierchipistoprovideenoughpowertogetadecentamountofsoundoutofyourloudspeaker.Thepurposeofusinga5-inchspeakeristoenableyoutohearlower-frequencysoundsthanthebabyspeakersthatwehaveusedpreviously.Bassnoteshavelongwavelengthsthatsmallspeakersarenotabletogenerateeffectively.Maybeyourememberfrombuildingtheintrusionalarmthataspeakermakesmuchmorenoiseifyoupreventthesoundwavesfromthebackoftheconefromcancellingthesoundwavesfromthefrontofthecone.Theobviouswaytoachievethisisbyenclosingthespeakerinabox.Isuggestaplasticbox,becausethey’recheap,andwedon’tcaretoomuchaboutsoundqualityaslongaswecanhearatleastsomeofthelowfrequencies.Figure5-39showsthespeakerboltedintothebottomofaplasticbox,andFigure5-40showstheboxturnedupside-downaftersnappingitslidintoplace.
![Page 203: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/203.jpg)
Figure5-39.Aresonantenclosureisnecessaryifyouwanttohearsomebass(lowerfrequencies)fromyourspeaker.Acheapplasticshoeboxissufficientfordemopurposes.
Figure5-40.Drillsomehalf-inchholesinthebottomofthebox,thenboltthespeakerinplace,runningawireoutthroughaholeinoneend.Snaponthelid,andyou’rereadyfornot-quite-high-fidelityaudio.
Normally,aspeakershouldbemountedinacabinetofheavy,thickmaterialthathasaverylowresonantfrequency—belowthelimitsofhumanhearing.Tominimizetheresonanceoftheshoebox,youcanputsomesoft,heavyfabricinsideitbeforeyousnapthelidon.Ahandtowelorsomesocksshouldbesufficienttoabsorbsomeofthevibration.
AddinganAmplifierBackinthe1950s,youneededvacuumtubes,transformers,andotherpower-hungryheavyweightcomponentstobuildanaudioamplifier.Today,youcanbuyachipforabout$1thatwilldothejob,ifyouaddafewcapacitorsaroundit,andavolumecontrol.TheTEA2025BthatI’mrecommendingisintendedforuseincheapportablecassetteplayersandCDplayers,andcanworkinstereoormonomode,fromapowersupplyrangingfrom3to9volts.With9voltsandthetwosidesofthechipbridgedtogethertodriveone8Ωspeaker,itcangenerate5wattsofaudiopower.Thatdoesn’tsoundmuchcomparedwithatypicalhometheatersystemratedat100wattsperchannel,butbecauseloudnessisalogarithmicscale,5wattswillbequiteenoughtoirritateanyfamilymembersinthesameroom—andpossiblyeveninotherrooms.Ifyoucan’tfindtheTEA2025Bchip,youcanuseanyalternativelistedasanaudioamplifier.Trytofindonethatisdesignedtodrivean8Ωspeakerwithupto5wattsinmonomode.Checkthemanufacturer’sdatasheettoseewhereyouattachcapacitorsaroundit.Notecarefullywhethersomeofthecapacitorshavenopolaritymarked,eventhoughtheyhavefairlyhighvalues,suchas100μF.Thesecapacitorsmustfunctionregardlessofwhichwaythealternatingcurrentisflowing,andI’vemarkedthem“NP”inmyschematicinFigure5-41,meaning“nonpolarized.”(Youmayfindthemidentifiedas“bipolar”or“BP”inpartscatalogs.)Asnotedintheshoppinglist,youcanputtwo220μFcapacitorsinseries,negative-to-negative,togetthesameeffectasasingle100μFnonpolarizedcapacitor.Forthisproject,it’sessentialtoincludetheregular100μFelectrolyticsmoothingcapacitoracrossthepowersupply.Otherwise,theamplifierwillpickupand—yes,amplify—smallvoltagespikesinthecircuit.
Figure5-41.Theaudioamplifierchipshouldbewiredwithcapacitorsarounditasshown,“NP”denotingtheonesthatarenotpolarized.Theacronym“BP,”meaningbipolar,isalsooftenusedtomeanthesamething.Theoutputfrompins2and15ofthechipcanbepassedthroughacoilora
10μFcapacitortodemonstrateaudiofiltering.
Theinputshownintheschematiccanreceiveasignalfromatypicalmediaplayer,suchasaportableMP3player,CDplayer,orcassetteplayer.Toconnectitsheadphonejacktothebreadboard,youcanuseanadapterthatconvertsittoapairofRCA-typeaudiojacks,andthenstickawireintooneofthemasshowninFigure5-42.Thewirewillconnecttothe33Kresistoronthebreadboardcircuit.ThechromedneckoftheRCAjack(whichissometimesgold-plated,oratleastgold-colored)mustbeconnected
![Page 204: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/204.jpg)
withthenegativesideofyourpowersupplyonthebreadboard;otherwise,youwon’thearanything.Youcanignorethesecondoutputontheadapter,becausewe’reworkinginmono,here,notstereo.
Figure5-42.Tosampletheoutputfromtheheadphonesocketofamusicplayer,youcanusethisadapterandpushthestrippedendofapieceofhookupwireintooneofthesockets.Thenusealligatorclipsonajumperwiretoconnecttheaudiotoyourbreadboardedcircuit.Don’tforgettousean
additionaljumperwiretoconnecttheoutsideofthesockettothenegativesideofthepowersupplyonthebreadboard.Becausewe’reonlyusingonespeaker,theamplifierisconnectedtoonlyoneofthestereooutputsfromyourplayer.Theotherisignored.
The33Kresistorisnecessarytoprotecttheamplifierfrombeingoverdriven.Ifyoudon’tgetenoughvolumeusingyourmusicplayer,decreasethe33Kvalue.Ifthemusicistooloudanddistorted,increasethevalue.Youcanalsotryomittingorincreasingthe10Kresistornexttoit,whichisincludedinanefforttoreducebackgroundhumnoise.I’veshowntwoswitchesatthetopoftheschematic:onetobypassacoil,theothertobypassacapacitor.Youcanusealligatorclipsinstead,aslongasyoucaneasilycomparethesoundwheneachofthecomponentsisinsertedintothecircuit.Figure5-43showsacoilconsistingofaspoolofhookupwirebeingused.Theredandblackalligatorclipsrestinglooseontopoftheshoeboxwillgototheoutputfromthechip(onpins2and15).Thereisnopolarity;itdoesn’tmatterwhichclipgoestowhichpin.
Figure5-43.Theredandblackalligatorclips,lyingontopoftheshoebox,shouldconnectwiththeoutputfromyouramplifierchip.Theredjumperwirepassesthesignalthroughacoilofhookupwireonitswaytothespeaker.Notethechangeinsoundwhenyoushortoutthecoil.
Beginbyturningthevolumecontrolonyourmusicsourceallthewaydownbeforeyouapplypower.Don’tbesurprisedifyouhearhummingorcracklingnoiseswhenyouactivatetheamplifier;itwillpickupanystrayvoltages,becauseinthissimpleexperiment,Ihaven’tsuggestedthatyoushouldshieldtheinput,andtheamplifiercircuitcanpickupnoise,asitswirescanactlikeantennas.Notethatyoumayalsogetadditionalunwantedsoundifyouusetheamplifieronaconductivedesktopsurface.Removeanyaluminumfoilorconductivefoamforthisproject.Makesurethatyourplayerisplayingmusic,andslowlyturnupitsvolumecontroluntilyouhearit.Ifyoudon’thearanything,you’llhavetocheckforcircuiterrors.Nowcomestheinterestingpart.Insertthe100-footspoolofhookupwirebetweenoneoutputfromtheamplifier,andoneinputofthespeaker(itdoesn’tmatterwhichone),orifyouusedswitches,opentheswitchthatbypassesthecoil.Youshouldfindthatthemusiclosesallitshigh-endresponse.Bycomparison,ifyoudisconnectthecoilandsubstitutea10μFcapacitor,youshouldfindthatthemusicsounds“tinny,”meaningthatitlosesallitslowrange,leavingonlythehighfrequencies.You’vejusttestedtwoverysimplefilters.Here’swhattheyaredoing:
Thecoilisalow-passfilter.Itpasseslowfrequenciesbutblockshighfrequencies,becausebriefaudiocyclesdon’thavetimetoovercomethecoil’sself-inductance.Abiggercoileliminatesawiderrangeoffrequencies.Thecapacitorisahigh-passfilter.Itpasseshighfrequenciesandblockslowfrequenciesbecauselongeraudiocyclescanfillthecapacitance,atwhichpointthecapacitorstopspassingcurrent.Asmallercapacitoreliminatesawiderrangeroffrequencies.
Youcangoalotfartherintofilterdesign,usingcomplexcombinationsofcoilsandcapacitorstoblockfrequenciesatanypointintheaudiblespectrum.Searchonlineforaudiofilterschematics—you’llfindhundredsofthem.
CrossoverNetworksInatraditionalaudiosystem,eachspeakercabinetcontainstwodrivers—oneofthemasmallspeakercalledatweeter,whichreproduceshighfrequencies,theotheralargespeakerknownasawoofer,whichreproduceslowfrequencies.(Modernsystemsoftenremovethewooferandplaceitinaseparateboxofitsownthatcanbepositionedalmostanywhere,becausethehumanearhasdifficultysensingthedirectionoflow-frequencysounds.)Theschematicthatyoujustlookedatandmayhaveconstructedisknownasa“crossovernetwork,”andtrulyhardcoreaudiophileshavebeenknownmaketheirown(especiallyforuseincarsystems)togowithspeakersoftheirchoiceincabinetsthattheydesignandbuildthemselves.Ifyouwanttomakeacrossovernetwork,youshouldusehigh-qualitypolyestercapacitors(whichhavenopolarity,lastlongerthanelectrolytics,andarebettermade)andacoilthathastherightnumberofturnsofwireandistherightsizetocuthighfrequenciesattheappropriatepoint.Figure5-44showsapolyestercapacitor.Figure5-45showsanaudiocrossovercoilthatIboughtoneBayfor$6.Iwascurioustofindoutwhatwasinsideit,soIboughttwoofthem,andtookoneapart.FirstIpeeledawaytheblackvinyltapethatenclosedthecoil.Insidewassometypicalmagnetwire—copperwirethinlycoatedwithshellacorsemitransparentplastic,asshowninFigure5-46.Iunwoundthewireandcountedthenumberofturns.ThenImeasuredthelengthofthewire,andfinallyusedamicrometertomeasurethediameterofthewire,afterwhichIcheckedonlinetofindaconversionfromthediameterinmils(1/1,000ofaninch)toAmericanwiregauge.Asforthespool,itwasplainplasticwithanaircore—noironorferriterodinthecenter.Figure5-47showsthespoolandthewire.
![Page 205: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/205.jpg)
Figure5-44.Somenonelectrolyticcapacitorshavenopolarity,suchasthishigh-qualitypolyesterfilmcapacitor.However,theytendtobemuchmoreexpensive,andarehardtofindinvalueshigherthan10μF.
Figure5-45.Whatexoticcomponentsmaywefindinsidethishigh-endaudiocomponentthat’susedwithasubwoofertoblockhighfrequencies?
Figure5-46.Theblacktapeisremoved,revealingacoilofmagnetwire.
Figure5-47.Theaudiocrossovercoilconsistsofaplasticspoolandsomewire.Nothingmore.
Sohere’sthespecificationforthisparticularcoilinanaudiocrossovernetwork.Fortyfeetof20-gaugecoppermagnetwire,wrappedin200turnsaroundaspoolof1/16–inch-thickplasticwithahubmeasuring7/8inchinlengthbetweentheflangesand1/2-inchexternaldiameter.Totalretailcostofmaterialsifpurchasedseparately:probablyabout$1,assumingyoucanfindormakeaspooloftheappropriatesize.Conclusion:there’salotofmystiqueattachedtoaudiocomponents.Theyarefrequentlyoverpriced,andyoucanmakeyourowncoilifyoustartwiththeseparametersandadjustthemtosuityourself.Supposeyouwanttoputsomethumpingbassspeakersintoyourcar.Couldyoubuildyourownfiltersothattheyonlyreproducethelowfrequencies?Absolutely—youjustneedtowindacoil,addingmoreturnsuntilitcutsasmuchofthehighfrequenciesasyouchoose.Justmakesurethewireisheavyenoughsothatitwon’toverheatwhenyoupush100ormoreaudiowattsthroughit.Here’sanotherprojecttothinkabout:acolororgan.Youcantapintotheoutputfromyourstereoandusefilterstodivideaudiofrequenciesintothreesections,eachofwhichdrivesaseparatesetofcoloredLEDs.TheredLEDswillflashinresponsetobasstones,yellowLEDsinresponsetothemid-range,andgreenLEDsinresponsetohighfrequencies(orwhatevercolorsyouprefer).YoucanputsignaldiodesinserieswiththeLEDstorectifythealternatingcurrent,andseriesresistorstolimitthevoltageacrosstheLEDsto,say,2.5volts(whenthemusicvolumeisturnedallthewayup).You’lluseyourmetertocheckthecurrentpassingthrougheachresistor,andmultiplythatnumberbythevoltagedropacrosstheresistor,tofindthewattagethatit’shandling,tomakesuretheresistoriscapableofdissipatingthatmuchpowerwithoutburningout.Audioisafieldofferingallkindsofpossibilitiesifyouenjoydesigningandbuildingyourownelectronics.
THEORYWaveformsIfyoublowacrossthetopofabottle,themellowsoundthatyouheariscausedbytheairvibratinginsidethebottle,andifyoucouldseethepressurewaves,theywouldhaveadistinctiveprofile.Ifyoucouldslowdowntimeanddrawagraphofthealternatingvoltageinanypoweroutletinyourhouse,itwouldhavethesameprofile.Ifyoucouldmeasurethespeedofapendulumswingingslowlytoandfroinavacuum,anddrawagraphofthespeedrelativetotime,onceagainitwouldhavethesameprofile.Thatprofileisasinewave,socalledbecauseyoucanderiveitfrombasictrigonometry.Inaright-angledtriangle,thesineofanangleisfoundbydividingthelengthofthesideoppositetheanglebythelengthofthehypoteneuse(theslopingsideofthetriangle).Tomakethissimpler,imagineaballonastringrotatingaroundacenterpoint,asshowninFigure5-48.Ignoretheforceofgravity,theresistanceofair,andotherannoyingvariables.Justmeasuretheverticalheightoftheballanddivideitbythelengthofthestring,atregularinstantsoftime,astheballmovesaroundthecircularpathataconstantspeed.Plottheresultasagraph,andthere’syoursinewave,showninFigure5-49.Notethatwhentheballcirclesbelowitshorizontalstartingline,weconsideritsdistancenegative,sothesinewavebecomesnegative,too.Whyshouldthisparticularcurveturnupinsomanyplacesandsomanywaysinnature?Therearereasonsforthisrootedinphysics,butI’llleaveyoutodigintothattopicifitinterestsyou.Gettingbacktothesubjectofaudioreproduction,whatmattersisthis:
Anysoundcanbebrokendownintoamixtureofsinewavesofvaryingfrequencyandamplitude.
Or,conversely:
![Page 206: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/206.jpg)
Ifyouputtogethertherightmixofaudiosinewaves,youcancreateanysoundatall.
Supposethattherearetwosoundsplayingsimultaneously.Figure5-50showsonesoundasaredcurve,andtheotheraspaleblue.Whenthetwosoundstraveleitheraspressurewavesthroughairorasalternatingelectriccurrentsthroughawire,theamplitudesofthewavesareaddedtogethertomakethemorecomplexcurve,whichisshowninblack.Nowtrytoimaginedozensorevenhundredsofdifferentfrequenciesbeingaddedtogether,andyouhaveanideaofthecomplexwaveformofapieceofmusic.
Figure5-48.Ifaweightontheendofastring(lengthb,inthediagram)followsacircularpathatasteadyspeed,thedistanceoftheweightfromahorizontalcenterline(lengtha,inthediagram)canbeplottedasagraphrelativetotime.Thegraphwillbeasinewave,socalledbecauseinbasictrigonometry,theratioofa/bisthesineoftheanglebetweenlinebandthehorizontalbaseline,measuredatthecenterofrotation.Sinewaves
occurnaturallyintheworldaroundus,especiallyinaudioreproductionandalternatingcurrent.
Figure5-49.Thisiswhata“pure”sinewavelookslike.
Figure5-50.Whentwosinewavesaregeneratedatthesametime(forinstance,bytwomusicians,eachplayingaflute),thecombinedsoundcreatesacompoundcurve.Thebluesinewaveistwicethefrequencyoftheredsinewave.Thecompoundcurve(blackline)isthesumofthedistancesof
thesinewavesfromthebaselineofthegraph.
THEORYWaveforms(continued)Youcancreateyourownwaveformasaninputforyouraudioamplifierwiththebasicastable555timercircuitshowninFigure5-51.Youhavetobecareful,though,nottooverloadtheamplifierinput.Notethe680Kseriesresistorontheoutputpinofthetimer.Alsonotethe500Ωpotentiometer.
Figure5-51.A555timeriswiredinastablemodeusingthecomponentvaluesshownheretogenerateawiderangeofaudiblefrequencieswhenthe100Kpotentiometerisadjusted.Aftertheoutputisreducedinpower,itcanfeedintotheamplifierchipthatwasusedpreviously.
Disconnectyourmusicplayerandconnecttheoutputfromthe555circuittotheinputpoint(the33Kresistor)intheamplifiercircuitshownearlierinFigure5-41.Youdon’thavetoworryaboutaseparateconnectiononthenegativesideaslongasthe555timersharesthesamebreadboardandthenegativesideofitspowersupply.Makesurethatthe500Ωpotentiometeristurnedallthewaytoshorttheoutputfromthetimertothenegativesideofthepowersupply.Thisfunctionsasyourvolumecontrol.Alsomakesurethe100Kpotentiometerisinthemiddleofitsrange.Switchonthepowerandslowlyturnupthe500Ωpotentiometeruntilyouhearatone.Nowadjustthe100Kpotentiometertocreatealow-pitchednote.You’llfindthatitdoesn’thavea“pure”sound.Therearesomebuzzingovertones.Thisisbecausethe555timerisgeneratingsquarewavessuchasthoseshowninFigure5-52,notsinewaves,andasquarewaveisactuallyasumofmanydifferentsinewaves,someofwhichhaveahighfrequency.Yourearhearstheseharmonics,eventhoughtheyarenotobviouswhenyoulookatasquare-shapedwaveform.Routeoneoftheconnectionstoyourloudspeakerthroughyourspoolofhookupwire,andnowyoushouldhearamuchpurertone,asthebuzzinghighfrequenciesareblockedbytheself-inductanceofthecoil.Removethecoilandsubstitutethe10μFcapacitor,andnowyouhearmorebuzzingandlessbass.You’vejusttakenasmallsteptowardsoundsynthesis.Ifthissubjectinterestsyou,youcangoonlineandsearchforoscillatorcircuits.Fora
![Page 207: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/207.jpg)
thoroughunderstandingoftherelationshipbetweenwaveformsandthesoundsyouhear,you’llreallyneedanoscilloscope,whichwillshowyoutheshapeofeachwaveformthatyougenerateandmodify.
Figure5-52.Theoutputfroma555timeriseither“on”or“off,”withaveryfasttransitionbetweenthosetwostates.Theresultisanalmostperfectsquarewave.Theoretically,thiscanbedisassembledintoacomplexsetofsinewavesthathavemanydifferentfrequencies.Thehumanearhears
thehighfrequenciesasharshovertones.
![Page 208: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/208.jpg)
Experiment30:FuzzLet’stryonemorevariationonthecircuitinExperiment28.Thiswilldemonstrateanotherfundamentalaudioattribute:distortion.Youwillneed:
Onemore100Kpotentiometer.GenericNPNtransistors:2N2222orsimilar.Quantity:2.Variousresistorsandcapacitors.
BACKGROUNDClippingIntheearlydaysof“hi-fi”sound,engineerslaboredmightilytoperfecttheprocessofsoundreproduction.Theywantedthewaveformattheoutputendoftheamplifiertolookidenticalwiththewaveformattheinputend,theonlydifferencebeingthatitshouldbebigger,sothatitwouldbepowerfulenoughtodriveloudspeakers.Evenaveryslightdistortionofthewaveformwasunacceptable.Littledidtheyrealizethattheirbeautifullydesignedtubeamplifierswouldbeabusedbyanewgenerationofrockguitaristswhoseintentionwastocreateasmuchdistortionaspossible.Themostcommonformofwaveformabuseistechnicallyknownas“clipping.”Ifyoupushavacuumtubeoratransistortoamplifyasinewavebeyondthecomponent’scapabilities,it“clips”thetopandbottomofthecurve.Thismakesitlookmorelikeasquarewave,andasIexplainedinthesectiononwaveforms,asquarewavehasaharsh,buzzingquality.Forrockguitariststryingtoaddanedgetotheirmusic,theharshnessisactuallyadesirablefeature.
Figure5-53.ThisVoxWow-Fuzzpedalwasoneoftheearlystompboxes,whichdeliberatelyinducedthekindofdistortionthataudioengineershadbeentryingtogetridoffordecades.
Thefirstgadgettoofferthisonacommercialbasiswasknownasa“fuzzbox,”whichdeliberatelyclippedtheinputsignal.AnearlyfuzzboxisshowninFigure5-53.TheclippingofasinewaveisshowninFigure5-54.
Figure5-54.Whenasinewave(top)ispassedthroughanamplifierwhichisturnedupbeyondthelimitofitscomponents(shownasdashedlines,center),theamplifierchopsthewave(bottom)inaprocessknownas“clipping.”Theresultisclosetoasquarewaveandisthebasicprincipleofa
fuzzboxcommonlyusedtocreateaharshguitarsound.
SchematicTheoutputfromthe555timerisasquarewave,soitalreadysoundsquite“fuzzy,”butwecanmakeitmoreintensetodemonstratetheclippingprinciple.I’veredrawnthewholecircuitinFigure5-55,asseveralcomponentshavechanged.TheprincipalalterationistheadditionoftwoNPNtransistors.Ifyouassemblethiscircuitonyourbreadboard,notecarefullythatthe33Kand10Kresistorsatthebottomoftheamplifierchiphavebeenremoved,andthere’snowjustan820Ωresistorinthatlocation.Thebottomoftheadjacent0.22μFcapacitorisstilltheinputpointfortheamplifier,andifyoufollowtheconnectionaroundtothemiddleoftheschematic,you’llfinditleadingtoa100Kpotentiometer.Thisisyour“fuzzadjuster.”ThetwoNPNtransistorsarearrangedsothattheoneontheleftreceivesoutputfromthe555timer.Thissignalcontrolstheflowofelectricitythroughthetransistorfroma33Kresistor.Thisflow,inturn,controlsthebaseoftherighthandtransistor,andtheflowofcurrentthroughthatiswhatultimatelycontrolstheamplifier.Whenyoupowerupthecircuit,usethe100Kpotentiometerattachedtothe555timertoadjustthefrequency(asbefore)andcrankthe“fuzzadjuster”potentiometertohearhowitaddsincreasing“bite”tothesounduntilultimatelyitbecomespurenoise.Thetwotransistorsactasamplifiers.Ofcourse,wedidn’tneedthemforthatpurpose—theinputlevelfortheamplifierchipwasalreadymorethanadequate.Thepurposeofthelefthandtransistorissimplytooverloadtherighthandtransistor,tocreatethe“fuzz”effect.Andwhenyouturnuptheoutputfromthetransistorswiththe“fuzzadjuster,”eventuallytheyoverloadtheinputoftheamplifierchip,creatingevenmoredistortion.Ifyouwanttotweaktheoutput,trysubstitutingdifferentvaluesforthe1Kresistorandthe1μFcapacitorthatarepositionedbetweentheemitteroftherighthandtransistorandthenegativesideofthepowersupply.Alargerresistorshouldoverloadthe
![Page 209: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/209.jpg)
transistorless.Differentcapacitorvaluesshouldmakethesoundmoreorlessharsh.Youcanfindliterallythousandsofschematicsonlineforgadgetstomodifyguitarsound.ThecircuitI’veincludedhereisoneofthemostprimitive.Ifyouwantsomethingmoreversatile,youshouldsearchfor“stompboxschematics”andseewhatyoucanfind.
Figure5-55.Foraquickdemoofclipping,insertacoupleoftransistorsbetweentheoutputfromthe555timerandtheinputoftheamplifierchip.Onetransistoroverdrivestheother,sothatwhenyouadjustthepotentiometeratthecenterofthecircuit,youhearanincreasinglyharsh,distortedsound.
BACKGROUNDStomp-boxoriginsTheVenturesrecordedthefirstsingletouseafuzzbox,titled“The2,000PoundBee,”in1962.Trulyoneofthemostawfulinstrumentalsevermade,ituseddistortionmerelyasagimmickandmusthavediscouragedothermusiciansfromtakingtheconceptseriously.RayDaviesoftheKinkswasthefirsttoembodydistortionasanintegralpartofhismusic.Daviesdiditinitiallybypluggingtheoutputfromoneampintotheinputofanother,supposedlyduringtherecordingofhishit“YouReallyGotMe.”Thisoverloadedtheinputandcreatedclipping—thebasicfuzzconcept.FromthereitwasashortsteptoKeithRichardsusingaGibsonMaestroFuzz-TonewhentheRollingStonesrecorded“(ICan’tGetNo)Satisfaction”in1965.Today,youcanfindthousandsofadvocatespromotingasmanydifferentmythologiesabout“ideal”distortion.InFigure5-56,I’veincludedaschematicfromFlavioDellepiane,acircuitdesignerinItalywhogivesawayhiswork(withalittlehelpfromGoogleAdSense)athttp://www.redcircuits.com.Dellepianeisself-taught,havinggainedmuchofhisknowledgefromelectronicsmagazinessuchastheBritishWirelessWorld.Inhisfuzzcircuit,heusesaveryhigh-gainamplifierconsistingofthreefield-effecttransistors(FETs),whichcloselyimitatetheroundedsquare-wavetypicalofanoverdriventubeamp.
Figure5-56.ThiscircuitdesignedbyFlavioDellepianeusesthreetransistorstosimulatethekindofdistortionthatusedtobecreatedbyoverloadingtheinputofatubeamplifier.
Dellepianeoffersdozensmoreschematicsonhissite,developedandtestedwithadual-traceoscilloscope,low-distortionsinewaveoscillator(sothathecangiveaudiodevicesa“clean”input),distortionmeter,andprecisionaudiovoltmeter.Thislastitem,andthe
![Page 210: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/210.jpg)
oscillator,werebuiltfromhisowndesigns,andhegivesawaytheirschematics,too.Thushissiteprovidesone-stopshoppingforhome-audioelectronicshobbyistsinsearchofaself-administerededucation.Beforefuzz,therewastremolo.Alotofpeopleconfusethiswithvibrato,solet’sclarifythatdistinctionrightnow:
Vibratoappliedtoanotemakesthefrequencywaverupanddown,asifaguitaristisbendingthestrings.Tremoloappliedtoanotemakesitsvolumefluctuate,asifsomeoneisturningthevolumecontrolofaguitarupanddownveryquickly.
BACKGROUNDStomp-boxorigins(continued)HarryDeArmondsoldthefirsttremolobox,whichhenamedtheTrem-Trol.Itlookedlikeanantiqueportableradio,withtwodialsonthefrontandacarryinghandleontop.Perhapsinanefforttocutcosts,DeArmonddidn’tuseanyelectroniccomponents.Hissteam-punkishTrem-Trolcontainedamotorfittedwithataperedshaft,witharubberwheelpressingagainstit.Thespeedofthewheelvariedwhenyouturnedaknobtorepositionthewheelupanddowntheshaft.Thewheel,inturn,crankedalittlecapsuleof“hydro-fluid,”inwhichtwowireswereimmersed,carryingtheaudiosignal.Asthecapsulerockedtoandfro,thefluidsloshedfromsidetoside,andtheresistancebetweentheelectrodesfluctuated.Thismodulatedtheaudiooutput.Today,Trem-Trolsareanantiquecollectible.WhenindustrialdesignerDanFormosaacquiredone,heputpicturesonlineathttp://www.danformosa.com/dearmond.html.AndJohannBurkardhaspostedanMP3ofhisDeArmondTrem-Trolsoyoucanactuallyhearit:http://johannburkard.de/blog/music/effects/DeArmond-Tremolo-Control-clip.html.Theideaofamechanicalsourceforelectronicsoundmodsdidn’tendthere.TheoriginalHammondorgansderivedtheirunique,richsoundfromasetoftoothedwheelsturnedbyamotor.Eachwheelcreatedafluctuatinginductanceinasensorliketherecordheadfromacassetteplayer.It’seasytothinkofotherpossibilitiesformotor-drivenstompboxes.Goingbacktotremolo:imagineatransparentdiscmaskedwithblackpaint,exceptforacircularstripethattapersateachend.Whilethediscrotates,ifyoushineabrightLEDthroughthetransparentstripetowardalight-dependentresistor,youwouldhavethebasisforatremolodevice.Youcouldevencreatenever-before-heardtremoloeffectsbyswappingdiscswithdifferentstripepatterns.Figures5-57and5-58showthekindofthingIhaveinmind.Forarealfabricationchallenge,howaboutanautomaticdiscchanger?
Figure5-57.Althoughelectromechanicalaudiodevicesareobsoletenow,someunexploredpossibilitiesstillexist.Thisdesigncouldcreatevarioustremoloeffects,ifanyonehadthepatiencetobuildit.
Figure5-58.DifferentstripepatternscouldbeusedinconjunctionwiththeimaginaryelectromechanicaldeviceinFigure5-57tocreatevarioustremoloeffects.
Today’sguitaristscanchoosefromasmorgasbordofeffects,allofwhichcanbehome-builtusingplansavailableonline.Forreference,trythesespecial-interestbooks:
AnalogMan’sGuidetoVintageEffectsbyTomHughes(ForMusiciansOnlyPublishing,2004).Thisisaguidetoeveryvintagestompboxandpedalyoucanimagine.HowtoModifyEffectPedalsforGuitarandBassbyBrianWampler(CustomBooksPublishing,2007).Thisisanextremelydetailedguideforbeginnerswithlittleornopriorknowledge.Currentlyitisavailableonlybydownload,fromsitessuchashttp://www.openlibrary.org,butyoumaybeabletofindthepreviousprintededitionfromsecondhandsellers,ifyousearchforthetitleandtheauthor.
Ofcourse,youcanalwaystakeashortcutbylayingdownacouplehundreddollarsforanoff-the-shelfitemsuchasaBossME-20,whichusesdigitalprocessingtoemulatedistortion,metal,fuzz,chorus,phaser,flanger,tremolo,delay,reverb,andseveralmore,allinoneconvenientmulti-pedalpackage.Purists,ofcourse,willclaimthatit“doesn’tsoundthesame,”butmaybethat’snotthepoint.Someofussimplycan’tgetnosatisfactionuntilwebuildourownstompboxandthentweakit,insearchofasoundthatdoesn’tcomeoff-the-shelfandiswhollyourown.
![Page 211: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/211.jpg)
Experiment31:OneRadio,NoSolder,NoPowerTimenowtogobackonemoretimetoinductanceandcapacitance,anddemonstrateanapplicationwhichalsomakesuseofthewaythatwaveformscanbeaddedtoeachother.IwanttoshowyouhowasimplecircuitwithnopowersupplyatallcanreceiveAMradiosignalsandmakethemaudible.Thisisoftenknownasacrystalradio,becausethecircuitincludesagermaniumdiode,whichhasacrystalinsideit.Theideadatesbacktothedawnofradio,butifyou’venevertriedit,you’vemissedanexperiencethatistrulymagical.Youwillneed:
Rigidcylindricalobject,suchasavitaminbottle.Quantity:1.22-gaugehookupwire,solid-core.Quantity:60feet.16-gaugewire,stranded.Quantity:100feet.Polypropylenerope(“polyrope”)ornylonrope.Quantity:10feet.Germaniumdiode.Quantity:1.High-impedanceheadphone.Quantity:1.
Thediodeandheadphonecanbeorderedfromhttp://www.scitoyscatalog.com.YoucannotuseamodernheadphoneofthetypeyouwearwithanMP3player.SomeoftheseitemsareshowninFigure5-59.
Figure5-59.Justaddwireandacoil,andthisisallyouneedtoreceiveAMradiosignals.Theblackdiscbecomesthetuningdial,afteritisscrewedontothevariablecapacitor(right).Thisisactuallyanoptionalextra.Agermaniumdiode(center)rectifiestheradiosignal.Thehigh-impedance
earphone(top)createsabarelyaudiblesound.
First,youneedtomakeacoil.Itshouldbeabout3inchesindiameter,andyoucanwinditaroundanyemptyglassorplasticcontainerofthatsize,solongasit’srigid.Asodabottleorwaterbottleisn’tsuitable,becausethecumulativesqueezingforceoftheturnsofwirecandeformthebottlesothatitisn’tcircularanymore.Ichoseavitaminbottlethatjusthappenedtobeexactlytherightsize.Toremovethelabel,Isofteneditsadhesivewithaheatgun(lightly,toavoidmeltingthebottle)andthenjustpeeleditoff.Theadhesiveleftaresidue,whichIremovedwithXylol(alsoknownasXylene).Thisisahandysolventtohavearound,asitcanremove“permanent”markerstainsaswellasstickyresidues,butyoushouldalwaysuselatexornitrileglovestoavoidgettingitonyourskin,andminimizeyourexposurethefumes.BecauseXylolwilldissolvesomeplastics,clearlyit’snotgoodforyourlungs.Afteryouprepareaclean,rigidbottle,drilltwopairsofholesinit,asshowninFigure5-60.You’llusethemtoanchortheendsofthecoil.
Figure5-60.Alarge,3-inchdiameteremptyvitaminbottlemakesanidealcoreforacrystalradiocoil.Thedrilledholeswillanchorwirewrappedaroundthebottle.
Nowyouneedabout60feetof22-gaugesolid-corewire.Ifyouusemagnetwire,itsthininsulationwillallowtheturnsofthecoiltobemorecloselyspaced,andthecoilmaybeslightlymoreefficient.Buteverydayvinyl-insulatedwirewilldothejob,andismucheasiertoworkwith.Beginbystrippingthefirst6inchesofinsulationfromtheendofthewire.Nowmeasure50inchesalongtheinsulatedremainderandapplyyourwirestrippersatthatpoint,justenoughtocuttheinsulationwithoutcuttingthewire.Useyourtwothumbnailstopulltheinsulationapart,revealingaboutahalf-inchofbarewire,asshowninFigure5-61.Benditatthecenterpointandtwistitintoaloop,asshowninFigure5-62.
![Page 212: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/212.jpg)
Figure5-61.Wirestrippersexposethesolidconductoratintervalsalonga22-gaugewire.
Youjustmadea“tap,”meaningapointwhereyouwillbeabletotapintothecoilafteryouwindit.You’llneedanother11ofthesetaps,allofthemspaced50inchesapart.(Ifthediameterofthebottlethatyou’llbeusingasthecoreofyourcoilisnot3inches,multiplyitsdiameterby16togettheapproximatedesiredspacingoftaps.)Afteryouhavemade12taps,cutthewireandstrip6inchesoffthatend.NowbendtheendintoaUshapeaboutahalf-inchindiameter,sothatyoucanhookitthroughthepairofholesthatyoudrilledatoneendofthebottle.Pullthewirethrough,thenloopitaroundagaintomakeasecureanchorpoint.Nowwindtherestofthewirearoundthebottle,pullingittightlysothatthecoilsstayclosetogether.Whenyougettotheendofthewire,threaditthroughtheremainingpairofholestoanchoritasshowninFigure5-63.ThecompletedcoilisshowninFigure5-64.
Figure5-62.Eachexposedsectionofwireistwistedintoaloopusingsharp-nosedpliers.
Figure5-63.Thestrippedendofthewireissecuredthroughtheholesdrilledinthebottle.
Figure5-64.Thecompletedcoil,wrappedtightlyaroundthebottle.
Yournextstepistosetupanantenna.Ifyouliveinahousewithayardoutside,thisiseasy:justopenawindow,tossoutareelof16-gaugewirewhileholdingthefreeend,thengooutsideandstringupyourantennabyusingpolypropylenerope(“polyrope”)ornylonrope,availablefromanyhardwarestore,tohangthewirefromanyavailabletrees,gutters,orpoles.Thetotallengthofthewireshouldbeabout100feet.Whereitcomesinthroughthewindow,suspenditonanotherlengthofpolyrope.Theideaistokeepyourantennawireasfarawayfromthegroundorfromanygroundedobjectsaspossible.
HighVoltage!Theworldaroundusisfullofelectricity.Normallywe’reunawareofit,butathunderstormisasuddenreminderthatthere’sahugeelectricalpotentialbetweenthegroundbelowandthecloudsabove.Ifyouputupanoutdoorantenna,neveruseitifthereisanychanceofalightningstrike.Thiscanbeextremelydangerous.Disconnecttheindoorendofyourantenna,dragitoutside,andpushtheendofthewireintothegroundtomakeitsafe.
Ifyouliveinanapartmentwhereyoudon’thaveaccesstoayardoutside,youcantrystringingyourantennaaroundtheroom,hangingthewirefrommorepiecesofpolyrope.Theantennashouldstillbeabout100feetlong,butobviouslyitwon’tbeinastraightline.Hookthefreeendofyourantennatooneendofyourcoil.Atthispoint,youalsoneedtoaddagermaniumdiode,whichfunctionslikeasilicon-baseddiodebutisbettersuitedtothetinyvoltagesandcurrentsthatwe’llbedealingwith.Theotherendofthediodeattachestooneofthewiresleadingtoahigh-impedanceearphone.Anormalmodernearphoneorheadphonewillnotworkinthiscircuit.Thereturnwirefromtheheadphoneisconnectedtoajumperwire,theotherendofwhichcanbeclippedtoanyofthetapsinyourcoil.Onelastmodification,andyou’llbereadytotunein.Youhavetogroundthejumperwire.BythisImeanconnectittosomethingthatliterallygoesintotheground.Acold-waterpipeisthemostcommonlymentionedoption,but(duh!)thiswillworkonlyifthepipeismadeofmetal.Becausealotofplumbingthesedaysisplastic,checkunderthesinktoseeifyouhavecopperpipesbeforeyoutryusingafaucetforyourground.Anotheroptionistoattachthewiretothescrewinthecoverplateofanelectricaloutlet,astheelectricalsysteminyourhouseisultimatelygrounded.Butthesure-firewaytogetagoodgroundconnectionistogooutsideandhammera4-footcopper-cladgroundingstakeintoreasonablymoistearth.Anywholesaleelectricalsupplyhouseshouldbeabletosellyouastake.They’recommonlyusedtogroundweldingequipment.
![Page 213: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/213.jpg)
Figure5-65.Thesimplepleasureofpickinguparadiosignalwithultra-simplecomponentsandnoadditionalpower.
Figures5-66and5-67showthecompletedradio.
Figure5-66.Asignalfromtheantennacanpassthroughthecoiltoground.Ifthejumperwireisattachedtoanappropriatetaponthecoil,itresonateswiththeradiosignal,justpowerfullyenoughtoenergizetheearphonewhichiswiredinserieswithadiode.
Figure5-67.Thereal-lifeversionofFigure5-66.
Ifyou’vemanagedtofollowtheseinstructions(onewayoranother),it’stimetotuneyourradiototheneareststation.Movethealligatorclipattheendofyourpatchcordfromonetaptoanotheronyourcoil.Dependingonwhereyoulive,youmaypickupjustonestation,orseveral,someofthemplayingsimultaneously.Itmayseemthatyou’regettingsomethingfornothinghere,astheearphoneismakingnoisewithoutanysourceofpower.Really,though,thereisasourceofpower:thetransmitterlocatedattheradiostation.Alargeamplifierpumpspowerintothebroadcastingtower,modulatingafixedfrequency.Whenthecombinationofyourcoilandantennaresonateswiththatfrequency,you’resuckinginjustenoughvoltageandcurrenttoenergizeahigh-impedanceheadphone.Thereasonyouhadtomakeagoodgroundconnectionisthattheradiostationbroadcastsitssignalatavoltagerelativetoground.Theearthcompletesthecircuitbetweenyouandthetransmitter.Formoreinformationonthisandotherconceptsrelatingtoradio,seetheupcomingsection“Theory:Howradioworks.”
EnhancementsThehigheryourantennais,thebetteritshouldwork.Inmylocation,thisisamajorproblem,asIliveinadesertareawithoutanytrees.Still,juststringingthewireoutofmywindowandtetheringit(withrope)tothefrontbumperofmycarenabledmetopickupafaintradiosignal.Toimprovetheselectivityofyourradio,youcanaddavariablecapacitor,asshowninthefollowingsection.Thisallowsyouto“tune”theresonanceofyourcircuitmoreprecisely.Variablecapacitorsareuncommontoday,butyoucanfindoneatthesamespecialtysourcethatIrecommendedfortheearphoneandthegermaniumdiode:theScitoysCatalog(http://www.scitoyscatalog.com).
![Page 214: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/214.jpg)
ThissourceisaffiliatedwithasmartmannamedSimonQuellanField,whosesitesuggestsmanyfunprojectsthatyoucanpursueathome.Oneofhiscleverideasistoremovethegermaniumdiodefromyourradiocircuitandsubstitutealow-powerLEDinserieswitha1.5-voltbattery.Thisdidn’tworkforme,becauseIlive40milesfromthenearestAMbroadcaster.Ifyou’reclosertoatransmitter,youmaybeabletoseetheLEDvaryinginintensityasthebroadcastpowerrunsthroughit.
THEORYHowradioworksWhenelectricalfrequenciesareveryhigh,theradiationtheycreatehasenoughenergytotravelformiles.Thisistheprincipleofradiotransmission:Ahigh-frequencyvoltageisappliedtoabroadcastingantenna,relativetotheground.WhenIsay“ground”inthisinstance,Iliterallymeantheplanetbeneathus.Ifyousetupareceivingantenna,itcanpickupafainttraceofthetransmissionrelativetotheground—asiftheearthisonehugeconductor.Actuallytheearthissolargeandcontainssomanyelectrons,itcanfunctionasacommonsink,likeagiganticversionofthefilecabinetthatIsuggestedyoushouldtouchtogetridofstaticelectricityinyourbodybeforetouchingaCMOSlogicchip.Tomakearadiotransmitter,Icouldusea555timerchiprunningat,say,850kHz(850,000cyclespersecond),andpassthisstreamofpulsesthroughanamplifiertoatransmissiontower;ifyouhadsomewaytoblockoutalltheotherelectromagneticactivityintheair,youcoulddetectmysignalandreamplifyit.ThiswasmoreorlesswhatMarconi(showninFigure5-68)wasdoingin1901,afterhehadpurchasedrightstoEdison’swirelesstelegraphypatent,althoughhehadtouseaprimitivesparkgap,ratherthana555timer,tocreatetheoscillations.Histransmissionswereoflimiteduse,becausetheyhadonlytwostates:onoroff.YoucouldsendMorsecodemessages,andthatwasall.
Figure5-68.Marconi,thegreatpioneerofradio(photographfromWikimediaCommons).
Fiveyearslater,thefirsttrueaudiosignalwastransmittedbyimposingloweraudiofrequenciesonthehigh-frequencycarrierwave.Inotherwords,theaudiosignalwas“added”tothecarrierfrequency,sothatthepowerofthecarriervariedwiththepeaksandvalleysoftheaudio.Atthereceivingend,averysimplecombinationofacapacitorandacoildetectedthecarrierfrequencyoutofalltheothernoiseintheelectromagneticspectrum.Thevaluesofthecapacitorandthecoilwerechosensothattheircircuitwould“resonate”atthesamefrequencyasthecarrierwave.Figures5-69and5-70illustratetheseconcepts.
Figure5-69.Whenanaudiosignal(middle)iscombinedelectronicallywithahighcarrerfrequency(top),theresultlookssomethinglikethecompoundsignalatthebottom.Inactuality,thecarrierfrequencywouldbemuchhighercomparedwiththeaudiofrequency,byaradioofperhaps
1,000:1.
Figure5-70.Whenthecompoundsignalispassedthroughadiode,onlytheupperhalfremains.Anearphonecannotreactfastenoughtoreproducethehighcarrierfrequency,soit“rides”thepeaksandthusreproducestheaudiofrequency.
TheschematicinFigure5-71showsthesimplecircuitthatyoubuiltbywrappingacoilaroundanemptyvitaminbottle.Whenapositivepulsewasreceivedbytheantenna,itresonatedwiththeantennaandthecoil,providedthattheantennawaslongenoughandthecoilwastappedattheappropriatenumberofturns.
THEORYHowradioworks(continued)
![Page 215: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/215.jpg)
Figure5-71.Anantennaatthetopoftheschematicpicksupfaintelectromagneticradiationfromadistanttransmitter.Thecoilattheleftsideistappedatintervalssothatitsresonancecanbeadjustedtomatchthecarrierfrequencyoftheradiosignal.Otherfrequenciesaregrounded(atthebottomoftheschematic).Thediodepassesthe“tophalf”ofthesignaltotheearphoneattheright,whichisincapableofrespondingfastenoughto
reproducethecarrierfrequency,andthusfiltersitout,leavingonlytheaudiofrequenciesthatweresuperimposedonit.
Byaddingacapacitor,youcantunethecircuit.Nowanincomingpulsefromthetransmitterisinitiallyblockedbytheself-inductanceofthecoil,whileitchargesthecapacitor.Ifanequallynegativepulseisreceivedafteranintervalthatisproperlysynchronizedwiththevaluesofthecoilandthecapacitor,itcoincideswiththecapacitordischargingandthecoilconducting.Inthisway,therightfrequencyofcarrierwavemakesthecircuitresonateinsympathy.Atthesametime,audio-frequencyfluctuationsinthestrengthofthesignalaretranslatedintofluctuationsinvoltageinthecircuit.Whathappenstootherfrequenciespulledinbytheantenna?Theloweronespassthroughthecoiltoground;thehigheronespassthroughthecapacitortoground.Theyarejust“thrownaway.”Therighthandhalfofthecircuitsamplesthesignalbypassingitthroughagermaniumdiodeandanearphone.Thepowerfromthetransmitterisjustsufficienttovibratethediaphragmintheearphone,afterthediodehassubtractedthenegativehalfofthesignal.Lookbackatthediagramoftheamplitude-modulatedsignal.You’llseethatitfluctuatesupanddownsorapidly,theearphonecannotpossiblykeepupwiththepositive-negativevariations—hencetheneedforthediode.Itwillremainhesitatingatthemidpointbetweenthehighsandlows,producingnosoundatall.Thediodesolvesthisproblembysubtractingthelowerhalfofthe“audioenvelope,”leavingjustthepositivespikesofvoltage.Althoughthesearestillverysmallandrapid,theyarenowallpushingthediaphragmoftheearphoneinthesamedirection,sothatitaveragesthemout,approximatelyreconstructingtheoriginalsoundwave.Figure5-72showshowthecircuitcanbeenhancedwithavariablecapacitor,totuneitwithoutneedingtotapthecoilatintervals.
Figure5-72.Byaddingacapacitortothecircuit,itsresonancecanbetunedmoreprecisely.Thediagonalarrowindicatesthatavariablecapacitorisused.
TheradiocanpullinthestationsontheAM(amplitude-modulated)wavebandthathappentobemostpowerfulinyourarea.Thewavebandrangesfrom300kHzto3MHz.Ifyoufindyourselfinterestedinradio,yournextstepcouldbetobuildapoweredradiousingacoupleoftransistors.Alternativelyyoucouldbuildyourown(legal)low-powerAMtransmitter.There’sanultra-simplekitavailablefromhttp://www.scitoys.comconsistingofjusttwoprincipalcomponents:acrystaloscillator,andatransformer,showninFigure5-73.That’sallittakes.
Figure5-73.AnAMradiotransmittercanbemadefromjusttwocomponents:atransformer(left)andacrystaloscillator(right),availablefromhttp://www.scitoys.com.
![Page 216: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/216.jpg)
![Page 217: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/217.jpg)
Experiment32:ALittleRobotCartRoboticsisanotherapplicationofelectronicsthatdeservesabookinitself—orseveralbooks.So,onceagain,I’mgoingtogiveyouanintroductionfollowedbysomepointsthatyoucanfollowifyouwanttogofurther.Asalways,Iwillstartwiththesimplestpossibledevice,whichintheworldofroboticsisacartthatfindsitswayaroundyourlivingroom.Youwillneed:
SPSTorSPDTmicroswitchesrequiringminimalpressuretoactivatethem.Aforcebetween0.02and0.1newtonswouldbeideal.Quantity:2.SeeFigure5-74.
Figure5-74.Amicroswitchhasasmallbutton(atthefront,righthandsideinthispicture)thatisoftenactuatedbyapivotedmetallever.Theswitchcanrespondtoaverylightpressure,butcanhandlerelativelyhighcurrents.
DCgear-motor,ratedforanyvoltagebetween5and12,drawingamaximumof100mAinitsfree-runningstate,outputshaftturningbetween30and60RPM.Quantity:1.AmotorisshowninFigure5-75.
Figure5-75.FortheLittleRobotCart,Ifoundthis5-voltmotor,whichissuppliedwithadiscthatfitsitsoutputshaft.Thecombinationcostlessthan$10.
Discorarmthatfitssecurelyontoyourmotorshaft.Quantity:1.555timer.Quantity:1.DPDTnonlatchingrelayratedforthesamevoltageasyourmotor.Quantity:1.1/4-inchplywoodorplastic,onepieceabout2feetsquare.#4sheet-metalscrews,5/8inchor3/4inchlong.Quantity:2dozen.#6bolts,3/4inchlong,withnylon-insertlocknuts.Quantity:2dozen.1/4-inchbolts,1inchlong,withnuts,tomountthewheels.Quantity:4.
I’mnotspecifyingoneparticularmotor,becauseifIdid,itmightnotbeavailablebythetimeyoureadthis.Motorsaren’tlikelogicchips,whichhaveretainedtheirbasicfunctionthroughoutvariousimprovementsoveraperiodofseveraldecades.Motorscomeandgo,andmanythatyoumayrunacrosswillbesurpluspartsthatwillneverbeenseenagain.Searchonlinefor“gear-motor”or“gearheadmotor”andfindoneascloseaspossibletothespecificationthatIhaveprovided.Themechanicalpoweroutputofthemotorshouldn’tbeimportant,becausewewon’tberequiringittodomuchwork.Theimportantconsiderationwhenyoubuyyourmotoristhatyoushouldalsoobtainsomethingthatfitsontoitsoutputshaft.Typically,thiswillbeadiskorarmthatcanbescrewedintoplace.Tothisyoucanthenaddalargerwheelofyourown,whichyoucancutwithaholesawormakefromthescrew-onlidofajar,oranythingelsecircularthatyoumayfindinthehouse.Alargerwheelwillmakeyourcartmovefasterthanasmallerwheel,butwillreduceitstorque,thuslimitingitspowertoovercomeobstacles.Thisbringsmetomynexttopic:fabrication.Althoughthisisanelectronicsbook,motorsareelectromechanicaldevices,andyouhavetobeabletoinstalltheminsomekindofamachinetogetanyinterestingresults.Youcanuseplywoodtocompletethetwolittleroboticsprojectshere(ideally,thekindofthin,high-qualityplywoodsoldbyhobbystores)butIrecommendsomethingthatlooksbetterandiseasiertoworkwith:ABSplastic.Beforeyoustartontheroboticcart,youmaywanttocheckthesection“Fundamentals:AllaboutABS.”
FUNDAMENTALSAllaboutABSUnlessyouthinkthesteampunkmovementisn’tgoingbackfarenough,youprobablydon’twantyourautonomousrobotcarttoresemblearelicfrombeforethe1800s.Therefore,woodmaynotbethebestconstructionmaterial.Metalcanlooknice,butisnoteasytoworkwith.Forquickresultsthathaveatwentieth-centurylook(maybeevena21st-centurylook),plasticistheobviouschoice,andIfeelthatABSisthebesttypeofplastictouse,becauseitprovidessuchquick,easyresults.ABSstandsfor“acrylonitrilebutadienestyrene.”Lego®blocksaremadeofABS.Car-stereoinstallersandmodel-railroadbuffsuseit.Youcanuseit,too.Youcansawit,drillit,sandit,whittleit,anddrivescrewsintoit,anditwon’twarp,split,orsplinter.It’swashable,doesn’tneedtobepainted,andwilllastalmostforever.Delrinisanothertypeofplastic,buttendstocostmoreandisalittletoughertodrillandcut.It’samatterofpersonalpreference.ABSmachinesfairlywell,butwhenyoudrillit,forexample,itcan“catch”onthebitandthepiecewillspinwiththebitduetothewaythatplasticchipsoffwiththebit.Delrinisself-lubricatingandhasbettermeltingpropertiesundertheheatofmachining,soitdrillsandcutsmuchmorecleanlyandeasilythanABS.
WheretofindABSPiecesofABSacoupleoffeetsquareareavailablefromonlinesourcessuchashttp://hobbylinc.comorestreetplastics(aneBaystore),butyou’llsavemoneyifyoucantruckondowntoyournearestplasticsupplyhouseandbuyitlikeplywood,insheetsmeasuring4by8feet.Todiscoverwhetheryouhaveanearbyplasticsupplyhouse,searchfor“plasticsupply”inyouryellowpagesorGoogleLocal.PiedmontRegalPlasticshasmanysupplycentersaroundthenation,butyou’llhavetocollectityourself,andtheymaynotbewillingtocut
![Page 218: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/218.jpg)
smallpieces.Youcancheckonlineathttp://www.piedmontplastics.comfortheirlocations.StockcolorsofABSincludeblack,white,and“natural,”whichisbeige.Sheetsusuallyaretexturedononeside,whichisthesidethatshouldfaceoutward,asitismorescratch-resistantthanthesmoothside.Becauseyouwon’tbeaddingpaintorotherfinishes,you’llhavetobecarefulnottoscufftheplasticorscratchitwhileworking.Cleanyourbenchthoroughlybeforeyoubegin,takingspecialcaretoremoveanymetalparticles,whichtendtobecomeembeddedintheplastic.Usewoodenshimsinthejawsofyourvise,andavoidrestingtheplasticaccidentallyonanysharptoolsorscrews.WorkingwithABSrequiresacleanenvironmentandaverygentletouch.
CutwithCareYoucansawABS,butifyouuseatablesaw,theplasticwilltendtomeltandsticktotheblade.Thesesmearswillgetwarmandstickywhenyoufeedthenextpieceofplasticintothesaw,andtheresultwillbeextremelyunpleasant.Thewhirlingbladewillgrabtheplasticandhurlitatyoupowerfullyenoughtobreakbones.Thisisknownas“kickback”andisaveryseriousriskwhensawingplastic.Ifyouhaveextensiveexperienceusingatablesaw,youareactuallymorevulnerable,becausethereflexesandcautionsyouhavedevelopedwhiledealingwithwoodwillnotbeadequateforworkingwithplastic.Pleasetakethiswarningseriously!Yourfirstandmostobviousprecautionistouseaplastic-cuttingblade,whichhasalargernumberofthickerteethtoabsorbtheheat.ThebladeIhaveusedisaFreud80T,butthereareothers.Ifyouuseabladethatisnotsuitable,youwillseeitstartingtoaccumulatestickysmears.Thisistheonlywarningyouwillget.Cleanthatbladewithasolventsuchasacetone,andneveruseitforABSagain.Regardlessofotherprecautions,alwayswearglovesandeyeprotectionwhenusingatablesaw,andstandtoonesidewhenfeedingmaterialsintoit.Personally,afteroneepisodeofkickbackthatIthoughthadbrokenmyarm,Iprefernottouseatablesawonplasticatall.Forlong,straightcuts,thealternativesinclude:
Panelsaw(bigandexpensive,butsafeandaccurate).Miniaturehandheldcircularsawwithabladearound4inchesindiameter,guidedwithastraightedgeclampedtothesheet.Handsaw.Thisismyold-schoolpreference.MyfavoriteisaJapanesepull-to-cutsaw,whichmakesverycleancuts:theVaughanExtra-FineCross-CutBearSaw,9-1/2inches,17tpi(teethperinch).Ifyouuseoneofthese,becarefultokeepyourfreehandoutoftheway,asthesawcaneasilyjumpoutofthecut.Becauseitisdesignedtocuthardmaterialssuchaswood,ithasnodifficultycuttingsoftflesh.Glovesarestronglyrecommended.
Figure5-76.Theperilsofkickback.Plasticeasilystickstothebladeofatablesaw,whichwillhurlitatyouunexpectedly.Useothertoolstocutplastic.
CurvingCutsCurvingcutsinvolverelativelylittledanger,althougheyeprotectionandglovesarestilladvisable.Mypreferredtools:
Bandsawwitha3/8-or1/4-inchbladedesignedforthinwoodorplywood.Jigsaw.IhaveaspeciallikingfortheDeWaltXRPusingBoschbladesthataredesignedforhardwoodorplastic.ThiswillcutcomplexcurvesinABSaseasilyasscissorscuttingpaper.
Nomatterwhattypeofsawyouuse,you’llhavetocleanraggedbitsofplasticoffthecutafterward,andtheabsolutelynecessaryitemforthispurposeisadeburringtool,availablefromhttp://www.mcmaster.comandmostotheronlinehardwaresources.Abeltsanderordiscsanderisidealforroundingcorners,andametalfilecanbeusedtoremovebumpsfromedgesthataresupposedtobestraight.Figures5-77through5-80showvariouscuttingtools.Figure5-81showsadeburringtool,andFigure5-82showsadiscsander.
Figure5-77.AbandsawisanidealtoolforcuttingcomplexshapesoutofABSplastic.Youcanoftenfindthemsecondhandforunder$200.
![Page 219: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/219.jpg)
Figure5-80.ThisDeWaltjigsawcanrunatveryslowspeeds,enablingpreciseandcarefulworkwithplastic.
Figure5-78.Ahandheldcircularsaw,runningalongastraight-edge,ismuchsaferthanatablesawforcuttingplastic,andcanproducecomparableresults.
Figure5-81.Adeburringtoolwillcleanandbevelthesawnedgeofapieceofplasticinjustacoupleofquickstrokes.
Figure5-79.ThisJapanese-stylesawcutswhenyoupullit,ratherthanwhenyoupushit.Aftersomepractice,youcanuseittomakeveryaccuratecuts.BecauseABSissosoft,minimalmuscle-powerisrequired.
Figure5-82.AbeltsanderordiscsanderistheidealtoolforroundingcornerswhenworkingwithABSplastic.
MakingPlansIliketousedrawingsoftwaretocreateplans,andItrytoprintthematactualscale.Itapethemtothesmoothsideofapieceofwhiteornatural-colorABS,thenuseanawltoprickthroughtheplanintothesoftsurfacebeneath.Iremovethepaperandconnecttheawlmarksbydrawingontotheplasticusingapencilorafine-pointwater-solublepen.Itslinescanbewipedawaylaterwithadampcloth.Don’tuseapermanentmarker,asthesolventsthatyouwillneedtocleanitmaydissolvetheplastic.BecauseABSwilltendtoopenafissurewhenyoubenditatanyinsidecornerwhereyoudon’thaveasmoothradius,youneedtodrillholesattheselocations,asshowninthecartplansinFigure5-92onpage275.Aregularhalf-inchdrillbitistooaggressive;itwilltendtojamitselfintotheplasticwithinoneturnofthedrill.UseForstnerbits(showninFigures5-83and5-84)tocutnicesmoothcircles.
![Page 220: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/220.jpg)
Figure5-83.AForstnerdrillbitmakesclean,preciseholes;alargeregulardrillbitwillchewupABSplasticandmakeamess.
Figure5-84.Bydrillingholesatanylocationwheretwobendsintersect,youreducetheriskoftheplasticfissuring.
Notethattheheatfrombendingwilltendtomakeanymarksontheplasticpermanent.
BendingItAbigadvantageofplasticoverwoodisthatyoucanmakecomplexshapesbybendingthem,insteadofcuttingseparatepiecesandjoiningthemwithnails,screws,orglue.Unfortunately,bendingdoesrequireanappropriatebender:anelectricheatingelementmountedinalong,thinmetalenclosurethatyouplaceonyourworkbench.ThebenderIuseismadebyFTM,acompanythatoffersallkindsofneatgadgetsforworkingwithplastic.Theircheapestbender,showninFigure5-85,isjustover$200witha2-footelement.Youcangeta4-footmodelforabout$50more.Checkthemoutathttp://thefabricatorssource.com.
Figure5-85.Makingclean,precisebendsinABSissimplyamatterofrestingtheplasticoverabenderthatconsistsofanelectricheatingelement.
AvoidBurnsWhileBendingAplasticbenderwillinflictseriousburnsifyouhappentorestyourhandonitaccidentally,andbecauseithasnowarninglight,youcaneasilyforgetthatyouhaveleftitpluggedin.Usegloves!
Tobendplastic,layitoverthehotelementofaplasticbenderforabrieftime(25to30secondsfor1/8-inchABS,40to45secondsfor3/16-inch,anduptoaminutefor1/4-inch).Ifyouoverheattheplastic,you’llsmellit,andwhenyouturnitoveryou’llfinditlookslikebrownmeltedcheese.Naturallyyoushouldlearntointervenebeforetheplasticreachesthatpoint.ABSisreadytobendwhenityieldstogentlepressure.Takeitoffthebenderandbenditawayfromthesidethatyouheated.Ifyoubendittowardthehotside,thesoftenedplasticwillbunchupinsidethebend,whichdoesn’tlooknice.Youcanworkwithitforabouthalfaminute,andwhenyouhaveitthewayyouwantit,sprayorspongewaterontoittomakeitsetquickly.Alternatively,ifyouneedmoretime,youcanreheatit.Theamountofforcenecessarytobendthesheetincreasesinproportionwiththelengthofthebend,soalongbendcanbedifficult,andIusuallyinsertitintoaloosevise,pushitabit,moveitalongtothenextspot,andpushitagain.Becauseplasticbendingisverysimilartomakingshapesinorigami,it’sagoodideatomodelyourprojectsinpaperbeforeyoucommityourselftoABS.Ifyoudecidethatyoudon’twanttospendmoneyonabender,don’tabandonplasticjustyet—youcanusescrewstoassembleseparatesectionswithgreatereaseandconveniencethanifyouwereworkingwithwood.
Making90-DegreeJointsDrivingscrewsintotheedgeofapieceofplywoodwillalmostalwaysseparateitslayers,butABShasnolayers(orgrain,either),andneversplitsorshatters.Thismeansthatyoucaneasilyjointwopiecesat90°usingsmallscrews(#4size,5/8-inchlong).Figures5-86through5-90showtheprocedureforjoining1/8-inch(orthicker)ABSto1/4-inchABS,whichIregardastheminimumthicknesswhenyou’reinsertingscrewsintoitsedge:1.Markaguidelineonthethinnerpieceofplastic,1/8inchfromitsedge.For#4screws,drillholesusinga7/64-inchbit.Ifyou’reusingflat-headedscrews,countersinktheholesverygently.
![Page 221: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/221.jpg)
Figure5-86.
2.Holdorclampthepiecesinplaceandpokeapenorpencilthroughtheholestomarktheedgeofthe1/4-inchplasticbeneath.
Figure5-87.
3.Removethethinplastic,clampthe1/4-inchplasticinavise,anddrillguideholesforthescrewsateachmark,centeredwithinthethicknessoftheplastic.BecauseABSdoesnotcompresslikewood,theholesmustbelargerthanyoumayexpect;otherwise,theplasticwillswellaroundthescrew.A3/32-inchbitisjustrightfora#4screw.
4.Assembletheparts.Becarefulnottoovertightenthescrews;it’seasytostripthethreadsthattheycutinthesoftplastic.
Figure5-88.
Figure5-89.Figures5-86through5-89illustratefourstepstojointwopiecesofABSusing#4sheet-metalscrews.Cut7/64-inchholesonaline1/8inchfromtheedgeofthefirstpiece,thenmarkthroughtheholestotheedgeofthesecondpiece.Drill3/32-inchholesthatarepreciselycenteredin
theedge,thenscrewthepiecestogether.
Figure5-90.Three#4screwsdrivenintotheedgeofABS,usinga1/16-inchguidehole,a5/64-inchguidehole,anda3/32-inchguidehole.respectivelyBecausethefirsttwoguidesholesweretoosmall,theplasticswelledaroundthescrew(butdidnotbreak).
FramingYourCartForreasonsthatwillsoonbeapparent,I’vechosenanunusualdiamond-shapedconfigurationofwheels.IntherenderingshowninFigure5-91,thefrontwheel(atthefarendofthecart)appliespower,therearwheel(atthenearendofthecart)steersthecartwhenbackingup,andthesidewheelspreventitfromfallingover.
![Page 222: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/222.jpg)
Figure5-91.Ifyouhave3Drenderingsoftware,itcanbeagreatwaytotestthefeasibilityofaconstructionprojectbeforeyoustartcuttingmaterialsandtryingtofitpiecestogether.Thisrenderingwasaproof-of-conceptfortheLittleRobotCart.
Dependingonthetypeofmotorthatyoubuy,you’llhavetoimproviseawaytomountitinthefrontsectionofthecart.Don’tbeafraidtousekludgessuchascableties,ducttape,orevenrubberbandstoattachthemotortotheframe.We’remakingaroughprototype,here,notathingofbeauty(althoughifyoudecideyoulikethecart,youcanalwaysrebuilditbeautifullylater).TheplaninFigure5-92showsthepiecesthatyouwillneed.PartAisthebodyofthecart.Ifyou’regoingtobenditfromABS,youshoulddrillhalf-inchholes,withaforstnerbit,atthefourinsidecorners,sothatthesecornershaveroundededges.Ifyousimplysawtheplastictomakesharp90°corners,theplasticmaydevelopfissuresatthecornerswhenyoubendit.Ifyoudon’thaveaplasticbenderanddon’tfeelinclinedtobuyone,youcanmakePartAfromthreeseparaterectanglesandthenscrewthemtogether.
Figure5-92.Thesesectionsof1/4-inchplasticcanbeassembledtocreatethesimplecartdescribedinExperiment32.
PartBisawheel,ofwhichyouwillneedfour.Icutthemusinga3-inchholesaw.Thefrontwheelisscrewedtowhateverdiscorarmyouobtainedtomatewiththeshaftofyourmotor.SeeFigure5-93.
Figure5-93.A3-inchwheelisscrewedtothediscthatmateswiththedriveshaftofthemotor.
PartsC,D,andEassembletoformayokeinwhichtherearwheelismounted.Iuseda2-inchhingetopivottheyoke.ThehingeismountedonPartF,whichisapartitionlocatedmidwayintheframeofthecart.ThephotographsinFigures5-94and5-95willhelptomakethisclear.Initially,whenyouinstallPartF,useonlytwoscrews,oneeachside,sothatyoucanadjustitsanglealittle.Thiswillbenecessarytooptimizethecontactofthewheelswiththefloor.
Figure5-94.Theassembledbodyofthecart,beforeaddingcontrolelectronics.Thewheelattherighthandendwillpullthecartfromlefttoright.Thehingedtrailingwheelwillallowthecarttomoveinarelativelystraightlinewhenitmovesforward,butwilltendtoturnitwhenitbacksup.
![Page 223: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/223.jpg)
Figure5-95.Acloseupofthehingedtrailingwheel,whichrotatesfreelyandcanflipfromsidetosidewithminimalfriction.
Thesidewheelsandrearwheelmustspinfreely,butontheotherhand,theyshouldn’twobble.Isimplytightenedthenutsontheboltsthatserveasaxlesforthewheels,untiltherewasmaybehalfamillimeterofclearance.IaddedadropofLoctitetostopthenutsfromgettingloose.Theplansdon’tshowpreciselywheretodrillholesfortheaxlebolts,becausethelocationwilldependonthesizeofyourwheels.Youcanfigurethisoutasyougoalong.Justmakesurethatthesidewheelsaren’tmountedtoolow.Wedon’twantthemtoliftthefrontwheelortherearwheeloffthefloor.Ifthesidewheelsareafractionhigheroffthegroundthanthefrontandrearwheels,that’sgood.Ifyouhavetileorwoodfloors,yourcartmayacquirebettertractionifyouwrapathickrubberbandaroundeachdiscthatyouuseforthedrivewheelandthesteeringwheel.Themostimportantaspectoftheconstructionistoplacemicroswitcheswherethey’llbetriggeredwhenthecartrunsintosomething.Iplacedmineatthefrontcorners,asshowninFigures5-96and5-97.Andthatbringsmetotheelectronics.
Figure5-96.
Figure5-97.Twomicroswitcheswithmetalarmsaremountedoneachsideofthecart,wheretheywillsenseanyobstacle.
TheCircuitTheschematicisvery,verysimple,withonlyfourprincipalcomponents:twomicroswitchesthatsenseobstaclesinfrontofthecart,onerelay,andone555timer.Youwillalsoneedasmallpowerswitch,abatteryorbatterypack,andaresistor,andcapacitorstogowiththetimer.Atrimmerpotentiometerwillallowyoutoadjustthe“on”timeofthe555timer,whichwilldeterminehowlongthecarttakestobackup.SeeFigure5-98.
Figure5-98.Thisultrasimpleschematicisallthecartneedstoenableittobackupwhenithitsanobstacle.
ThemotorIchoserequires5volts,soIhadtouseavoltageregulatorwitha9-voltbattery.Ifyourmotoruses6volts,youcanwirefourAAbatteriestoitdirectly.Ifyouhavea12-voltmotor,youcanusetwo9-voltbatteriesinseries,supplyingpowerthrougha12-voltvoltageregulator.Assemblethecomponents,mountthemonthecart,andswitchiton,anditshouldmoveforwardslowlyinamore-or-lessstraightline.Ifitmovesbackward,reverseyourconnectiontotheterminalsonthemotor.Whenthecartbumpsintosomething,eitherofthemicroswitcheswillconnectnegativevoltagetotheinputpinofthe555timer.Thistriggersthetimer,whichrunsinmonostablemode,generatingasinglepulselastingabout5seconds,whichclosestherelay,whichiswiredsothatitreversesthevoltagetothemotor.
![Page 224: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/224.jpg)
WhenthevoltageisreversedtoasimpleDCmotor,itrunsbackward.Sothecartbacksup.Becausetherearwheelismountedinayokethatpivots,theyokewilltendtofliponewayortheother,causingthecarttodescribeanarcasitmovesbackward.Attheendofthetimercycle,therelayrelaxesandthecartstartsmovingforwardagain.Inforwardmode,therearwheeljustfollowsalongwithoutapplyinganysteeringforce,sothecarttendstofollowastraightline—untilithitsanotherobstacle,atwhichpointitbacksup,andtriesanotherpath.
FUNDAMENTALSAllaboutlimitswitchesThemostobviousenhancementforyourcartwouldbeabettersteeringmechanism.Youcoulduseanothermotortotakecareofthis,withapairoflimitswitches.Becauselimitswitchesareabasic,importantideainconjunctionwithmotors,I’llexplainthemindetail.Figure5-99showsthreesuccessiveviewsofamotorwithanarmattachedtoit,whichcanpresseitheralowerpushbuttonoranupperpushbutton.Bothofthepushbuttonsarenormallyclosed,butwillopenwhenpressedbythemotorarm.Thesebuttonsarethelimitswitches.Typicallyyouwouldusemicroswitchesforthispurpose,justliketheonesthatIsuggestedasbarrier-sensorsatthefrontofthecart.Inaddition,there’saDPDTrelaythatisactivatedbyasimpleon/offswitchattherighthandside.Onthecart,the555timertakestheplaceoftheon/offswitch,byfeedingpowertotherelay.Supposethatthemotorbeginswiththearmpointingdownward,asshowninthetopviewinFigure5-99,andthemotoriswiredsothatwhenitreceivesnegativevoltageatitslowerterminalandpositiveatitsupperterminal,itrotatescounter-clockwise.Thisiswhathappenswhentheon/offswitchclosesandsendspowertotheDPDTrelay.Positivevoltagefromtherelaycontactscannotpassthroughtheupperdiode,butcanpassthroughtheupperlimitswitch,whichisclosed.Negativevoltagecannotpassthroughthelowerlimitswitch,becauseit’sopen,butcanpassthroughthelowerdiode.So,themotorstartstoturncounterclockwise.Duringthemidpointofitsarc,itreceivespowerthroughbothofthelimitswitches.Finally,themotorarmreachestheupperswitch,andopensit.Thispreventspositivevoltagefromreachingthemotorthroughthatswitch,andthepositivevoltageisalsoblockedbytheupperdiode.So,atthistime,themotorstops.Nowsupposethattheon/offswitchisopened,asinthetopviewinFigure5-100.Therelaylosesitspower,soitscontactsrelax.Thevoltagetothemotorisnowreversed.Negativevoltagepassesthroughtheupperdiode,whilepositivevoltagereachesthemotorthroughthelowerlimitswitch.Themotorstartsrunningclockwise,untilitsarmhitsthelowerswitch,openingitandcuttingoffpowertothemotor.Limitswitchesarenecessary,becauseifyoucontinuetoapplyvoltagetoasimpleDCmotorthatisunabletoturn,themotorsucksmorecurrent,getshot,andmayburnout.Youcaneasilyseehowthiskindofsystemcouldbeusedtocontrolthecart’ssteering.Eventhoughthemotorhasonlytwopositions,thesearesufficienttomakethecartturnwhengoingbackward,andproceedstraightaheadwhengoingforward.Toreducepowerconsumption,theDPDTrelaycouldbereplacedwithatwo-coillatchingrelay.Thecircuitwouldthenhavetoberevisedsothattherelayisflippedtoandfrobyapulsetoeachofitscoils.
FUNDAMENTALSAllaboutlimitswitches(continued)
Figure5-99.Thethreediagrams,fromtoptobottom,showthreesnapshotsofamotorcontrolledbyaDPDTrelayandtwolimitswitches.Whentheon/offswitchatbottom-rightsendspowertotherelay,thelowerrelaycontactscausethemotortoruncounterclockwiseuntilitstopsitselfasits
armopenstheupperlimitswitch.
![Page 225: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/225.jpg)
Figure5-100.Whentheon/offswitchatbottom-rightopens,therelayconnectsitsuppercontacts.Thiscausesthemotortorunclockwiseuntilitsarmopensthelowerlimitswitch.Limitswitchesavoidtheoverheatingandpossibledamagethatarelikelywhenpowerisdeliveredtoamotorthat
ispreventedfromturning.
FUNDAMENTALSAllaboutmotorsBrushedDCmotor
Thisistheoldest,simplestdesignforanelectricmotor,showninverysimplifiedforminFigure5-101.Coilsareattachedtoashaftwheretheycaninteractwithstationarymagnetsaroundthem.Themagneticattractionturnstheshaftalittle,atwhichpointthenextcoilontheshaftisenergizedtoturntheshaftalittlemore,andthenthenextcoil—andsoon.Tomakethishappen,electricityhastobefedintothecoilsby“brushes,”oftenconsistingofsoftcarbonpadsthatconductpowertoahub,knownasacommutator,dividedintosections,eachofwhichisconnectedtoaseparatecoil.Thisbasicdesignhasseveraladvantagesifwewanttobuildasmallmotorizedgadget,suchasaminiaturerobotorevenamodelairplane:
WidelyavailableLowcostSimpleReliableWillruninreversewhenvoltagereverses
Inaddition,brushedmotorsareoftensoldwithreductiongearingbuiltin.Suchunitsareknownasgearheadmotorsorgearmotors.Theyfreeyoufromtheneedtouseyourowngearsorbeltstoadjusttheoutputspeedyourself.Yousimplychoosethemotorthatfitsyourspecification.
DCsteppermotorThisrequiresacontroller,consistingofsomeelectronicstotellthemotortorotateitsshaftinsmall,discretesteps.Theadvantagesofasteppermotorare:
PrecisepositioningoftheshaftPrecisespeedadjustment
Steppermotorsareidealfordevicessuchascomputerprinters,wherethepaperhastorollupbyaprecisedistanceandtheprintheadhastomovelaterallybyanequallyprecisedistance,buttheyarealsousefulinrobots.Ifthemotorissmallenoughtodrawlessthan200mAandwillrunon12voltsorless,youcancontrolitwithpulsesfroma555timer.I’lldescribesteppermotorsinmoredetailinExperiment33.
ServomotorThisisgenerallyusedinconjunctionwithaprogrammablemicrocontroller,whichsendsinstructorstorotatethemotorshafttoaspecificpositionandthenholditthere.I’llmentionservomotorswhenIintroduceyoutomicrocontrollers,butwewon’tbedealingwiththemindetail.
Othertypesofmotorsexist,includingbrushlessDCmotors(whichrequireadifferenttypeofcontrollerandarefoundincomputerdiskdrivesandCDplayers),andACmotors(includingsynchronousmotors,whichsynchronizetheirrotationwiththefrequencyofACvoltage,andwereusedextensivelyinclocks,beforeclocksmostlybecamedigital).Inthisbook,I’llbetalkingmostlyaboutbrushedDCmotorsandDCsteppermotors.
![Page 226: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/226.jpg)
Figure5-101.ThebasicprincipleofasimpleDCmotor.Thecommutatorpasseselectricitythroughacoil,creatingamagneticfieldthatinteractswithamagnetaroundthemotor.Thecoilturns,andthecommutatorturnswithit,untiltheelectricfieldthroughthecoilisreversed.Thiscauses
theprocesstorepeat.Inreality,amotorislikelytohaveacommutatorformedfrommultiplesegments,connectedwithmultiplecoils.Theprinciple,however,remainsthesame.
Take-homemessagesfromthisexperimentincludethefollowing:
YoucanbuysimpleDCmotorswithreductiongearingbuiltin,providingyourchoiceofRPM.Literallyhundredsofwebsiteswillsellyousmallmotorsforroboticsprojects.WhenyoureversethevoltagetoaDCmotor,themotorrunsinreverse.ADPDTrelaycanbewiredsothatwhenitclosesitscontacts,itreversesapowersupplytoamotor.Youcanusetwolimitswitchesandapairofdiodestostopamotorattwopositions.Ineachofitsstoppingpositions,themotorconsumesnopowerandyouwon’thavetheriskofitburningout.
Whatotherprojectscanyouimagineusingthissimplesetoftechniques?
MechanicalPowerIntheUnitedStates,theturningforce,ortorque,ofamotorisusuallymeasuredinpound-feetorounce-inches.InEurope,themetricsystemisusedtomeasuretorqueindynes.Apound-footiseasytounderstand.Imaginealeverpivotedatoneend,asshowninFigure5-102.Iftheleverisonefootlong,andyouhangaone-poundweightattheendofit,theturningforceisonepound-foot.
Figure5-102.Therotationalforcecreatedbyamotorisknownas“torque,”andintheUnitedStatesitismeasuredinpound-feet(orounce-inches,forsmallmotors).Inthemetricsystem,torqueismeasuredindynes.Notethatthetorquecreatedbyamotorwillvaryaccordingtothespeedatwhichthe
motorisrunning.
FUNDAMENTALSWiregaugesIfyou’regoingtopowerlargermotors,orothercomponentsthattakemorecurrentthanLEDsorsmallrelays,youreallyneedtoknowaboutwiregauges.Inparticular,what’stherelationshipbetweenwirethicknessandAWG(AmericanWireGauge)?Andwhatgaugeofwireshouldyouuseforanygivencurrent?Youcanfindnumerouschartsandtablesifyougoonline,butmanyofthesesourcescontradicteachother,especiallyonthetopicofhowmuchcurrentissafetorunthrougheachgaugeofwire.Aftermakingseveralcomparisons(andtestingsomewiresamplesmyself),I’vecompiledthetableinFigure5-103,whichIrecommendasacompromise.Notethefollowing:
Thistableappliestosolid-corecopperwire.Forstrandedwire,orcopperthathasbeentinned(givingitasilverappearance),thenumberofohmsperfootwillincrease,thenumberoffeetperohmwilldecrease,andthemaximumamperagewilldecrease,probablybyaround20%.
![Page 227: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/227.jpg)
Figure5-103.Americanwiregauges(AWG)andtheirproperties.
Themaximumamperageassumesthatthewireisinsulated,preventingitfromradiatingheataseffectivelyasabareconductor.Iamalsoassumingthatthewireislikelytobeatleastpartiallyenclosed,insideaboxorcabinet.Attheamperageslistedforeachgaugeofwire,youshouldexpectthewiretobecomenoticeablywarm,andpersonallyIwouldtendtousethickerwireinsteadofthemaximumsindicatedinthetable.Mosttablesofthistypeonlytellyoutheresistanceofeachgaugeofwireinohmsper1,000feet.Ihaveincludedthatnumberbuthavealsoexpressedthefunctiontheotherwayaround,asthenumberoffeetperohm,asthisdoesn’trequireyoutodosomucharithmeticwithdecimals.
THEORYCalculatingvoltagedropAnotherfactthatyouoftenneedtoknowishowmuchofavoltagedropaparticularlengthofwirewillintroduceinacircuit.Ifyouwanttogetmaximumpowerfromamotor,youdon’twanttolosetoomuchvoltageinthewiresthatgotoandfromthemotor.Voltagedropistricky,becauseitdependsnotonlyonthewire,butalsoonhowheavilythecircuitisloaded.Supposethatyouareusing100feetof22-gaugewire,whichhasaresistanceofabout1.5ohms.Ifyouattachittoa12-voltbatteryanddriveanLEDandaseriesresistorofferingatotaleffectiveresistanceofabout1,200ohms,theresistanceofthewireistrivialbycomparison.AccordingtoOhm’sLaw:
amps=volts/ohmssothecurrentthroughthecircuitisonlyabout10mA.Again,byOhm’sLaw:
volts=ohms×ampssothewirewithresistanceof1.5ohmsimposesavoltagedropof1.5×0.01=0.015volts.Nowsupposeyou’rerunningamotor.Thecoilsinthemotorcreateimpedance,ratherthanresistance,butstillifwemeasurehowmuchcurrentisgoingthroughthecircuit,wecanestablishitseffectiveresistance.Supposethecurrentis1amp.Repeatingthesecondcalculation:
volts=ohms×ampsSothevoltagedropinthewireisnow1.5×1=1.5volts!ThisisillustratedinFigure5-104.Bearingthesefactorsinmind,Ihavecompiledatableforyou.I’veroundedthenumberstojusttwodigits,asvariationsinthewirethatyouusemakeanypretenseofgreateraccuracyunrealistic.Tousethistable,youneedtoknowhowmuchcurrentispassingthroughyourcircuit.Youcancalculateit(byaddingupalltheresistancesanddividingitintothevoltagethatyouareapplying)oryoucansimplymeasurethecurrentwithameter.Justmakesurethatyourunitsareconsistent(allinohms,amps,andvolts,ormilliohms,milliamps,andmillivolts).Inthetable,Ihavearbitrarilyassumedalengthof10feetofwire.Naturallyyouwillhavetomakeallowancesfortheactuallengthofwireinyourcircuit.Theshorterthewire,thelessthelosswillbe.Acircuitwithonly5feetofwire,andthesameamperageandvoltage,willsufferhalfofthepercentagelossshowninthetable.Acircuitwith15feetofwire,andthesameamperageandvoltage,willsuffer1.5timesthepercentageloss.So,tousethetable:1.Divideyourlengthofwireby10.(Makesurethatyoumeasurethelengthinfeet.)2.Usetheresulttomultiplythenumberinthetable.
Thetablealsoarbitrarilyassumesthatyouhavea12-voltsupply.Again,youwillhavetomakeallowancesifyouareusingadifferentvoltage.So,tousethetable:1.Divide12bytheactualvoltageofyourpowersupply.2.Usetheresulttomultiplythenumberinthetable.
Icansummarizethosetwostepslikethis:Percentvoltagelost=P×(12/V)×(L/10)
wherePisthenumberfromthetable,Visyourpower-supplyvoltage,andListhelengthofyourwire.
![Page 228: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/228.jpg)
Figure5-104.Thevoltagedropimposedbywiringwilldependonthecurrentandtheresistanceinthecircuit.Thedropwillbegreatestwhentheresistanceofthecircuitislowandtheamperageishigh.
THEORYCalculatingvoltagedrop(continued)Thistableshowsthepercentvoltagelostinacircuitwith10-footwireat12volts.
WIREGAUGE AMPERES 1 2 3 4 5 6 7 8 9 10
10 0.08 0.17 0.25 0.33 0.42 0.50 0.58 0.67 0.75 0.83
12 0.13 0.27 0.40 0.53 0.66 0.80 0.93 1.1 1.2 1.3
14 0.21 0.42 0.63 0.84 1.1 1.3 1.4 1.5 1.9 2.1
16 0.33 0.67 1.0 1.3 1.7 2.0 2.3 2.7 3.0 3.4
18 0.53 1.1 1.6 2.1 2.7 3.2 3.7 4.3 4.8 5.3
20 0.85 1.7 2.6 3.4 4.3 5.1 6.0 6.8 7.7 8.5
22 1.3 2.7 4.0 5.4 6.7 8.1 9.4 11 12 13
24 2.1 4.3 6.4 8.6 11 13 15 17 19 21
26 3.4 6.8 10 14 17 20 24 27 31 34
28 5.4 11 16 22 27 32 38 43 49 54
30 8.6 17 26 34 43 52 60 69 77 86
Remember,though,thatthewireresistancewillbehigherifyouareusingstrandedcopperwireortinnedcopperwire,andthiswillincreasethepercentageofvoltagelost.
![Page 229: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/229.jpg)
Experiment33:MovinginStepsTimenowtobuildsomethingmoresophisticated:acartthatorientsitselftowardalightsource.I’mgoingtotellyouallyouneedtogetstartedonthisproject,butthistimeIwon’tgoallthewaytotheendinexhaustivedetail.Iwantyoutogetintothehabitoffiguringoutthedetails,improvingonplans,andeventuallyinventingthingsforyourself.Youwillneed:
555timers.Quantity:8.Trimmerpotentiometer,2Klinear.Quantity:2.LEDs.Quantity:4.IfyougettiredofusingseriesresistorstoprotectLEDsina12-voltcircuit,considerbuying12-voltLEDssuchasChicagoMiniature606-4302H1-12V,whichcontaintheirownresistorsbuiltin.However,theschematicinFigure5-108assumesthatyouwilluseregular2Vor2.5VLEDs.Steppermotor:Unipolar,four-phase,12-volt.Parallax27964orsimilar,consuming100mAmaximum.Quantity:2.Photoresistors,ideally500to3,000Ωrange.Quantity:2.ULN2001AorULN2003ADarlingtonarraysbySTMicroelectronics.Quantity:2.CMOSoctalordecadecounter.Quantity:2.Variousresistorsandcapacitors.
ExploringYourMotorI’vespecifiedaunipolar,four-phase,12-voltmotorbecausethisisaverycommontype.AtypicalsampleisshowninFigure5-105.Ifyoucan’teasilyfindtheonethatI’velisted,youshouldfeelsafeinbuyinganyotherthathasthesamegenericdescription.“Unipolar”meansthatyoudon’thavetoswitchthepowersupplyfrompositivetonegativeandbacktopositiveagain,torunthemotor.Four-phasemeansthatthepulsesthatrunthemotormustbeappliedinsequencetofourseparatewires.Becauseyouwillberunningyourmotordirectlyfrom555timers,theloweritspowerconsumption,thebetter.
Figure5-105.Atypicalsteppermotor.Theshaftrotatesinstepswhennegativepulsesareappliedtofourofthewiresinsequence,thefifthwirebeingcommon-positive.
First,though,wecanapplyvoltagetothemotorwithoutusinganyothercomponentsatall.Mostlikelyitwillhavefivewiresalreadyattached,withtheendsstrippedandtinned,sothatyoucaneasilyinsertthemintoholesinabreadboard,asshowninFigure5-106.Checkthedatasheetforyourmotor;youshouldfindthatfourofthewiresareusedtoenergizethemotorandturnitinsteps,whilethefifthisthecommonconnection.Inmanycases,thecommonconnectionshouldbehookedtothepositivesideofyourpowersupply,whileyouapplynegativevoltagetotheotherfourwiresinsequence,onestepatatime.
Figure5-106.Thesimplesttestofasteppermotoristoapplyvoltagemanuallytoeachofitsfourcontrolwires,whileapieceofducttape,attachedtotheoutputshaft,makesiteasytoseehowthemotorresponds.
Thedatasheetwilltellyouinwhatsequencetoapplypowertothewires.Youcanfigurethisoutbytrialanderrorifnecessary.Onethingtobearinmind:asteppermotorisverytolerant.Aslongasyouapplythecorrectvoltagetoit,youcan’tburnitout.Toseeexactlywhatthemotorisdoing,stickapieceofducttapetotheendoftheshaft.Thenapplyvoltagetowires,oneatatime,bymovingyournegativepowerconnectionfromonetothenext.Youshouldseetheshaftturninginlittlesteps.Insidethemotorarecoilsandmagnets,buttheyfunctiondifferentlyfromthoseinaDCmotor.YoucanbeginbyimaginingtheconfigurationasbeinglikethediagraminFigure5-107.Eachtimeyouapplyvoltagetoadifferentcoil,theblackquadrantoftheshaftturnstofacethatcoil.Inreality,ofcourse,themotorturnslessthan90°fromonecoiltothenext,butthissimplifiedmodelisagoodwaytogetaroughideaofwhat’shappening.Foramorepreciseexplanation,seetheupcomingsection“Theory:Insideasteppermotor.”Bearinmindthataslongasanyofthewiresofthemotorareconnected,itisconstantlydrawingpower,evenwhilesittinganddoingnothing.UnlikearegularDCmotor,asteppermotorisdesignedtodonothingformuchofthetime.Whenyouapplyvoltagetoadifferentwire,itstepstothatpositionandthenresumesdoingnothing.Thecoilinsidethemotorisholdingtheshaftinposition,andthepowerthatthemotordrawswillbedissipatedasheat.It’squitenormalforthemotortogetwarmwhileyou’reusingit.Thetroubleis,ifyouuseabatterytopowerit,andyouforgetthatyouhaveitconnected,thebatterywillnotholditschargeforlong.
Figure5-107.Thisgreatlysimplifieddiagramhelpsinvisualizingthewayinwhichasteppermotorworks.Inreality,almostallmotorsrotatebylessthan90°inresponsetoeachpulse.
![Page 230: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/230.jpg)
QuickDemoNowthatyou’veprovedthatyourmotorisfunctional,howcanyouactuallyrunit?Youneedtosendapulsetoeachofthefourwiresinturn,inarapidlyrepeatingsequence.Ifyoucanalsoadjustthespeedofthepulses,somuchthebetter.I’mthinkingthatforaquickandsimpledemo,youcanhandlethechallengesimplybyusingfour555timers,alloftheminmonostablemode,witheachonetriggeringthenext.TheschematicinFigure5-108showswhatIhaveinmind.Itlooksmorecomplexthanitreallyis.Eachtimerhasthesamepatternofcomponentsaroundit,soafteryoucreatethefirstmodule,youjustmakethreecopiesofit.
Figure5-108.Averyquickandsimplecircuittocontrolasteppermotorusesfour555timers,eachinmonostablemode,triggeringeachotherinarepeatingsequence.
I’veuseda10Kresistortopulluptheinputtoeach555,sothatthetimersarenaturallyintheirquiescentstate.A0.01μFcapacitorlinkstheoutputfromonetimertotheinputofthenextsothattheyareelectricallyisolatedfromeachother,andthecapacitorjustconveysa“spike”ofvoltagewhenonetimerfinishesits“on”cycle,anditsoutputgoeslow,whichtriggersthenext.Ontherighthandside,I’veused10Kresistorsand22μFcapacitorstogenerateacycleofaboutaquarterofasecond—exceptthatthetopmosttimerhasa8K2timingresistor.Thereasonforthisisthatwhenpowerisfirstapplied,thetimerswillallbewaitingforeachothertobegin,andtimers2and4or1and3mayfiretogether.Bygivingonetimerashortercyclethantheothers,Iminimizethisproblem.TheLEDsareincludedjusttogiveyousomevisualverificationofwhat’shappening.Withoutthem,ifyoumakeawiringerror,themotormayturntoandfroerratically,andyouwon’tknowwhy.InitiallyyoucanrunyourcircuitwithonlytheLEDsconnected,justtomakesureitworks.Figure5-109showsthebreadboardedcircuitbeforethemotorispluggedin.Thenaddthemotorbypluggingitswiresintothebreadboard,whereyou’llmakeconnectionwiththeoutputs(pins3)ofthetimers.SeeFigure5-110.
Figure5-109.Totestthecontrolcircuitforerrors,fourLEDsshowtheoutputsfromthefour555timers.Thelooseyellowwireattherighthandsideconnectstopin2ofthefirsttimer.Touchthefreeendofthiswiretothepositivesideofthepowersupplytoresetthetimers,andthen,ifnecessary,
makeabriefnegativeconnectionwiththefreeendofthewiretorestarttheirsequence.
Figure5-110.Afterthecircuithasbeentested,themotorcanbeaddedbyhookingitscontrolwirestotheoutputsofthefour555timers.
Applypower,andyoushouldseethemotorturninginsteps,insequencewiththeLEDs.IftheLEDsequenceisn’tstable:1.Connectawiredirectlyfromtheinput(pin2)ofthetopmosttimertothepositivesideofthevoltagesupply,andwaitforthetimerstocalmdown.
2.Restartthesequencebydisconnectingthefreeendofthiswire,or(ifnecessary)touchthefreeendofitbrieflytothenegativesideofthesupply,totriggerthefirsttimer.
3.Ifyouhavetroublegettingthemotortorespondatall,trydisconnectingtheLEDsshowninFigure5-108.Alternatively,trydrivingthefourpolesofthemotordirectlyfromthefouroutputsofthetimers,insteadofthrough1Kresistors.Toverifythatthisisnotoverloadingthetimers,substituteamuchhighervaluetimingresistorforthe8K2resistor,toslowthefirsttimertoa5-secondpulse,andinsertyourmeter,settomeasuremA,betweenpin3ofthistimerandtheloadthatitisdriving.The
![Page 231: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/231.jpg)
maximumcurrentmustnotexceed200mA.Onethingyoumayhavenoticed,ifyou’repayingverycloseattention:thecommonterminalofthemotorisconnectedtopositive.Therefore,wheneachtimerflashespositive,thatpositivesignalisn’tactuallypoweringthemotor.Thelowoutputsfromthethreetimersthatarenotfiringatanygivenmomentaresinkingcurrentfromthemotor.Itseemsquitehappywiththisarrangement.You’llneedsometheorytounderstandwhy.
THEORYInsideasteppermotorIfyouchecktheWikipediaentryforsteppermotors,youmayseeaverynice3Drenderingshowingatoothedrotorandfourcoilsarrayedaroundit.Maybesteppermotorsusedtobemanufacturedlikethisonceuponatime,butnotanymore.Imaginetwohorizontalrowsofcoils.Inthespacebetweenthemisaseriesoflittlemagnets,likeafreighttrain,thatcanmoveleftorright,asshowninFigures5-111and5-112.Eachcoilhastwowindings,inoppositedirections,sothatcurrentthroughonewindingwillcreateanupwardmagneticforcewhilecurrentthroughtheotherwillcreateadownwardforce.Eachrowofwindingsisconnectedinparallel,sothattheyswitchonandoffsimultaneously.
Figure5-111.Thissequenceshowsthefirsttwostepsastherotorofasteppermotor(shownasaseriesofnorth-southmagnets)movesinresponsetopulsesthroughelectromagnets.
Figure5-112.Aftertakinganothertwosteps,themotorwillbebackwhereitstartedatStep1inFigure5-111.
InStep1,thenegativeconnectionenergizestheupperwindingsoftheuppercoils,whichcreatesanupwardmagneticforce.I’veshownthisforceusingblue-greenarrowssothatyouwon’tmistakeitforaflowofelectricity.Itsohappensthatthisforceattractsthenorthpolesofthemagnetsandrepelsthesouthpoles,soifthemagnetsbegininthepositionshowninStep1,theywillwanttomoveonesteptotheright.ThisbringsthemtothepositionshowninStep2.Nowtheupperwindingsofthelowercoilsareenergized,andagain,thisproducesanupwardforce,whichagainattractsthenorthpolesandrepelsthesouthpoles.ThisadvancesthemagnetstotheirlocationinStep3.Nowthelowerwindingsoftheuppercoilsareenergized,producingadownwardforce.Thisrepelsthenorthpolesofthemagnetsandattractstheirsouthpoles.Sothemagnetskeepmoving.TheyreachthepositionshowninStep4.Thelowerwindingsofthelowercoilsareenergized,producingadownwardforcewhichcontinuestoattractthesouthpoleswhilerepellingthenorthpoles.Sothemagnetsmoveafinalsteptotheright—whichleavestheminthesameorientationshowninStep1.Andtheprocesscanrepeatalloveragain.
THEORYInsideasteppermotor(continued)Inreality,themagnetsarenotseparatefromeachother.Theedgeofarotorismagnetizedinzonesthatalternatebetweensouthandnorthpolarity.Andinsteadofmultiplecoils,therearejustfourwindingsthatgoaroundallthemagneticcores.Buttheprincipleisexactlythesame.The3Drenderinggivesageneralidea,andthephotographshowswhatIfoundwhenIcrackedopenatypicalsteppermotor.Nowbearinmindthatwhenthisdeviceisdrivenbyasetof555timers,wedon’tjustconnectnegativetoonewireatatimeontheleft,leavingtheothersfloating.Inreality,atanygivenmoment,threeofthetimershaveanegativeoutputandthefourthhasapositiveoutput.ThelastdiagraminFigure5-112showsthissituation.Supposethetopwireispositivewhiletheotherthreearenegative,asshowninFigure5-113.Thepositiveoutputdoesnothing,becauseitisbalancedbythepositivepowerontheotherendofthecoils.Thetwonegativesattachedtothebottomsetofcoilscreateequalandoppositeforcesthatcanceleachotherout(whilewastingsomepower).SothenetresultisthesameasinStep3.Infact,youshouldfindthatyoucandisconnectthecommonwirecompletelywhileusingthesteppermotorwith555timers,andthemotor
![Page 232: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/232.jpg)
willstillturn,becauseoneofthetimersisprovidingpositivepowerwhiletheothersarenegative.Infact,you’llberunningthemmoreefficientlythisway.
Figure5-113.Whenthemotorisdrivenbyfour555timers,theyareactivatingitbysinkingpositivevoltagefromit.Theinteriorworkingsofthemotorlooksomethinglikethis.It’snotthemostefficientwaytodothejob.
Figures5-114and5-115mayhelptogiveyouaclearerideaofwhatthemotoractuallylookslikeinside.
Figure5-114.This3Drenderinggivesabetterideaofwhatatypicalsteppermotorlookslikeinside.Thecoppercoilsandgraycylindersarestationary,whiletheblackdiscrotatesbetweenthem.
Figure5-115.Whenasteppermotorisbrokenopen,thisiswhatyou’relikelytofind.Ontheleft,therotorofthemotor,whichhasamagnetizedbandarounditscircumference,isstillattachedtothelowerhalfofthecasing.Ontheright,theupperhalfofthecasinghasbeenopened,andthecoilhasbeenremoved(actuallythewindingyoucanseeconsistsoftwocoils,woundinoppositedirections).Thespikesarethemagneticcoresthat
exertforceontherotor.
SpeedControlIfyouareatrulyexceptionallyobservant,youmayhavenoticedthatIleftpin5ofeachofthetimersunconnectedintheschematicfordrivingthesteppermotorinFigure5-108.Normally,pin5shouldbegroundedthroughacapacitortopreventitfrompickingupstrayvoltageswhichcanaffecttheaccuracyofthechip.IleftthepinsunconnectedbecauseIhadaplanforthem.Infact,changingthetimingofthechipisexactlywhatwewanttodonow,asawaytochangethespeedofthesteppermotor.Ifyoutiepin5ofallfourtimerstogether,asshowninFigure5-116,andputa2Ktrimmerpotentiometer(showninFigure5-117)betweenthemandthenegativesideofthepowersupply,you’llfindthatasyouturnthetrimmertoreduceitsresistance,thetimersstarttorunfaster.Figure5-118showsthebreadboardlayout.Eventually,whentheresistancegoesbelowaround150ohms,everythingstops.TheLEDsgodark,becauseyou’vereducedthevoltageonpin5belowthethresholdlevelthatthe555timerfindsacceptable.
![Page 233: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/233.jpg)
Figure5-116.Toadjustthespeedofthesequenceof555timers,theircontrolpins(pin5oneachtimer)arelinkedtogetherandattachedtoatrimmerpotentiometerthatadjuststheresistancebetweenthepinsandthenegativesideofthepowersupply.
Figure5-117.Close-upofatrimmerpotentiometerwithpinsspacedat1/10inchforinsertioninabreadboardorperforatedboard.Thebrassscrew,attop-left,turnsawormgearinsidetheunit,allowingpreciseadjustmentofinternalresistance.
Figure5-118.Thetrimmerpotentiometerhasbeenaddedtothecircuit,allowingmotorspeedcontrol.
InitiallyIsuggestedasteptimeof1/4secondjustsothatyoucouldseewhatwashappening.Whenyou’reactuallyusingthiscircuit,you’llneverneedittorunasslowlyasthat.Soyoucanincreasetheentirerangeofspeeds.Removethe22μFtimingcapacitorsandsubstitute,say,4.7μFcapacitors,orsmaller.Nowwhenyouadjustthepotentiometer,you’llgetausefulrangeofspeed.
AddingAutonomyCurrently,thecircuitsimplydoeswhatyoutellittodo.Thenextstepistomakeitautonomous—inotherwords,giveittheillusionofmakingupitsownmind.I’mthinkingthatinsteadofatrimmerpotentiometer,wecouldsubstituteaphotocell,properlyknownasaphotoresistor.Typically,theresistanceofacadmiumsulfidephotoresistorishighestinthedark,andlowestwhenlightshinesonit.Oneproblemwithphotoresistorsisthatthey’renotaswidelyavailableasmanyothertypesofelectroniccomponents.IfyousearchMouser.com,forinstance,you’llfindvirtuallynothing.PartlythisisbecausetheonlinesearchfunctionatMouseristheweakestfeatureofthesite,andpartlyit’sbecauseMouserisnotorientedtowardhobbyists.Whatyouneedtodoisconducta“productsearch.”Gotohttp://www.google.com/products,enterthesearchterms“CdS”and“photocell,”andyou’llfindabunchofcheapcadmiumsulfidecomponentsfromplacesyoumayneverhaveheardof.BecausephotoresistorsseemtocomeandgoaserraticallyasDCmotors,Iamnotofferinganypartnumbers.Youcanbuyanyproductthathasanappropriateminimumresistance(inbrightlight)andmaximumresistance(inthedark).Ifyoufindacomponentthatrangesfrom500to3,000Ω,thatwouldbeagoodchoice.Iftheonlyonesyoucanfindhaveahigherminimumthan500Ω,youcouldconsiderputtingacoupleoftheminparallel.
SettingUpYourLightSeekingRobotWhywouldyouwanttocontrolthespeedofasteppermotorbyusingaphotoresistor?Becausetheoriginalobjectivewastobuildarobotthatisattractedtolight.Theideaissimpleenough:usetwosteppermotors,eachcontrollingthespeedofonewheelofthecart.Usetwophotoresistors,eachcontrollingthespeedoftheoppositesteppermotor.Whentherighthandphotoresistorpicksupmorelight,itsresistancelowers,causingthelefthandsetoftimerstorunfaster,whichwillmakethelefthandwheelrunfaster.Thus,thecartwillturntowardthelight.Figure5-119illustratestheconcept.
![Page 234: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/234.jpg)
Figure5-119.Iftwophotoresistorscontrolthespeedoftwo555-timerarrays,thedifferenceinspeedbetweenonewheelandtheothercanturnthecarttowardalightsource.
Beforeyoustartwiringmore555timers,though,youmightconsiderdoingthejobwithamoreappropriatecomponent.TheULN2001AandULN2003AarechipscontainingDarlingtonamplifiersspecificallydesignedtodelivercurrenttoinductiveloadssuchassolenoids,relays,and(youguessedit)motors.Eachchiphasseveninputsthatrequireverylittlecurrent,andsevenoutputsthatcandeliver500mAeach.TheinputsareTTLandCMOScompatible(the2001Ahasawidertoleranceforvoltagesthanthe2003A)andeachchannelofthechipfunctionsasaninverter,sothatwhentheinputgoeshigh,theoutputgoeslowandsinkscurrent.Thisisofcoursejustwhatweneedforoursteppermotorthathasacommonpositiveconnection.TheULN2001Aisonlyanamplificationdevice,soyouhavetoprecedeitwithacounterthatrunsfrom1to4andthenrepeats.Youcanstickwithyour555timers,asyou’vealreadyassembledthem,orsubstitutealmostanyCMOSoctalordecadecounterthatsendsitsoutputpulsestoaseriesofpins.Justusetheoutputfromthefifthpinasthe“carry”outputtorestartthecountingsequence.IsuggestaCMOScountersimplybecauseitwillrunon12volts,soyoucanusethesamepowersupplythatsuitsyoursteppermotors.IfyouswitchtoCMOScounters,youwillstillneedapairof555timerssendingpulsestothecounters.Thetimerswillbefree-runninginastablemode,andyourphotoresistorswillcontroltheirspeed.Figure5-120showstheconfiguration.
Figure5-120.Amoreefficientwaytodrivethemotorsistousejustonetimertosetthespeedofeach,withacounterandamplifier(suchasaDarlingtonarraychip)sendingthepulsesdownthewires.Theprincipleisstillthesame,though.
Onelastitem:you’llneeda12-voltbattery.YoucanofcourseputeightAAcellstogether,butIthinkyoushouldconsiderarechargeablepackfromasourcesuchashttp://www.all-battery.com,whichhasasectionentirelydevotedto“robotbatteries.”Ifyouputitalltogether,youshouldfindthatwhenyouplaceyourrobotcartinaverydimlylitroom,itwillturntowardthebeamfromabright,well-focusedflashlight.Togetreliableresults,youmayhavetorecesseachofthephotoresistorsinlittletubes,sothattheyreceivemuchmorelightwhentheyfaceyourflashlightthanwhentheyfaceawayfromit.Figure5-121isa3Drenderingoftheconcept.
Figure5-121.This3Drenderingshowsapossibleconfigurationofthelight-seekingcart,withtwophotoresistorsenclosedinsmalltubestorestricttheirresponsetolight.
Anotherideaistorewireyourcartsothatitactuallyrunsawayfromthelight.Canyouimaginehowthismightbedone?Justonemorethought:ifyouuseinfraredphotoresistors,youcancontrolyourcartwithbeamsfrominfraredLEDs,innormalroomlighting.Ifyouandacoupleoffriendsallhaveinfraredtransmitters,youcangetyourcarttorunfromoneofyoutothenext,likeanobedientdog.ThistakesusaboutasfarasI’mgoingtogointorobotics.Iurgeyoutocheckoutthesitesonlineifyouwanttopursuethetopicfurther.Youcanalsobuyawidevarietyofrobotkits,althoughofcourseIfeelthatit’smorefuntoinventordevelopthingsforyourself.Allthat’sleftnowistoperformonelastintroduction:toadevicethatshouldmakeyourlifemucheasier,eventhoughthedeviceismuchmorecomplicatedthananythingwehavedealtwithsofar.
![Page 235: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/235.jpg)
Experiment34:HardwareMeetsSoftwareThroughoutthisbook,inaccordancewiththegoaloflearningbydiscovery,Ihaveaskedyoutodoanexperimentfirst,afterwhichI’vesuggestedthegeneralprinciplesandideasthatwecanlearnfromit.Inowhavetochangethatpolicy,becausethenextexperimentinvolvessomuchsetupthatit’sonlyfairtotellyouwhattoexpectbeforeyoubeginthepreparations.Weareabouttoentertherealmofcontrollerchips,oftenknownasMCUs,whichisanacronymformicrocontrollerunit.AnMCUcontainssomeflashmemory,whichstoresaprogramthatyouwriteyourself.Theflashmemoryislikethememoryinaportablemediaplayer,orthememorycardthatyouuseinadigitalcamera.Itneedsnoelectricitytopowerit.Inaddition,thechiphasaprocessorwhichcarriesouttheinstructionsinyourprogram.IthasRAMtostorethevaluesofvariablesonatemporarybasis,andROM,whichtellsithowtoperformtaskssuchassensingavaryingvoltageinputandconvertingitintodigitalformforinternaluse.Italsocontainsanaccurateoscillator,sothatitcankeeptrackoftime.Putitalltogether,andit’satinycomputerthatyoucanbuyforunder$5.Let’ssupposethatyouhaveagreenhousewherethetemperaturemustneverfallbelowfreezing.Yousetupatemperaturesensor,andyouhavetwodifferentheaters.Youwanttoswitchonthefirstheaterifthetemperaturefallsbelow38°Fahrenheit.Butif,forsomereason,thatheaterisbroken,youwanttoswitchonthesecond,backupheaterwhenthetemperaturegoesbelow36°Fahrenheit.ProgrammingaMCUtotakecareofthiscanbeverysimpleindeed.Youcouldevenaddextrafeatures,suchasasecondtemperaturesensor,justincasethefirstonefails,andyoucouldtellthechiptousewhicheversensorgivesalowerreading.AnotherapplicationforaMCUwouldbeinafairlyelaboratesecuritysystem.Thechipcouldmonitorthestatusofvariousintrusionsensors,andcantakevariouspreprogrammedsteps,dependingonthesensors’status.Youcouldincludedelayintervals,too.ManyMCUshaveadditionalusefulfeaturesbuiltin,suchastheabilitytocontrolservomotorsthatturntoaspecificangleinresponsetoastreamofpulses.Servosarewidelyusedinradio-controlledmodelboats,airplanes,andhobbyrobotics.Perhapsyouarenowwonderingwhy,ifMCUscandoallthis,haven’twebeenusingthemallalong?WhydidIspendsomuchtimedescribingthedevelopmentofanalarmsystemusingdiscretecomponents,ifonechipcouldhavedoneeverything?Therearethreeanswers:1.MCUscannotdoeverything.Theyneedothercomponentstohelptheminteractwiththeworld,suchastransistors,relays,sensors,andamplifiers.Youneedtoknowhowthosethingswork,sothatyoucanmakeintelligentuseofthem.
2.MCUscanintroducetheirownkindsofproblemsanderrors,associatedwithusingsoftwareinadditiontohardware.I’llhavemoretosayaboutthislater.
3.MCUshavelimitsandrestrictions,mostobviouslytheirrequirementfora5-voltregulatedpowersupply,andtheirinabilitytosourceorsinkmuchcurrentfromeachpin.Theyalsodemandthatyoulearnaprogramminglanguage(whichdiffersfromonebrandofMCUtothenext).Andtogettheprogramintothechip,youhavetobeabletoplugitintoacomputeranddoadownload,whichisnotalwaysconvenient.
Inthisexperiment,you’lllearnhowtowriteaprogramforasmallandsimpleMCU,andyou’lltransfertheprogramintoitandseehowitworks.
BACKGROUNDOriginsofprogrammablechipsInfactoriesandlaboratories,manyproceduresarerepetitive.Aflowsensormayhavetocontrolaheatingelement.Amotionsensormayhavetoadjustthespeedofamotor.Microcontrollersareperfectforthiskindofroutinetask.AcompanynamedGeneralInstrumentintroducedanearlylineofMCUsin1976,andcalledthemPICs,meaningProgrammableIntelligentComputer—orProgrammableInterfaceController,dependingwhichsourceyoubelieve.GeneralInstrumentsoldthebrandtoanothercompanynamedMicrochipTechnology,whichownsittoday.“PIC”istrademarked,butissometimesusedasifit’sagenericterm,likeScotchtape.Inthisbook,I’vechosenarangeofcontrollersbasedonthePICarchitecture.TheyarelicensedbyaBritishcompanynamedRevolutionEducationLtd.,whichcallsitsrangeofchipsthePICAXE,fornoapparentlogicalreasonotherthanthatitsoundscool.Ilikethesemicrocontrollersbecausetheyweredevelopedoriginallyasaneducationaltoolandbecausetheyareveryeasytouse.They’recheap,andsomeofthemarequitepowerful.Despitetheiroddname,Ithinkthey’rethebestwaytogetacquaintedwiththecoreconceptsofMCUs.AfteryouplaywiththePICAXE,ifyouwanttogofartherintoMCUs,IsuggesttheBASICStamp(whichusesaverysimilarlanguage,butwithadditionalpowerfulcommands)andtheverypopularArduino(whichisamorerecentdesign,packedwithpowerfulfeatures,butrequiresyoutolearnavariantofClanguagetoprogramit).I’llsaymoreaboutthesechipslater.Ifyousearchfor“picaxe”onWikipedia,you’llfindanexcellentintroductiontoallthevariousfeatures.Infact,Ithinkit’sacleareroverviewthanyou’llgetfromthePICAXEwebsite.
SuppliesThePICAXE08Mwasthelowest-pricechipintherangeformanyyears,butwassupercededmorerecentlybythe08M2,whichwasamajorupgrade.The08Misstillbeingsoldfrommanysuppliers,andthestepsdescribedinthischapterwillworkifyouhavethatversion.Butifyoubuythenewer08M2,thatshouldworktoo,andwillallowyoutotacklemoreambitiousprojectsinthefuture.Figure5-122showsthefeaturesofthetwochipsasspecifiedbythevendor,whileFigure5-123showsacloseupofthe08Mwithitslegssafelyembeddedinapieceofconductivefoam.
![Page 236: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/236.jpg)
Figure5-122.ApagefromthePICAXEcataloglistsonlysomeofthechipsthatareavailable.Whatbeganasaneducationalaidhasbecomeausefulprototypingtool.
IntheUnitedStates,therearethreedistributorsofthischip:
http://www.advancedmicrocircuits.comhttp://www.phanderson.com/picaxehttp://www.sparkfun.com
IlikeP.H.Andersonforitsgrass-rootshobbyistapproach,andtheyhavegoodpricesifyouwanttobuymultiplechips.ButSparkFunElectronicsoffersotherassociatedproductsthatyoumayfindinteresting.Allthedistributorswillwanttosellyou“starterkits,”suchastheoneinFigure5-124,perhapsbecausethePICAXEitselfissocheapthatitdoesn’toffermuchofaprofitmargin.Still,forourpurposes,youshouldbuythechipasastandaloneitem.Andbuytwoofthem,justincaseyoudamageone(forexample,byconnectingvoltagetoitincorrectly).
Figure5-123.WhensuppliedbyoneofitsAmericandistributors,aPICAXE08Marrivesembeddedinalittlesquareofconductivefoam.Thechipisthesamesizeasa555timerbuthasthepowerofatinycomputer.
Figure5-124.AtypicalPICAXEkitincludesaprintedcircuitboard,whichyoumaynotreallyneed,andsomeothernot-entirely-essentialitems.Butthe3.5-mmstereojacksocket(top,center)isabsolutelynecessary.
Todownloadyourprogramminginstructionsintothechip,firstyou’lltypetheinstructionsonacomputer,andthenyou’llfeedthemthroughacableintothePICAXEmemory.Soyou’llneedtobuyacable,andyou’llneedsoftwaretohelpyoutowritetheprogram.YoucanusethePICAXEwithaserialcable,butIdon’trecommendit.TheoldRS-232serialcommunicationsstandardonPCsisprettymuchobsolete,andPICAXEhasrecognizedthisbyofferingaUSBcable(whichcontainsaserialconverterinsideitsplug).TheUSBcableisalittlemoreexpensive,butisalsosimplerandcompatiblewithApplecomputers.FromanyoftheU.S.distributors,buyUSBcablepartAXE027,alsosoldaspartPGM-08312byhttp://www.sparkfun.com(quantity:1).ThecableisshowninFigure5-125.
Figure5-125.TheUSBdownloadcablemadeforusewiththePICAXEterminatesina3.5-mmaudioplug.Thisshouldnotbeinsertedinanyaudio
![Page 237: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/237.jpg)
device.Itestablishesaserialconnectionwithacomputer,allowingprogramcodetobedownloadedintothechip.
Towriteyoursoftwareandsenditdownthewiretothechip,thePICAXEProgrammingEditoristhetoolofchoice.ItcomesinonlyaWindowsversion.ForthosewhopreferMacOSorLinux,youcangetafreedownloadofanotherpieceofsoftwareknownasAXEpad,whichhasfewerfeatures,butwilldothejob.Allthedownloadablesoftwareisfreelyavailablefromhttp://www.rev-ed.co.uk/picaxe/software.htm.Finally,youneeda3.5-mmstereoaudiosocketwithsolderconnections.ThereasonforthisisthatthemanufacturersofthePICAXEhaveusedastereoaudioplugonthefreeendoftheirUSBcable,andyouhavetobeabletoplugitintosomething.ThePICAXEbreadboardadapter,SparkFunstocknumberDEV-08331,containsthenecessarystereosocketinadditiontoafewotherlittleitems.Quantity:1.SeeFigure5-126.
Figure5-126.Closeupofthe3.5-mmstereosocketthatisusedwiththeUSBdownloadcable.
Oddlyenough,theUSBcableisthemostexpensiveitemonthelist,becauseoftheelectronicshiddeninsideit.
SoftwareInstallationandSetupNowyouhavetogothroughasetupprocedure.Thereisnowayaroundthis.Hereiswhatyouwillbedoing:1.InstalladriversothatyourcomputerwillrecognizethespecialUSBcable.2.InstalltheProgrammingEditorsoftware(orAXEpadforMac/Linux)sothatyourcomputerwillhelpyoutowriteprogramsandthendownloadthemintothechip.
3.MountthePICAXEonyourbreadboardandaddthesockettoreceivedownloads.Thesestepsareexplainedinthefollowingsections.
TheUSBdriverFairwarning:IfyougotothePICAXEwebsiteandtrytouseitssearchfunction,itprobablywon’tfindwhatyouwant.Searchfor“USBDriver,”forinstance,anditwillpretendithasneverheardofsuchathing.ThePICAXEhomepagealsohasirritatingdrop-downmenusthattendtodisappearjustwhenyou’reabouttoclickonthem,butatthetimeofwriting,youcanbypasstheseissuesbygoingstraighttotheSoftwareDownloadssectionathttp://www.rev-ed.co.uk/picaxe/software.htm.ScrolldownpastallthesoftwareuntilyougettoAdditionalResources.LookfortheAXE027PICAXEUSBDownloadCable.Atfirstglance,itlooksasiftheywanttosellyouacable,butinfactthisisthelistofdrivers.Double-clicktheoneappropriatetoyourcomputer,andchooseadestinationonyourcomputerforthedownload—aplacewhereyouwillfinditeasily,suchasyourdesktop.
BecarefulnottodownloadthedriverfortheUSB010USB-Serialadapterbymistake.TheUSB-Serialadapterissomethingelseentirely.
Thedownloadwillleaveyouwithazippedfilefolder.Youwillhavetounzipit.OnWindowsXP,right-clickthefolderandchoose“Extractall.”ViewtheextractedfilesandyouwillfindaPDFinstallationguide.LinuxandMacuserscanfindinstructionscurrentlystashedathttp://www.rev-ed.co.uk/docs/AXE027.pdf.WheninstallingthedriveronaWindowsplatform,hereareafewtipstominimizeyourexasperationlevel:1.Remember,thespecialUSBcablecontainssomeelectronics.Itisnotjustacable,butadevicedesignedforinteractingwithaPICAXEchip.Don’ttrytouseitforanythingelse!
2.YouhavetoplugthecableintoaUSBportbeforeyouinstallthedriver,becauseyourcomputerwillneedtoverifythatthedrivermatchesthecable.
3.YoumustnotattachthePICAXEtotheotherendofthecableuntilafteryouhaveinstalledthedriver.4.EveryUSBportonyourcomputerhasaseparateidentity.Whicheveroneyouchoosewhenyoufirstpluginthecable,youshouldusethatporteverytimeinthefuture.Otherwise,youwillhavetorepeattheprocessoftellingyourcomputerwhatthecableis.
5.BearinginmindTip#4,youshouldavoidusingthecableinastandaloneUSBhub.6.ThecableisfoolingthePICAXEintothinkingthatit’stalkingtoaserialportonyourcomputer.Those“communication”portsareknownasCOM1,COM2,COM3,orCOM4.Whenyouinstallthedriver,theinstallerwillchooseoneofthoseCOMportsforyou,andlateryouwillhavetoknowwhichoneitis.ThePDFguideshouldhelpyouthroughthisprocedure.Unfortunately,youcannotskipit.
TheProgrammingEditorsoftwareIfyouhavecomethisfar,you’rereadyforthenextbigstep,whichismucheasier.YouneedthePICAXEProgrammingEditor,availableforfreeontheSoftwareDownloadswebpagewhereyoufoundtheUSBdriver.(IfyouareusingaMacorLinux,youwillneedAXEpad,whichisonthesamewebpage.)DownloadingandinstallingtheProgrammingEditorshouldbesimpleandpainless.Onceyouhavedonethat,youshouldfindthatithasplacedashortcutonyourdesktop.Double-clickit,gotoView→Options,andinthewindowthatopens(showninFigure5-127),clicktheSerialPorttab.YoushouldseeadialogboxliketheoneinFigure5-128.NowmakesurethattheProgrammingEditorislookingatthesameCOMportthatwaschosenbytheUSBdriver.Otherwise,theProgrammingEditorwon’tknowwheretofindyourPICAXEchip.IntheProgrammingEditor,gotoView→OptionsandclicktheModetab,thenclickthebuttontoselectthe08Mchip.
![Page 238: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/238.jpg)
Figure5-127.ThisscreenshotshowstheoptionswindowofthePICAXEProgramEditor,whichyoumustusetoselectthetypeofchipthatyouintendtoprogram(inourcase,the08M).
Figure5-128.Anotherscreenshotoftheoptionswindowshowsthesecondessentialchoicethatyoumustmake:selectionoftheCOMportthattheinstallerchoseonyourcomputer.
Arewehavingfunyet?Obviouslynot,butyou’rethroughwithsoftwarehasslesforthetimebeing.Thelaststepbeforeyou’rereadytousethePICAXEistomountit,anditssocket,onyourbreadboard.
SettingupthehardwareThePICAXE08Mlookslikea555timer.(OtherchipsinthePICAXErangehavemorepinsandmorefeatures.)Itrequiresaproperlyregulated5volts,justlikethelogicchipsyoudealtwithpreviously.Infact,thePICAXEpeopleareratheremphaticaboutprotectingitfromvoltagespikes.Theywantyoutousetwocapacitors(one100μF,one0.1μF)oneithersideofanLM7805regulator.Thisseemslikeoverkill,butthePICAXEismoreinconvenienttoreplacethana555timer.Youcertainlycan’trundowntoRadioShacktobuyone.Solet’sdowhatthemanufacturersays,justincase,andsetupabreadboardasshowninFigures5-129and5-130.
Figure5-129.PICAXEdocumentationspecifiesa100μFand0.1μFcapacitorontheinputsideofa5-voltregulator,andasimilarpairofcapacitorsonitsoutputside.Onabreadboard,theycanbearrayedlikethis.
Figure5-130.Theactualcomponentsforpowerregulation,appliedtoabreadboard,delivering5volts(positiveandnegative)downeachside.
Nowforthechipitself.Notethatthepinsforpositiveandnegativepowerareexactlyoppositetothoseforthe555timer,sobecareful!SetupyourbreadboardfollowingtheschematicshowninFigure5-131.NotethatIamshowingthestereosocketonitsunderside,becauseIthinkthat’showyou’llhavetouseitwiththebreadboard.Ifyoutrytostickitspinsintotheholesintheboard,theywillfit,butwhenyouinserttheplugintothesocket,thethicknessoftheplugwilltendtoraisethesocketupsothatitlosescontact.Ireallythinkthewaytogoistosolderwirestothepinsonthesocketandpushthewiresintothebreadboard.SeeFigure5-133.
![Page 239: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/239.jpg)
Figure5-131.TheschematicofatestcircuitforthePICAXE08Mshowstheundersideofthestereosocket,theessential10Kand22Kresistorsontheinputpin,andanLEDtoshowanoutputfromthechip.
BeawarethatthePICAXEmanualshowsthingsdifferently(althoughIhaveretainedtheirlabelingconventionforthepartsofthesocketandthepartsoftheplug,identifiedasa,b,andc).OnelittledetailaboutthesocketthatiscommonlysuppliedforusewiththePICAXE:typicallyithastwopairsofcontactsfortheconnectionslabeledbandcinthemanual,andinmydiagram.Whenyousolderaconnection,yoursolderjointshouldincludebothofthecontactsineachpair,asshowninFigure5-132.RememberthatthePICAXEmusthave5voltsDC,andrememberthatyourvoltageregularwilldeliverthisvoltagereliablyonlyifyougiveitextravoltageonitsinputside.Ifyouprovideitwith9volts,thatwillprovideagoodamountofheadroom.The22Kand10Kresistorsareessentialforusingthechip;seethefollowingwarningnoteforanexplanation.MyschematicalsoincludesanLEDanda330Ωresistor,buttheyareneededonlyforthetestthatwe’llbemakingmomentarily.
Pin2Pull-DownAlwaysincludethe22Kresistorandthe10KresistorintheconfigurationshowninFigure5-131.Theseresistorsapplycorrectvoltagetotheserialconnection,andwhenyou’reusingthePICAXEonitsown,theypulldownthevoltageonpin2.Ifpin2isleftunconnected(floating),itmaypickuprandomvoltages,whichthechipcanmisinterpretasanewprogramorotherinstructions,withunpredictableandundesirableresults.The22Kand10KresistorsshouldberegardedaspermanentitemsaccompanyingyourPICAXEregardlessofwhetheryouhaveitattachedtoyourcomputer.
Figure5-132.Correctwiringofthesocketisessential.Whensolderingwirestothelowerterminals,makesurethatyouattachthewirestobothoftheterminalsineachpair.
Figure5-133.Thebreadboardversionofthetestschematic,withtheplugoftheUSBdownloadcableinsertedinthesocketontheboard.ThePICAXEchipcannowreceiveadownloadedprogram,andwillimmediatelystarttoexecuteit.
VerifyingtheConnectionFollowthesestepscarefullyeverytimeyouwanttoprogramorreprogramyourPICAXEchip:1.InserttheUSBplugofyourPICAXEcableintothesameUSBportthatyouusedbefore.2.StarttheProgrammingEditor(orAXEpadifyouareusingaMacOSorLinux).3.IntheProgrammingEditor,selectView→OptionstoverifythattheeditorisusingtherightCOMportandisexpectingthe08MPICAXEchip.
4.PlugthestereoplugonthefreeendoftheUSBcableintothestereosocketthatisnowwiredintoyourbreadboard.SeeFigures5-133and5-134.
![Page 240: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/240.jpg)
Figure5-134.Aftertheprogramhasbeendownloaded,theplugcanberemoved,andtheprogramwillcontinuetorun,causingtheLEDtocontinueflashing.
5.Checkyourwiring,andthenconnectyourpowersupplytothebreadboard.6.Clickthebuttonlabeled“program”intheProgramEditorwindowtotellthesoftwaretolookforthePICAXE.
WhatIfItDoesn’tWork?ThefirstthingtodoispullouttheplugoftheUSBcablefromthePICAXEbreadboard,leavingtheotherendofthecableattachedtoyourcomputer.SetyourmultimetertomeasureDCvolts,andattachitsprobestosectionsbandcoftheplug.SeeFigure5-135.Nowclickthe“program”buttonagain,andyourmetershouldshow5voltsbrieflycomingoutofyourcomputertotheplugontheendofthecable.Ifyoudetectthevoltage,thesoftwareisinstalledandworkingproperly.Inthatcase,there’saproblemonyourbreadboard,eitherinthechiporinthewiringaroundit.
Figure5-135.ThestereoplugontheendoftheUSBdownloadcablecanbeusedforfaulttracing.AmultimetersettomeasureDCvoltscanbeattachedtosectionsbandcoftheplugtoestablishwhethertheProgrammingEditorissendingdatathroughtheserialconnection.
Ifyoucannotdetectanyvoltage,thesoftwareprobablywasn’tinstalledproperly,orislookingforthewrongserialport.Tryuninstallingitandreinstallingit.
YourFirstProgramFinallyyou’rereadytocreateyourfirstprogram.TypethefollowingcodeintotheProgrammingEditorwindow:
main:high1pause1000low1pause1000gotomain
Besuretoincludethecolonaftertheword“main”onthefirstline.SeeFigure5-136forascreenshot.TheindentsarecreatedbypressingtheTabkey.Theironlypurposeistomakeprogramlistingsmorelegible.Thesoftwareignoresthem.
Figure5-136.ThisscreenshotshowsthefirsttestprogramasitshouldbedisplayedbytheProgrammingEditor(onaWindowscomputer).
ClicktheProgrambuttonintheProgrammingEditortodownloadthisprogramintothechip.Assoonasthedownloadiscomplete,thechipshouldstartflashingtheLED,lightingitfor1secondandthenswitchingitofffor1second.Figure5-137showsthestepsthatyoushouldhavefollowedtoprogramthechip.
![Page 241: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/241.jpg)
Figure5-137.FourstepstocreateandrunaprogramonthePICAXEcontrollerchip.
Nowfortheinterestingpart:disconnecttheUSBcablefromthebreadboard.Thechipshouldcontinueflashing.Disconnectthepowersupplyfromthebreadboardandwaitaminuteortwoforthecapacitorstolosetheircharge.Reconnectthepower,andthechipwillstartflashingagain.Theprogramthatyoudownloadedtothechipwillremaininthememoryinsidethechipandwillbeginrunningeverytimepowerisappliedtothechip.
DecodingtheCodeLet’stakealookatthelittleprogramthatyoutypedin.Thefirstlineidentifiesasectionoftheprogram.Thisprogramonlyhasonesection,andwe’recallingit“main.”Anywordwithacolonafteritisthenameofasectionofaprogram:
main:ThesecondlinetellsthechiptosendahighoutputfromLogicPin1:
high1
Theprogramdoesn’tusetheusualpinnumbersonthechip.ItuseswhatIwillcall“logicpinnumbers.”Figure5-138showshowtheyarenumbered.Figure5-139showstheirmultiplefunctions.IhaveputLogicPin0inparenthesesbecauseitsmainpurposeistosenddatatothecomputerthroughtheUSBcable.Itcandodoubledutyasadigitaloutput,butyouhavetodisconnectitfromtheUSBcablefirst.It’seasytoforgettodothis.It’sahasslethatIprefertoavoid.
Thethirdlineoftheprogramtellsthechiptowaitfor1,000milliseconds.Thisofcourseisthesameasonesecond:pause1000
ThefourthlinetellsthechiptochangeLogicPin1backtoitslowstate:low1
Thefifthlinetellsthechiptowaitforanother1,000milliseconds:pause1000
Thelastlinetellsthechiptogobacktothebeginningofthe“main”section:gotomain
Figure5-138.TheconventionalpinnumbersofthePICAXEchipareincompatiblewiththenumberingsystemthatisusedinthePICAXEprogramminglanguage.Tominimizeconfusion,thisguiderefersto“LogicPins”whenusingthenumberingsystemthatisrequiredforprogrammingthechip.
Figure5-139.ManyofthepinsonthePICAXE08Mhavemultiplefunctions,whichcanbeselectedbyappropriateprograminstructions.
![Page 242: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/242.jpg)
EditingWhatifyouwanttochangetheprogram?Noproblem!UsetheProgrammingEditortochangeoneofthelinesintheprogram.Substitute100insteadof1000milliseconds,forinstance.(Thepausecommandcanbefollowedbyanynumberupto65535.)Inyourprogram,don’tuseathousandscommainanyofthenumbersthatyouspecify.PlugtheUSBcableintothebreadboardagain,hittheProgrambuttononthescreen,andthenewversionoftheprogramwillbeautomaticallydownloadedtothechip,overwritingtheoldversion.Whatifyouwanttosavetheprogramforfutureuse?JustgototheFilemenuintheProgrammingEditorandsavetheprogramontoyourcomputer’sharddrive.BecausethePICAXEusesavariantoftheBASICcomputerlanguage,itaddsa.basfilenameextension.
SimulationIfyoumakeasimpletypingerror,theProgrammingEditorwillfinditandstopyoufromdownloadingyourprogram.Itwillleaveyoutofigureouthowtofixthelinethatcontainstheerror.
You’llneedtocheckthesecondpartofthePICAXEdocumentation,whichcontainsalltheprogrammingstatementsandtheircorrectsyntax.Atthetimeofwriting,thisisstoredathttp://www.rev-ed.co.uk/docs/picaxe_manual2.pdf.
Evenifallthestatementsinyourprogramarecorrectlytyped,it’sagoodideatorunasimulationofwhatthey’lldo,beforeyoudownloadthem.Thisiseasilydone:clickthe“simulate”buttononthemenubaroftheProgrammingEditor.Anewwindowwillopen,displayingadiagrammaticviewofthePICAXEchipandshowingyouthestatesofitspins.(Notethatifyouuseveryshortpausecommands,thesimulationwon’trunfastenoughtodisplaythetimeaccurately.)AsimulationscreenshotisshowninFigure5-140.The>>buttonatthebottom-rightcornerofthesimulationwindowwillopenupalistofallthevariablesinyourprogram.Sofar,itdoesn’thaveanyvariables,butitsoonwill.Allthezerosontherighthandsidearebinarynumbers,whichyoucanignorefornow.
Figure5-140.ThisscreenshotshowsthesimulationwindowthatcanbeopenedintheProgramEditortotestprogramcodebeforeitisdownloadedtothechip.Thevaluesofvariablesareshowninthesectionontheright.Thepinstatesareshownontheleft.
LoopsHere’sanotherthingI’dlikeyoutotry.RewriteyourprogramcodeasshownhereanddownloaditontothePICAXE:
main:forb0=1to5high1pause200low1pause200nextwait2gotomain
Notethatb0isletterbfollowedbyazero,notletterbfollowedbyletterO.Theextraindentsonceagainareaddedtomakethelistingeasiertounderstand.Thefourlinesbeginning“high1”andending“pause200”willbeexecutedrepeatedly.It’shelpfultoseethemasablock.Watchthelightandseewhathappens.Itshouldflashfivetimesquickly,thenwaitfortwoseconds,andthenrepeat.Youjustaddedalooptoyourprogram.Youcanusealoopifyouwantsomethingtohappenmorethanonce.b0isknownasavariable.Thinkofitasbeinglikealittle“memorybox”withitsname,b0,onalabelontheoutside.Figure5-141illustratesthisconcept.Thisparticularmemoryboxcancontainanynumberfrom0through255.Theloopbeginsbytellingthecomputertoputnumber1inthebox,thenprocesstheremainingstatements,untiltheword“next”sendstheprocessorbacktothefirstline,atwhichpointitadds1tothecontentsofb0.Ifthevalueofb0is5orless,thelooprepeats.Ifthevalueis6,theloophasrunfivetimes,soit’sover,andthePICAXEskipsdowntothe“wait2”statementafter“next.”SeeFigure5-142foranannotatedversionoftheprogramlisting.
Figure5-141.Tounderstandhowaprogramworks,visualizeavariableasbeinglikea“memorybox”withitsnameontheoutsideandanumberstoredontheinside.
“Wait”isaPICAXEcommandthatismeasuredinwholeseconds,so“wait2”waitsfor2seconds.Then“gotomain”beginsthe
![Page 243: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/243.jpg)
procedurealloveragain.Ifyourflashing-lightdemoworkedoutasplanned,it’stimetotakethenextstepandmakethechipdosomethingmoreuseful.
Figure5-142.Theblueannotationsexplainwhattheprogram,ontheright,istellingthePICAXEtodo.
FUNDAMENTALSBasicPICAXEparametersHerearesomeofthemostusefulparametersofthePICAXE:
ThePICAXErequires5voltsDC,regulated.TheinputsandoutputsofthePICAXEarecompatiblewith5-voltlogicchips.Youcanattachthemdirectly.EachPICAXEpincansinkorsourceupto20mA.Thewholechipcandeliverupto90mA.ThismeansthatyoucanrunLEDsdirectlyfromthepins,orapiezonoisemaker(whichdrawsverylittlecurrent),oratransistor.YoucanuseachipsuchastheULN2001ADarlingtonarray(mentionedinthepreviousexperiment)toamplifytheoutputfromthePICAXEanddrivesomethingsuchasarelayoramotor.Thechipexecuteseachlineofyourprograminabout0.1milliseconds.The08Mchiphasenoughflashmemoryforabout80linesofprogramcode.OtherPICAXEchipshavemorememory.ThePICAXEprovides14variablesnamedb0throughb13.The“b”standsfor“byte,”aseachvariableoccupiesasinglebyte.Eachcanholdavaluerangingfrom0through255.Nonegativeorfractionalvaluesareallowedinvariables.Youalsohave7double-bytevariables,namedw0throughw6.The“w”standsfor“word.”Eachcanholdavaluerangingfrom0through65535.The“b”variablessharethesamememoryspaceasthe“w”variables.Thus:b0andb1usethesamebytesasw0.b2andb3usethesamebytesasw1.b4andb5usethesamebytesasw2.b6andb7usethesamebytesasw3.b8andb9usethesamebytesasw4.b10andb11usethesamebytesasw5.b12andb13usethesamebytesasw6.b14andb15usethesamebytesasw7.
Therefore,ifyouusew0asavariable,donotuseb0orb1.Ifyouuseb6asavariable,donotusew3,andsoon.
VariablevaluesarestoredinRAM,anddisappearwhenthepowerisswitchedoff.Theprogramisstoredinnonvolatilememory,andremainsintactwhenthepowerisoff.Themanufacturer’sspecificationclaimsthatthenonvolatilememoryisrewritableuptoabout100,000times.Ifyouwanttoattachaswitchorpushbuttontoapinanduseitasaninput,youshouldadda10Kpull-downresistorbetweenthepinandthenegativesideofthepowersupplytoholdthepininalowstatewhentheswitchisopen.Figure5-143showshowpull-downresistorsshouldbeusedinconjunctionwithaSPSTswitchorapushbutton.Onthe08Mchip,ifyouapplyavaryingresistancebetweenLogicPins1,2,or4,andthenegativesideofthepowersupply,thechipcanmeasureitand“decide”whattodo.Thisisthe“Analog-DigitalConversion”feature—whichleadstoournextexperiment.
Figure5-143.ThePICAXEcanrespondtothestateofaswitchorbuttonattachedtoanyofitsinput-capablepins.A10Kresistormustbeusedtopulldownthestateofthepinwhenthecontactoftheswitchorbuttonisopen.Otherwise,youmaygetunpredictableresults.
![Page 244: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/244.jpg)
Experiment35:CheckingtheRealWorldOftenwewantamicrocontrollertomeasuresomethingandrespondinanappropriateway.Forinstance,itcanmeasurealowtemperatureandsoundanalarm,asIsuggestedintheexamplethatIgaveearlier.ThePICAXEhasthreeanalog-to-digitalconverters(ADCs)builtin,accessiblevialogicpins1,2,and4,asshowninFigure5-139.Thebestwaytousethemisbyapplyingapotentialsomewherebetween0and5volts.Inthisexperiment,I’llshowyouhowtocalibratetheresponseofthechip.Youwillneed:
Trimmerpotentiometer,2K.Quantity:1.PICAXE08MchipandassociatedUSBcableandsocket.Quantity:1ofeach.
ProcedureTakethesametrimmerpotentiometerthatyouusedinExperiment32andwireitscenterterminaltoLogicPin2ofthePICAXE(whichishardwarepin5).Theothertwoterminalsofthe2Ktrimmergotopositiveandtonegative,respectively.Sodependinghowyousetthetrimmer,thepinofthePICAXEisdirectlyconnectedtopositive(atoneendofthescale),ordirectlyconnectedtonegative(attheotherendofthescale),orsomewhereinbetween.SeeFigure5-144fortherevisedschematic,andFigure5-145foraphotographofthebreadboardedcircuit.
Figure5-144.Thisschematic,drawninalayoutsuitableforbreadboarding,showshowa2KpotentiometercanbeusedtoapplyavaryingvoltagetooneofthepinsofthePICAXEthatiscapableofconvertingananalogsignaltoadigitalvalue.
Figure5-145.Thetrimmerpotentiometeraddedtothepreviouslybreadboardedcircuit.
Nowweneedaprogramtotellthechipwhattodo.UsingtheProgrammingEditor,startanewdocument.Thecodeshouldlooklikethis:
main:readadc2,b0debugb0gotomain
Thecommand“readadc2,b0”means“readtheanaloginputonLogicPin2,convertfromanalogtodigital,andstoretheresultinb0.”Thecommand“debugb0”tellsthechiptogointoprogramdebuggingmode,inwhichitusesitsUSBcabletotelltheProgrammingEditorthevaluesofallthevariableswhiletheprogramisrunning.Thevariablesaredisplayedinadebuggingwindow.Downloadtheprogram,andastheprogramstartstoexecute,thedebuggingwindowshouldopen.Startadjustingthetrimmerwhilelookingatthevalueofb0,andyou’llseeb0changeitsvalue.YoucanmakeatableanddrawagraphshowingtherelationshipbetweentheresistancebetweenLogicPin2andground,andthevalueofb0.Justpullthetrimmeroffthebreadboard,measureitsresistancewithameter,thenincreaseitsresistanceby,say,200Ω,putitbackintothebreadboard,andlookatthevalueofb0again.Thisislaborious,butcalibratingequipmentisalwayslaborious—andinanycase,Idecidedtodoitforyou.ThegraphisshowninFigure5-146.Youcanalsoseetherawdatanumbersinthefollowingtable.IwaspleasedtofindthatthePICAXEgivesaveryprecise,linearresponsetotheinputvoltage.Inotherwords,thegraphisastraightline.
![Page 245: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/245.jpg)
Figure5-146.WhenanADCinputpinishookeduptoa2Kpotentiometer,whichisconnectedacrossthesamevoltagethatpowersthechip,youshouldfindthattheresistancebetweentheinputpinandthenegativesideofthepowersupplygeneratestheseriesofdigitalvaluesshownonthegraph.Note
thatthepotentiometermusthavea2Kvalue,andthepowersupplyisassumedtobeprecisely5volts.
ThistableshowsmeasurementsmadewithPICAXE08Mcontroller.
RESISTANCE(INOHMS)BETWEENTHEADCPINANDTHENEGATIVESUPPLY EQUIVALENTDIGITALVALUE
2000 255
1900 243
1800 230
1700 218
1600 205
1500 192
1400 179
1300 166
1200 154
1100 141
1000 128
900 115
800 102
700 90
600 77
500 64
400 51
300 38
200 26
100 13
0 0
Nowwecanmodifytheprogramtomakeitdosomethingwiththeinformationthatit’stakingin:main:readadc2,b0letw1=5*b0high1pausew1low1pausew1gotomain
Noticewhat’shappeninghere.Firstwegetavalueinb0,andthenonthenextline,wedosomearithmeticwithit.Theasteriskmeans“multiply.”Sothestatementsays,“Takewhatevervalueisinb0,multiplyby5,andtransferittoanothervariable,w1.”Wehavetouseawvariable,becausewhenwemultiplythevalueofb0by5,wemaygetanumberthatisbiggerthan255—toobigtofitintoabytevariable.Finally,wetakevariablew1anduseitwitha“pause”statementinsteadofafixednumbervalue.We’resayingtothePICAXE,“pauseforwhatevernumberofmicrosecondsyougetbycheckingthevalueofw1.”Sothesoftwarechecksavariableresistance,turnsitintoanumber,andappliesthatnumbertoadjusttheflashingspeedoftheLED.Thinkbacktotheneedofthecartpoweredbysteppermotors.Itwassupposedtochecktwophotoresistors,andadjustthespeedofeachmotoraccordingly.Well,thisPICAXEprogramisastepinthatdirection.Itcanmeasurevoltageonapinandchangetheoutputfrequencyonanotherpin.IfyouhadtwoPICAXEchips,youcouldwireeachofthemtoaphotoresistorandamotor.Thenyoucouldadjustthebehaviorofyourcartbyeditingthesecondlineintheprogram,whereitconvertsthevalueofb0tothevalueofw1whichwillbeusedinthe“pause”commandtodeterminethenumberofpulsespersecond.Insteadofmultiplyingby5youcouldmultiplyby7orwhatevernumbergivesyoutheresultyouneed.Thisleadstoanimportantconclusion:abigadvantageofaprogrammablechipisthatyoucanmakeadjustmentsinsoftware.
![Page 246: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/246.jpg)
BecausethePICAXE08MactuallyhasmorethanoneADCinput,andhasthreepinsthatcanbeusedforoutput,youmightwonderwhetheryoucouldusejusttheonechiptocontrolbothmotorsinresponsetoinputsfromtwosensors.Theproblemisthatthethreeoutputpinsonthe08MalsofunctionasthethreeADCinputpins.You’ddobettertobuyoneofthemoreadvancedPICAXEchips,suchasthe18M,whichhasmorepinstochoosefrom.Itusesthesamebasicsetofprogramminginstructions,anddoesn’tcostmuchmoremoney.Also,youshouldreadthePICAXEdocumentationandlookupthe“pwmout”command,whichisshortfor“pulse-widthmodulationoutput,”butyoucanthinkofasmeaning“powermotoroutput.”Thisisspecificallyintendedtorunsteppermotors.Itestablishesanoutputfrequencyofpulsesthatwillcontinuewhilethechipobeysotherinstructionsinitsprogram.
FUNDAMENTALSExtrafeaturesAcompleteguidetothe08Mwouldfillabookofitsown,andofcoursesuchbooksalreadyexist(justsearchthebookssectionofAmazon.comforkeyword“picaxe”).ButI’llfinishmyintroductiontothecontrollerbylistingsomeofitsextracapabilities,leavingyoutolookthemupandexplorethem.ThenI’mgoingtosuggestonelastexperiment.Interrupts
ThePICAXE08Mallowsyoutosetone“interrupt.”Thisfeaturetellsthechiptomakeamentalnotethatifaparticulareventoccurs—suchasaswitchapplyingvoltagetoonepin—itshouldstopdoingwhateverelseitwasdoing,andrespondtotheinterruption.
InfraredOnepinonthePICAXE08McanbeusedtoreceiveinfraredsignalsfromaTV-styleremotethatyoucanbuyfromthesamesuppliersthatsellthePICAXEitself.Withaninfraredsensorattachedtothechip,youcanissuecommandsremotely.Ifyouwanttobuildaremote-controlledrobot,thechipisspecificallydesignedwiththisinmind.
ServomotorsEveryPICAXEchiphasatleastonepinthatcansendastreamofpulsestocontrolatypicalservomotor.Onthe08Mchip,it’sLogicPin2.Thewidthofeachpulsetellsthemotorhowfartorotatefromitscenterpositionbeforestopping.A555timercansendthisstream,butthePICAXEmakesiteasier.Youcansearchonlineformoreinformationaboutservomotors,whichareespeciallyusefulforapplicationssuchassteeringmodelvehicles,adjustingtheflapsonmodelairplanes,andactuatingrobots.
MusicThePICAXEhasanonboardtonegeneratorthatcanbeprogrammedwitha“tune”commandtoplaytunesthatyouwriteusingasimplecode.
Alphanumericinput/outputThe“kbin”programmingcommandisavailableinthePICAXEmodels20X2,28X1and28X2,and40X1and40X2.Youcanplugastandardcomputerkeyboardintothechip,anditwillreadthekeypresses.Youcanalsoattachalphanumericdisplays,buttheseproceduresarenontrivial.Forinstance,whenyou’retryingtofigureoutwhichkeysomeonehaspressedonakeyboard,yourprogramhastocontainalistofthespecialhexadecimalcodesthatthekeyboardcreates.
PseudorandomnumbergenerationAllPICAXEmodelscangeneratepseudorandomnumbersusingabuilt-inalgorithm.Ifyouinitializethenumbergeneratorbyaskingtheusertopressabutton,andyoumeasurethearbitrarytimethatthistakes,youcanseedthepseudorandomnumbergeneratorwiththeresult,andthepseudorandomnumbergeneratorwillhavealessrepeatablesequence.
Visithttp://www.rev-ed.co.uk/docs/picaxe_manual1.pdftolearnmore.
![Page 247: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/247.jpg)
Experiment36:TheLock,RevisitedThecombinationlockthatIdescribedinExperiment20isespeciallyappropriateforamicrocontroller,becauseitrequiresaseriesofoperationsthatresembleacomputerprogram.I’mgoingtoshowhowthisprojectcanberedesignedusingaPICAXE08M,andthenleaveittoyoutoconsiderhowsomeoftheotherprojectsinthisbookcouldbeconverted.Youwillneed:
ThesametypeofkeypadandrelayrecommendedinExperiment20.AtransistororDarlingtonarraytoamplifytheoutputfromthePICAXEsothatitcandrivetherelay.
GettingtheUserInputAnyoftheinputpinsonthePICAXEcansenseaswitchclosing.Thetroubleisthatweonlyhavethreepinscapableofdoingthis,andeventhemostadvancedPICAXEchiphasfewerthan10suchpins.Sohowcanweattacha10-keykeypadtothe08M?Ihaveasuggestion:attachvariousresistorstothekeypad,sothateachkeyappliesadifferentvoltagetooneoftheADCpins.ThenusetheADCfeaturetoconvertthevoltagetoanumber,anduseatableofpossiblenumberstofigureoutwhichkeyisbeingpressed.Thismaynotbethemostelegantsolution,butitworks!ThekeypadcanbewiredasshowninFigure5-147.Theasteriskkeyisstillbeingusedtosupplypower,asintheoriginalexperiment,whilethepoundkeyresetstherelayattheendofyourcomputingsession,asbefore.Currentflowsthroughaseriesofresistors,beginningwithonethathasavalueof500Ω.Becausethisisnotastandardvalue,youwilleitherhavetomakeitbycombiningotherresistorsinseries,orbypresettingatrimmerpotentiometer.Afterthat,eachbuttonisseparatedfromthenextbuttonbya100Ωresistor.Finally,attheendofthechain,a600Ωresistorseparatesthelastbuttonfromthenegativesideofthepowersupply.Again,thisisnotastandardvalue,andyoumayhavetouseatrimmer.Addupalltheresistancesandyouhave2K,whichistherangethatthePICAXEwantsustouse.Whenyoupressabutton,youtapintothechainofresistances.Button9puts600ΩbetweenthePICAXEADCpinandground.Button6is700Ω,button3is800Ω,andsoon.(Youmayprefertolayoutthebuttonssothattheresistanceprogressesinamorelogicalfashion.That’suptoyou.Ichosetolaythemoutinthewaythatwouldbeeasiesttovisualizeonakeypad.)NowlookbackattheADCvaluesthatIsuppliedinthetableonpage308.Thesearethevaluesthatyoushouldgetwhenyoupressvariouskeypadbuttons—butyoucannotcountonthembeingabsolutelyprecise,becausetheymayvaryifyourresistorvaluesarenotquiteaccurate,orifyourpowersupplyisn’texactly5volts.It’snotsafetosay,forexample,thatthePICAXEwilldeliveranADCconversionvalueofprecisely77whentheresistanceis600Ω.It’ssafertosaythatthevaluewillbebetween71and83.Ifwespecifyarangeasshowninthefollowingtable,wehaveamuchbetterchanceofinterpretingeachbuttoncorrectly.
BUTTONNUMBER RANGE
9 600 71–83
6 700 84–96
3 800 97–108
0 900 109–121
8 1000 122–134
5 1100 135–147
2 1200 148–160
7 1300 161–172
4 1400 173–185
1 1500 191–198
SupposeyouattachthecommonpinofyourkeypadtoADCLogicPin2ofthePICAXE.YoucannowusetheProgramEditortowriteaprogramthatlookslikethis:
getkey:readadc2,b0letb1=3ifb0<115thenfinishreadadc2,b0letb1=6ifb0<127thenfinishreadadc2,b0letb1=9ifb0<138thenfinishreadadc2,b0letb1=2ifb0<149thenfinishreadadc2,b0letb1=5ifb0<159thenfinishreadadc2,b0letb1=8ifb0<169thenfinishreadadc2,b0letb1=0ifb0<179thenfinishreadadc2,b0letb1=1ifb0<188thenfinishreadadc2,b0letb1=4ifb0<197thenfinishreadadc2,b0letb1=7ifb0<210thenfinishgotogetkeyfinish:readadc2,b0ifb0<250thenfinish
![Page 248: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/248.jpg)
returnWhatdoestheword“return”meanattheend?I’llgettothatinasecond.Iwanttoexplaintherestoftheroutinefirst.b0receivesthevaluesuppliedbytheanalog-digitalconverterwhenitlooksatthekeypad.Afterstoringthenumberinb0,theroutinehastofigureoutwhichkeypadkeyitmatches.Thekeyidentity(0through9)willbestoredinanothervariable,b1.Theprogramstartsbyassigningvalue9tob1.Thenitcheckstoseewhetherb0<84.Thismeans“ifb0islessthan84.”Ifitis,thentheroutinetellsthePICAXEto“finish,”whichmeans“jumptothefinish:label.”Butifb0isnotlessthan84,bydefaultthePICAXEcontinuesontothenextline,whichmakesasecondattemptatguessingwhichkeyhasbeenpressed.Itassignsnumber6tob1.Nowthere’sanotherif-thentest—andsoon.Thisprocessofreassigningvaluestob1stopsonlywhenitgetstothepointwhereb0isgreaterthananumberinthetable.Ifyou’refamiliarwithotherdialectsofBASIC,thismayseemabitlaborioustoyou.Youmaywonderwhywecan’tuseastatementsuchasthis:
ifb0>70andb0<84thenb1=9TheansweristhatPICAXEBASICisn’tsufficientlysophisticatedtoallowthis.Anif-thenstatementhastoresultinajumptoanothersectionoftheprogram.That’stheonlypermittedoutcome.Ifyoudon’thaveanypriorprogrammingexperience,theroutinemaystillseemlaborioustoyou,andperhapsabitpuzzling,too.Thisisunderstandable,becauseyou’regettingacrashcourseinsoftwaredesignwithoutanyformalpreparation.Still,thePICAXEProgrammingEditorcanbeabighelp,becauseithasitssimulationfeature.Beforeyoucanusethis,though,youhavetoprecedetheroutinethatIjustsuppliedwithacontrolroutinethatyoumusttypeaboveit.ThescreenshotinFigure5-148showsyouhowitshouldlook.
Figure5-147.AquickandsimplewayofattachingakeypadtoprovidenumericinputtothePICAXEusesachainofresistorstotalling2,000Ω.Whenabuttonispressed,itconnectstheADCinputpintoapointinthechain.Theresistancedetectedbytheinputpincanthenbeconvertedbytheprogram
inthechiptodeterminewhichkeyhasbeenpressed.
Ihavechosenanarbitrarycombinationof7-4-1forourcombinationlock.Usingthesenumbers,themainsectionoftheprogramlookslikethis:
main:low1gosubgetkeyifb1<>7thenmaingosubgetkeyifb1<>4thenmaingosubgetkeyifb1<>1thenmainhigh1end
Ishouldexplainthatthe<>pairofsymbolsmean“isnotequalto.”Sothefourthlineoftheprogrammeans,“ifb1isnotequalto7.”Thevalueofb1issupposedtobe7iftheuserisputtinginthecorrectcombination.Soifit’snot7,theuserhasenteredthewrongvalue,andtheif-thenstatementsendsthePICAXEbacktothebeginning.Infactanytimetheuserinputsanumberthatisnotinthecorrect7-4-1sequence,theprogramsendsthePICAXEbacktothebeginning.Thisisthewaythepure-hardwareversionofthisexperimentwassetup.Butwhatisthisword“gosub”?Itmeans“gotoasubroutine.”Asubroutineisanysequenceofprogramstatementsthatendswiththeinstructionto“return.”So“gosubgetkey”tellsthePICAXEtomarkitscurrentplaceintheprogramwhileitskipstothegetkey:sectionofcode,whichitobeys,untilitfindstheword“return,”whichreturnsittotheplacefromwhereitcame.ThePICAXEcontinuesinthisfashionuntilitreachestheword“end.”Ihadtoinserttheword“end”becauseotherwisethePICAXEwillcontinueexecutingtheprogramandwillfallintothesubroutine.“End”stopsitfromdoingso.Figure5-148showsascreenshotofthecompletelisting.So—isthatall?Yes,that’sit.IfyouenterthecodeintotheProgrammingEditorexactlyasIhavesuppliedit,youshouldbeabletorunitinsimulationmode,andinthesimulationwindow,clicktheright-arrowbesideLogicalPinA2toincreaseitsvalueinsteps.Eachtimeyoupassoneofthevaluesinthegetkey:subroutine,youshouldseethevalueforvariableb1changeinthedisplay.Thisisreallyallyouneedtoperformthefunctionsofthecombinationlock.WhenthePICAXErunsthisprogram,itwaitsforthecorrectcombination.Ifitreceivesthecombination,itsendstheoutputfromlogicalpin1high;otherwise,logicalpin1stayslow.TheonlyadditionalitemyouneedisatransistororCMOSgatebetweenlogicalpin1andtherelaythatunlocksthecomputer,becausethePICAXEcannotdeliverenoughcurrenttooperatetherelaybyitself.Puttingthisprocedureintoacontrollerchipnotonlysimplifiesthecircuit,butoffersanotheradvantage:youcanchangethecombinationsimplybyrewritingtheprogramanddownloadingthenewversionintothechip.
![Page 249: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/249.jpg)
Figure5-148.Thisscreenshotshowsthecompletelistingofaprogramtoreadasequenceofthreekeypressesinconjunctionwithacombinationlock.Ifthesequenceiscorrect,thePICAXEsendsahighoutputfromoneofitspins.Ifthesequenceisincorrect,theprogramloopsbacktothebeginning.
FUNDAMENTALSLimitationsofMCUsThePICAXEdoeshavesomedisadvantages.Itsvoltagerequirementsalonerestrictyoufromusingitwiththekindoffreedomofa555timer.Also,althoughIcangetaninstantresultbyplugginga555timerintoabreadboardandaddingacoupleofresistorsandacoupleofcapacitors,thePICAXErequiresmetoaddadownloadsocket,hookituptomycomputer,writeaprogramintheProgrammingEditor,anddownloadtheprogram.Somepeopledon’tlikewritingsoftware,ortheyhavedifficultythinkingintherelentlesslyleft-brainwaythatcomputerprogrammingrequires.Theymaypreferthehands-onprocessofassemblinghardware.Otherpeoplemayhavetheoppositepreference.Thisofcourseisamatteroftaste,butonethingweknowbeyondalldoubtisthatcomputerprogramsoftencontainerrorsthatmaynotrevealthemselvesuntilweeksormonthslater.ThePICAXE,forinstance,doesn’tprotectyouifanumberisassignedtoavariablethatexceedsthelimitforthattypeofvariable.Supposeb1=200andb2=60andyourprogramtellsthePICAXE:
letb3=b1+b2Theresultshouldbe260,butbyte-sizevariablescanonlycountupto255.Whathappens?Youwillfindthatb3acquiresavalueof4,withoutanywarningorexplanation.Thisisknownasan“overflowerror,”whichcanbeverydifficulttopredict,becauseithappensatruntime,whenexternalfactorsareincontrol.Thecodelooksperfectlygood;theProgrammingEditordoesn’tfindanysyntaxerrors;thesimulationbehavesproperly.Butintherealworld,daysorevenmonthslater,anunexpectedsetofcircumstancesresultsinaninputthatcausestheoverflow,andbecausethecodeisresidinginsidethechipatthispoint,youmayhaveahardtimefiguringoutwhatonearthwentwrong.Softwarehasitsproblems.Hardwarehasitsadvantages.
FUNDAMENTALSUnexploredterritoryIfyou’vetakenthetimetocompletemostoftheprojectsinthisbookwithyourownhands,youhavegainedaveryrapidintroductiontothemostfundamentalareasofelectronics.Whathaveyoumissedalongtheway?Herearesometopicsthatremainwideopenforyoutoexplore.Naturallyyoushouldsearchonlineiftheyinterestyou.Theinformal,learning-by-discoveryapproachthatIhaveusedinthisbooktendstobelightontheory.I’veavoidedmostofthemaththatyou’dbeexpectedtolearninamorerigorouscourseonthesubject.Ifyouhavemathematicalaptitude,youcanuseittogainamuchdeeperinsightintothewayinwhichcircuitswork.Ididn’tdealmuchwithcomputerarchitecture,either.Wedidn’tgoveryfarintobinarycode,andyoudidn’tbuildahalf-adder,whichisagreatwaytolearnhowcomputersfunctiononthemostfundamentallevel.Perhapsyoushouldthinkaboutassemblingone.Iavoidedgoingdeeplyintothefascinatingandmysteriouspropertiesofalternatingcurrent.Hereagain,somemathisinvolved,butjustthebehaviorofcurrentathighfrequenciesisaninterestingtopicinitself.Forreasonsalreadystated,Iavoidedsurface-mountcomponents—butyoucanstillgointothisareayourselfforarelativelysmallinvestment,ifyouliketheideaofcreatingfascinatinglytinydevices.Thismaybethefutureofhobbyelectronics,soifyoustickwithit,you’llprobablyendupintheworldofsurface-mount.Vacuumtubeswerenotmentioned,becauseatthispoint,theyaremainlyofhistoricalinterest.Butthere’ssomethingveryspecialandbeautifulabouttubes,especiallyifyoucanenclosetheminfancycabinetwork.Inthehandsofaskilledcraftsperson,tubeamplifiersandradiosbecomeartobjects.
![Page 250: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/250.jpg)
Ididn’tshowyouhowtoetchyourownprintedcircuitboards.Thisisataskthatappealstoonlycertainpeople,andthepreparationforitrequiresyoutomakeveryneatdrawingsorusecomputersoftwareforthatpurpose.Ifyouhappentohavethoseresources,youmightwanttodoyourownetching.Itcouldbeafirststeptowardmass-producingyourowndevices.Ididn’tcoverstaticelectricityatall.High-voltagesparksdon’thaveanypracticalapplications,andtheyentailsomesafetyissues—buttheyarestunninglyimpressive,andyoucaneasilyobtainthenecessaryinformationtobuildtheequipment.Maybeyoushouldtry.
OtherControllersIfyouwantsomethingmorepowerful,aBASICStampisthelogicalnextstepafteraPICAXE.theBASICStampissocalledbecauseitoriginallylookedlikeapostagestamp.TheBASICStamphasalargervocabularyofcommandsandabiggerrangeofadd-ondevices(includingdisplayswithgraphicalcapability,andalittlekeyboardthatisspecificallydesignedforusewiththecontroller).TheBASICStampisshowninFigure5-149.
Figure5-149.TheBASICStampcontrollerconsistsofsurface-mountedcomponentsonaplatformthathaspinsspacedat1/10-inchintervals,forinsertioninabreadboardorperforatedboard.ThiscomponentusesaversionofBASICthatissimilartotheprogramminglanguageofthePICAXE,but
hasmanymoreextensions.TheBASICStampisavailableforusewithawiderangeofperipheraldevices,includingmanyalphanumericdot-matrixdisplays.
Onthedownside,you’llfindthateverythingassociatedwiththeBASICStampisabitmoreexpensivethaninthePICAXEworld,andthedownloadprocedureisn’tquiteassimple.OneofthemorerecentdevelopmentsintheworldofMCUsistheArduino,whichisbothsophisticatedandpowerful.ItdoesrequireprogrammingintheClanguage.Thislanguageisalittlemoredifficulttounderstand,andhasonlythevaguestsimilaritytothesyntaxthatisusedinthePICAXEandBASICStamp.Ontheotherhand,becauseCdominatesthelargerworldofcomputing,learningitmightnotbesuchabadidea—andtheArduinoofferssometrulyamazingcapabilities.Becauseitissopopular,therearealsomanysoftwaretools,documentation,userforums,andmanyenthusatichobbyiststohelpyou.TwootherMake:BookstitlesthatImentionedpreviously,GettingStartedwithArduinoandMakingThingsTalk,provideagreatintroduction.
![Page 251: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/251.jpg)
InClosingIbelievethatthepurposeofanintroductorybookistogiveyouatasteofawiderangeofpossibilities,leavingyoutodecideforyourselfwhatyouwanttoexplorenext.Electronicsisidealforthoseofuswholiketodothingsourselves,becausealmostanyapplication—fromrobotics,toradio-controlledaircraft,totelecommunications,tocomputinghardware—allowsopportunitiesthatwecanexploreathome,withlimitedresources.Asyoudelvedeeperintotheareasofelectronicsthatinterestyoumost,Itrustyou’llhaveasatisfyinglearningexperience.Butmostofall,Ihopeyouhavelotsoffunalongtheway.
![Page 252: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/252.jpg)
Appendix.OnlineRetailSourcesandManufacturersThisappendixcontainsURLsforcompaniesmentionedasretailsourcesormanufacturers,alongwiththecommonlyusednameofthesourceandthecompanyname.
COLLOQUIALLYUSEDNAME ACTUALCORPORATEORCOMPANYNAME URL
3M MinnesotaMiningandManufacturingCo. http://solutions.3m.com/en_US/
AceHardware AceHardwareCorporation http://www.acehardware.com
AdvancedMicroCircuits AdvancedMicroCircuitsCorp http://www.advancedmicrocircuits.com
Akro-Mils MyersIndustries,Inc. http://www.akro-mils.com
Alcoswitch DivisionofTycoElectronicsCorporation http://www.tycoelectronics.com/catalog/menu/en/18025
AllElectronics AllElectronicsCorporation http://www.allelectronics.com
AllSpectrumElectronics AllSpectrumElectronics http://www.allspectrum.com
All-Battery.com TenergyCorporation http://www.all-battery.com
Alphapotentiometers AlphaProductsInc. http://www.alphapotentiometers.net
ALPSpushbutton ALPSElectricCo.,Ltd. http://www.alps.com
Amazon Amazon.com,Inc. http://www.amazon.com
Amprobe AmprobeTestTools http://www.amprobe.com
Arduino Nocorporateidentity http://www.arduino.cc
ArtCity ArtCity http://www.artcity.com
AutoZone AutoZone,Inc. http://www.autozone.com
Avago AvagoTechnologies http://www.avagotech.com
BASICStamp BrandownedbyParallax,Inc. http://www.parallax.com
BITechnologies BITechnologiesCorporation http://www.bitechnologies.com
BKPrecision B&KPrecisionCorp. http://www.bkprecision.com
Bussmannfuses CooperBussman,Inc. http://www.cooperbussmann.com
C&Kswitch CoActiveTechnologies,Inc. http://www.ck-components.com
Chicagolighting CMLInnovativeTechnologies http://www.cml-it.com
CraftAmerica CardinalEnterprises http://www.craftamerica.com
Darice DariceInc. http://www.darice.com
DeWalt DeWaltIndustrialToolCompany http://www.dewalt.com
Digi-Key Digi-KeyCorporation http://www.digikey.com
Directedswitches DirectedElectronicsInc. http://www.directed.com
Doctronics DoctronicsEducationalPublishing http://www.doctronics.co.uk
eBay eBayInc. http://www.ebay.com
Elenco ElencoElectronicsInc. http://www.elenco.com
Everlight EverlightElectronicCo.Ltd. http://www.everlight.com
Extech ExtechInstrumentsCorporation http://www.extech.com
Fairchild FairchildSemiconductorIncorporated http://www.fairchildsemi.com
FTM FTMIncorporated http://thefabricatorssource.com
Fujitsu FujitsuAmerica,Inc. http://www.fujitsu.com/us/
GBwirestrippers GardnerBenderInc. http://www.gardnerbender.com
Hobbylinc HobbylincHobbies http://www.hobbylinc.com
HomeDepot HomerTLC,Inc. http://www.homedepot.com
Idealwirestrippers IdealIndustriesInc. http://www.idealindustries.com
Jameco JamecoElectronics http://www.jameco.com
K&JMagnetics K&JMagneticsInc. http://www.kjmagnetics.com
Kingbright KingbrightCorporation http://www.kingbrightusa.com
Kobiconn Nowebpagefound;usemouser.com
KVMTools KVMToolsInc. http://www.kvmtools.com
![Page 253: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/253.jpg)
Lowe’shardware LF,LLC http://www.lowes.com
Lumex LumexInc. http://www.lumex.com
McMaster-Carr McMaster-CarrSupplyCompany http://www.mcmaster.com
Megahobby Megahobby.com http://www.megahobby.com
MeterSuperstore DivisionofSRSMarketSolutionsInc. http://www.metersuperstore.com
Michaelscraftstores MichaelsStores,Inc. http://www.michaelscrafts.com
Mill-Max Mill-MaxManufacturingCorp. http://www.mill-max.com
Mitutoyo MitutoyoAmericaCorporation http://www.mitutoyo.com
Motorola Motorola,Inc. http://www.motorola.com/us
Mouserelectronics MouserElectronics,Inc. http://www.mouser.com
Muelleralligatorclip MuellerElectricCompany http://www.muellerelectric.com
Newark SubsidiaryofPremierFarnellplc http://www.newark.com
NKKswitches NihonKaiheikiIndustryCo.Ltd. http://www.nkkswitches.com
NXPsemiconductors NXPSemiconductors http://www.nxp.com
Omron OmronCorporation http://www.omron.com
OnSemiconductor SemiconductorComponentsIndustries,LLC http://www.onsemi.com
Optek SubsidiaryofTTElectronicsplc http://www.optekinc.com
Panasonic PanasonicElectricWorksCorporation http://pewa.panasonic.com
PanaVise PanaviseProducts,Inc. http://www.panavise.com
Parallax Parallax,Inc. http://www.parallax.com
PepBoys PepBoys-Manny,MoeandJack http://www.pepboys.com
Philips KoninklijkePhilipsElectronicsN.V. http://www.usa.philips.com
PICAXE RevolutionEducationLtd. http://www.rev-ed.co.uk
PiedmontPlastics PiedmontPlastics,Inc. http://www.piedmontplastics.com
Planostoragesboxes PlanoMoldingCompany http://www.planomolding.com
Pomonatestequipment PomonaElectronicsInc. http://www.pomonaelectronics.com
RadioShack RadioShackCorporation http://www.radioshack.com
Sears SearsBrands,LLC http://www.sears.com
SparkFunElectronics SparkfunElectronics http://www.sparkfun.com
Stanleytools TheStanleyWorks http://www.stanleytools.com
STMicroelectronics STMicroelectronicsGroup http://www.st.com
TexasInstruments TexasInstrumentsIncorporated http://www.ti.com
TowerHobbies TowerHobbies http://www.towerhobbies.com
TwinIndustries TwinIndustries http://www.twinind.com
Tyco TycoElectronicsCorporation http://www.tycoelectronics.com
Vaughan Vaughan&BushnellMfg. http://hammernet.com/vaughan/
Vellemankeyboards Vellemannv http://www.velleman.eu
Vishay VishayIntertechnologyInc. http://www.vishay.com
Wal-Mart Wal-MartStores,Inc. http://www.walmart.com
Weller DivisionofCooperIndustries,LLC http://www.cooperhandtools.com/brands/weller/
X-Acto DivisionofElmer’sProducts,Inc. http://www.xacto.com
Xcelite DivisionofCooperIndustries,LLC http://www.cooperhandtools.com/brands/xcelite/
Xytronic XytronicIndustriesLtd. http://www.xytronic-usa.com
![Page 254: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/254.jpg)
AcknowledgmentsMyassociationwithMAKEmagazinebeganwhenitseditor,MarkFrauenfelder,askedmetowriteforit.IhavealwaysbeenverygratefultoMarkforhissupportofmywork.ThroughhimIbecameacquaintedwiththeexceptionallycapableandmotivatedproductionstaffatMAKE.GarethBranwyneventuallysuggestedthatImightliketowriteanintroductoryguidetoelectronics,soIamindebtedtoGarethforinitiatingthisprojectandsupervisingitasmyeditor.AfterIwroteanoutlineinwhichIdescribedmyideafor“LearningbyDiscovery”andtheassociatedconceptthatcuttingopencomponentsorburningthemupcanbeaneducationalactivity,MAKE’spublisher,DaleDougherty,utteredthememorablephrase,“Iwantthisbook!”ThereforeIofferspecialthankstoDaleforhisbeliefinmyabilities.DanWoods,theassociatepublisher,wasalsoextremelysupportive.Theproductionprocesswasswift,competent,andpainless.ForthisIthankmyeditoratO’Reilly,BrianJepson;seniorproductioneditorRachelMonaghan;copyeditorNancyKotary;proofreaderNancyReinhardt;indexerJulieHawks;designerRonBilodeau;andRobertRomano,whotweakedmyillustrations.MostofallIamindebtedtoBunnieHuang,mytechnicaladvisor,whoreviewedthetextindetailandknowsabunchofstuffthatIdon’tknow.Anyresidualerrorsarestillmyfault,eventhoughIwouldprefertoblamethemonBunnie.ThanksalsotoMattMets,BeckyStern,CollinCunningham,MarcdeVinck,PhillipTorrone,LimorFried,JohnEdgarPark,JohnBaichtal,andJonathanWolfeforhelpingoutwithsomelast-minuteprojecttesting.LastlyIhavetomentionthegeniusofJohnWarnockandCharlesGeschke,foundersofAdobeSystemsandcreatorsoftheverybeautifulPostScriptlanguage,whichrevolutionizedallofpublishing.Thehorrorofattemptingtocreatethisbookusinggraphic-artstoolsfrom…someothercompany…isalmostunimaginable.Infact,withoutIllustrator,Photoshop,Acrobat,andInDesign,IdoubtIwouldhaveattemptedthetask.IamalsoindebtedtotheCanon1Dswith100mmmacrolens,whichtookmanyofthepicturesinthisbook.Nofreesamplesorotherfavorswerereceivedfromanyofthevendorsmentionedherein,withtheexceptionoftwosamplebooksfromMAKE,whichIreadtoensurethatIwasnotduplicatinganythingthathadalreadybeenpublished.
![Page 255: Make: Electronicswebéducation.com/wp-content/uploads/2020/12/Platt...Preface How to Have Fun with This Book Everyone uses electronic devices, but most of us don’t really know what](https://reader036.vdocuments.us/reader036/viewer/2022081411/60a5d81ebb736e0c275a892b/html5/thumbnails/255.jpg)
ColophonTheheadingandcoverfontareBentonSans,thetextfontisMyriadPro,andthecodefontisTheSansMonoCondensed.
AbouttheAuthorCharlesPlattbecameinterestedincomputerswhenheacquiredanOhioScientificC4Pin1979.Afterwritingandsellingsoftwarebymailorder,hetaughtclassesinBASICprogramming,MS-DOS,andsubsequentlyAdobeIllustratorandPhotoshop.Hewrotefivecomputerbooksduringthe1980s.Hehasalsowrittenscience-fictionnovelssuchasTheSiliconMan(publishedoriginallybyBantamandlaterbyWiredBooks)andProtektor(fromAvonBooks).HestoppedwritingsciencefictionwhenhestartedcontributingtoWiredin1993,andbecameoneofitsthreeseniorwritersacoupleofyearslater.CharlesbegancontributingtoMAKEmagazineinitsthirdissueandiscurrentlyacontributingeditor.Make:ElectronicsishisfirsttitleforMakeBooks.CurrentlyheisdesigningandbuildingprototypesofmedicalequipmentinhisworkshopinthenorthernArizonawilderness.