Projects / Shift register fault hunt

Shift register fault hunt

Intermediate1.2 hGuided buildReviewed

Build it step by step

0 of 6 done
  1. NANO

    Wire the working circuit

    Data D2, latch D3, clock D4, outputs through 330 ohms.

  2. NANO

    Upload and watch

    A single light walks from Q0 to Q7.

  3. NANO

    Look away while the helper plants a fault

    The pattern goes wrong.

  4. NANO17.6 mA

    Compare the serial bits with the lit LEDs

    Note which positions differ.

  5. NANO

    Check pins 10, 12, 13 and 14

    A swapped or floating pin shows here.

  6. NANO17.6 mA

    Trace each LED

    Find swapped output wires, then re-test every bit.

In short

How do you build a shift register fault hunt?

Eight LEDs on a 74HC595 should show a walking light. Build it working, have a helper plant safe faults such as the latch and clock swapped, the output enable left floating and two LEDs on the wrong pins, then use a test pattern to find each. You need Arduino Nano, 74HC595 Shift Register, LED 5 mm red × 8, Resistor 330 Ω × 8, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 6 steps and about 70 minutes.

Level
Intermediate
Time
About 70 min
Parts
6

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
74HC595 pin 14 (data)Nano D2Serial data in
74HC595 pin 12 (latch)Nano D3Copies the bits to the outputs
74HC595 pin 11 (clock)Nano D4Shifts one bit per pulse
74HC595 pin 10Nano 5VClear held inactive
74HC595 pin 13Nano GNDOutputs enabled
74HC595 pin 16 and pin 8Nano 5V and GNDChip power
Outputs Q0 to Q7Each through a 330 ohm resistor to an LEDEight LEDs with their short legs to GND

Code

The 74HC595 takes bits in on the data pin, moves them along one place for each pulse on the clock pin, and copies them to its eight outputs when the latch pin pulses. The sketch walks a single lit LED from Q0 to Q7, then shows two alternating test patterns, and prints the same bits so you can compare what was sent with what lit. Build it working first. Each LED uses a 330 ohm resistor, and the walking light keeps only one lit at a time. Do not light all eight for long, because the chip's total output current limit is about 70 milliamps. Then ask a helper to plant one fault at a time while you look away. Safe faults are swapping the latch and clock wires, lifting pin 13 so output enable floats, and swapping two LED wires. Use the alternating patterns to see which bits are wrong, check pins 10, 12, 13 and 14 with the meter, then trace each LED back to its pin. Fix and re-test every bit.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const uint8_t DATA = 2;     // pin 14
const uint8_t LATCH = 3;    // pin 12
const uint8_t CLOCK = 4;    // pin 11

void show(uint8_t pattern) {
  digitalWrite(LATCH, LOW);
  shiftOut(DATA, CLOCK, MSBFIRST, pattern);
  digitalWrite(LATCH, HIGH);
  Serial.print("Sent ");
  for (int i = 7; i >= 0; i--) Serial.print((pattern >> i) & 1);
  Serial.println();
}

void setup() {
  pinMode(DATA, OUTPUT);
  pinMode(LATCH, OUTPUT);
  pinMode(CLOCK, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  for (int i = 0; i < 8; i++) {          // a walking one: bit 0, then bit 1 ...
    show(1 << i);
    delay(400);
  }
  show(0xAA);                           // alternating test pattern
  delay(800);
  show(0x55);
  delay(800);
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

Sent 00000001
Sent 00000010
Sent 00000100
Sent 00001000
Sent 00010000
Sent 00100000

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Working circuitOne light walks along in order
Latch and clock swappedThe pattern lags or looks scrambled
Pin 13 floatingLights flicker or look dim
Two LEDs swappedThe walk jumps out of order at two places
Test patterns 0xAA and 0x55Alternate LEDs light, then the others

If it does not work

No LED lights

Check pin 16 to 5V, pin 8 to GND and pin 13 to GND.

All LEDs stay lit dimly

Pin 13 may be floating.

Pattern shifts by one

Check the clock and latch wires.

Chip gets warm

Check the 330 ohm resistors are in line.

LED never lights

Check its leg direction.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the shift register fault hunt?

Arduino Nano, 74HC595 Shift Register, LED 5 mm red × 8, Resistor 330 Ω × 8, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the shift register fault hunt take to build?

About 70 minutes for a intermediate maker, in 6 steps.

How do I know the shift register fault hunt works?

Working circuit: One light walks along in order. Latch and clock swapped: The pattern lags or looks scrambled. Pin 13 floating: Lights flicker or look dim.

No LED lights: what should I check?

Check pin 16 to 5V, pin 8 to GND and pin 13 to GND.

All LEDs stay lit dimly: what should I check?

Pin 13 may be floating.

Pattern shifts by one: what should I check?

Check the clock and latch wires.

Chip gets warm: what should I check?

Check the 330 ohm resistors are in line.