Skip to content

Taming a Sticky Relay in Fishtank Automation with an RC Snubber

Challenge

I built some automations for my fish tanks, with relays driving a mister and the tank's LED lights. Intermittently, the relay controlling the mister would refuse to switch off — the module's indicator LED went dark (so the control signal had dropped), but the relay contacts stayed closed and the mister kept running.

To make it more interesting, a second tank running its own setup showed the same behaviour, except there it was the LED-light relay that wouldn't release. So this wasn't a one-off bad relay — it was a pattern worth understanding.

Troubleshooting

I worked through it roughly in this order:

Split the shared relay. The mister and the LED lights were originally on the same relay, so I separated them. The wiring was rerouted so each line got its own relay on the same bank. The fault followed the mister onto its new relay — telling me the problem was tied to that load, not to one specific relay.

The knock test. A hard physical knock would release a stuck relay. That's a strong hint that the contact was mechanically/electrically holding closed (sticking) rather than the coil logic being wrong.

External power for the active-low modules. These are active-low relay boards, so I wondered whether they needed a separate power feed to switch cleanly. I tested it — no difference.

A software band-aid. I updated the firmware to toggle the relay three times with 10 ms intervals at switch-off, hoping to "wiggle" it loose. It sometimes worked, but it was very hit-and-miss — a workaround, not a fix.

The interference lead. The idea of electrical interference / switching transients came up while I was talking it through with an LLM. That reframed the whole thing: an inductive or transient-heavy load can arc across the contacts as they open, and that arc can keep the contacts effectively conducting (or slowly weld/stick them). The classic remedy is an RC snubber — a resistor and capacitor in series, placed across either the load or the switch. Snubbers are used across power switches specifically to suppress voltage spikes and damp the ringing that circuit inductance produces when a switch opens. For this case I put it across the relay contacts, since protecting the switching element is the whole point.

The safety catch — fail-open resistors. My first instinct was to just buy a resistor and a cap and solder them together. The LLM flagged something important: the snubber resistor should be a fail-open (burnout) type. The idea is that if it's overstressed it burns open and disconnects, rather than failing short and becoming a fire path across the mains. On the capacitor side, an X2-rated part is the right choice because X2 caps are designed for continuous line-to-line mains use and to fail safely.

Result

The fix is a mains-rated RC snubber across the relay contacts, built from parts chosen for safe failure rather than just the nominal values:

  • Resistor: 120R 2W Metal Oxide or 120 Ohm 2W Fusible Resistor — the fusible/fail-open behaviour is the point, so it disconnects instead of shorting if it ever burns out.
  • Capacitor: 10nF 275VAC X2.

On the capacitor value there's a trade-off worth knowing about if you're switching LED drivers:

  • A snubber cap passes a small leakage current even when the relay is open. With LED drivers, that trickle can make the lights faintly glow when they should be off — "ghost glow."
  • A larger cap (100nF) snubs harder and is generally the better electrical choice, but it leaks more and worsens the ghosting.
  • A smaller cap (10nF) leaks less, so I chose it specifically to avoid ghost glow on the LED lines, accepting slightly less aggressive snubbing.

So: 100nF if ghost glow isn't a concern; 10nF when you're driving LED loads and want them fully dark when off.

The takeaways I'd hand to my past self:

  1. If a relay switches off in software (indicator LED confirms it) but the load stays on until you knock it, suspect contact arcing/sticking, not your control logic.
  2. Reach for an RC snubber across the relay contacts before you start abusing your firmware with retry hacks.
  3. Use a fail-open (fusible) resistor and an X2 capacitor — on a mains circuit, how the part fails matters as much as its value.
  4. On LED loads, size the snubber cap down (e.g. 10nF) to keep leakage low and avoid ghost glow.

References