Go Down

Topic: Relays and Solenoid Valves (Read 229 times) previous topic - next topic

RayLivingston

I am, once again, battling a problem I've battled on every such project, with varying degrees of success.  I have an Arduino Nano controlling a set of 8 relays, using 4 of the little widely available Arduino dual-relay boards.  Each relay is controlling a pneumatic solenoid valve, with a 12V/5W coil.  The problem is, de-energizing ANY solenoid coil causes the Arduino to reset!  It all works perfectly with the solenoid coils disconnected, or un-powered.  I've tried everything I can think of - snubber diodes, separate power supplies, etc.  Right now, I have a separate 120VAC->12VDC/2.5A wall wart connected to the relay contacts to power the solenoid coils.  I have a separate 120VAC->12VDC wall wart which powers a 12VDC->5VDC DC-DC converter, which in turn powers the Arduino and the relay boards.  There are NO shared connections between the two power supplies, other than the AC line.  Even grounds are not connected to each other.  Yet, every time I turn ANY solenoid coil OFF, the Arduino resets itself.

Any suggestions?

Regards,
Ray L.

hammy

Really need to see a circuit diagram of this , plus a sketch listing .

Wawa

#2
Nov 15, 2018, 10:08 pm Last Edit: Nov 15, 2018, 10:18 pm by Wawa
In general, three things are important.

1) Snubber diode across the solenoid, on the solenoid.

2) No solenoid wiring near Arduino/relay wiring. No solenoid near the Arduino.

3) Use opto isolation if possible, which gives you a second layer of isolation.
a) Relays need a separate supply
b) JD-VCC jumper must be removed
c) NO ground wire between Arduino and relay board.

Leo..

RayLivingston

In general, three things are important.

1) Snubber diode across the solenoid, on the solenoid.

2) No solenoid wiring near Arduino/relay wiring. No solenoid near the Arduino.

3) Use opto isolation if possible, which gives you a second layer of isolation.
a) Relays need a separate supply
b) JD-VCC jumper must be removed
c) NO ground wire between Arduino and relay board.

Leo..
The relay boards are exactly like these:
https://www.ebay.com/itm/2pcs-5V-Dual-Channel-2-Relay-Module-Arduino-Relays-Switch-110V-115V-120V-220V-US/292230695516?hash=item440a4e8a5c:g:WXEAAOSw0xRZpJ8g:sc:USPSFirstClass!95060!US!-1:rk:2:pf:0


What does the "JD-VCC" jumper actually do?  How should it be wired if that jumper is pulled?  How do the control signals work if there is "NO ground wire between Arduino and relay board?"


Regards,
Ray L.

RayLivingston

OK, found what claims to be a schematic for that relay board.  So:

Remove VCC-to-JD-VCC jumper
Connect Arduino VCC to VCC pin
Connect Arduino output pins to IN1/IN2 pins
Connect a separate 5V supply to the Gnd and JD-VCC pins?

In my case, the relay itself is NEVER a problem.  Even with the JD-VCC jumper installed, I NEVER have a problem cycling all 8 relays in any way I choose.  There is ONLY a problem when the 12V solenoid coils are connected so they can be energized by the relay contacts.  The problem NEVER occurs when energizing the solenoid coils, but ONLY when de-energizing them.  Since there is NO electrical connectivity between the solenoid coils/relay contacts and the "logic" side of the relay boards and the Arduino itself, it seems to me the problem has to be EMI affecting the Arduino itself.

Regards,
Ray L.

outsider

#5
Nov 16, 2018, 04:21 am Last Edit: Nov 16, 2018, 04:22 am by outsider
Like this, Ray:

MarkT

#6
Nov 16, 2018, 12:11 pm Last Edit: Nov 16, 2018, 12:14 pm by MarkT
Have you implemented the first and most important recommendation of Wawa's?:
Quote
1) Snubber diode across the solenoid, on the solenoid.
Actually the diode should go on the relay terminals for best effect.  It provides a diversion
path for the solenoid current when the contacts open, preventing a huge voltage spike
(and preventing lots of interference and possible damage to solenoid winding insulation too).

Having the snubber on the solenoid means the current in the wiring between relay and
solenoid has to change extremely rapidly, which will radiate some EMI.  Having the diode
at the relay limits the region of rapid current change to just the relay contacts...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

RayLivingston

Having the diode at the relay limits the region of rapid current change to just the relay contacts...
Sorry, but that is just wrong.  Current continues to flow specifically because of the inductance of the solenoid coil.  
V = L * di/dt
It is the inductance that causes the large voltage spike that causes arcing of the relay contacts.  The current through a wire CAN be stopped almost instantly, due to the very low inductance.  The coil, however, has a great deal of stored energy, which must be dissipated over a significant period of time.
Regards,
Ray L.

RayLivingston


Putting the snubber diodes directly on the solenoid coils solved that problem, which makes sense - this is snubbing the reverse current WITHOUT sending high current through the wires, which will make them act as an antenna.  I can now de-energize all the solenoid coils at once, without crashing the Arduino!

Next problem - I have two solenoid valves with 120VAC coils, which I just wired up.  They are now causing the Arduino to crash when turned off.  Since it is AC, can't use diodes.  Only thing I can come up with is non-polarized capacitors, but I don't have any of those handy, and nowhere close by I can get them from...

Regards,
Ray L.

Wawa

A VDR/MOV (voltage dependent resistor/ metal oxide varistor) or a snubber circuit can be used for AC loads.
Leo..

RayLivingston

Luckily, I had a couple of 12VDC solenoids I could swap in, to replace the 120VAC ones.  They don't have quite the flow rate I need (they are providing air to a pair of vacuum ejectors), but are close enough for my short-term needs.  I'll order some better 12VDC valves to drop in soon.

Otherwise, all is now working perfectly!

Thanks to all!

Regards,
Ray L.

RHowes

I am, once again, battling a problem I've battled on every such project, with varying degrees of success.  I have an Arduino Nano controlling a set of 8 relays, using 4 of the little widely available Arduino dual-relay boards.  Each relay is controlling a pneumatic solenoid valve, with a 12V/5W coil.  The problem is, de-energizing ANY solenoid coil causes the Arduino to reset!  It all works perfectly with the solenoid coils disconnected, or un-powered.  I've tried everything I can think of - snubber diodes, separate power supplies, etc.  Right now, I have a separate 120VAC->12VDC/2.5A wall wart connected to the relay contacts to power the solenoid coils.  I have a separate 120VAC->12VDC wall wart which powers a 12VDC->5VDC DC-DC converter, which in turn powers the Arduino and the relay boards.  There are NO shared connections between the two power supplies, other than the AC line.  Even grounds are not connected to each other.  Yet, every time I turn ANY solenoid coil OFF, the Arduino resets itself.

Any suggestions?

Regards,
Ray L.

Maybe a EMF spike from the collaping coil current (similar to a radio transmitter) - try shielding (ensuring the shield is grounded - (put the controller in a metal box, or wrap the solenoid in tin foil (careful not to short the wiring out).

Regards,
Rob

Go Up