# \[SOLVED\] Flyback diode equivalent for AC solenoids

**URL:** <https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827>\
**Category:** General Electronics\
**Created:** [July 23, 2020, 1:13am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827 "2020-07-23T01:13:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 23, 2020, 1:13am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/1 "2020-07-23T01:13:20Z")

</div>

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 😛  
Thank you for any insight!

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [July 23, 2020, 2:31am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/2 "2020-07-23T02:31:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MarkT](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@MarkT](https://forum.arduino.cc/u/MarkT)\
**Post date:** [July 23, 2020, 2:44am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/3 "2020-07-23T02:44:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 23, 2020, 3:21am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/4 "2020-07-23T03:21:51Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 23, 2020, 12:20pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/5 "2020-07-23T12:20:39Z")

</div>

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?

 ![voltage-spike.png](https://europe1.discourse-cdn.com/arduino/original/4X/e/5/a/e5ace8a6258068deb0ce57220922577a4ebef3a5.png)  
And which would you recommend?

 ![voltage-spike.png](https://europe1.discourse-cdn.com/arduino/original/4X/e/5/a/e5ace8a6258068deb0ce57220922577a4ebef3a5.png)

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 23, 2020, 1:11pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/6 "2020-07-23T13:11:57Z")

</div>

Not sure what relay board you're using, but here's an [example of the connections for the 4-relay module](https://i.imgur.com/6m95zlV.jpg) 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.](https://i.imgur.com/2KglQKA.png)  
[Here's some TVS/MOVs to choose from](https://www.digikey.com/en/products/filter/tvs-varistors-movs/141?s=N4IgjCBcoGwJxVAYygMwIYBsDOBTANCAPZQDaIALGGABxwDsIAuoQA4AuUIAyuwE4BLAHYBzEAF9C1GIhApIGHAWJkQAJgCsABgCCIQhS279IbccI0jeqQGs9LEBy4BVIQPYB5VAFlc6bACufLgSUnB0svKKeIQkkORazGyckDz8wmKS6mAaENByaFgxKvEgAMxaAGpJjikgru5evv5BIVkAtGqRUPwBynHkGjVOqRJZXaUAtkQAbsziQA) (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.

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 23, 2020, 1:55pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/7 "2020-07-23T13:55:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 23, 2020, 2:23pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/8 "2020-07-23T14:23:55Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 23, 2020, 3:13pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/9 "2020-07-23T15:13:01Z")

</div>

> 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. 🙂

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 26, 2020, 12:47pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/10 "2020-07-26T12:47:04Z")

</div>

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? 😛  
Don't worry, the page is in english.  
[https://www.hestore.hu/prod\_10040273.html?lang=en](https://www.hestore.hu/prod_10040273.html?lang=en)

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 26, 2020, 12:53pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/11 "2020-07-26T12:53:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [July 26, 2020, 1:03pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/12 "2020-07-26T13:03:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 26, 2020, 1:08pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/13 "2020-07-26T13:08:42Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [July 27, 2020, 11:11am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/14 "2020-07-27T11:11:11Z")

</div>

> dlloyd:  
> Install them at the solenoid for best results.

Which is of course, quite **wrong**! 🙄

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 27, 2020, 1:20pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/15 "2020-07-27T13:20:39Z")

</div>

> Paul\_\_B:  
> Which is of course, quite **wrong**! 🙄

Can you elaborate?

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [July 28, 2020, 11:52am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/16 "2020-07-28T11:52:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dlloyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dlloyd/32/751911_2.png) [@dlloyd](https://forum.arduino.cc/u/dlloyd)\
**Post date:** [July 28, 2020, 12:47pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/17 "2020-07-28T12:47:05Z")

</div>

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._](https://www.littelfuse.com/~/media/electronics/trainings/littelfuse_mov_general_electrical.pdf.pdf)

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [July 28, 2020, 1:10pm UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/18 "2020-07-28T13:10:46Z")

</div>

> 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. 😰 Oh well! 😀

> 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!

---

<div class="post-metadata">

**Author:** ![RedyAu](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/redyau/32/264303_2.png) [@RedyAu](https://forum.arduino.cc/u/RedyAu)\
**Post date:** [August 7, 2020, 11:47am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/19 "2020-08-07T11:47:14Z")

</div>

Hi!  
I'm just here here to report, that my problem is solved. 🙂  
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.

---

<div class="post-metadata">

**Author:** ![azeeman](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@azeeman](https://forum.arduino.cc/u/azeeman)\
**Post date:** [August 9, 2020, 3:42am UTC](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827/20 "2020-08-09T03:42:01Z")

</div>

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.

[Next page](https://forum.arduino.cc/t/solved-flyback-diode-equivalent-for-ac-solenoids/666827.md?page=2)
