Silly Electronics for Fun and Absolutely no Proft
FlüüfffFirstfEditionf–f03/11/2017
FloerefT.fPillowcase,fDevourerfoffAutomobilesf(foere@robocow.be)
Silly Electronics for Fun and Absolutely no Proft - - PowerPoint PPT Presentation
Silly Electronics for Fun and Absolutely no Proft FlfffFirstfEditionff03/11/2017 FloerefT.fPillowcase,fDevourerfoffAutomobilesf(foere@robocow.be) Disclaimer Thisfpresentationfisfintendedfforf educationalfpurposesfonlyfandfdoesf
FloerefT.fPillowcase,fDevourerfoffAutomobilesf(foere@robocow.be)
2
3
– ButffeelffreeftofcomeffndfmefandfIfwillfhappilyf
– Iffnot,fdofnotfworry.fThisftalkfshouldfstillfmakef
4
5
6
7
8
– Arduinof/fT
– RaspberryfPi
https://www.arduino.cc/
9
microcontrollerfdofnotfmatchfthefdevicef youfarefconnectingfto.f
– 3.3Vf→f5VffffOK – 5Vffff→f3.3VfNOK
Unlessfthef3.3Vfinputfisf5Vftolerant.
levels.fThesefmess-upfsignalftiming.f (ButfOKfforfslowfthingsflikefpushf buttons.)
basedfonfMOSFET sf(e.g.fBSS138).f
– Thesefarefgoodfforf<f2fMHzfsignals. – Ifftoofslow,fusefafdedicatedflevelf
shifterfIC,fe.g.:f74LVx245fseries.
directionfsetfandfrespected!
10
11
12
– Currentfrelatesftofbrightness. – T
– Voltageftofcurrent?fJustfafresistor.
– Appliedfvoltagef(U) – LEDfforwardfvoltagefdropf(Uf) – LEDfcurrentf(I)
– Thefcurvefisfforfaf20fmAfredfLED. – (5fVf–f1.8fV)f/f20e-3fAf=f160fΩ – NearestflargerfE12fvalue:f180fΩf – Keepfthefunitsfconsistent!
LEDs,fthefvoltagefdropfisf~thefsamefforf allfsmallfLEDs.fItfdependsfonfthefcolour.
– Normalfdrivefcurrentfisf~20fmA – High-efciencyftypesfwillfrequirefless! http://www.electronics-tutorials.ws/diode/diode_8.html
13
– Wefdropf~3.2fVfoverfthefresistorf=f64%fpowerfloss.
– Rf=ff68fΩf – Wefdropf~1.4fVfoverfthefresistorf=f28f%fpowerfloss.
– ThreefoffthesefLEDsfwillfjustfaboutfworkfwithf5fV.f
14
– GPIOflimits
–WithfblueforfwhitefLEDs,fthisfwillfgofdownftofone.f(Uffisfmuchfgreater.) –Af3.3fVfGPIOfwillfnotfbefableftofdrivefblueforfwhitefLEDsfdirectly. – MCUflimits
ypicalfmaximumfvaluesfaref100f–f200fmA.
– BrighterfLEDsfrequirefmuchfmorefcurrentfthanf20fmA.
– Canfbefscaledftofanyftotalfdrivefcurrent. – Thesefalsofallowfafhigherfsupplyfvoltage,fseparateffromfthefMCU. – Youfcanfalsofbuyfvariousf(multi-channel)fLEDfdriversffromfvariousfvendors. – BUT,ftherefisfafsimplerfway...
15
(RGBfLED)fcolourfandfbrightness.
driverfICfforfeachfLEDfindividually.
allfthefLEDsfyourself.
– Connectfaf5fVfsupply.f(Checkfthis!)
– Connectfyourffavouritefmicrocontrollerf
tofthefdigitalflines.
– Downloadfafsuitablefsupportflibrary.
(Buyfafstripfthatfhasfone!)
– Modifyfandfprogramfanfexample.
displayfsimplefanimations.f(E.g.:f winkingfsmileyfface.)
https://www.adafruit.com/
16
changedf(modulated).
– Expressedfinf%fdutyfcycle.
resultsfinfanfin-betweenfvalue.
fltered),fthefeyefdoesfnotfperceivef thefblinking.
– ClassfDfaudiofamplifers. – Motorfvariablefspeedfdrives. – LEDfdrivers. – Servofpositionfencoding.
17
18
– Highfdrivingfvoltagef(butflowfcurrent)fneedsf
specialfinverterf(90f–f150fVftypical)
– Needfanfinverterfwithfcontrolfinputfiffyouf
wantftofchangefbrightnessfinfsomefway.
– Onlyfonefspecifcfcolour. – Ratherfdim.fWillfonlyfworkfwellfinfthefdark.f
(Eg:fduringfdances)
– ELfsheetf→fLEDfstripsfunderftheffur,forfunderf
afdifuserfsheet.f
– ELfwiref→fSide-Emittingfplasticfopticalffbre
–Lightfsourcef(calledfaf“lightfengine”)fisf
extra.f3fWfversionsfarefinexpensive.
19
– RunfmultiplefLEDfstripsfinf
parallel,fwithfafhalffLEDf spacingfofset,fforflargerf areas.
– Usefanfopticalfdifuser
– 1fmmfplasticfopticalffbref
(POF)fisfinexpensive.f
– Joinfseveralfstrandsftofaf
brightfLED,forfusefafrealflightf enginefdriverfmodule.
– Feedfthefotherfendsftofwheref
youfwantflights.
– Jacketedfandfnon-jacketedf
POFfexists.
– Idea:fglowingfwhiskers!
20
– Useflensesfiffyoufcanfsparef
thefdepth.
– Usefafdifuserftofgetfanf
evenly-litfarea.
– Stencilsfcanfbefincorporatedf
intofthefopticalfpath.
– Usefafrayftracer.fThisfletsfyouf
testflensesfbeforefbuying.
https://arachnoid.com/OpticalRayTracer/
– Printfonfoverheadfprojectorf
transparencyfflm.fOrfcutfoutfaf shapeffromfsomefopaquef material.
– Afdifuseflightfsourcefwillfmakefaf
bigfdiference.
– Projectingfontofafdifuserfwillfalsof
work.
– Idea:fglowingftattoofunderffur!
21
22
– Vintagef8-bitfsound. – Yourfmicrocontrollerfcanfdofthis! – But:flimitedfrangefoffexpression. – Plentyfoffexamplesfon-line,fmodifyf
asfneeded.
asfshownfinfmostfon-linefexamples.f
– Needsfaffewfextrafpartsftofprotectf
yourfMCUfI/Ofpinfandfthefpiezo.
– Notfloudfenoughfforfperformance.
– Afveryfbasicfinterfacefcircuitftof
lineflevelfisfsuggestedfhere.
330R ~ok
23
Image creator unknown
24
– Musicforfsoundfefects?f – Characterfvoicefwithfsqueaksforfwords?
– Phoneforfsimplefportablefmusicfplayer. – Therefmanyfaudiofadd-onfboards. – AnfadvancedfMCUfcanfdofanything. – Considerfhowftofcontrolfthefaudio!
– Buyfanfampliferfkitforftake-apartfsomef
battery-poweredfloudspeakers.
– Class-Dfinfbridgeftopologyfpreferred! – Makefsurefit’sfbothfthermallyfandf
short-circuitfprotected.
– Criticalftofsystemfperformance!
https://www.adafruit.com/
25
Ohmfspeakerf(iffthefampliferfallowsf this).fItfwillfbeflouder.
rangefisfpreferredfinfmostfcases.
– MeanfSPLfinfdBfatf1W/m. – Youfwantfitfhigh,fbutfwithoutfbigf
peaksfinfthefresponse.
– Sameforfhigherfthanfyourfamplifer.f – BewarefthefdiferencefbetweenfRMSf
(music)fpowerfandfratedf(peak)f power.
thesefthingsfaboutftheirfproduct,fit’sf probablyfgoingftofbefbad…
26
toffront/backfcancellationfefects.
sealedfboxfenclosure.
– Bothfmustfhavefsufcientfsizeftof
work.fAreaf/fvolumefmatters.
– Stuffboxesfwithfdampingf
materialsfforfbetterfbass.
– Boxesfmustfbefwellfsealed,fbutf
notfentirely.f(Ambientfpressuref equalisationfisfneeded.)f
FlüüffBoardfOnefuserfmanual.f
– Youfarefwelcomeftofafpdffcopy!
www.robocow.be
27
This is what we’re building in the electronics workshop after this talk.
28
29
Gmork - Acrylic painting by Bruce White
30
forfthefsamefairffow.
– Tinyffansfsoundflikefhornetsfonfspeed.f
Thisfcanfbefaudibleftofyourfaudience.
– Therefarefveryfquietftypesfonfthef
market.fCheckfthefdBfratings!
– Lessfbatteryfdrainfwhenfslower. – Lessfnoisefwhenfslower. – Canfstillfaccessffull-blastfwhenfneeded.
canfbefhadfwithfcentrifugalftypes.
http://www.ebmpapst.com/
31
angularfpositionfsensor.
– Lotsfofftorque,fbutfnotfthatffast. – Don’tfover-stressfthemforfyou’llfbreakf
gears.
mechanismftoftakefoverloads.
– Quitefnoisy.
– Verify,fasftherefarefvariations. – Therefarefaffewfvariationsfonfthef
connectionfplugsfasfwell.
position,fvelocityfandfaccelerationfcontrol.
– ControlfisfviafafPWMfpulseftrain. – However,fnofreporting-backftofMCUfoffthef
actually-achievedfangle.
changeable! Images: www.robotpark.com
32
transmission.
– Veryfstrong,fbutfalsofveryfslow.
features,fsuchfasfwings.
– Drivefthemfusingfanf“H-bridge”fdriver,forf
afmanualfreversingfswitch.
– Useflimitfswitchesfiffyoufdon’tfneedfthef
fullfactuatorftravel.fTherefisfaflotfoffforce!
therefthatfwillftakefafPWMfpositionfandf havefthefdriverfbuilt-in.f(E.g.fActuonix)
– Usefulfforfsmallffeatures,fsuchfasfearsf
andftailfwags.f(Iffyoufcan’tfusefregularf servos.)
33
– Steppersfarefblindffeed-forwardfsystemsfandfmissedfstepsfarefnotfrecoveredffrom.f – RCfservosfwill,fiffpossible,fachieveftheirfintendedfpositionfdueftoflocalffeed-back. – Bothfmayfneverfactuallyfachievefthefcommand.f(Notfenoughftorqueftofmove,f
transmissionflinkagefslip,fetc…)
– Wrongfassumedfpositionfmayfcausefthefmechanismftofbefover-drivenfandfbroken! – Orfyoufjustfend-upfwithfyourfanimatronicsfinfafsillyfstate...
linkfthemftofthefmechanism.
– End-of-runfswitches.f(Basicfprotectionfandfpositionfcalibration.) – Digitalfencoder.f(Bothfabsolutefandfrelativefoutputfexists.) – Analogfpotentiometer.f(Bestfusefafspecialftypefforfthis.) – Capacitive/magnetic/opticalfdistancefsensors.
34
stage.f
– Somefmotorsfhavefthisfbuilt-in.f(e.g.:fcomputerffans,fRCfservos)
– Thisfcanfcrashfthefmicrocontrollerfandfmessfwithfotherfdevices. – Knowfthefdiferencefbetweenfrunningfcurrentfandfstart/stallfcurrent.
protectedfagainstfthesefwithfdiodes.f(Don’tfforgetfthisfiffyoufrollfyourfown.)
– Thisfcanfgetfintofyourfaudiofsystem.f – Filterfcapacitorsfmayfbefneededfonfthefmotor.
– Buyfthefappropriatefdriverfmodulefforfyourfmotor. – Makefsurefitfhasfshort-circuit/over-current,fandfthermalfprotection!
35
36
37
Not a whole lot has been done with interactive costumes yet...
38
– Onforfof. – But:ftheyfbounce...fAflot!
(E.g.:fMC14490,fMAX6816)
well,fevenfiffrecommendedf everywhere.
upfresistorfandfswitchftofgroundf (plusfaflittlefextra).
– Thisfinverts,fjustfswap-backfinf
software.
– Makesfwiringfmorefnoisefimmune!f
(Usefshieldedfwire.)
39
anglefandfpositionfsensorsfavailable.
forfthefanalogfADCfinput.
– Resistivefdividerfisfeasiest.
– Canfeasilyfusefshieldedfcablefforf
betterfnoisefimmunity.
– Mayfneedftoffipfdirectionfinf
software.
– Look-upftablefwithfinterpolation. – Correctingfequation. – Ignore.fQuitefoften,flinearityfnotf
important.
40
notfoverexpose).
– Controlfsoundsfandfaudiofplay-back. – Controlfofffacialfexpression.
magic.f(E.g.:fmagneticfswitchesfinfstrategicflocationsf&fmagnetfinfglove.)
– Controlfventilationflevel. – Controlfaudiofloudness. – Controlffacialfexpression. – T
urn-off(orfatfleastfreduce)flightsf&fsoundsfwhenfsittingfinfanfaudience.
41
42
– Batteriesfarefdangerousfthings! – LiPofbatteriesfarefespeciallyfdangerousfthings!
precautions.f(DiscussedfinfSafety.)
arefencased,fprotectedfLiPofcellsfandfmuchfsafer.
– Issue:fonlyf5V,f1forf2fAf(thus,f5forf10fW). – Iff5forf10fWfisn’tfenoughftofrunfyourfsuit,fandfyouf
can’tfsplitfthefload:
andffre-wallf+fotherfsafetyfmeasures.
– ThesefwillfefcientlyfconvertfandfregulatefDCf
voltagesftofotherfDCfvoltagesf(neff>0.8).
– “Buck”fconvertsfdown,f“boost”fconvertsfup. – Thinkfpowerfin,fpowerfout.
43
tofselectfthefbattery.
– Tryftofreducefthefnumberfoffdiferentfsupplyfvoltages. – Thinkfoffhowfthefwiringfwillfrunfinfthefsuit,fandfwhereftofplacefconnectorsf
(E.g.:ftoftakefthefheadfoffforfbreaks.)f
– Whilefaftotalffailurefwillfbeflessflikelyfwithfdistributedfpower,... – Managingfthisfisfaflogisticsfnightmarefandfgettingfitfwrongfwillfresultfinf
partialffailuresfwhilefperforming.f(Arefallfthefcellsffresh?fDofIfhavefallfthef variousfAA,fAAA,f9Vfcellsfwithfme?fHowflongfdoesfeachfgizmoflast?)
– Youfneedftoftakefbreaks,fusefthisftofswapfbatteries.fIffitfisfjustfthefonef
powerfbank,fthisfisfafno-brainer!fHavefanotherfonfafcharger.
44
45
– Constantfmotion. – Regularfhigh-velocityfimpacts. – Lotsfoffwireffexing. – Highfhumidity. – Chargefbuild-upfonfsyntheticfeverything.f
46
andfsecurefeverythingfproperly.
– Firstflinefoffdefence. – Willfkeepfthingsffromfshortingfout,f
beingfcrushed,forfgettingfloose.
– Givesfyoufafbaseftofattachf
connectorsfandfstrainfrelieffto.
– Helpsfkeepfsweat,fbeer,fcoinsfandf
keysfoutfoffthefcircuits.
everythingfonfafsolderboard!
47
– Partialfshortsfresultingfinfrandomfbuttonf
presses,fsensorfreadings,fMCUfissues...
– Long-termfelectrolysisfdamage. – Fungalfgrowth.
– Thisfwillfhelpfreducefconductivityfandf
andfcanfbefre-activatedfbyfmoisture.
– Preferablyfusef“safewash”fasffuxfremover. – Followfthefmanufacturer’sfinstructions!
coating.f
– Afpossiblefalternativefisfclearfpolyurethanef
varnish.f(Butfnofguarantees!)
– Carefulfnotftofcoatfswitches,fconnectors,forf
anythingfelsefthatfhasftofmakefcontactforf move.
– T
ape-offsuchfareasfwhenfspray-painting,forf justfusefafbrushftofapplyfthefproduct.
– CoatfbothfsidesfoffthefPCB!
48
notfROUNDfwires.
– Sofwhyfdoesfeveryonefkeepfdoingfthis?fItfisfnotf
reliable.f(Andfprooffthatftheyffailedfkindergarten!)
metalfsurfaces.
– Thisfisfwhatfkeepsfthefconnectionffromfoxidizingf
andfbecomingfunreliable.
– Matingfthefconnectorfalsofscrapes-off
contaminantsffromfthefsurfaces.
– Iffthefsurfacesfdofnotfmatefwell,fwithfthefrightf
shapefandfcontactfpressure,fthefcontactfwillffailf soonerfratherfthenflater.
– Metallurgyfmatters:fDofnotfbuyfAufoverfCu,fbutf
Au-Ni-Cu.fThefnickelfbarrierflayerfisfimportant!
– Managefthefunitsfinfthefsuit. – Insurefreliablefconnections. – Makefmaintenancefsimpler.
connections.fChoosefgenderfsofpowerfplugsfcanf notfshortf(femalefpinsfonfthefbatteryfside).
49
andfcausefintermittentffaults.
high-currentfcircuits!
– Willfalsofworkfwithfstrandedf
conductors.
– NASAfapproves!f(P
.f71) NASA-STD-8739.4Af–f2016-06-30
– Thisfdocumentfshowsfeveryfotherf
methodfasfwell,fandfhowftofdof them.fAfveryfusefulfmanual.
50
repeatedlyffexedfoffpulled.
– Don’tftinfwiresfforfusefinfscrewf
connectors,fusefwirefendfferrulesf instead!
reliability.
relieffintegratedfinfthefconnectorf housing.
distanceffromfafsolderfjointfwithfaf nylonfcableftieftofafsupportfwillf alsofhelpfaflot. Solder Screw
51
thatfgetfpulled-loosefduringfperformance.
costumefasforgansfandfthefmammalianf nervousfsystem.
– Layfitfoutfasfsuch,fasfanfintegralfpartfoffthef
costume.
– Thinkfoffhowfyoufwillfmovefandfbend. – Thefbrainfmayfnotfbefinfthefhead!
yourfcostume!
– Afwiringfharnessfwillfmakefthisfeasy:fallfthef
wiringfbecomesfonef“thing”,fwithfthef variousfdevicesfconnectedftofitfviaf separablefconnectors.
nylonfwovenftubes,felectricalftape,fetc…f Therefarefmanyfproductsfonfthefmarketftof makefafnicefharness.
committingftofaftechnique.
52
justfbyfshufingfoverfafcarpet.
– Whilefdry,faffursuitfisfanfambulant,ffufyf
electrostaticfgenerator.
againstfElectro-StaticfDischarge,fbutfnotf enough.
thatfconnectsftofoutboardfwires,fforfbothf analogfandfdigitalfpins.
protectionfisfshownfhere,fusablefforfMCUf digitalfandfanalogfpinsf(0ftof5fVfrange).
– Thisfisfnotfcomprehensive,fbutfwillfhelp. – SimplefprotectionfusingfafTVSfdiodefandf
thefESDfdiodesfbuiltfintofthefchip.
– Seriesfresistorfalsofhelpsfagainstfoutput-
to-outputferrorsfandfaccidentalfshorts.
– Rxfdependsfonfthefapplication.f1Kfwillf
53
arefcurrentflimited.
– Loadfchangesfhavefanfefect. – Heavyfloadf(peaks)fcanfde-stabilizef
yourfpowerfbus.
– Motorsfandfaudiofamplifersfarefthef
usualfcause.
canfcrashfyourfMCUforfdisturbfotherf digitalfdevices.
(MCU)ffromfthefpowerfbusfwithfaf Schottkyfdiodefandfaflocalfbuferf capacitor.fThisfisfoftenfveryfefective.
groundfpotentialfswingsfinfcheck.
thefpointfoffafheavyfloadfcanfalsofhelp.f (Butflargefin-rushfcurrentfatfstart-up!)
54
55
56
57
powerfsupplyforflightningfstrike.fAsfyoufarefwearingfthem,fyoufcannotfdisengage.
(Suchfasfphoneflines,fnetworkfcables,faudio/videofsystems,fetc…)f
– Nofmains-poweredfenergyfsourcefisfallowedfwhilefwearingfthefcostume.f
Thus,fnofadapters,fchargers,fbenchftopfpowerfsupplies,fetc...fmayfbefin-use!
– Nothingfmayfbefconnectedftofanythingfthatfisfnotfexclusivelyfbatteryfpoweredf
itselffandfisolatedffromfoutsidefsystems.
– Nofelectricalfconnectionsftofoutsidefsystemsf(suchfasfphoneflines,fnetworkf
cables,faudio/videofsystems,fetc…)farefallowed.f
– IffyoufneedftofsendfaudioftofthefDJ/PAfsystem,fusefafwirelessfapproachf(e.g.f
Bluetooth),forfhold/stickfafmicrophonefinffrontfoffyourfcostumefloudspeakers.
tofbefsafe,fbutfemployfgoodfelectricalfsafetyfpracticesfasfnothingfisfguaranteed.f Also:fRFfburnsflastflongfandfhurt.
58
59
60
61
– Componentsfcanfoverheatfandfburn,fevenfatflowfcurrents. – Wiresfcanfoverheatfandfcauseftheirfinsulationftofcatchffre. – Sparkingfisfalsofpossible.
materials,fyourfhair,fetc…)
– Batteryffusesfgofrightfatfthefbattery,ftofprotectfthefwiringffromfcatchingffre.
– Usefconnectorsfwithfshells. – Enclosefyourfelectronicsfinfprojectfboxes. – Usefstructuralfsupportsftofkeepfcostumefmaterialsfawayffromfelectricalfparts. – Installfnon-combustiblefandfthermally-isolatingflayersfiffnecessary.
– Usefheatfshrinkftofisolatefthings. – Makefproperfwirefjoints.f(Solderedf“linemanfsplice”,fdoubleflayerfheatfshrink.) – Usefmaterialsfratedfforfthefintendedfuse.f(Observefcurrentfratings,fvoltagefratings,fetc...)
62
63
– Highfshort-circuitfcurrentsfcauseffre,fbatteryfover-heating. – Hotfchemicalsfcanfventfout,forfresultfinfafchemicalffre. – H2fisfafcommonfby-productfoffoverheatingfcells... – Batteryffusesfarefonlyfaffrst-linefoffdefence.
64
65
66
– Nylon,fspandex,fpolyester,fpolycotton,ffoams,fresins,fglues,f... – Manyfhaveflargefsurfacefareasf(imitationffur,ffeece). – Stufngfisfoftenfpolyurethaneffoam.
– Somefemitftoxicffumes. – Manyfalsofmelt.f→fThisfisfveryfbadfnewsfforfburnfwounds!
– Theyfmakeftheffrefself-extinguishfandfkeepfitffromfspreading.
– Onlyftwofpracticalfways:
estfeachfmaterialfwithfafgasf(butane/propane)ftorch.f(Outside,fandfhavefmeansftof extinguishfaffrefatfhand.)fTheffrefshouldfstopfwhenftheffamefisfremoved.
– Bestftoftestfsamplesfoffallfthefmaterialsfused.
67
68
– Goodfqualityffurfappearsfproperlyffamefretardant. – Cheapffurfdefnitelyfisfnot! – Foamsfarefafproblem.fYoufmustfdefnitelyftestftheffoamfinf
yourfcostume!
– Theyfburnfandfmeltfintofyourfskin. – BuyfNomexf(andfsimilarfmaterials)! – Gofshopfatfmotorsportsfplaces,fthey
havefthisfstuffforfdriverffrefsafety.
Therefisfsomeftimeftofextinguishforfescape.
69
70
upfinsidefthefcostume.fNowfwhat?
– Accessftoffreshfair!f(removablefheadfpiece?) – Quickfegressffromfthefcostume!
panicking.
handlerfcarries,fripablefseams,fetc…
evacuation?f(E.g.:fwings.)
71
72
– Small,frechargablefLiPofbatteryffresfcanfbefextinguishedfwithfwater. – Mostfoffthefotherfmaterialsfarefalsofreadilyfextinguishfwithfwater.
– STOPf–fDROPf–fROLL – Dofnotfrun!fYoufmayfhaveftofbringfafpersonftofthefgroundfifftheyfarefpanickingf
andfrunningf(legfsweep).
– Havefthefusualffreffghtingfdevicesfonfhand:
burnedfareasfwithfsterilefcotton.
73
74
– Forcesfcanfbefhigh,fedgesfsharp…
75
– Beingfcreativefmeansfworkingfbothfwithfandf
– Usually,ftherefisfafknownfsolution.
– Dofitfwell. – Scale-downfthefambitionfuntilfyoufcanfdofitfwell.
76
77
“Dumb Ways to Die” PSA by Metro Trains, Melbourne, Australia