Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

Relay vs SSR vs MOSFET — how to switch loads safely

Relay modules, solid-state relays and MOSFETs compared on AC/DC, isolation, speed, heat, leakage and price, with mains safety rules for Indian 230 V homes.

Community draft — report a mistake

Relay moduleSolid-state relay (SSR)MOSFET
SwitchesAC or DCAC only for the common "DA" type (DC types exist)DC only
Isolation from your boardYes — separate contacts (plus an optocoupler on many modules)Yes — opticalNo — shares ground with the board
Switching speedAbout 5–15 ms; a few switches per second at mostAC types switch at the next zero-crossingMicroseconds — fine for PWM dimming and speed control
NoiseClicksSilentSilent
Wears outYes — contacts are rated for a limited number of operationsNo moving partsNo moving parts
Off-state leakageNoneA few mA — LED bulbs may glow faintlyNegligible
HeatCoil onlyAbout 1–1.5 V drop: needs a heatsink above a few ampsVery low with a logic-level MOSFET
Typical price in India₹60–120 (1-channel module)₹150–450 (fakes common)₹30–150

All three let a 3.3 V or 5 V pin control something much bigger. Picking the wrong one leads to burnt contacts, glowing bulbs, hot heatsinks — or worse. Behaviour described here is typical of the parts sold in India; always check your part’s own ratings.

Mains safety first

If the load runs on 230 V AC:

  • Mains wiring is electrician-only work, inside a proper enclosure, with an MCB/RCCB and earth. Never on a breadboard.
  • A relay module or SSR drives a contactor coil or a small lamp within its rating — never a motor or pump directly. Motors draw several times their running current at start-up and weld relay contacts. The contactor switches the motor. Our water tank alarm and smart pump controller show this arrangement.
  • The ratings printed on a cheap relay (10 A 250 VAC) are optimistic for inductive loads.

Relay module: the default

  • Switches AC or DC with a real air gap — when it’s off, it’s off.
  • Works for lamps, contactor coils, solenoid valves, 12 V pumps.
  • Most Indian modules are active-LOW and have the flyback diode and driver transistor built in. Day 25 shows safe wiring with a 12 V lamp.
  • Too slow for PWM; contacts wear out over time. Clicks but nothing switches? Fix.

Component: relay module.

SSR: silent AC switching

  • No click and no wear — good for heaters, incubators and lights switched often.
  • Leakage: even “off”, a few mA flows. A low-wattage LED bulb may glow or flicker. Not a safe isolation point for working on the circuit.
  • Heat: about 1–1.5 V is lost inside, so a 10 A load makes 10–15 W of heat. It needs a real heatsink.
  • Fake ratings are common. Many cheap 25 A or 40 A SSRs can’t carry anywhere near that. Derate heavily, or use a small 2 A SSR module for light loads.

MOSFET: for DC loads and PWM

  • The right choice for 12 V LED strips, DC fans, DC pumps and motor speed control — it switches thousands of times a second.
  • Pick a logic-level MOSFET (fully on at 3.3–5 V gate voltage, e.g. IRLZ44N, or an AO3400 for small loads). The popular IRF520 module is not logic-level; from a 3.3 V pin it barely turns on and runs hot.
  • Use a gate resistor (100–220 Ω) and a pull-down (10 kΩ) so the load stays off at boot.
  • Inductive loads (motors, solenoids) need a flyback diode across them.

Verdict

Load Pick
230 V motor or pump Relay or SSR → contactor → motor (electrician wires it)
230 V lamp or contactor coil, switched occasionally Relay module
Heater or light switched often, silent SSR with a heatsink, derated
12 V LED strip, DC fan, DC pump, PWM speed or dimming Logic-level MOSFET

↑↓ to move · Enter to open