[SOLVED] Flyback diode equivalent for AC solenoids

Hi!
I have the common problem of my arduino resetting randomly, when it turns off power to my solanoids.
The way I have it hooked up: Arduino pin goes to an optocoupler Relay board, and the Relays switch power going to the solanoids.
The arduino is running on 5V DC, the relay board on 12V DC, and the solanoids want 24V AC. They are also quite far from the relays doing the switching, the cable (one way) is around 10m long.
From what I read, when the relay opens, the current in the long wire has to suddenly stop and while the relay bounces, the >1000V micro-sparks can cause a lot of EM noise, which can reset the Arduino.
The common advice is to use a flyback diode on the solanoid, but that wouldn't be possible on DC-driven ones, if I'm not mistaken. I've also read somewhere that problems like this can be fixed with ferrite beads clipped to the cables.
I'm pretty sure the problem is not with the supply voltage to the Arduino fluctuating, since it has it's own power supply.
I didn't post any wiring diagrams, specific hardware, or code, because I think this is a general question, and not a specific problem with my project, as I tried multiple power delivery configurations, and nothing helped. If however they are needed, I'll gladly post them, but be vary, this is quite an expansive project already and it'll be a lot to take in :stuck_out_tongue:
Thank you for any insight!

A quick check would be to replace the 24VAC relay with an incandescent light bulb for whatever mains voltage you have there. Then you will only have a resistive load. Let us know the results.

Also be sure the 24VAC wiring is far from the rest of you project wiring.
Paul

TVS diode, or MOV can be used to clamp spikes, or a resistor or RC snubber in parallel with the solenoid.

Ferrite beads are for suppressing RF and EMI, not large inductive voltage spikes like this.

The way I have it hooked up: Arduino pin goes to an optocoupler Relay board, and the Relays switch power going to the solanoids

If there's a ground wire connected from the relay board to the Arduino or if the relay board is using the same power supply as the Arduino, then opto-isolation would be disabled. I highly recommend making use of the opto-isolation feature of your relay boards. Combine this with adding TVS diodes or MOVs as suggested by MarkT and I'm quite sure the resetting problem would be resolved.

Thank you for your answers!

Paul_KD7HB:
A quick check would be to replace the 24VAC relay with an incandescent light bulb

That's a great way to diagnose this, will try it.

Paul_KD7HB:
Also be sure the 24VAC wiring is far from the rest of you project wiring.

Unfortunately it's right beside it, and I'd have to rebuild the whole thing to place it apart. Hoping for an easier solution.

dlloyd:
If there's a ground wire connected from the relay board to the Arduino

Right now there is, but I don't see the advantage or there not being. I mean if they weren't directly connected, the ground would still be the same, as it comes from the same electric system in the building. I'll do my best to separate the 5V supply tho.

I'll try the resistive load test and do my best to separate the circuits, but if nothing else helps, how would I go about using a MOV, TVS or just resistor? Like this?


And which would you recommend?

Not sure what relay board you're using, but here's an example of the connections for the 4-relay module to get full opto-isolation.
The MOV's could be installed at the COM (common) and NO (normally open) terminals of the relay, like here.
Here's some TVS/MOVs to choose from (rated at 30VAC) that should work OK.

Right now there is, but I don't see the advantage or there not being. I mean if they weren't directly connected, the ground would still be the same, as it comes from the same electric system in the building. I'll do my best to separate the 5V supply tho.

I would remove the ground wire from the Arduino to the relay board as this disables opto-isolation. The relay board needs a separate DC supply.

Thank you for those linked images.

dlloyd:
as this disables opto-isolation

That makes sense! Ok, I'll remove it.
The exact spec of the MOV is I'd guess highly dependent on the hardware, which I haven't shared. I'm sure I can find a good guide on how to choose one.
Will report back when I did some experimenting, but that might be weeks from now as I'm busy with other stuff.

Just to note that in the link provided, from the thousands of MOV parts available, I preselected through-hole type, 30VAC working voltage, 250A to 1kA surge, in stock and active. Therefore any of the MOVs on the list would work fine (still lots to choose from).

dlloyd:
Just to note that in the link provided, from the thousands of MOV parts available, I preselected through-hole type, 30VAC working voltage, 250A to 1kA surge, in stock and active. Therefore any of the MOVs on the list would work fine (still lots to choose from).

