Tải bản đầy đủ (.pdf) (606 trang)

Raspberry pi mechatronics projects HOTSHOT by sai yamanoor

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (8.47 MB, 606 trang )



RaspberryPiMechatronicsProjects
HOTSHOT


TableofContents
RaspberryPiMechatronicsProjectsHOTSHOT
Credits
AbouttheAuthors
AbouttheReviewers
www.PacktPub.com
Supportfiles,eBooks,discountoffers,andmore
Whysubscribe?
FreeaccessforPacktaccountholders
Preface
Whatthisbookcovers
Whatyouneedforthisbook
Whothisbookisfor
Conventions
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
Missionchecklist
Task1
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Classifiedintel
Readerfeedback
Customersupport


Downloadingtheexamplecode
Downloadingthecolorimagesofthisbook
Errata
Piracy
Questions


1.HelloWorld
AquickintroductiontotheRaspberryPi
FeaturesofaRaspberryPi
WherecanIbuyaRaspberryPi?
RequirementstogetstartedwiththeRaspberryPi
OperatingsystemsontheRaspberryPi
GettingstartedwithRaspbian
DownloadingRaspbian
FlashingimageontotheSDcard
Windows
Linux
Acommand-lineinterface-basedapproach
IdentifyingtheSDcardmountpoint
UnmounttheSDcard
FlashtheSDcard
GUI-basedapproach
SettinguptheRaspberryPi
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
Missionchecklist
Huntingandgathering
Engagethrusters

Objectivecomplete–minidebriefing
SettinguptheGPIO
Engagethrusters
InstallingGPIOlibraries
Objectivecomplete–minidebriefing
GPIOprogrammingusingPython
Engagethrusters
Analternativetoquick2wire–RPi.GPIO


Objectivecomplete–minidebriefing
Electricaloutputofourprogram
Engagethrusters
Objectivecomplete–minidebriefing
IntroductiontothePiCrust–aprototypingplatformfortheRaspberryPi
Missionaccomplished
Hotshotchallenge
2.ARaspberryWebIDEExample
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
Missionchecklist
Installation,features,andusageoftheOccidentalisoperatingsystemfromAdafruit
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
SetupofaremoteloginintotheRaspberryPi
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing

InstallationoftheRaspberryPiWebIDE
Engagethrusters
Objectivecomplete–minidebriefing
PythondevelopmentontheWebIDE
Prepareforliftoff
QuickintroductiontotheI2Cinterface
ConfiguringtheI2CinterfaceontheRaspberryPi
Engagethrusters
Objectivecomplete–minidebriefing
TestanddebuggingexamplesusingtheWebIDE
Prepareforliftoff


Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
3.TheArduinoRaspberryPiInterface
Missionbriefing
Whyisitawesome?
WherecanyoubuyanArduino?
YourHotshotobjectives
Missionchecklist
InstallingtheArduinoIDE
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
ProgrammingtheArduinousingtheRaspberryPi
Prepareforliftoff
Engagethrusters

Objectivecomplete–minidebriefing
RaspberryPiAlaMode
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
TheWeasleyweatherclock
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
ControllingthestepperusingtheArduino
Prepareforliftoff
Engagethrusters
Counterclockwiserotationofthesteppermotor
Objectivecomplete–minidebriefing


ControllingtheRGBLEDStripusingtheArduino
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
I2CCommunicationusingtheArduino(optional)
Prepareforliftoff
Engagethrusters
The7-Segmentdisplay
8x8LEDmatrix
BlinkM
Proximitysensor
Objectivecomplete–minidebriefing
SerialportcommunicationwiththeRaspberryPi
Engagethrusters

PythonprogramfortheWeasleyclock
Arduinoacknowledgementtocontrolsignal
Controlflowfortheweatherclock
Temperaturedata
ControloftheRGBLEDstrip
Controlofstepperviaserialport
Programmingtheweatherforecastposition
8x8matrixcontrol
BlinkMcontrol
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
4.ChristmasLightSequencer
Missionbriefing
Whyisitawesome?
Yourobjectives
Missionchecklist


InterfacethedevicestotheRaspberryPi
Prepareforliftoff
Engagethrusters
ConnectingmultipleappliancestotheRaspberryPi
Objectivecomplete–minidebriefing
SettingupthedigitallyaddressableRGBmatrix
Prepareforliftoff
WherecanIbuythem?
Engagethrusters
Howdoesitwork?
LightinguptheRGBLEDstrip

