RC Snubber on Relay controlling Motorized Ball valves

I have several 3 wire 220AC motorized ball valves controlled by Opto Coupler relays. Occasionally when the relays switch, my ESP32 is reset. I have a separate 5V supply powering the boards from the 3v signals from GPIO25,26&27, so I can’t figure out why the microcontroller is being affected, but I read that it is a common issue, and the RC Snubber is the proposed solution.

I can’t figure out if I need 2 snubbers for each relay, which switch the valve open (NO) and closed (NC). I have 220VAC connected to the COM pole on the relay which switches the power to the valve to open it on the NO circuit and close it on the NC circuit. Can I use a single snubber to protect both circuits since only one circuit will be energized at any one time?
Thank you for your advice.

Or a MOV (Meta Oxide Varistor), which might be easier to get.
Use two on each relay. One between CO and NO and one between Co and NC.
Leo..

1 Like

And I will say it again.

Wiring layout is generally at least as important as your "snubbers". :roll_eyes:

Until we see the wiring layout, it is not really practical to comment in detail.

Thank you PaulB and Wawa. See below the parts I am using.
Dual Channel relay
RC Snubber circuit
RC Snubber

Based on Wawa's suggestion, i will use 2 snubbers per relay, as I already have them, and see how that works.

My apologies for lack of circuit diagram.

Sometimes a snubber or MOV isn't enough protection from EMI interference. You can add an extra level of isolation by taking advantage of the relay module's opto isolators (at no extra cost). Just remove the jumper and connect your spare 5V supply as shown. IMPORTANT: There's no GND connection from the relay module to the ESP32.

2 Relay Module Circuit Connections (showing isolation barriers) ...

1 Like

And note that the left-hand "Vcc" must connect to 5 V on the ESP, not 3.3 V.

1 Like

Thank you for these insights. I had already removed the jumper on the relay and used 5v supoly from the (same) PSU. However I was using 3.3v from the ESP and also had ground connected. I am surprised and do not understand why there should not be a ground connected? Should I have a second PSU to power the relays? Of if I remove the ground and supply both sides of the relay with 5v, will that solve my resetting problem?

As an aside I have RF chokes on all AC leads and ferrite beads on the 5v supply leads. Do I need fly back diodes on my circuit?

Thanks again.

  • 5V power from the ESP32's USB cable is available at the VIN pin. As you can see from the circuit, we have VIN(5V) --> 1K --> IRLED --> RED LED --> INx (GPIO). The GPIO pin(s) are protected from over-voltage because of the voltage drop of the IRLED (1.1V) and the RED LED (2.0V).

  • Really, all that's being powered is LEDs ... the GPIO provides the ground path when its switched low (relay activated). A ground connection would disable opto-isolation and provide a path for interference.

  • You need a 5V power supply connected to the relay module where this PSU isn't connected in any way to the ESP32 VIN or GND pins. It needs to be isolated from the USB power.

  • Flyback diodes are already included on the relay module (D1 and D2).

1 Like


Whether you actually need a separate power supply just for the relays is not the point. they draw about 70 mA each so 140 mA for two relays.

Actually, it is usually a green LED - which is about 2 V.

You have saved me explaining - as I usually have to - why it connects to 5 V and not 3.3 V.

Right, getting back to that first diagram, the important point is that even if it is the same 5 V power supply, the 5 V and ground connections travel back as a pair using ribbon or "figure eight" wire to the output terminals of the "separate" supply.

Similarly, the 5 V and ground for the ESP connect back as a pair to the output terminals of the supply itself. This is how the wiring needs to be arranged to avoid interference between the two parts of the system.

The "IN" pin connections travel back as a bundle using ribbon wire to the I/O pins of the ESP, again together with the 5 V connection which is the return for those controls. You always need a return, but it is not always ground - as in this case.

1 Like

Even though you've had the relays operating using 3.3V, this would be using them almost at the threshold of failure. The relay driver would be so weakly driven that this increases the turn-on time and contact bounce-time. The force on the contacts would be reduced, more arcing, EMI, contact wear, reduced life span, reduced reliability, etc.

Even though any one of the suggestions in this thread could seem to resolve the problem, it's best to implement everything you can as this will boost the durability and reliability of your project.

There's probably more that could be done, but we have no picture or diagram of your setup.

1 Like

Thank you so much all for your inputs. I will implement the changes and revert with results.

The 6 x RC snubbers will be awkard to implement, so i may leave that as a next step, and see if the 5v vs 3.3v and no ground solution will suffice.

Then use MOVs.
They can be connected directly, with the wires, to the screw terminals.
Leo..

2 Likes

When I search my local supplier for MOVs there is a bewildering choice. Would these work ok?

Bourns, MOV-20D Metal Oxide Varistor 500pF 100A, Clamping 1355V, Varistor 820V

If not, how can i determine the correct specifications?

I think the MOV-20D391K (250V rms) or the MOV-20D431K (275V rms) would be good choices.

1 Like

Yep, the whole idea is to pick one with a voltage just above your mains power voltage.
A small one (max current) would be ok to protect a ball valve.
Leo..

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.