I got my Arduino kit a few days ago and I've been going through some of the tutorials.

I got to the 8 LEDs with a shift register tutorial, where I got stuck. Nothing would light up after I plugged everything in and uploaded the sketch.


This is the circuit I've attempted to recreate using Fritzing, and the following is the code I used, from the tutorial :

int tDelay = 100;
int latchPin = 11;      // (11) ST_CP [RCK] on 74HC595
int clockPin = 9;      // (9) SH_CP [SCK] on 74HC595
int dataPin = 12;     // (12) DS [S1] on 74HC595

byte leds = 0;

void updateShiftRegister()
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, LSBFIRST, leds);
  digitalWrite(latchPin, HIGH);

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

void loop()
  leds = 0;
  for (int i = 0; i < 8; i++)
    bitSet(leds, i);

I have also attempted to use an 8-segment digit display using the same shift register, also failing.

Is there something wrong that I am doing or could it be that the little chip is broken?

I accidentally discovered that when I swap the ground from pin 8 on the 595 to 5V, all the LEDs will light up.

Update : I got the same circuit in Tinkercad, some kind of Arduino simulator. After dropping in the code and running the simulation, after it lights up the 5th LED, I get this warning :


However, when I change the 220 ohm resistors to something like 500 ohm resistors, that pop-up is gone. Could this be another reason of why my chip could be possible broken at the moment?

  • LEDs light up because of protection diodes on the inputs/outputs. You've got negative voltage on the outputs, so current flows. I'd worry about OE input, as it's hardwired to the ground. Protection diodes are for the small currents only so i'd expect burning protection diode and after that /OE might get destroyed.
    – KIIV
    Commented Jan 5, 2019 at 14:33
  • BTW: code + schematics is working.
    – KIIV
    Commented Jan 5, 2019 at 15:06
  • Okay... thanks for confirming that. Guess I'll have to buy a new shift register... the issue is I have no idea where in the town I can get electronics like that. Thank you, anyway!
    – hiimsoba
    Commented Jan 5, 2019 at 15:09
  • 1
    I tried the config in different places on the breadboard and with different wires... same result.
    – hiimsoba
    Commented Jan 5, 2019 at 15:11
  • 2
    the power and ground rails on breadboards are sometimes interrupted int the middle of the breadboard
    – Juraj
    Commented Jan 6, 2019 at 12:00

3 Answers 3


The only way i found to make this circuit to work is by putting 8 pullup resistors (1k) from vcc to each of the output pins of the 74hc595 whithout them no leds light up ever.


A few thoughts

Connecting 5v to pin 8 (=gnd) is not a good idea. It may not cause any damage if pin 16(=vcc) is also connected to 5v but i would not rely on that. Generally reverse voltage will kill all electronics unless they are specifically protected against it.

For the LEDs I would use 1k to 10k ohm resistors. This is giving still enough current to see them light up. Using 330ohms just takes more current and makes the leds extremely bright (3mA is enough).

For testing whether something simple is working, like a shiftregister, flipflop, or logic gate, I would not use a microcontroller at all. You can just use a couple of switches attached to the CLK and LATCH pins, with a slide switch attached to the DATA pin to select 1 or 0 input bit. This eliminates one point where stuff can go wrong.

Whether or not you put in a bypass cap will not make a difference if your supply is sufficiently capable and stable. I use the charger of my broken laptop that can deliver 5v at up to 2.5amps. In this setup I don't need any bypassing, although it's still best practise to include it.

Adding LEDs to the serial IN, latch, and shift clock, and serial output may also help nail down the problem.

Also make sure you don't have dodgy cables. If any of the wires is broken or has microscopic internal breaks this can lead to misbehaviour and is very difficult to find.

One thing I did when I tried if my chips worked was to first use a known good chip from a colleague to confirm the circuit was ok.

Depending on where you take your power from, adding a power LED is usually a good idea as well. If you power everything from a powerbank you may find that some of them just shutoff the outputs if there is less than a certain threshold current flowing out. This can leads to effects like "the circuit worked for 30 seconds and then died. After disconnecting and waiting a couple of seconds and repluging the power it works again..." For this reason I include a power LED in just about every project of mine.

  • Your answer seems to be getting some down votes. Perhaps if you took the trouble to properly construct English sentences that would help? Sentences start with a capital letter, and the word "I" is capitalized. This isn't a mobile phone message.
    – Nick Gammon
    Commented Mar 11, 2019 at 6:16
  • Really? That seems unduly harsh to down vote an answer because it is not punctuated and does not start sentences with capitals correctly. I also could not see that as a reason in the help center arduino.stackexchange.com/help/privileges/vote-down . Now if it were the English literature SO community, I would tend to agree. It is a shame that people are not required to give a reason for the down vote... I to have received several on the arduino site and often have no clue why.
    – GMc
    Commented Jul 19, 2019 at 8:02
  • 1
    This is a good discussion on troubleshooting best practice (especially e.g. the point about testing with switches instead of microcontroller code). I've made the grammatical edits, and removed some of the unnecessarily provocative phrases ("stupid idea", etc.) Commented May 6, 2021 at 5:02

One omission I see is that you don't have a bypass capacitor across Vcc and Gnd of the 74HC595. Without it you would have inconsistent operation.

But if you had the power reversed on the chip then that will be the major problem and I'm sure the chip is damaged.

What I would do is put leds on the clock, data, and latch lines. And then make your delay very long, 1 second, so that you can see what the lines are doing. Just to confirm that you are getting the output that you expect. But first put a bypass cap across the chip.

Also double check that your leds are in the right way.

  • I'm quite a newb in the electronics field, may I ask what am I supposed to do, in a step-by-step fashion? I followed the guide I got with the kit and it didn't have any capacitors involved. The LEDs are the right way, I tried each one of them out before and they all light up.
    – hiimsoba
    Commented Jan 5, 2019 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.