8 LED Chaser With 74HC595 8 Bit Shift Register





Introduction: 8 LED Chaser With 74HC595 8 Bit Shift Register

Have you wanted to make a sweet Cylon/Knight Rider (Larson) Scanner effect? But you don’t want to use up all of your Arduino IO pins? Well, you can make a nice 8 LED Scanner with a shift register IC.

In this tutorial we’ll be using the 74HC595 8 Bit Shift Register, and this is what we'll be making;

Parts Required:
Arduino Uno (Or Arduino compatible clone)
Jumper Wires (Various colours and lengths)
1x 74HC595 8 Bit Shift Register
1x Breadboard
8x 220 Ohm Resisters

Step 1: Get Ready to Shift

Take your shift register and place it on your breadboard over the IC gap, now take your black jumper wires and you’ll want to ground the IC, taking note where the notch is (Pin 1 is usually left of the notch) you’ll want to ground pin 8 and pin 13.

Step 2: Power, Data, Clock and Latch

Take your red jumper wire and wire in the voltage to pins 10 and 16.

Take your blue wire (data) and connect it to pin 14, the yellow (clock) to pin 11 and green (latch) to pin 12 on the IC respectfully.

Then take your LED’s (I’m using an LED bar graph for size) and place them over the IC gap.

Step 3: Let There Be LED Light!

Now take some more jumper wires and start to wire up the LED’s, Start with IC pin 15, then from pin 1 to pin 7.

Then take your 220 Ohm resistors and wire them from the other side of the LED’s to the ground rail.

Step 4: Arduino Time!

Bring your Arduino over and hook it up to your PC and load in this code.

int clockPin = 12; //IC Pin 11, Yellow Jumper
int dataPin = 11; //IC Pin 14, Blue Jumper
int latchPin = 8; //IC Pin 12, Green Jumper

byte patterns[30] = {
B00000001, 100,
B00000010, 100,
B00000100, 100,
B00001000, 100,
B00010000, 100,
B00100000, 100,
B01000000, 100,
B10000000, 100,
B01000000, 100,
B00100000, 100,
B00010000, 100,
B00001000, 100,
B00000100, 100,
B00000010, 100

int index = 0;
int count = sizeof(patterns) / 2;

void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);

void loop() {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, patterns[index * 2]);
digitalWrite(latchPin, HIGH);
delay(patterns[(index * 2) + 1]);
if (index >= count){
index = 0;

Once you've uploaded the sketch to your Arduino disconnect it for now and hook up the data (blue jumper) to D11, clock (yellow jumper) to D12 and latch (green jumper) to D8, reattach the computer, or a power supply and watch the light chase.

Step 5: Going Further

I hope this instructable has opened your eyes to a lot of possibilities... such as, did you know that if you add another 74HC595 8 Bit Shift Register to the mix you can control another 8 LED's on the same amount of wires (5 including power) and shift registers are awesome, with these little IC's they can expand your arduino outputs by 8 per IC, and you can in theory have an infinite amount of shift registers connected to your arduino.

If I touch onto Shift Registers in the future (Which I most likely will) I will show you how to expand.


  • Try this pattern, pe...-BrendanG27

    BrendanG27 made it!


  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge

We have a be nice policy.
Please be positive and constructive.




A friendly suggestion: people who create electronic instructables should try to include schematics. A schematic would make this a whole lot easier to describe. It's worth learning how to create them, and read them!

Can this be modified to run short el strips in place of the LEDs with the help of an inverter?

so if one would like to create a rgb pov stick how would the code go for 6 registers and would like to control every light with a b00101010

can somone give me the code for 2 595 shifters
i am gonna rewrite it so you can use it with only 2 wires

Hi Robot797,

The following code works with two 595s. Be sure to connect the overflow pin of the first 595 to the data in pin of the second and connect the clock and latch pins together.


von Biffo.


A simple 16 LED chaser using two 74HC595N serial in/parallel out shift registers.
This sketch causes one of sixteen LEDs to be lit in turn moving up and down the display.

By Baron von Biffo

28th April 2012.


// setup the data, latch and clock pins for the 74HC595.

int dataPin = 2;
int latchPin = 3;
int clockPin = 4;

void setup(){

// Set the data, latch and clock pins to output mode.

pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);


void loop(){

// Setup array with the individual LED positions. Decimal is easier to use than binary.
unsigned int displayLED[] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768};

// Setup two 8 bit bytes to hold the data for each 595.
uint8_t low_byte;
uint8_t high_byte;

// Set length of time to display each LED.
int pause = 45;

// Loop control variable
int count;

// Count up loop.
for(count = 1; count < 16; count++){

// Read the decimal value from the array. Use bitwise And with OxFF for the low byte
// and shift 8 bits right for the high byte.
// I learned this from Korman at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285651171

low_byte = displayLED[count] & 0xff;
high_byte = (displayLED[count] >> 8);

// set the latch pin low prior to shifting out the data.
digitalWrite(latchPin, LOW);

// Shift out the data. The first shiftout puts the high byte into the first 595.
// The second shiftout shifts the high byte from the first 595 to the second and
// shifts the low byte into the first 595.
shiftOut(dataPin, clockPin, MSBFIRST, high_byte);
shiftOut(dataPin, clockPin, MSBFIRST, low_byte);

// Display the data by setting the latch pin high.
digitalWrite(latchPin, HIGH);

// Pause for the number of miliseconds determined by the 'pause' variable.


//Count down loop. Same as the count up loop but moves in the opposite direction.
for(count = 16; count > 0; count--){

low_byte = displayLED[count] & 0xff;
high_byte = (displayLED[count] >> 8);

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, high_byte);
shiftOut(dataPin, clockPin, MSBFIRST, low_byte);

digitalWrite(latchPin, HIGH);


Looks great! You could create some stunning effects with a few of these, or even make an LED matrix display!

I guess you don't need a separate latch pin for each chip so in effect you seem to be getting 8 outputs for every pair of normal pins, with 1 extra pin for latching. That's potentially a lot of outputs!

You don't need to a data, clock and latch for each shift register, you can just run another shift register off the first one by placing jumper wires coming from the clock and latch to the next shift register and place a jumper wire from pin 9 (Serial Out) to pin 14 (Data input) on the second shift register and you've got a second shift register in serial, which gives you another 8 outputs on the same 3 (5 if you include power) wires.

Thanks for your response - That's fantastic.

Only question - how do you know which '595 you are writing to? Maybe it's clear from the code but I missed that if so.

It occurs to me that a shift register has just the right number of outputs to control a seven-segment+decimal LED display.... wouldn't take a whole lot of code to write a library that would output any number of digits to daisy-chained 7-segment displays with a shift register attached to each.

I may have to try that.

The way I see '595's are like a boolean (True/False) switch, if you notice in the code, each pattern starts with a B and has 8 numbers after it, be it a 1 or a 0, if you've got two 595's in serial you can double that to sixteen true/false so the code COULD look like B1000000000000000 etc, or at least that's to my limited understanding.

Also, I am sure that someone in the Arduino community has in fact written a library to interface the '595 and 7-Segment displays.