That's very handy, thank you! I'll order from a shop in Hungary, but I can select the product on this page. :slight_smile:

So, I've found this MOV on a hungarian store, this was the closest to the properties you specified. Could you please double-check it for me? :stuck_out_tongue:
Don't worry, the page is in english.
https://www.hestore.hu/prod_10040273.html?lang=en

SVAR7-30
Varistor, metal-oxide, 30V AC, 38V DC, 47V, 250A
Yes, this should work fine.

Thank you! I'll order it, and reply with the results.

The arduino is running on 5V DC, the relay board on 12V DC, and the solanoids want 24V AC. They are also quite far from the relays doing the switching, the cable (one way) is around 10m long.

Install them at the solenoid for best results.

dlloyd:
Install them at the solenoid for best results.

Which is of course, quite wrong! :roll_eyes:

Paul__B:
Which is of course, quite wrong! :roll_eyes:

Can you elaborate?

There is a tendency to "magical thinking" which blames the inductor for "generating" an impulse. But of course, that is exactly what inductors do not do! Inductors act to oppose changes in the current passing through them.

The often-called inductive "kickback" is generated by the switching device, whether a semiconductor or switch contacts. This transient travels from the switch along the transmission line, such as the 10 metre cable described here, to the inductor.

If you provide a diode, most of the transient is then arrested by the diode (and similarly for other devices). This means that if you put the diode at the inductor, the major transient will propagate all the way along the transmission line and be induced into anything nearby. If on the other hand, you place the diode adjacent to the switching device, you restrict the transient to that locality. Note also that the transient occurs in the circuit including the switching device and the power supply, so you need to provide a local bypass capacitor nearby as well to confine the transient to those three components - the switching device, the diode and the supply bypass capacitor, and avoid it propagating back along the wiring to the power supply itself.

To clarify in case you missed it: We are talking about a current transient. The switch opens, the current in the power supply and switch circuit promptly drops from the original current to zero. The current in the diode promptly rises from zero to that original current. The net result is that the current in the inductor instantaneously stays the same - because that is what inductors do. At that point however, it begins an exponential fall toward zero which is however not a transient.

And if you look at voltage, then what happens is that at the moment of switch-off, the voltage at the switch (near-)instantaneously transitions (a transient) from the forward voltage across the inductor, to the reverse voltage restricted by the diode's conduction.

This voltage transient propagates from the switch along to the inductor but if the diode is at the inductor, then it is only limited by the diode when the transient arrives, so the actual transient at the switch can be substantially greater until the "clamping" effect of the diode on that diode when the initial transient reaches it, is reflected back along the transmission line to the switch. In short, placing the diode at the inductor end of the transmission line makes the transient greater that placing it at the switch!

Thanks paul. I'm sure that installing the MOV either across the relay contacts or at the load would work well.

Note that the source of the transient is at the load side of the cable, not the switch (relay). I was thinking that by installing at the load, most of the clamped transient energy gets re-circulated and absorbed through the load. Here, the cable could be considered as a component to protect:

Page 13: The MOV should always be placed as close as possible to the source of the transient and in front of all components to be protected.

dlloyd:
Note that the source of the transient is at the load side of the cable, not the switch (relay).

Then you did not comprehend what I wrote. :cold_sweat: Oh well! :grinning:

dlloyd:
I was thinking that by installing at the load, most of the clamped transient energy gets re-circulated and absorbed through the load. Here, the cable could be considered as a component to protect:

Interesting gobbledegook!

Hi!
I'm just here here to report, that my problem is solved. :slight_smile:
I installed the MOVs ordered from the link I sent earlier at the relay board (at the solanoids would've been a pain), and the Arduino doesn't reset anymore. Even though I only installed MOVs at the relays closest to the Arduino. My ethernet shield still freezes sometimes, but I expect that will be solved too, when I install the rest.

The commercial AC equivalent to a flyback diode is a QuenchArc which is a capacitor in series with a resistor rated for power line use. These are rated for various residential and industrial voltages and will last forever. MOVs will burn out if used for snubbing and using limiting type devices will generate lots of RF noise and cause all kinds of problems.