Hardware Reference
In-Depth Information
As you chug away building exciting new projects with your Arduino, you
might already be thinking: “What happens when I run out of pins?” Indeed,
one of the most common projects with the Arduino is using the platform to put
an enormous number of blinking LEDs on just about anything. Light up your
room! Light up your computer! Light up your dog! Okay, maybe not that last one.
But there's a problem. What happens when you want to start blinking 50 LEDs
(or controlling other digital outputs) but you've used up all of your I/O pins? That's
where shift registers can come in handy. With shift registers, you can expand
the I/O capabilities of your Arduino without having to pay a whole lot more
for a more expensive microcontroller with additional I/O pins. In this chapter,
you'll learn how shift registers work, and you'll implement both the software
and hardware necessary to interface your Arduino with shift registers for the
purpose of expanding digital output capabilities of your Arduino. Completing
the exercises in this chapter will familiarize you with shift registers, and will
help you to make a more informed design decision when you are developing a
project with a large number of digital outputs.
CHOOSING THE RIGHT ARDUINO FOR THE JOB
Thischapter,likemostoftheearlierchapters,usestheArduinoUnoasthe
developmentplatform.AnyotherArduinowillworkjustaswelltocomplete
theexercisesinthischapter,butit'sworthconsideringwhyyoumightwant
touseoneArduinooveranotherforaparticularprojectyoumaybepursu-
ing.Forexample,youmightalreadybewonderingwhyyouwouldn'tjustuse
anArduinowithmoreI/Opins,suchastheMega2560ortheDue.Ofcourse,
thatisacompletelyreasonablewaytocompleteprojectsthatrequiremore
outputs.However,asanengineer,youshouldalwaysbemindfulofother
considerationswhendesigninganewproject.Ifyouonlyneedtheprocess-
ingpowerofanUno,butyouneedmoredigitaloutputs,forexample,adding
afewshiftregisterswillbeconsiderablycheaperthanupgradingyourentire
platform,andwillalsobemorecompact.Asatradeoff,itwillalsorequire
youtowriteslightlymorecomplexcode,anditmightnecessitatemore
debuggingtimetogetitworkingright.
UnderstandingShiftRegisters
A shift register is a device that accepts a stream of serial bits and simultaneously
outputs the values of those bits onto parallel I/O pins. Most often, these are
used for controlling large numbers of LEDs, such as the configurations found
 
Search WWH ::




Custom Search