There’s a million tutorials out there describing how to use shift registers. If you’re just getting into embedded systems you should know how to use them as they allow you to take three microcontroller pins and expand them virtually without limits. This is due to the serial-in parallel-out nature of these integrated circuits. A key feature of these chips is the ability to overflow, or cascade to the next chip which is what provides the expansibility.
Protostack just published a tutorial that uses this hardware to interface sixteen LEDs using two shift registers. The explanation is short and to-the-point with easy to understand code examples. There’s also something to be said for their crisp and clean breadboarding work.
Take a look at how they do it and then use the concept to make a fancy clock or reduce the pins needed to drive a display.
Nice tutorial. I’ve been messing around with an 8 bit shift register to control my quad half H bridge chip which in turn controls the motors of my little pet robot. To drive just 2 motors I didnt gain any pins, but it does allow me to upgrade to 4 wheel drive later down the road if I would like.
THANK YOU!!!! Thank you, HAD, for the clean breadboarding plug! Something everyone should do but very few do. Thank you.
Some friends and I build an “Art” machine using
343 stepper motors and a pile of shift registers.
Each group of 49 stepper motors is driven off 1
data pin from a PC parallel port, a clock and
a latch, so we can drive all 7 strings of 49
motors off 9 bits of data from the PC.
I wrote the Linux driver software to generate all
the stepper sequences as well as the IR
rangefinder input code using a Wiring.org.co
board. (Like an Arduino, but people don’t
complain about it as much. :-)
So, I LOVE this tutorial. If anyone wants to
know more about the non trivial parts of driving
196 shift registers with 1 clock and 1 latch pin,
just ask. (Hint: The signals get really ugly really quick as you add more and more shift registers to the clock and latch lines.)
References:
http://picasaweb.google.com/AlanKilian/AfterHours#
http://picasaweb.google.com/AlanKilian/Museum#
http://bobodyne.com/web-docs/robots/Hex/index.html
http://taomc.com/art/kinetic_sculptures/animanemone.html
the post is a bit old but I’m starting with shift registers and stepper motors and I found this post interesting so I ask ;)
Is it possible to have the details ?thanks in advance
LOL, it would’ve been good if TFA used LED drivers like these
http://www.marktechopto.com/Products/toshiba-led-drivers.cfm
http://www.allegromicro.com/en/products/categories/ics/leddriver.asp
http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?family=analog&familyId=480&uiTemplateId=NODE_STRY_PGE_T
generally much nicer than a simple shift register, especially if they buffer clock and data for cascading.
as an idea for a more advanced project, here’s a lovely led random number generator based on 4 shift registers.
http://www.youtube.com/watch?v=W8o8mHK3rfY
to my eye, it gives the impression of flowing water. one of my faves :)
Looks like the site is down. /.’ed?!?!?
eh, if I were to clip the leads of components, then i would be really limited with where i could reuse them. I think i will stick with my messy breadboards and save the resistors and LEDs for future projects.
I know a lot of people here hate Arduinos, but here is a simple Arduino shield that uses shift registers to add more output pins. There’s a software library that makes access to the pins trivial:
http://nootropicdesign.com/ez-expander/
IsotopeJ: That was my first thought as well. Sure, it looks nice but you’ll be running out of components fast. And it also seems a bit wasteful to use an entire breadboard just for the LEDs. For the tutorial it’s great since it shows what’s going on clearly but I’m too damn cheap to use up breadbards that fast hehe
Seems odd that they are using a shift register chip but don’t acutally use any standard ansi c bit shifting operators in the code. Doing so would improve the extensibility, save a few lines, save a bunch of cycles and would make for much more portable code. That said, this is pretty good explanation of the hardware involved.
The link is broken now – new URL is:
http://www.protostack.com/blog/2010/05/introduction-to-74hc595-shift-register-controlling-16-leds/