Interactive LED animation controller for Arduino using the 74HC595 shift register. The project demonstrates multiple LED animation modes with switching via a push button.

- 6 display modes
- Button-controlled mode switching
- 74HC595 shift register support
- Clean and modular code structure
- Easy to extend with new animation patterns
- Arduino Uno (or compatible)
- 74HC595 Shift Register
- 8 LEDs
- 8 * 220 Ω resistors
- Push button
- Breadboard
- Jumper wires
| Arduino |
74HC595 |
| D8 |
ST_CP (Latch) |
| D12 |
SH_CP (Clock) |
| D11 |
DS (Data) |
| GND |
GND |
| 5V |
VCC |
Button connection:
| Arduino |
Button |
| D2 |
Button |
| GND |
Button |
The button uses the internal pull-up resistor (INPUT_PULLUP).
| Arduino Pin |
Type |
Connected Device |
Description |
| D8 |
Output |
ST_CP (Latch) |
Latches the shifted data and updates the outputs of the 74HC595. |
| D12 |
Output |
SH_CP (Clock) |
Clock signal used to shift bits into the register. |
| D11 |
Output |
DS (Data) |
Serial data input for the 74HC595. |
| D2 |
Input (INPUT_PULLUP) |
Push Button |
Changes the current LED animation mode when pressed. |
| 5V |
Power |
74HC595 VCC |
Supplies power to the shift register. |
| GND |
Ground |
74HC595 GND, Button |
Common ground for the circuit. |
| Output Pin |
LED |
| Q0 |
LED 1 |
| Q1 |
LED 2 |
| Q2 |
LED 3 |
| Q3 |
LED 4 |
| Q4 |
LED 5 |
| Q5 |
LED 6 |
| Q6 |
LED 7 |
| Q7 |
LED 8 |
| Mode |
Description |
| 0 |
All LEDs ON |
| 1 |
Running light (Left -> Right) |
| 2 |
Running light (Right -> Left) |
| 3 |
Center -> Edges animation |
| 4 |
Edges -> Center animation |
| 5 |
Even/Odd LEDs blinking |
const int latchPin = 8;
const int clockPin = 12;
const int dataPin = 11;
const int buttonPin = 2;
The Arduino sends an 8-bit value to the 74HC595 using the shiftOut() function. Each bit represents the state of one LED.
The push button changes the current animation mode. Each mode continuously displays its pattern until another button press is detected.
| Pattern |
Binary |
| All ON |
11111111 |
| Even LEDs |
10101010 |
| Odd LEDs |
01010101 |
| Center |
00011000 |
| Edges |
10000001 |