Está en la página 1de 10

Arduino Workshop

NEXT

PREV

Acknowledgments

2. Exploring the Ar

Recent

Topics
Tutorials

Chapter1.Getting Started

Highlights

Settings
Feedback(http://community.safaribooksonline.com)

Haveyoueverlookedatsomegadgetandwonderedhowitreallyworked?
Maybeitwasaremotecontrolboat,thesystemthatcontrolsanelevator,a

Sign Out

vendingmachine,oranelectronictoy?Orhaveyouwantedtocreateyour
ownrobotorelectronicsignalsforamodelrailroad,orperhapsyoudlike
tocaptureandanalyzeweatherdataovertime?Whereandhowdoyou

Settings

start?
TheArduinoboard(showninFigure11)canhelpyoufindsomeofthe
answerstothemysteriesofelectronicsinahandsonway.Theoriginal
creationofMassimoBanziandDavidCuartielles,theArduinosystem

10 days left in your trial.

Feedback(http://community.safaribooksonline.com/)

offersaninexpensivewaytobuildinteractiveprojects,suchasremote
controlledrobots,GPStrackingsystems,andelectronicgames.
TheArduinoprojecthasgrownexponentiallysinceitsintroductionin
2005.Itsnowathrivingindustry,supportedbyacommunityofpeople
unitedwiththecommonbondofcreatingsomethingnew.Youllfindboth
individualsandgroups,rangingfrominterestgroupsandclubstolocal
hackerspacesandeducationalinstitutions,allinterestedintoyingwiththe
Arduino.

Figure11.TheArduinoboard

TogetasenseofthevarietyofArduinoprojectsinthewild,youcan
simplysearchtheInternet.Youllfindalistofgroupsoffering
introductoryprogramsandcourseswithlikeminded,creativepeople.

The Possibilities Are Endless


AquickscanthroughthisbookwillshowyouthatyoucanusetheArduinotodo
somethingassimpleasblinkingasmalllight,orevensomethingmore
complicated,suchasinteractingwithacellularphoneandmanydifferent
thingsinbetween.
Forexample,havealookatPhilipLindsaysdevice,showninFigure12.Itcan
receivetextmessagesfromcellularphonesanddisplaythemonalargesignfor
useindancehalls.ThisdeviceusesanArduinoboardandacellularphoneshield
toreceivetextmessagesfromotherphones(similartoProject65).Thetext
messageissenttoapairoflarge,inexpensivedotmatrixdisplaysforeveryoneto
see.

Subscribe.

Sign Out

Figure12.SMS(shortmessageservice)textmarquee

YoucanpurchaselargedisplayboardsthatareeasytointerfacewithanArduino,
soyoudonthavetomakeyourowndisplayfromscratch.(Formore
information,visithttp://www.labradoc.com/i/follower/p/projectsmstext
scroller(http://www.labradoc.com/i/follower/p/projectsmstextscroller).)
Howaboutcreatingauniquemarriageproposal?TylerCooperwantedan
originalwaytoproposetohisgirlfriend,sohebuiltwhathecallsareverse
geocacheboxasmallboxthatcontainedanengagementring,asshownin
Figure13.Whentheboxwastakentoacertainarea(measuredbytheinternal
GPS),itunlockedtorevealaromanticmessageandthering.Youcaneasily
reproducethisdeviceusinganArduinoboard,aGPSreceiver,andanLCD
module(asusedinChapter13),withasmallservomotorthatactsasalatchto
keeptheboxcloseduntilitsinthecorrectlocation.Thecoderequiredtocreate
thisisquitesimplesomethingyoucouldcreateinafewhours.Themosttime
consumingpartischoosingtheappropriateboxinwhichtoenclosethesystem.
(Formoreinformation,visithttp://learn.adafruit.com/reversegeocache
engagementbox/(http://learn.adafruit.com/reversegeocacheengagementbox/).)

Figure13.MarriageproposalviaArduino

Heresanotherexample.KurtSchulzwasinterestedinmonitoringthebattery
chargelevelofhismoped.However,afterrealizinghowsimpleitistoworkwith
Arduino,hisprojectmorphedintowhathecallstheScooterputer:acomplete
mopedmanagementsystem.TheScooterputercanmeasurethebatteryvoltage,
plusitcandisplaythespeed,distancetraveled,tiltangle,temperature,time,date,
GPSposition,andmore.Italsocontainsacellularphoneshieldthatcanbe
controlledremotely,allowingremotetrackingofthemopedandengineshutdown
incaseitsstolen.Theentiresystemcanbecontrolledwithasmalltouchscreen,
showninFigure14.Eachfeaturecanbeconsideredasimplebuildingblock,and
anyonecouldcreateasimilarsysteminacoupleofweekends.(See
http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer/(http://www.janspace.com/b2evolution/arduino.php/2010/06/26/scooterputer/).)

Figure14.TheScooterputerdisplay(courtesyofKurtSchulz)

ThentheresJohnSarik,whoenjoysthepopularSudokumathpuzzleshealso

likesworkingwithNixienumericdisplaytubes.Withthosetwodriversinmind,
Johncreatedahuge81digitSudokugamecomputer!Theusercanplayafull9
by9game,withtheArduinoincontrolofthedigitsandcheckingforvalid
entries.Althoughthisprojectmightbeconsideredamoreadvancedtype,itis
certainlyachievableandtheelectronicsarenotcomplex.Thedeviceisquite
largeandlooksgreatmountedonawall,asshowninFigure15.(See
http://trashbearlabs.wordpress.com/2010/07/09/nixie
sudoku/(http://trashbearlabs.wordpress.com/2010/07/09/nixiesudoku/).)

Enjoy Safari? Subscribe Today

TheteamatOomloutevenusedtheArduinotocreateaTwypeWriter.Theyfitted
anArduinoboardwithanEthernetshieldinterfaceconnectedtotheInternet,

You have 10
days left in
your trial,
Mihai.bogan.

whichsearchesTwitterforparticularkeywords.Whenakeywordisfound,the
tweetissenttoanelectrictypewriterforprinting.TheArduinoboardis
connectedtothetypewriterskeyboardcircuit,whichallowsittoemulateareal
persontyping,asshowninFigure16.(Seehttp://oomlout.co.uk/blog/twitter
monitoringtypewrittertwypwriter/(http://oomlout.co.uk/blog/twittermonitoringtypewritter
twypwriter/).)

TheseareonlyafewrandomexamplesofwhatispossibleusinganArduino.
Youcancreateyourownprojectswithoutmuchdifficultyandafteryouve
workedthroughthisbook,theyarecertainlynotoutofyourreach.

Safari is your trusted guide for building


a remarkable career. We hope you've
been enjoying your trialready to join?

Subscribe Today
/ Contact
Us(http://safaribooksonline.com/contact/) /
Blog(http://blog.safaribooksonline.com)
2015 Safari(http://www.safaribooksonline.com)
Terms of Service /
Membership Agreement / Privacy Policy

Figure15.NixietubeSudoku

Figure16.TheTwypeWriter

Strength in Numbers
TheArduinoplatformincreasesinpopularityeveryday.Ifyouremoreofa
sociallearnerandenjoyclassorientedsituations,searchtheWebforCultof
ArduinotoseewhatpeoplearemakingandtofindArduinorelatedgroups.
MembersofArduinogroupsintroducetheworldofArduinofromanartists
perspective.ManygroupmembersworktocreateasmallArduinocompatible
boardatthesametime.Thesegroupscanbealotoffun,introduceyouto
interestingpeople,andletyoushareyourArduinoknowledgewithothers.

Parts and Accessories


Aswithanyotherelectronicdevice,theArduinoisavailablefrommanyretailers
thatofferarangeofproductsandaccessories.Whenyoureshopping,besureto
purchasetheoriginalArduino,notaknockoff,oryouruntheriskofreceiving
faultyorpoorlyperforminggoodswhyriskyourprojectwithaninferiorboard
thatcouldendupcostingyoumoreinthelongrun?ForalistofArduino
suppliers,visithttp://arduino.cc/en/Main/Buy/(http://arduino.cc/en/Main/Buy/).
Heresalistofcurrentsuppliers(inalphabeticalorder)thatIrecommendfor
yourpurchasesofArduinorelatedpartsandaccessories:
AdafruitIndustries(http://www.adafruit.com/(http://www.adafruit.com/))
DigiKey(http://www.digikey.com/(http://www.digikey.com/))

JamecoElectronics(http://www.jameco.com/(http://www.jameco.com/))
LittleBirdElectronics
(http://www.littlebirdelectronics.com/(http://www.littlebirdelectronics.com/))
Newark(http://www.newark.com/(http://www.newark.com/))
nicegear(http://www.nicegear.co.nz/(http://www.nicegear.co.nz/))
Oomlout(http://www.oomlout.co.uk/(http://www.oomlout.co.uk/))
RadioShack(http://www.radioshack.com/(http://www.radioshack.com/))
RSComponents(http://www.rscomponents.com/(http://www.rscomponents.com/))
SparkFunElectronics(http://www.sparkfun.com/(http://www.sparkfun.com/))
Asyoullseeinthisbook,IuseseveralArduinocompatibleproductsfrom
Freetronics(http://www.freetronics.com/(http://www.freetronics.com/)).However,you
willfindthatalltherequiredpartsarequitecommonandeasilyavailablefrom
variousresellers.
Butdontgoshoppingyet.Takethetimetoreadthefirstfewchapterstogetan
ideaofwhatyoullneedsothatyouwontwastemoneybuyingunnecessary
thingsimmediately.

Required Software
YoushouldbeabletoprogramyourArduinowithjustaboutanycomputerusing
apieceofsoftwarecalledanintegrateddevelopmentenvironment(IDE).Torun
thissoftware,yourcomputershouldhaveoneofthefollowingoperatingsystems
installed:
MacOSXorhigher
WindowsXP32or64bit,orhigher
Linux32or64bit(Ubuntuorsimilar)
NowisagoodtimetodownloadandinstalltheIDE,sojumptotheheadingthat
matchesyouroperatingsystemandfollowtheinstructions.Makesureyouhave
orbuythematchingUSBcableforyourArduinofromthesupplieraswell.Even
ifyoudonthaveyourArduinoboardyet,youcanstilldownloadandexplorethe
IDE.BecausetheIDEversionnumbercanchangequiterapidly,thenumberin
thisbookmaynotmatchthecurrentversion,buttheinstructionsshouldstill
work.

NOTE
Unfortunately,asthisbookwenttopress,therewereissues
withWindows8installations.IfyouhaveWindows8,visitthe
ArduinoForumat
http://arduino.cc/forum/index.php/topic,94651.15.html(http://arduino.cc/forum/index.php/topic,94651.15.html)
forguidanceanddiscussion.

Mac OS X
Inthissection,youllfindinstructionsfordownloadingandconfiguringthe
ArduinoIDEinMacOSX.
Installing the IDE
ToinstalltheIDEonyourMac,followtheseinstructions:
1. UsingawebbrowsersuchasSafari,visitthesoftwaredownloadpage
locatedat
http://arduino.cc/en/Main/Software/(http://arduino.cc/en/Main/Software/),asshown
inFigure17.

Figure17.TheIDEdownloadpageinSafari

2. ClicktheMacOSXlink.Thefilewillstartdownloading,anditwill
appearintheDownloadswindowshowninFigure18.

Figure18.Filedownloadiscomplete.

3. Onceitsfinisheddownloading,doubleclickthefiletostartthe
installationprocess.Youwillthenbepresentedwiththewindowshownin
Figure19.

Figure19.YournewArduinoIDEfolder

NOTE
ThethirdfileiconshowninFigure19needstobe
installedonlyifyouhaveanArduinoboardolderthan
thecurrentUno.

4. DragtheArduinoiconovertheApplicationsfolderandreleasethemouse
button.Atemporarystatuswindowwillappearasthefileiscopied.
5. NowconnectyourArduinotoyourMacwiththeUSBcable.Aftera
moment,thedialogshowninFigure110willappear.

Figure110.AnewArduinoboardisdetected.Yourdialogmayread
UnoinsteadofEleven.

6. ClickNetworkPreferences...,andthenclickApplyintheNetworkbox.
Youcanignorethenotconfiguredstatusmessage.
Setting Up the IDE
OnceyouhavedownloadedtheIDE,usethefollowinginstructionstoopenand
configuretheIDE:
1. OpentheApplicationsfolderinFinder(showninFigure111)anddouble
clicktheArduinoicon.

Figure111.YourApplicationsfolder

2. Awindowmayappearwarningyouaboutopeningawebapp.Ifitdoes,
clickOpentocontinue.YouwillthenbepresentedwiththeIDE,as
showninFigure112.

Figure112.TheIDEinMacOSX

3. YourealmosttherejusttwomorethingstodobeforeyourArduinoIDE
isreadytouse.First,youneedtotelltheIDEwhichtypeofsocketthe
Arduinoisconnectedto.SelectToolsSerialPortandselectthe
/dev/tty.usbmodem1d11option,asshowninFigure113.

Figure113.SelectingtheUSBport

4. ThefinalstepistotelltheIDEwhichArduinoboardyouhaveconnected.
Thisiscrucial,sinceArduinoboardsdodiffer.Forexample,ifyouhave
themostcommonboard,theUno,thenselectToolsBoardArduino
Uno,asshowninFigure114.ThedifferencesinArduinoboardsare
explainedinmoredetailinChapter11.
Nowyourhardwareandsoftwarearereadytoworkforyou.Next,moveonto
Safety.

Figure114.SelectingthecorrectArduinoboard

Windows XP and Later


Inthissection,youllfindinstructionsfordownloadingtheIDE,installing
drivers,andconfiguringtheIDEinWindows.
Installing the IDE
ToinstalltheArduinoIDEforWindows,followtheseinstructions:
1. UsingawebbrowsersuchasFirefox,visitthesoftwaredownloadpage
locatedat
http://arduino.cc/en/Main/Software/(http://arduino.cc/en/Main/Software/),asshown
inFigure115.

Figure115.TheIDEdownloadpageinWindowsFirefox

2. ClicktheWindowslink,andthedialogshowninFigure116willappear.
SelectOpenwithWindowsExplorer,andthenclickOK.Thefilewill
starttodownload,asshowninFigure117.

Figure116.Downloadingthefile

Figure117.Firefoxshowstheprogressofyourdownload.

3. Oncethedownloadiscomplete,doubleclickthefile,andthewindow
showninFigure118willappear.

Figure118.TheIDEpackage

4. Copythefoldernamedarduino0022(orsomethingsimilar)tothe
locationwhereyoustoreyourapplications.Oncethecopyingisfinished,
locatethefolderandopenittorevealtheArduinoapplicationicon,as
showninFigure119.Youmaywishtocopytheiconandplaceashortcut
onthedesktopforeasieraccessinthefuture.

Figure119.YourIDEfolderwiththeArduinoapplicationiconselected

Installing Drivers
ThenexttaskistoinstallthedriversforyourArduinoboardsUSBinterface.
1. ConnectyourArduinotoyourPCwiththeUSBcable.Afterafew
momentsanerrormessagewillbedisplayed,whichwillsaysomething
likeDevicedriversoftwarenotsuccessfullyinstalled.Justclosethat
dialogorballoon.

2. NavigatetotheWindowsControlPanel.OpentheDeviceManagerand
scrolldownuntilyouseetheArduino,asshowninFigure120.

Figure120.TheDeviceManager

3. RightclickArduinoUnounderOtherDevicesandselectUpdateDriver
Software.Then,selecttheBrowsemycomputerfordriversoftware
optionthatappearsinthenextdialog.AnotherBrowseForFolderdialog
willappearclickBrowse,andnavigatetothedriversfolderinthenewly
installedArduinosoftwarefolder(showninFigure121).ClickOK.

Figure121.Locatingthedriversfolder

4. ClickNextinthedialogthatfollows.Windowsmaypresentamessage
statingthatitcannotverifythepublisherofthedriversoftware.Click
Installthissoftwareanyway.Afterashortwait,Windowswilltellyou
thatthedriverisinstalledandtheCOMportnumbertheArduinois
connectedto,asshowninFigure122.

Figure122.Thedrivershavebeenupdatedsuccessfully.

Setting Up the IDE


Okay,werealmosttherejusttwomorethingstodotofinishsettingupthe
IDE.
1. OpentheArduinoIDE.YouneedtotelltheIDEwhichtypeofsocketthe
ArduinoisconnectedtobyselectingToolsSerialPortandselectingthe
COMportnumberthatappearedintheUpdateDriverSoftwarewindow.
2. ThefinalstepistotelltheIDEwhichArduinoboardwehaveconnected.
Thisiscrucial,astheArduinoboardsdodiffer.Forexample,ifyouhave
theUno,selectToolsBoardArduinoUno.Thedifferencesin
ArduinoboardsareexplainedinmoredetailinChapter11.
NowthatyourArduinoIDEissetup,youcanmoveontoSafety.

Ubuntu Linux 9.04 and Later


IfyouarerunningUbuntuLinux,hereareinstructionsfordownloadingand
settinguptheArduinoIDE.
Installing the IDE
UsethefollowinginstructionstoinstalltheIDE:
1. UsingawebbrowsersuchasFirefox,visitthesoftwaredownloadpage

locatedat
http://arduino.cc/en/Main/Software/(http://arduino.cc/en/Main/Software/),asshown
inFigure123.

Figure123.TheIDEdownloadpageinUbuntuFirefox

2. ClicktheLinux32bitor64bitlink,dependingonyoursystem.When
thedialoginFigure124appears,selectOpenwithArchiveManager
andclickOK.

Figure124.Downloadingthefile

3. Afterthefilehasdownloaded,itwillbedisplayedintheArchiveManager,
asshowninFigure125.Copythearduino0022folder(orsomething
similar)toyourusualapplicationorHomefolder.

Figure125.TheIDEpackage

Setting Up the IDE


Next,youllconfiguretheIDE.
1. ConnectyourArduinotoyourPCwiththeUSBcable.Atthispointyou
wanttoruntheArduinoIDE,solocatethearduino0022folderyou
copiedearlieranddoubleclickthearduinofilethatsselectedinFigure1
26.

Figure126.YourArduinoIDEfolderwiththearduinofileselected

2. IfthedialogshowninFigure127appears,clickRun,andyouwillbe
presentedwiththeIDE,asshowninFigure128.

Figure127.GrantingpermissiontoruntheIDE

Figure128.TheIDEinUbuntu

3. NowthattheIDEisrunning,weneedtotellitwhichtypeofsocketthe
Arduinoisconnectedto.SelectToolsSerialPortandselectthe
/dev/ttyACMxport,wherexisasingledigit(thereshouldbeonlyone
portwithanamelikethis).
4. Next,telltheIDEwhichArduinoyouhaveconnected.Thisiscrucial,as
Arduinoboardsdodiffer.Forexample,ifyouhavetheUno,selectTools
BoardArduinoUno.ThedifferencesinArduinoboardsareexplained
inmoredetailinChapter11.
Nowyourhardwareandsoftwarearereadytoworkforyou.

Safety
Aswithanyhobbyorcraft,itsuptoyoutotakecareofyourselfandthose
aroundyou.Asyoullseeinthisbook,Idiscussworkingwithbasichandtools,
batterypoweredelectricaldevices,sharpknives,andcuttersandsometimes
solderingirons.Atnopointinyourprojectsshouldyouworkwiththemains
current.Leavethattoalicensedelectricianwhoistrainedforsuchwork.
Rememberthatcontactingthemainscurrentwillkillyou.

Looking Ahead
Youreabouttoembarkonafunandinterestingjourney,andyoullbecreating
thingsyoumayneverhavethoughtpossible.Youllfind65Arduinoprojectsin
thisbook,rangingfromtheverysimpletotherelativelycomplex.Allare
designedtohelpyoulearnandmakesomethinguseful.Soletsgo!

Recommended / Queue / Recent / Topics / Tutorials / Settings / Blog(http://blog.safaribooksonline.com) /


Feedback(http://community.safaribooksonline.com/) / Sign Out
2015 Safari(http://www.safaribooksonline.com/).
Terms of Service / Privacy Policy

También podría gustarte