Introduction: 8 LED Chaser With 74HC595 8 Bit Shift Register
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
Step 2: Power, Data, Clock and Latch
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!
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!
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]);
index++;
if (index >= count){
index = 0;
}
}
Step 5: Going Further
If I touch onto Shift Registers in the future (Which I most likely will) I will show you how to expand.