Control eight LEDs with a 74HC595
Shift a walking bit and alternating patterns into a 74HC595 using D11 data, D12 clock and D8 latch.
Shift a walking bit and alternating patterns into a 74HC595 using D11 data, D12 clock and D8 latch.
Use the Uno R3 Learning Kit. Build with power disconnected, check the labelled connections, then upload the supplied sketch. Drag or zoom the 3D model to inspect it from any angle.
Also needed
Use an additional full-size 830-contact breadboard so the eight LED bodies can be spaced apart without touching.
Step 1 — Watch the complete build
Press Play for the narrated build. You can rotate and zoom the model while it plays, or follow the individual steps below.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around. Connect the Arduino’s five volt output to the positive rail. Connect Arduino ground to the ground rail. Add the 74HC595 shift register. Its Q1 lead goes into F2; the highlights show the remaining holes. Add the 100 nanofarads ceramic capacitor. Its 0 lead goes into H10; the highlights show the remaining holes. Connect the chip’s supply pin to the positive rail. Connect the chip’s MR pin to the positive rail. Connect the chip’s ground pin to the ground rail. Connect the chip's output enable pin to the ground rail. Connect the capacitor’s 0 pin to the chip’s supply pin. Connect the capacitor’s 1 pin to the chip’s ground pin. Connect Arduino digital pin 11 to the chip’s DS pin. Connect Arduino digital pin 12 to the chip’s SH_CP pin. Connect Arduino digital pin 8 to the chip’s ST_CP pin. Add the Red L E D · 5 millimetres. Its cathode lead goes into J12; the highlights show the remaining holes. Add the Yellow L E D · 5 millimetres. Its cathode lead goes into J15; the highlights show the remaining holes. Add the Green L E D · 5 millimetres. Its cathode lead goes into J18; the highlights show the remaining holes. Add the Blue L E D · 5 millimetres. Its cathode lead goes into J21; the highlights show the remaining holes. Add the Red L E D · 5 millimetres. Its cathode lead goes into J24; the highlights show the remaining holes. Add the Yellow L E D · 5 millimetres. Its cathode lead goes into J27; the highlights show the remaining holes. Add the Green L E D · 5 millimetres. Its cathode lead goes into J30; the highlights show the remaining holes. Add the Blue L E D · 5 millimetres. Its cathode lead goes into J33; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E13; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E16; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E19; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E22; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E25; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E28; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E31; the highlights show the remaining holes. Add the 1 kiloohm resistor. Its Pin 0 lead goes into E34; the highlights show the remaining holes. Connect the chip’s Q0 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q1 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q2 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q3 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q4 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q5 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q6 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Connect the chip’s Q7 pin to one end of the resistor. Connect the L E D’s cathode lead to the ground rail. Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 2 — Understand the breadboard
Keep USB disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Step 3 — Connect Uno 5V → T+ rail 15
Connect the Arduino’s five volt output to the positive rail.
| Connect | To |
|---|---|
| Uno 5V | T+ rail 15 |
Loading assembly…
Connect the Arduino’s five volt output to the positive rail.
Step 4 — Connect Uno GND → T− rail 11
Connect Arduino ground to the ground rail.
| Connect | To |
|---|---|
| Uno GND | T− rail 11 |
Loading assembly…
Connect Arduino ground to the ground rail.
Step 5 — Place 74HC595 shift register
Add the 74HC595 shift register. Its Q1 lead goes into F2; the highlights show the remaining holes.
Exact breadboard holes
- shift · VCC → E2
- shift · Q4 → F5
- shift · Q5 → F6
- shift · Q6 → F7
- shift · Q7 → F8
- shift · GND → F9
- shift · Q7' → E9
- shift · MR → E8
- shift · SH_CP → E7
- shift · ST_CP → E6
- shift · OE → E5
- shift · Q1 → F2
- shift · Q2 → F3
- shift · DS → E4
- shift · Q0 → E3
- shift · Q3 → F4
Loading assembly…
Add the 74HC595 shift register. Its Q1 lead goes into F2; the highlights show the remaining holes.
Step 6 — Place 100 nF ceramic capacitor
Add the 100 nF ceramic capacitor. Its 0 lead goes into H10; the highlights show the remaining holes.
Exact breadboard holes
- bypass · 0 → H10
- bypass · 1 → H11
Loading assembly…
Add the 100 nanofarads ceramic capacitor. Its 0 lead goes into H10; the highlights show the remaining holes.
Step 7 — Connect A2 → T+ rail 1
Connect the chip’s supply pin to the positive rail.
| Connect | To |
|---|---|
| A2 | T+ rail 1 |
Loading assembly…
Connect the chip’s supply pin to the positive rail.
Step 8 — Connect A8 → T+ rail 6
Connect the chip’s MR pin to the positive rail.
| Connect | To |
|---|---|
| A8 | T+ rail 6 |
Loading assembly…
Connect the chip’s MR pin to the positive rail.
Step 9 — Connect J9 → T− rail 6
Connect the chip’s ground pin to the ground rail.
| Connect | To |
|---|---|
| J9 | T− rail 6 |
Loading assembly…
Connect the chip’s ground pin to the ground rail.
Step 10 — Connect A5 → T− rail 3
Connect the chip’s OE pin to the ground rail.
| Connect | To |
|---|---|
| A5 | T− rail 3 |
Loading assembly…
Connect the chip's output enable pin to the ground rail.
Step 11 — Connect J10 → B2
Connect the capacitor’s 0 pin to the chip’s supply pin.
| Connect | To |
|---|---|
| J10 | B2 |
Loading assembly…
Connect the capacitor’s 0 pin to the chip’s supply pin.
Step 12 — Connect J11 → I9
Connect the capacitor’s 1 pin to the chip’s ground pin.
| Connect | To |
|---|---|
| J11 | I9 |
Loading assembly…
Connect the capacitor’s 1 pin to the chip’s ground pin.
Step 13 — Connect Uno D11 PWM/MOSI → A4
Connect Arduino digital pin 11 to the chip’s DS pin.
| Connect | To |
|---|---|
| Uno D11 PWM/MOSI | A4 |
Loading assembly…
Connect Arduino digital pin 11 to the chip’s DS pin.
Step 14 — Connect Uno D12/MISO → A7
Connect Arduino digital pin 12 to the chip’s SH_CP pin.
| Connect | To |
|---|---|
| Uno D12/MISO | A7 |
Loading assembly…
Connect Arduino digital pin 12 to the chip’s SH_CP pin.
Step 15 — Connect Uno D8 → A6
Connect Arduino digital pin 8 to the chip’s ST_CP pin.
| Connect | To |
|---|---|
| Uno D8 | A6 |
Loading assembly…
Connect Arduino digital pin 8 to the chip’s ST_CP pin.
Step 16 — Place Red LED · 5 mm
Add the Red LED · 5 mm. Its cathode lead goes into J12; the highlights show the remaining holes.
Exact breadboard holes
- led0 · cathode → J12
- led0 · anode → J13
Loading assembly…
Add the Red L E D · 5 millimetres. Its cathode lead goes into J12; the highlights show the remaining holes.
Step 17 — Place Yellow LED · 5 mm
Add the Yellow LED · 5 mm. Its cathode lead goes into J15; the highlights show the remaining holes.
Exact breadboard holes
- led1 · cathode → J15
- led1 · anode → J16
Loading assembly…
Add the Yellow L E D · 5 millimetres. Its cathode lead goes into J15; the highlights show the remaining holes.
Step 18 — Place Green LED · 5 mm
Add the Green LED · 5 mm. Its cathode lead goes into J18; the highlights show the remaining holes.
Exact breadboard holes
- led2 · cathode → J18
- led2 · anode → J19
Loading assembly…
Add the Green L E D · 5 millimetres. Its cathode lead goes into J18; the highlights show the remaining holes.
Step 19 — Place Blue LED · 5 mm
Add the Blue LED · 5 mm. Its cathode lead goes into J21; the highlights show the remaining holes.
Exact breadboard holes
- led3 · cathode → J21
- led3 · anode → J22
Loading assembly…
Add the Blue L E D · 5 millimetres. Its cathode lead goes into J21; the highlights show the remaining holes.
Step 20 — Place Red LED · 5 mm
Add the Red LED · 5 mm. Its cathode lead goes into J24; the highlights show the remaining holes.
Exact breadboard holes
- led4 · cathode → J24
- led4 · anode → J25
Loading assembly…
Add the Red L E D · 5 millimetres. Its cathode lead goes into J24; the highlights show the remaining holes.
Step 21 — Place Yellow LED · 5 mm
Add the Yellow LED · 5 mm. Its cathode lead goes into J27; the highlights show the remaining holes.
Exact breadboard holes
- led5 · cathode → J27
- led5 · anode → J28
Loading assembly…
Add the Yellow L E D · 5 millimetres. Its cathode lead goes into J27; the highlights show the remaining holes.
Step 22 — Place Green LED · 5 mm
Add the Green LED · 5 mm. Its cathode lead goes into J30; the highlights show the remaining holes.
Exact breadboard holes
- led6 · cathode → J30
- led6 · anode → J31
Loading assembly…
Add the Green L E D · 5 millimetres. Its cathode lead goes into J30; the highlights show the remaining holes.
Step 23 — Place Blue LED · 5 mm
Add the Blue LED · 5 mm. Its cathode lead goes into J33; the highlights show the remaining holes.
Exact breadboard holes
- led7 · cathode → J33
- led7 · anode → J34
Loading assembly…
Add the Blue L E D · 5 millimetres. Its cathode lead goes into J33; the highlights show the remaining holes.
Step 24 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E13; the highlights show the remaining holes.
Exact breadboard holes
- r0 · Pin 0 → E13
- r0 · Pin 1 → G13
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E13; the highlights show the remaining holes.
Step 25 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E16; the highlights show the remaining holes.
Exact breadboard holes
- r1 · Pin 0 → E16
- r1 · Pin 1 → G16
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E16; the highlights show the remaining holes.
Step 26 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E19; the highlights show the remaining holes.
Exact breadboard holes
- r2 · Pin 0 → E19
- r2 · Pin 1 → G19
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E19; the highlights show the remaining holes.
Step 27 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E22; the highlights show the remaining holes.
Exact breadboard holes
- r3 · Pin 0 → E22
- r3 · Pin 1 → G22
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E22; the highlights show the remaining holes.
Step 28 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E25; the highlights show the remaining holes.
Exact breadboard holes
- r4 · Pin 0 → E25
- r4 · Pin 1 → G25
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E25; the highlights show the remaining holes.
Step 29 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E28; the highlights show the remaining holes.
Exact breadboard holes
- r5 · Pin 0 → E28
- r5 · Pin 1 → G28
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E28; the highlights show the remaining holes.
Step 30 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E31; the highlights show the remaining holes.
Exact breadboard holes
- r6 · Pin 0 → E31
- r6 · Pin 1 → G31
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E31; the highlights show the remaining holes.
Step 31 — Place 1 kΩ resistor
Add the 1 kΩ resistor. Its Pin 0 lead goes into E34; the highlights show the remaining holes.
Exact breadboard holes
- r7 · Pin 0 → E34
- r7 · Pin 1 → G34
Loading assembly…
Add the 1 kiloohm resistor. Its Pin 0 lead goes into E34; the highlights show the remaining holes.
Step 32 — Connect A3 → A13
Connect the chip’s Q0 pin to one end of the resistor.
| Connect | To |
|---|---|
| A3 | A13 |
Loading assembly…
Connect the chip’s Q0 pin to one end of the resistor.
Step 33 — Connect I12 → T− rail 9
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I12 | T− rail 9 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 34 — Connect J2 → A16
Connect the chip’s Q1 pin to one end of the resistor.
| Connect | To |
|---|---|
| J2 | A16 |
Loading assembly…
Connect the chip’s Q1 pin to one end of the resistor.
Step 35 — Connect I15 → T− rail 12
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I15 | T− rail 12 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 36 — Connect J3 → A19
Connect the chip’s Q2 pin to one end of the resistor.
| Connect | To |
|---|---|
| J3 | A19 |
Loading assembly…
Connect the chip’s Q2 pin to one end of the resistor.
Step 37 — Connect I18 → T− rail 14
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I18 | T− rail 14 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 38 — Connect J4 → A22
Connect the chip’s Q3 pin to one end of the resistor.
| Connect | To |
|---|---|
| J4 | A22 |
Loading assembly…
Connect the chip’s Q3 pin to one end of the resistor.
Step 39 — Connect I21 → T− rail 16
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I21 | T− rail 16 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 40 — Connect J5 → A25
Connect the chip’s Q4 pin to one end of the resistor.
| Connect | To |
|---|---|
| J5 | A25 |
Loading assembly…
Connect the chip’s Q4 pin to one end of the resistor.
Step 41 — Connect I24 → T− rail 19
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I24 | T− rail 19 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 42 — Connect J6 → A28
Connect the chip’s Q5 pin to one end of the resistor.
| Connect | To |
|---|---|
| J6 | A28 |
Loading assembly…
Connect the chip’s Q5 pin to one end of the resistor.
Step 43 — Connect I27 → T− rail 21
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I27 | T− rail 21 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 44 — Connect J7 → A31
Connect the chip’s Q6 pin to one end of the resistor.
| Connect | To |
|---|---|
| J7 | A31 |
Loading assembly…
Connect the chip’s Q6 pin to one end of the resistor.
Step 45 — Connect I30 → T− rail 24
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I30 | T− rail 24 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 46 — Connect J8 → A34
Connect the chip’s Q7 pin to one end of the resistor.
| Connect | To |
|---|---|
| J8 | A34 |
Loading assembly…
Connect the chip’s Q7 pin to one end of the resistor.
Step 47 — Connect I33 → T− rail 26
Connect the LED’s cathode lead to the ground rail.
| Connect | To |
|---|---|
| I33 | T− rail 26 |
Loading assembly…
Connect the L E D’s cathode lead to the ground rail.
Step 48 — Place USB-A to USB-B cable · Uno
Check all wiring. Connect the square USB-B plug to the Uno and the USB-A plug to your computer. Use Verify and Upload in the code editor below.
Loading assembly…
Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 49 — Program your Uno
Choose Arduino Uno. Verify, pair the board and Upload this sketch. Keep USB connected. Shift a walking bit and alternating patterns into a 74HC595 using D11 data, D12 clock and D8 latch.
Step 50 — Try it and troubleshoot
A single lit LED walks across the row, then alternating LEDs swap. One kilohm keeps the output currents modest even when several LEDs are lit.
If it does not work
Check the notch, power pins, MR high and OE low. Do not connect LEDs without their own resistors. The serial output Q7-prime is for a second chip, not one of these eight LEDs.
Parts List
Required Parts (2)
Use the components named in this tutorial. A computer and any additional power supply are not included.
x1
$64.70
In stock
Use this larger board in place of the kit’s 400-contact breadboard, to keep component bodies and jumper connections clear.
x1
$8.90
In stockProject Summary
2 parts total
Unavailable items will be skipped