I am hoping to use raspberry pi to switch on and off a heating lamp and an aquarium pump via a relay switch. Both devices are plugged into 120V AC normally.

The relay tutorials online seem to be mostly directly connecting the pi to the relay. Are RC snubbers needed in this kind of use case for safety? If so, where can I get a schematics or just some ideas on how to set one up.

Thanks in advance.

  • 1
    I doubt you have seen any videos of the Pi directly connected to a relay. The videos probably show the Pi connected to a relay module, i.e. a board containing electronics which allows safe control of the relay from a microcontroller.
    – joan
    Apr 17, 2019 at 13:37
  • You are right. It is a relay module. I should have specified. That's the clarification I needed. thx.
    – Viele
    Apr 17, 2019 at 15:26
  • Your need for suppression or safety features will depend entirely on what relay you use. RC snubbers are rarely used for safety, They are used to address the inductive Ldi/dt *kick associated with switching off current flow through an inductive load. If you use a solid state relay, you won't need to consider snubbers as there are no inductive components. They may be easier to use for these reasons. Let us know what type relay you're using, & we'll provide a factual answer.
    – Seamus
    Apr 17, 2019 at 18:07

1 Answer 1


Are RC snubbers needed in this kind of use case for safety?

Well, when the relay switch contact breaks, current (of inductive load storing the inductive energy) has no where to go and therefore crazily fly across the contacts of the relay switch, in the form of a spark. The sparks would shorten the life of the silver contact points of the relay switch. But there is usually little safety problem (too little heat energy to cause a fire etc).

However, EMI (Electro Magnetic Inference) comes with the spark and may cause two things to happen.

  1. EMI might cause flickers in your TV or HiFi equipment.

  2. If you don't have optoisolation in your relay module (not the relay switch), EMI might be picked up by the signal/power/ground wires (which act like antennas) and triggers your Rpi to reset (usually won't hurt or kill your Rpi).

Back EMF is different from EMI. Back EMF is generated at the solenoid coil when the switching device, usually a power switching transistor, cutting off the coil activating current. This time the current has somewhere to go, through the flyback diode, or if no flyback diode, go back, in reverse direction, to the driving circuit, crazily killing things in their journey.

  1. Back EMF can be suppressed by a flyback diode.

  2. EMI can be suppressed by a RC snubber.

If you don't mind the EMI causing flicker in your TV set, or your Rpi from time to time automatically resets itself, then no snubber is necessary. Otherwise use snubber.

This snubber thing is electrical engineering stuff and you need to ask the EE guys for more details. You might like to read the articles at the appendix below. I googled those articles mostly from EE Stack Exchange.

Here are two pictures of MOV (Metal Oxide Varistor, snubber) for you reference. I bought the quad relay green module with preinstalled varistors from a industrial products shop, not from eBay who sell you cheapy relays! :)



Appendix - AC EMI References

Introduction to Transient Voltage Suppressors

Mechanical Relay Primer Section4.3.1 Arc Supression

Simple relay circuit getting noise spike form AC line - ETech online 2009apr05

Relay noise problem although flyback diode is used - rudwna 2015may24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.