Go Down

Topic: 74HC595 and relays (Read 1 time) previous topic - next topic


I am here again!

No very good news...

The code I pasted here one year ago works fine... but only when Arduino is plugged to the USB of the computer. Otherwise, the the relays go crazy... just like me, that I am going crazy too...


As a side note, 74hc595 outputs are only rated for 35 milliamps. I don't really understand the purpose of this circuit, but if it is powering the relays for an extended period of time you might want to drive it with IGBTs (transistors) Here is a circuit of how to set this up:

As a bonus it has a diode to attenuate the inductive spike. This will help preserve the transistor especially if it is turned on and off a lot.

Oops I forgot a 1k ohm resistor between the shift register and the IGBT.
I like cooking children and Arduinos
Is not the same as: I like cooking, children, and Arduinos
Grammar matters!


May 26, 2019, 07:36 pm Last Edit: May 26, 2019, 07:37 pm by Grumpy_Mike
No, driving the output of 74HC595 directly into the base of a transistor configured like that is a really bad idea. You need a base resistor.

Now your text speaks of using  IGBTs . If that is what you intend then please use the right symbol.
Don't give me a lame excuse that Fritzing dosn't have the right symbol. If you are answering questions here do it like a pro and answer it properly, either make the symbol in Frtizing or ditch the pile of crap.



Mike, don't complain too much, at least NoraTD is using the schematic editor in Fritzing instead of the breadboard editor! I know how much you love those!

Anyway, who uses IGBTs to drive relays? What's wrong with BJTs or MOSFETs? Have we established if the OP is using a relay module with a transistor or opto-isolator rather than a bare relay? I can't remember.

Another mistake in NoraTD's schematic is the relay terminals shown connected. Hint: not the coil!


And the flyback diode is shorted out.


I understand that if Arduino works perfectly when connected to the computer's USB, the code is correct. I'm right?

If so, how can it be that the relays go crazy when I disconnect the USB from the Arduino from the USB of the computer?

What can be wrong?


Probably a power supply issue. But that's a guess, made without your schematic and links to your components.

I imagine you are using a 9V power supply, either a wall-wart or a PP3 battery. Your relay boards are 5V. The Arduino's power regulator cannot supply enough current to run the relays without a voltage drop which causes the Arduino to reset. Or the PP3 battery cannot provide enough current because they are no use for anything except smoke alarms.


Thanks PaulRB!!!

Well, after a lot of bothering everyone (including you, friends) I think that unintentionally (like Fleming with penicillin... I would like to) I just found the key to leave, by mistake, the USB connector supported in the metal casing of the fountain.

Indeed, as you say PaulRB, I feed the relays with an additional source because there are so many relays and Arduino could not support the power needed to move them.

Well: leaving the USB support (unintentionally) in the metal casing of that source has eliminated the problem. The next thing I've done has been to connect the metal casing of the source to the ground of the Arduino and ... eureka!!! It has been fixed!!!

I've been with this topic for weeks... as Picasso said, "...whenever the inspiration came, he found me working!"

And since I do not get tired, now I have to get the inputs to the 74HC165, which behave like push buttons, to switch switches. But this is another issue not as simple (I think) as doing it without the 74HC165. Any help will be welcome!!!

Thanks, again, for being there!!!


I have to get the inputs to the 74HC165, which behave like push buttons, to switch switches. But this is another issue not as simple (I think) as doing it without the 74HC165
You will have to explain your problem in more detail. Are you using 74hc165 or not?

Time to post some schematics and any code you have.


Hi PaulRB,

The schemes and code that I have followed are those that I already put before, that's why I did not want to put them back.

Now is the typical problem of using a button as a switch, very basic when there is no 74HC165 in between but a little more complicated (for me) when there is 74HC165.


You got the 74hc165 working on that other thread. So you don't need more help at this time. OK, good luck with the rest of your project.


Thank you very much, Paul!

Go Up