AnArduino-basedcontrol
Objectivecomplete–minidebriefing
Interfaceofanaudiodevice
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Installingthewebserver
Prepareforliftoff
Engagethrusters
Objectivecomplete–missiondebriefing
Interfacingthewebserver
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
References
5.InternetofThingsExample–AnE-mailAlertWaterFountain
Missionbriefing
Whyisitawesome?
Yourobjectives


Missionchecklist
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
InstallationoftheFlaskframework
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing

ControllingRGBLEDsfromawebpage
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Setupofthee-mailalertsinthefountain
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
6.RaspberryPiasaPersonalAssistant
Missionbriefing
Whyisitawesome?
Yourobjectives
Missionchecklist
Settingupthee-mailfeedparser
Prepareforliftoff
Engagethrusters
Settinguptheparserforremindersandevents
Prepareforliftoff
Engagethrusters
Designinganenclosuredesignforthepersonalassistant
Prepareforliftoff


Engagethrusters
Settinguptheassemblyforthedishmonitor
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing

Settingupsensorsforthekeyalertsystem
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenges
References
7.RaspberryPi-basedLineFollowingRobot
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
Missionchecklist
AssemblyofthePiPlateforthelinefollowingrobot
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Sensorselection,interface,anddatainterpretation
Engagethrusters
LightDependentResistors
Infraredemitter/detector
Machine-vision-basedlinefollowingrobot
Sensorselection
Objectivecomplete–missiondebriefing
Implementationoflinefollowinglogicbasedonsensordata
Prepareforliftoff
Engagethrusters


Objectivecomplete–minidebriefing
Testingthemotordrivercircuit

Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Preparationofthelinefollowingcourse
Prepareforliftoff
Engagethrusters
Useelectricaltapeandbuildatrack
Designingthechassisforthelinefollowingrobot
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Astep-by-stepassemblyoftherobot
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
References
8.ConnectFourDesktopGameusingRaspberryPi
Missionbriefing
Whyisitawesome?
Yourobjectives
Missionchecklist
Helloworldexamplewiththepygame
Prepareforliftoff
Engagethrusters
Playingsoundsusingthepygamemodule
Buildingmenususingthepygamemodule
Objectivecomplete–minidebriefing



GettingstartedwiththeConnectFourgame(UIandsoundeffects)
Prepareforliftoff
EngageThrusters
Addingamenuforthegame
Addingsoundstothegame
Objectivecomplete–missiondebriefing
InterfacinggameinputsusingthePiFacemodule
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
AbriefdescriptionoftheConnectFourGameAI
Prepareforliftoff
Engagethrusters
Maingameloop
Objectivecomplete–minidebriefing
Marqueedesignandcontrol(optional)
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Setupoftheswitchesusingacardboardbox
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
References
9.TheRaspberryPi-enabledPet/WildlifeMonitor
Missionbriefing
Whyisitawesome?

Yourobjectives
Missionchecklist


Installingandtestingthepython-twistedframework
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
SettingupandtestingSparkCoretointeractwithappliances
Prepareforliftoff
EngageThrusters
Objectivecomplete–minidebriefing
InstallingandtestingtheGoogleCoderprojectontheRaspberryPi
Prepareforliftoff
Engagethrusters
Objectivecomplete–objectivecomplete
Abriefoverviewofabirdfeederthattriggersacamera
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Alternativesandprojectideastoconsider
Missionaccomplished
Hotshotchallenge
10.RaspberryPiPersonalHealthMonitor
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
Missionchecklist
Settingupawebservertorecordhealthparameters
Prepareforliftoff

Engagethrusters
Objectivecomplete–minidebriefing
AsimpleexercisetoolusingtheRaspberryPi
Prepareforliftoff
Engagethrusters


Aminiprojectidea
Objectivecomplete–minidebriefing
Settingupane-mailfeedparsertorefillaprescriptionaswellasremindtheuserabout
anupcomingdoctor’sappointment
Engagethrusters
Settingupareminderfordoctor’sappointments
Objectivecomplete–minidebriefing
Asimpletoolthatremindsapersontotakehis/herpills
Prepareforliftoff
Engagethrusters
Otherprojectideas
Objectivecomplete–minidebriefing
Missionaccomplished
Hotshotchallenge
11.HomeAutomationusingRaspberryPi
Missionbriefing
Whyisitawesome?
Yourobjectives
Missionchecklist
Asimpleexamplethatcontrolslimitedindoorandoutdoorlightingintheevening
Prepareforliftoff
Softwareprerequisites
Engagethrusters

