Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

At sometime or another you may run out of pins on your Arduino board and need to extend it with shift registers. This example is based on the 74HC595. The datasheet refers to the 74HC595 as an "8-bit serial-in, serial or parallel-out shift register with output latches; 3-state." In other words, you can use it to control 8 outputs at a time while only taking up a few pins on your microcontroller. You can link multiple registers together to extend your output even more. (Users may also wish to search for other driver chips with "595" or "596" in their part numbers, there are many. The STP16C596 for example will drive 16 LED's and eliminates the series resistors with built-in constant current sources.)

...

"3 states" refers to the fact that you can set the output pins as either high, low or "high impedance." Unlike the HIGH and LOW states, you can"t set pins to their high impedance state individually. You can only set the whole chip together. This is a pretty specialized thing to do -- Think of an LED array that might need to be controlled by completely different microcontrollers depending on a specific mode setting built into your project. Neither example takes advantage of this feature and you won"t usually need to worry about getting a chip that has it. 


Figure 1 - chip pines Scheme 74HC595.


Image Added

1. Turning it on

...

Figure 5 - Circuit Diagram.

5. Add a second shift register.

In this example you'll add a second shift register, doubling the number of output pins you have while still using the same number of pins from the Arduino. Starting from the previous example, you should put a second shift register on the board. It should have the same leads to power and ground.

Figure 6 - Connecting power pins and ground of second registered.

6. Connect the 2 registers.

Two of these connections simply extend the same clock and latch signal from the Arduino to the second shift register (yellow and green wires). The blue wire is going from the serial out pin (pin 9) of the first shift register to the serial data input (pin 14) of the second register.

Figure 7 - Two registers Liaison cascaded.

7. Add a second set of LEDs.

In this case I added green ones so when reading the code it is clear which byte is going to which set of LEDs.

Figure 8 - Expanding eight leds.

Figure 9 - Circuit Diagram.