Académique Documents
Professionnel Documents
Culture Documents
NEXT
PREV
10 USB Projects w
Appendix: Compo
Recent
Topics
Tutorials
CHAPTER 11
Highlights
Settings
Feedback(http://community.safaribooksonline.com)
Your Projects
SOYOUHAVETRIEDyourhandatsomeoftheauthorsprojectsand
Sign Out
hopefullylearnedsomethingalongtheway.Nowitstimetostart
developingyourownprojectsusingwhatyouhavelearned.Youwillbe
abletoborrowbitsofdesignfromtheprojectsinthisbook,buttohelp
Settings
youalong,thischaptergetsyoustartedwithsomedesignand
constructiontechniques.
Circuits
Feedback(http://community.safaribooksonline.com/)
Theauthorlikestostartaprojectwithavaguenotionofwhathewantsto
achieveandthenstartdesigningfromtheperspectiveoftheelectronics.
Thesoftwareusuallycomesafterwards.
Thewaytoexpressanelectroniccircuitistouseaschematicdiagram.The
authorhasincludedschematicdiagramsforalltheprojectsinthisbook,
soevenifyouarenotveryfamiliarwithelectronics,youshouldnowhave
seenenoughschematicstounderstandroughlyhowtheyrelatetothe
breadboardlayoutdiagramsalsoincluded.
Schematic Diagrams
Inaschematicdiagram,connectionsbetweencomponentsareshownas
lines.Theseconnectionswillusetheconnectivestripsbeneaththesurface
ofthebreadboardandthewiresconnectingonebreadboardstripto
another.Forthekindsofprojectsinthisbook,itdoesnotnormallymatter
howtheconnectionismade.Thearrangementoftheactualwiresdoesnot
matteraslongasallthepointsthatshouldbeconnectedareconnected.
Schematicdiagramshaveafewconventionsthatareworthpointingout.
Forinstance,itiscommontoplaceGNDlinesnearthebottomofthe
diagramandhighervoltagesnearthetopofthediagram.Thisallows
someonereadingtheschematictovisualizetheflowofchargethroughthe
systemfromhighertolowervoltages.
Anotherconventioninschematicdiagramsistousethelittlebarsymbol
toindicateaconnectiontoGNDwherethereisnotenoughroomtodraw
alltheconnections.
Figure111,originallyfromProject5,showsthreeresistors,allwithone
leadconnectedtotheGNDconnectionoftheArduinoboard.Inthe
correspondingbreadboardlayout(Figure112),youcanseethatthe
connectionstoGNDgothroughthreewiresandthreestripsof
breadboardconnectorblock.
Subscribe.
Sign Out
Figure111 Aschematicdiagramexample.
Figure112 Examplebreadboardlayout.
Therearemanydifferenttoolsfordrawingschematicdiagrams.Someof
themareintegratedelectronicscomputeraideddesign(CAD)products
thatwillgoontolayoutthetracksonaprintedcircuitboardforyou.By
andlarge,thesecreatefairlyuglylookingdiagrams,andtheauthor
preferstousepencilandpaperorgeneralpurposedrawingsoftware.All
thediagramsforthisbookwerecreatedusingOmniGroupsexcellentbut
strangelynamedOmniGrafflesoftware,whichisonlyavailableforApple
Macs.OmniGraffletemplatesfordrawingbreadboardlayoutsand
schematicdiagramsareavailablefordownloadfrom
www.arduinoevilgenius.com(http://www.arduinoevilgenius.com).
Component Symbols
Figure113showsthecircuitsymbolsfortheelectroniccomponentsthat
wehaveusedinthisbook.
Figure113 Circuitsymbols.
Therearevariousdifferentstandardsforcircuitdiagrams,butthebasic
symbolsareallrecognizablebetweenstandards.Thesetusedinthisbook
doesnotcloselyfollowanyparticularstandard.IhavejustchosenwhatI
considertobethemosteasytoreadapproachtothediagrams.
Components
Inthissectionwelookatthepracticalaspectsofcomponents:whatthey
doandhowtoidentify,choose,andusethem.
Datasheets
Allcomponentmanufacturersproducedatasheetsfortheirproducts.
Theseactasaspecificationforhowthecomponentwillbehave.Theyare
notofmuchinterestforresistorsandcapacitorsbutaremuchmoreuseful
forsemiconductorsandtransistorsandespeciallyintegratedcircuits.
Theywilloftenincludeapplicationnotesthatincludeexampleschematics
forusingthecomponents.
TheseareallavailableontheInternet.However,ifyousearchforBC158
datasheetinyourfavoritesearchengine,youwillfindthatmanyofthe
tophitsarefororganizationscashinginonthefactthatpeoplesearchfor
datasheetsalot.Theseorganizationssurroundthedatasheetswith
pointlessadvertisingandpretendthattheyaddsomevaluetolookingup
datasheetsbysubscribingtotheirservice.Thesewebsitesusuallyjustlead
toafrustrationofclickingandshouldbeignoredinfavorofany
manufacturerswebsites.Soscanthroughthesearchresultsuntilyousee
aURLsuchaswww.fairchild.com(http://www.fairchild.com).
Alternatively,manyofthecomponentretailsupplierssuchasFarnell
providefreeofchargedatasheetsforpracticallyeverycomponentthey
sell,whichistobemuchapplauded.Thisalsomeansthatyoucan
comparepricesandbuythecomponentswhileyouarefindingoutabout
them.
Resistors
Resistorsarethemostcommonandcheapestelectroniccomponents
around.Theirmostcommonusesare
Topreventexcessivecurrentflowing(seeanyprojectthatusesan
LED)
Inapairorasavariableresistortodivideavoltage
Chapter2explainedOhmslawandusedittodecideonavalueofaseries
resistorforanLED.Similarly,inProject19wereducedthesignalfrom
ourresistorladderusingtworesistorsasapotentialdivider.
Resistorshavecoloredbandsaroundthemtoindicatetheirvalue.
However,ifyouareunsureofaresistor,youcanalwaysfinditsresistance
usingamultimeter.Onceyougetthehangofit,itseasytoreadthevalues
usingthecoloredbands.
Eachbandcolorhasavalueassociatedwithit,asshowninTable111.
TABLE111ResistorColorCodes
Therewillgenerallybethreeofthesebandstogetherstartingatoneendof
theresistor,agap,andthenasinglebandattheotherendoftheresistor.
Thesinglebandindicatestheaccuracyoftheresistorvalue.Sincenoneof
theprojectsinthisbookrequireaccurateresistors,thereisnoneedto
selectyourresistorsonthisbasis.
Figure114showsthearrangementofthecoloredbands.Theresistor
valueusesjustthethreebands.Thefirstbandisthefirstdigit,thesecond
theseconddigit,andthethirdmultiplierbandishowmanyzerostoput
afterthefirsttwodigits.
Figure114 Acolorcodedresistor.
Soa270resistorwillhaveafirstdigitof2(red),aseconddigitof7
(violet),andamultiplierof1(brown).Similarly,a10kftresistorwillhave
bandsofbrown,black,andorange(1,0,and000).
Mostofourprojectsuseresistorsinaverylowpowermanner.Aquick
calculationcanbeusedtoworkoutthecurrentflowingthroughthe
resistor,andmultiplyingthatnumberbythevoltageacrosstheresistor
willtellyouthepowerusedbytheresistor.Theresistorburnsoffthis
surpluspowerasheat,soresistorswillgetwarmifasignificantamountof
currentflowsthroughthem.
Youonlyneedtoworryaboutthisforlowvalueresistorsoflessthan100
orsobecausehighervalueresistorswillhavesuchasmallcurrent
flowingthroughthem.
Asanexample,a100ftresistorconnecteddirectlybetween5VandGND
willhaveacurrentthroughitofI=V/R,or5/100,or0.05A.Thepowerit
useswillbeIVor0.055=0.25W
Astandardpowerratingforresistorsis0.5or0.6W,andunless
otherwisestatedinprojects,0.5Wmetalfilmresistorswillbefine.
Transistors
Browsethroughanycomponentcatalogandyouwillfindliterally
thousandsofdifferenttransistortypes.Inthisbookthelisthasbeen
simplifiedtowhatsshowninTable112.
TABLE112TransistorsUsedinThisBook
ThebasicswitchcircuitforatransistorisshowninFigure115.
Figure115 Basictransistorswitchcircuit.
Thecurrentflowingfrombasetoemitter(btoe)controlsthelarger
currentflowingfromthecollectortotheemitter.Ifnocurrentflowsinto
thebase,thennocurrentwillflowthroughtheload.Inmosttransistors,if
theloadhaszeroresistance,thecurrentflowingintothecollectorwould
be50to200timesthebasecurrent.However,wearegoingtobe
switchingourtransistorfullyonorfullyoff,sotheloadresistancewill
alwayslimitthecollectorcurrenttothecurrentrequiredbytheload.Too
muchbasecurrentwilldamagethetransistorandalsoratherdefeatthe
objectiveofcontrollingabiggercurrentwithasmallerone,sothebase
willhavearesistorconnectedtoit.
WhenswitchingfromanArduinoboard,themaximumcurrentofan
outputis40mA,sowecouldchoosearesistorthatallowsabout30mAto
flowwhentheoutputpinishighat5VUsingOhmslaw,
R=V/I
R=(50.6)/30=147
The0.6isbecauseonecharacteristicofbipolartransistorsisthatthere
isalwaysavoltageofabout0.6Vbetweenbaseandemitterwhena
transistoristurnedon.
Therefore,usinga150baseresistor,wecouldcontrolacollector
currentof40to200times30mA,or1.2to6A,whichismorethan
enoughformostpurposes.Inpractice,wewouldprobablyusearesistor
of1korperhaps270.
Transistorshaveanumberofmaximumparametervaluesthatshouldnot
beexceededorthetransistormaybedamaged.Youcanfindtheseby
lookingatthedatasheetforthetransistor.Forexample,thedatasheetfor
a2N2222willcontainmanyvalues.Theonesofmostinteresttousare
summarizedinTable113.
TABLE113TransistorDatasheet
Other Semiconductors
Thevariousprojectshaveintroducedanumberofdifferenttypesof
components,fromLEDstotemperaturesensorsTable114provides
somepointersintothevariousprojects.Ifyouwanttodevelopyourown
projectthatsensestemperatureorwhatever,firstreadabouttheprojects
developedbytheauthorthatusethesecomponents.
TABLE104UseofSpecializedComponentsinProjects
Itmayevenbeworthbuildingtheprojectandthenmodifyingittoyour
ownpurposes.
Ethernet(connectyourArduinototheInternet)
XBee(awirelessdataconnectionstandardusedinhomeautomation,
amongotherthings)
Motordriver
GPS
Joystick
SDcardinterface
GraphicLCDtouchscreendisplay
WiFi
Buying Components
Thirtyyearsago,theelectronicsenthusiastlivinginevenasmalltown
wouldbelikelytohavethechoiceofseveralradio/TVrepairandspare
storeswhereheorshecouldbuycomponentsandreceivefriendlyadvice.
Thesedaysthereareafewretailoutletsthatstillsellcomponents,suchas
RadioShackintheUnitedStatesandMaplinsintheUnitedKingdom,but
theInternethassteppedintofillthegap,anditisnoweasierandcheaper
thanevertobuycomponents.
WithcomponentsupplierssuchasDigikey,Mouser,Newark,Radio
Spares,andFarnell,youcanfillavirtualshoppingbasketonlineandhave
thecomponentsarriveinadayortwo.Shoparoundbecausepricesvary
considerablyamongsuppliersforthesamecomponents.
YouwillfindeBaytobeagreatsourceofcomponents.Ifyoudontmind
waitingafewweeksforyourcomponentstoarrive,therearegreat
bargainstobehadfromChina.Youoftenhavetobuylargequantitiesbut
mayfinditcheapertoget50ofacomponentfromChinathan5locally.In
thisway,youhavesomesparesforyourcomponentbox.
Tools
Whenmakingyourownprojects,thereareafewtoolsthatyouwillneed
atabareminimum.Ifyoudonotintendtodoanysoldering,thenyouwill
need
Solidcorewireinafewdifferentcolors,somethingaround0.6mm
(23SWG)diameter
Pliersandwiresnips,particularlyformakingjumperwiresforthe
breadboard
Breadboard
Multimeter
Ifyouintendtosolder,thenyouwillalsoneed
Solderingiron(duh)
Leadfreealloysolder
Component Box
Whenyoufirststartdesigningyourownprojects,itwilltakeyousome
timetograduallybuildupyourstockofcomponents.Eachtimeyouare
finishedwithaproject,afewmorecomponentswillfindtheirwaybackto
yourstock.
Itisusefultohaveabasicstockofcomponentssothatyoudonothaveto
keeporderingthingswhenyoujustneedadifferentvalueresistor.You
willhavenoticedthatmostoftheprojectsinthisbooktendtouseresistor
valuessuchas100,1k,10k,etc.Youactuallydontneedthatmany
differentcomponentstocovermostofthebasesforanewproject.
AgoodstartingkitofcomponentsislistedintheAppendix.
Boxeswithcompartmentsthatcanbelabeledsavealotoftimein
selectingcomponents,especiallyresistorsthatdonothavetheirvalue
writtenonthem.
Figure116 Snipsandpliers.
Youalsocanbuyanautomaticwirestripperthatgripsandremoves
insulationinoneaction.Inpractice,theseoftenonlyworkwellforone
particularwiretypeandsometimesjustplaindontwork.
Soldering
Youdonothavetospendalotofmoneytogetadecentsolderingiron.
Temperaturecontrolledsolderstations,suchastheoneshowninFigure
117,arebetter,butafixedtemperatureelectricironisfine.Buyonewith
afinetip,andmakesurethatitisintendedforelectronicsandnot
plumbinguse.
Figure117 Solderingironandsolder
Usenarrowleadfreesolder.Anyonecansolderthingstogetherandmake
themwork,butsomepeoplejusthaveatalentforneatsoldering.Dont
worryifyourresultsdonotlookasneatasarobotmadeprintedcircuit.
Theyarenevergoingto.
Solderingisoneofthosejobsthatyoureallyneedthreehandsfor:one
handtoholdthesolderingiron,onetoholdthesolder,andonetohold
thethingyouaresoldering.Sometimesthethingyouaresolderingisbig
andheavyenoughtostayputwhileyousolderitonotheroccasions,you
willneedtoholditdown.Heavypliersaregoodforthis,asareminivises
andhelpinghandtypeholdersthatuselittleclipstogripthings.
Thebasicstepsforsolderingare
1.Wetthespongeinthesolderingironstand.
2.Allowtheirontocomeuptotemperature.
3.Tinthetipoftheironbypressingthesolderagainstituntilitmeltsand
coversthetip.
4.Wipethetiponthewetspongethisproducesasatisfyingsizzling
soundbutalsocleansofftheexcesssolder.Youshouldnowhaveanice
brightsilvertip.
5.Touchtheirontotheplacewhereyouaregoingtosoldertoheatit
thenafterashortpause(asecondortwo),touchthesoldertothepoint
wherethetipoftheironmeetsthethingyouaresoldering.Thesolder
shouldflowlikealiquid,neatlymakingajoint.
6.Removethesolderandsolderingiron,puttingtheironbackinitsstand
andbeingverycarefulthatnothingmovesinthefewsecondsthatthe
solderwilltaketosolidify.Ifsomethingdoesmove,thentouchtheironto
itagaintoreflowthesolderotherwise,youcangetabadconnection
calledadryjoint.
Aboveall,trynottoheatsensitive(orexpensive)componentsanylonger
thannecessary,especiallyiftheyhaveshortleads.
Practicesolderinganyoldbitsofwiretogetherorwirestoanoldbitof
circuitboardbeforeworkingontherealthing.
Multimeter
Abigproblemwithelectronsisthatyoucannotseethelittlemonkeys.A
multimeterallowsyoutoseewhattheyareupto.Itallowsyoutomeasure
voltage,current,resistance,andoftenotherfeaturestoo,suchas
capacitanceandfrequency.Acheap$10multimeterisperfectlyadequate
foralmostanypurpose.Theprofessionalsusemuchmoresolidand
accuratemeters,buttheyrenotnecessaryformostpurposes.
Multimeters,suchastheoneshowninFigure118,canbeeitheranalogor
digital.Youcantellmorefromananalogmeterthanyoucanfroma
digitalmeterbecauseyoucanseehowfastaneedleswingsoverandhow
itjitters,somethingthatisnotpossiblewithadigitalmeter,wherethe
numbersjustchange.However,forasteadyvoltage,itismucheasierto
readadigitalmeterbecauseananalogmeterwillhaveanumberofscales,
andyouhavetoworkoutwhichscaleyoushouldbelookingatbeforeyou
takethereading.
Figure118 Amultimeter.
Youcanalsogetautorangingmeters,which,onceyouhaveselected
whetheryouaremeasuringcurrentorvoltage,willautomaticallychange
rangesforyouasthevoltageorcurrentincreases.Thisisuseful,butsome
wouldarguethatthinkingabouttherangeofvoltagebeforeyoumeasure
itisactuallyausefulstep.
Tomeasurevoltageusingamultimeter:
1.Setthemultimeterrangetovoltage(startatarangethatyouknowwill
behigherthanthevoltageyouareabouttomeasure).
2.ConnecttheblackleadtoGND.Acrocodilecliponthenegativelead
makesthiseasier.
3.Touchtheredleadtothepointwhosevoltageyouwanttomeasure.For
instance,toseeifanArduinodigitaloutputisonoroff,youcantouchthe
redleadtothepinandreadthevoltage,whichshouldbeeither5Vor0V.
Measuringcurrentisdifferentfrommeasuringvoltagebecauseyouwant
tomeasurethecurrentflowingthroughsomethingandnotthevoltageat
somepoint.Soyouputthemultimeterinthepathofthecurrentthatyou
aremeasuring.Thismeansthatwhenthemultimeterissettoacurrent
setting,therewillbeaverylowresistancebetweenthetwoleads,sobe
carefulnottoshortanythingoutwiththeleads.
Figure119showshowyoucouldmeasurethecurrentflowingthroughan
LED.
Figure119 Measuringcurrent.
Tomeasurecurrent:
1.Setthemultimeterrangetoacurrentrangehigherthantheexpected
current.Notethatmultimetersoftenhaveaseparatehighcurrent
connectorforcurrentsashighas10A.
2.Connectthepositiveleadofthemetertothemorepositivesidefrom
whichthecurrentwillflow.
3.Connectthenegativeleadofthemetertothemorenegativeside.Note
thatifyougetthisthewrongwayround,adigitalmeterwilljustindicatea
negativecurrenthowever,connectingananalogmeterthewrongway
roundmaydamageit.
4.InthecaseofanLED,theLEDshouldstilllightasbrightlyasbefore
youputthemeterintothecircuit,andyouwillbeabletoreadthecurrent
consumption.
Anotherfeatureofamultimeterthatissometimesusefulisthecontinuity
testfeature.Thiswillusuallybeepwhenthetwotestleadsareconnected
together.Youcanusethistotestfuses,etc.,aswellastotestfor
accidentalshortcircuitsonacircuitboardorbrokenconnectionsina
wire.
Resistancemeasurementisoccasionallyuseful,particularlyifyouwantto
determinetheresistanceofanunmarkedresistor.
Somemetersalsohavediodeandtransistortestconnections,whichcan
beusefultofindanddiscardtransistorsthathaveburnedout.
Oscilloscope
InProject18webuiltasimpleoscilloscope.Anoscilloscopeisan
indispensabletoolforanykindofelectronicsdesignortestwhereyouare
lookingatasignalthatchangesovertime.Oscilloscopesarerelatively
expensive,andtherearevarioustypes.Oneofthemostcosteffective
typesissimilarinconcepttotheoneinProject18.Thatoscilloscopejust
sendsitsreadingsacrosstoacomputerthatisresponsiblefordisplaying
them.
Entirebookshavebeenwrittenaboutusinganoscilloscopeeffectively,
andeveryoscilloscopeisdifferent,sowewilljustcoverthebasicshere.
AsyoucanseefromFigure1110,thescreenshowingthewaveformis
displayedoverthetopofagrid.Theverticalgridisinunitsofsome
fractionofvolts,whichonthisscreenis2Vperdivision.Sothevoltageof
thesquarewaveintotalis2.52=5V.
Figure1110 Anoscilloscope.
Thehorizontalaxisisthetimeaxis,andthisiscalibratedinsecondsin
thiscase,500ms(microseconds)perdivision.Sothelengthofone
completecycleofthewaveis1000ms,thatis,1ms(millisecond),
indicatingafrequencyof1kHz.
Project Ideas
TheArduinoPlaygroundonthemainArduinowebsite(www.arduino.cc)
isagreatsourceofideasforprojects.Indeed,itevenhasasection
specificallyforprojectideas,dividedintoeasy,medium,ordifficult.
IfyoutypeArduinoprojectintoyourfavoritesearchengineorYouTube,
youwillfindnoendofinterestingprojectsthatpeoplehaveembarkedon.
Anothersourceofinspirationisthecomponentcatalog,eitheronlineor
onpaper.Browsingthrough,youmightcomeacrossaninteresting
componentandwonderwhatyoucoulddowithit.Thinkingupaproject
issomethingthatshouldbeallowedtogestateinthemindoftheEvil
Genius.Afterexploringalltheoptionsandmullingeverythingover,the
EvilGeniusprojectwillstarttotakeshape!
Ifyouenjoyedreadingthisbook,youmightliketoconsidersomeofthe
authorsotherbooksonArduinoandotherareasofelectronics.Pleasesee
www.simonmonk.org(http://www.simonmonk.org)forafulllist.
PREV
10enjoyed:
USB Projects w
People who finished this also
BOOK SECTION
NEXT
Appendix: Compo
BOOK SECTION
Daniel Mitchell
from: How I Made It, 2nd Edition by Rachel Bridge
Released: April 2010
6 MINS
BOOK SECTION
BOOK SECTION
Retrieving Information
INTRODUCTION
22 MINS
Certification / Design / Digital Media / Web Development
BOOK SECTION
21 MINS
Personal & Professional Development
BOOK SECTION
Chapter 6 Post-Production/Image
Manipulation
Introduction
from: Adventures in Arduino by Becky Stewart
Released: May 2015
36 MINS
DIY & Hardware
284 MINS
Digital Media
BOOK SECTION
BOOK SECTION
7 MINS
Core Programming
53 MINS
Business
BOOK SECTION
BOOK SECTION
5 MINS
59 MINS
Engineering