74HC595 8-bit Shift Registers!
Friday, September 14th, 2007How’s that for a geeky title? Tired of the geekiness? TOO BAD! I’m a geek, and this is something you’re just going to have to deal with.
I received a package of goodies from Sparkfun yesterday, and immediately put it to work. Here’s the deal:
Normally, driving LEDs requires the use of one digital output pin on the Arduino board per LED (you drive some current down a pin, it flows through the LED, and lights up—cut the current and the LED goes dark). Once you get past a couple LEDs, however, your available pin inventory starts to get a little thin, and you start running out of room for things like sensors or servo outputs. The answer is a shift register.
Except for the obligatory 5V input and a connection to ground, a shift register requires just three digital connections to the Arduino. Then, up to eight LEDs (or other components) are connected to the output pins of the register, and then the magic starts. By twiddling the current on the three lines controlling the shift register, you start ‘programming’ the chip, describe the desired state of the eight outputs, and when you indicate that the ‘programming’ is done, the eight output lines flip on or off as you’ve requested. It’s a very powerful technique.
(Further, it’s possible to control multiple shift registers using those same three connections. Very cool. If you’re a geek. Which I am.)
Read the rest of this entry »