Objectivecomplete–minidebriefing
Alternativesolutionsandsomeprojectideastoconsider
Acustomarywebserverexample
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
Turningonalawnsprinkleronlywhenthereisnorainforecast!
Prepareforliftoff
Engagethrusters


Objectivecomplete–minidebriefing
GainingremoteaccesstoyourRaspberryPitocontrolappliances
Someprojectideastoconsider
Missionaccomplished
12.UsingaRaspberryPiforScienceandEducation
Missionbriefing
Whyisitawesome?
YourHotshotobjectives
ImprovingyourvocabularyusingtheRaspberryPi
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
RaspberryPiandKhanAcademy
Someideastoconsider
BuildingasciencefairexhibitusingtheRaspberryPi
Prepareforliftoff
Engagethrusters
Objectivecomplete–minidebriefing
SomesimpleeducationalexperimentsusingtheRaspberryPi

Hotshotchallenge
13.TipsandTricks
Missionbriefing
Whyisitawesome?
Yourobjectives
Missionchecklist
SettingupRaspberryPiasadevelopmentplatform
#1–SimpletrickforPythondevelopmentviaremotelogin
#2WebdevelopmentusingGoogleCoder
#3AdafruitOccidentalis
#4JavaDevelopmentusingtheRaspberryPi
#5TheThingboxproject


RemotelyloggingintheRaspberryPifromanywhereontheInternet
ProblemsthatmightbeencounteredwhileusingRaspberryPi
SDcardcorruption
Powerissues
DevicespoweredbyUSB
Cooladd-onhardwaresourcesdevelopedfortheRaspberryPiplatform
TheRaspberryPimodelBversusB+,modelAversusA+
Projectideasthatcanbeimplementedoveraweekend
UsefulresourcesfortheRaspberryPi
RaspberryPiFoundation’sforums:
RaspberryPiStackExchange:
Element14’sRaspberryPicommunity:
Missionaccomplished
Index




RaspberryPiMechatronicsProjects
HOTSHOT



RaspberryPiMechatronicsProjects
HOTSHOT
Copyright©2015PacktPublishing
Allrightsreserved.Nopartofthisbookmaybereproduced,storedinaretrievalsystem,
ortransmittedinanyformorbyanymeans,withoutthepriorwrittenpermissionofthe
publisher,exceptinthecaseofbriefquotationsembeddedincriticalarticlesorreviews.
Everyefforthasbeenmadeinthepreparationofthisbooktoensuretheaccuracyofthe
informationpresented.However,theinformationcontainedinthisbookissoldwithout
warranty,eitherexpressorimplied.Neithertheauthors,norPacktPublishing,andits
dealersanddistributorswillbeheldliableforanydamagescausedorallegedtobecaused
directlyorindirectlybythisbook.
PacktPublishinghasendeavoredtoprovidetrademarkinformationaboutallofthe
companiesandproductsmentionedinthisbookbytheappropriateuseofcapitals.
However,PacktPublishingcannotguaranteetheaccuracyofthisinformation.
Firstpublished:February2015
Productionreference:1190215
PublishedbyPacktPublishingLtd.
LiveryPlace
35LiveryStreet
BirminghamB32PB,UK.
ISBN978-1-84969-622-7
www.packtpub.com




Credits
Authors
SaiYamanoor
SrihariYamanoor
Reviewers
GuyScheffer
SreedharVaddi
CheukYu
CommissioningEditor
UshaIyer
AcquisitionEditors
UshaIyer
RebeccaPedley
SamWood
ContentDevelopmentEditor
SusmitaSabot
TechnicalEditor
ParagTopre
CopyEditor
JanbalDharmaraj
ProjectCoordinator
MiltonD’souza
Proofreaders
SimranBhogal
MariaGould
AmeeshaGreen
PaulHindle
Indexer
HemanginiBari

Graphics
SheetalAute


DishaHaria
ProductionCoordinators
AparnaBhagat
ManuJoseph
CoverWork
AparnaBhagat



×