[Solved] 74HC595N all outputs high no matter what I do

Hi, I’m dealing with the 74HC595N shift register to control 8 LEDs.
The connections are done exactly as it’s shown in the image


The code is really simple, and it’s read as follows:


int SER =8;
int LATCH =9;
int CLK =10;

void setup()
{
   pinMode(SER, OUTPUT);
   pinMode(LATCH, OUTPUT); 
   pinMode(CLK, OUTPUT);
   digitalWrite(LATCH, LOW);
   shiftOut(SER, CLK, MSBFIRST, B10101010);
   digitalWrite(LATCH, HIGH);
}
void loop(){}

The problem is that no matter what Number I send to the shift register, either integer or binary, the 8 LEDs glow constantly when arduino is connected. Even if there’s no code, just plugging-in the arduino is sufficient to glow every single LED. This seems quite weird to me, I’ve already checked all my connections, and it looks everything is fine.

Let’s see your actual wiring.

Change the series resistors to a higher value, try about 1k

Add de-coupling to to the Vcc pin 16.

Thank you so much for your answer, I’m not sure I understand “de-coupling to the VCC”, I’m afraid I’m not so good in electronics.

Place a 100nF capacitor close to pin 16 (between GND and 16 which is 5V).

image

The load is the chip, pins 16 and 8

Oh I see, thank you, I’ll try it tomorrow after buying one because unfortunately I don’t have any capacitor.
Anyway, in what sense the 1k resistor changes could be a good idea? I thought a 220Ω resistor was quite enough to current-limit the 2-3 V LEDs.
Actually, I have a 470 μF capacitor, would it work?

Make sure to buy a ceramic 0.1uF capacitor. Any other type of capacitor will not work.
See:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

1 Like

I you are serious in learning this stuff and you want to properly communicate with people about your project, you need to learn to post a proper schematic of the circuit you are referring to.

Also, make your test sketches a bit more dynamic.

Example:

int SER              = 8;
int LATCH            = 9;
int CLK              = 10;

unsigned int counter = 0;


//*********************************************************************************
void setup()
{
  pinMode(SER, OUTPUT);
  pinMode(CLK, OUTPUT);
  pinMode(LATCH, OUTPUT);

  //digitalWrite(LATCH, LOW);
  //shiftOut(SER, CLK, LSBFIRST, B10101010);
  //digitalWrite(LATCH, HIGH);

} //END of   setup()


//*********************************************************************************
void loop()
{
  digitalWrite(LATCH, LOW);
  shiftOut(SER, CLK, LSBFIRST, counter++);
  digitalWrite(LATCH, HIGH);
  delay(200);

} //END of   loop()

1 Like

Hi,
this is your code.
I made a small change to it just to give it "movement".

It works correctly.
I see some possibilities:
Or, as already mentioned, the lack of capacitors is proving failures;
or you connected something wrong in your assembly;
or your 74HC595 is faulty.

1 Like

Please post clear, complete images of your actual wiring.

Thank you so much guys.
LarryD thank you, I supposed it wasn’t the best option but I though it was better than posting a photo of my actual wiring. What software would you recommend me for making my own schematics?
Also, I know there are several programs that help you simulating the behaviour of your circuits, do you know some I could start with?

EasyEDA or KiCAD are good options for drawing schematics, a pencil and paper works too.

1 Like

I started drawing schematics with pencil and paper (and a big eraser)!

See reply #8

1 Like

Updating:
I replaced 220Ω resistors by 1K, also added the 0.1μF de-coupling capacitor (ceramic) as you told me.
It’s acting the same way. Just a lower bright of the LEDs.

See post #9. Something is wrong with your setup.

The schematic and sketch in post #7 works perfectly here.

You must have a bad component or miswiring.

Note:
You might have bad wires too. :thinking:

Finally. The chip was the problem, I just bought another and replaced it. It works perfect. Thank you!!!!🫶🏿

If your problem was solved, do a kindness to everyone on the forum, especially to those who helped you.
Write [Solved] before your topic title, so if someone searches and finds your topic, they'll know what the solution looks like.

And if it was solved by some help, please tick the one that best describes your solution.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.