My goal for a usable LED driver board is to have something that can turn on or off up to 64 individual LEDs. Ideally I can communicate with the board by sending it a stream of bytes via the serial port. Ideally I want the board to maintain the state of the LEDs when I am not sending data to it. In other words, once I tell it to turn on a set of LEDS, I want the board to keep those LEDS on until told otherwise. That way I don’t have to rely on sending a continuous stream of data to the board to maintain the state of the lights. This will greatly reduce the load on the processor (Arduino) that sends data to the driver board.
What I have decided to use is the 74LS595 8 Bit Shift Register chip. The chip will allow you to serially send one or my bytes of data to the chip. Each bit corresponds to one output pin on the chip which can be used to control a single LED. So one 8 bit shift register can control up to 8 LEDs. The chip has an overflow pin that will send additional bits (past the 8 it handles) to a second shift register. In this manner you can theoretically chain an unlimited number of shift registers to control as many LEDs as you want (within reason of course). The best part is that you only need 3 GPIO (General Purpose Input/Output) Arduino pins to control any number of shift register chips.
The Arduino website has a great tutorial on the use of shift registers:
You can use any three Arudino GPIO pins to control the shift register. One pin (the latch) will connect to pin 12 of the shift register. A second Arudino pin (the clock) connects to Pin 11 of the shift register. And the third Arudino pin (the data) connects to pin 14 of the shift register.
Attaching the Arduino 5v output to the shift register Pin 16 and the Arduino Ground to the shift register pin 8.
The LEDs attach to the shift register’s Q0 – Q7 pins. One side of the LED attaches to the Q# pin on the shift register and the other side goes to ground.
Here is my prototype board that currently has 3 shift registers and 21 LEDS working:
and here is the board in action…