Arduino power shutdown when relay connected

Hello,
I am new here.

I am trying to build a arduino project with solenoid door lock.
I followed tutorial from http://jume-maker.blogspot.com/2018/05/relay-module-solenoid-door-lock-how-to.html

then, when I connect relay to arduino, the arduino power shutdown. I don't have any idea why.
I connect relay vcc to arduino 5v.
I used 5V relay, SRD-05VDC-SL-C

I'm waiting for your help.
Thank you.

Hi,
Welcome to the forum.

What are you using to power the UNO?
Have you got the 12V wiring away from the wiring for the UNO?

Can you post a picture of your project please, so we can see your component layout.

Thanks.. Tom..

TomGeorge:
Hi,
Welcome to the forum.

What are you using to power the UNO?
Have you got the 12V wiring away from the wiring for the UNO?

Can you post a picture of your project please, so we can see your component layout.

Thanks.. Tom..

Hi, Tom. Thank you for responding.

I use adapter 12V to relay and solenoid,
I use USB arduino first, but it didn't work I tried to use 12V adapter. But still the relay power the arduino off.

Must add a diode across the solenoid, to kill the kickback spike when the relay/solenoid turns off.
Leo..

Wawa:
Must add a diode across the solenoid, to kill the kickback spike when the relay/solenoid turns off.
Leo..

Hello Leo, thank you for responding.
what kind of diode should I use? and where should I add that?

Any 1Amp diode. A 1N4004 will do.

The diode goes across the solenoid (connected to the two wires of the solenoid).
With the cathode (ring) of the diode to + of the solenoid/supply.

Leo..

Wawa:
Any 1Amp diode. A 1N4004 will do.

The diode goes across the solenoid (connected to the two wires of the solenoid).
With the cathode (ring) of the diode to + of the solenoid/supply.

https://www.azatrax.com/image/CoilDiode.png

Leo..

I've tried using diode, it still doesn't work.
I tried do test to relay only, the arduino shutdown and the relay led is not even turning on.
is the relay broken?

Remove the solenoid for now, and the solenoid supply.
And test the Mega, on USB supply, with only the relay module connected.
You should hear the relay module click on/off every 5 seconds with the code from that site.

If that works, then think of connecting the solenoid/supply again.
WITH the diode.
A solenoid without kickback diode could randomly reboot the Mega and eventually damage the relay module.
Leo..

Wawa:
Remove the solenoid for now, and the solenoid supply.
And test the Mega, on USB supply, with only the relay module connected.
You should hear the relay module click on/off every 5 seconds with the code from that site.

If that works, then think of connecting the solenoid/supply again.
WITH the diode.
A solenoid without kickback diode could randomly reboot the Mega and eventually damage the relay module.
Leo..

Hi Leo, thank you for your help so far.
I've tried test with mega and module relay only, unfortunately it still doesn't work.
the relay shut the mega down every time I connected VCC or GND.
and the mega powered when I disconnected the relay

Hi,
Your connection from the Mega to the relay are not the same in both pictures.

In picture you have the signal going to the right terminal of the input on the relay.
In Fritzy you have the signal going to the left terminal of the input to the relay.

Can you tell us what the terminals are labeled on the relay and what connections from the Mega you have to them?
Can you post a picture showing the input terminals to the relay PCB?

Thanks.. Tom.. :slight_smile:

TomGeorge:
Hi,
Your connection from the Mega to the relay are not the same in both pictures.

In picture you have the signal going to the right terminal of the input on the relay.
In Fritzy you have the signal going to the left terminal of the input to the relay.

Can you tell us what the terminals are labeled on the relay and what connections from the Mega you have to them?
Can you post a picture showing the input terminals to the relay PCB?

Thanks.. Tom.. :slight_smile:

Hello Tom.
I connected the component like this
Adapter
positive to NO relay
negative to negative solenoid

Solenoid
positive to COM relay
negative to negative adapter

relay to arduino
IN to D7
GND to GND
VCC to 5V

the problem is when I connected VCC or GND (relay) to 5V or GND (arduino), the arduino power is off. when I disconnected them the arduino power is on.

Thank you.

Hi,
It looks like you have a short circuit on the relay board between the 5V and gnd connections.

Do you have a DMM to do some circuit measurements.

Look under the relay pcb and see if any adjacent solder joints look like they are touching, especially at the edge of the relay PCB where you make your 5V and gnd connections.

Are you able to take a closeup picture of both sides of the PCB please?

Tom.. :slight_smile:

TomGeorge:
Hi,
It looks like you have a short circuit on the relay board between the 5V and gnd connections.

Do you have a DMM to do some circuit measurements.

Look under the relay pcb and see if any adjacent solder joints look like they are touching, especially at the edge of the relay PCB where you make your 5V and gnd connections.

Are you able to take a closeup picture of both sides of the PCB please?

Tom.. :slight_smile:

Hi Tom,

I wonder what's wrong with my relay module or is it broken.
here the closeup picture of the relay module

Thank you so much.

Hi,
Thanks for the pics.

Have you got a DMM, Digital MultiMeter?

Tom.. :slight_smile:

TomGeorge:
Hi,
Thanks for the pics.

Have you got a DMM, Digital MultiMeter?

Tom.. :slight_smile:

Hi Tom,

Unfortunately I haven't.
I think I should check it on the lab tomorrow.
Thank you for your help, Tom.
I really appreciate it.

Without reading too hard, the 5V connection on the relay module seems to be incorrectly labelled Vcc by the manufacturer.
Specifically, it would seem to be the +Vcoil pin, which isn’t really suitable to feed from the Arduino regulator. They have oddly put both the driver transistor and relay on the same +5V rail, which is poor practice.

The relay supply should be provided separately from the Arduino 5V in all projects, fed from a beefier supply/regulator - with the appropriate diode for back-EMF protection.
Only the common 0V, and control wires should go from the Arduino to the relay module’s low-current ‘control’ pin.

Not a problem to power a single relay module from the 5volt pin.
Those modules only draw ~80mA when the relay is active.

There must be something wrong with the module and/or wiring.
Leo..

Agreed, but I would NEVER put a switched inductive load on the same supply rail as uP or logic.
Just good style. Beginners don’t understand the difference between relays and relays, or volts and volts. Teach good habits.

Hello everyone. I'm new here too. But I'm here to confirm what the original poster of this topic is here to say: That the Arduino dose indeed reset itself when plugged into the same outlet as a 12V solenoid.

My solenoid is also isolated from the Arduino by power relay and opto-coupler with the exception of sharing the same 120VAC wall outlet. I also connected the diode across the terminals of relay..but same results...it still resets the Arduino.

NOTE: the relay does not reset the Arduino, because when I trigger the relay without the solenoid attached....everything works fine. I suspect a surge is coming from the outlet.

msuopys:
My solenoid is also isolated from the Arduino by power relay and opto-coupler with the exception of sharing the same 120VAC wall outlet.

I also connected the diode across the terminals of relay..but same results...it still resets the Arduino.

So you use a separate supply for the (unspecified) relay module, and there is NO ground connection between the module and the Arduino.
If you connect/power a relay module the default way (shared ground), then there is no opto isolation.

The diode goes across the solenoid, not across the relay contacts (where it does nothing).

Post links to the parts used, a diagram, and/or picture of the setup.
Read the 'how to post' guidelines before doing so.
Leo..