5V Single-Channel Relay Module
A ready-to-wire breakout board built around a 5V relay, an onboard transistor driver, flyback diode, and often an optocoupler — commonly wired active-LOW, which trips up beginners expecting a HIGH signal to mean "on."
How this component works
A relay is an electromechanical switch that allows a low-power circuit to control a completely separate high-power circuit. It contains a small electromagnet coil. When a small current energizes the coil, the magnetic field physically pulls a set of mechanical switch contacts closed (or open).
Relays provide total electrical isolation (galvanic isolation) between the control circuit and the load. This allows a delicate 5V microcontroller pin to safely turn on a 120V AC appliance without any direct electrical connection between the two systems.
Deep Dive: 5V Relay Module
The active-LOW trigger convention on most of these modules is a direct consequence of how their onboard driver is wired, not an arbitrary design choice. The module's small NPN driver transistor has its base biased through a resistor connected to the module's own 5V supply rail; grounding the input pin (pulling it LOW) is what completes that base-bias path and turns the transistor on, which in turn energizes the relay coil. A microcontroller sending a HIGH signal instead leaves that base path un-grounded, so the transistor — and the relay — stays off. This is a subtle but common source of confusion for anyone assuming relay-on always means signal-high.
The module exists in the first place because a bare relay coil (see the sibling entry in this category) draws considerably more current than a microcontroller pin can safely supply directly, and switching that inductive coil without a flyback diode risks a voltage spike damaging whatever is driving it. This module packages the transistor driver and flyback diode (and, on many boards, an optocoupler for additional electrical isolation between the low-voltage control side and the relay/load side) onto one small breakout board specifically so a beginner doesn't have to build that driver circuit from discrete parts — the tradeoff being less visibility into, and control over, exactly how that driver stage is built compared to wiring a bare relay by hand.
Common Use Cases
- Switching mains-voltage or high-current DC loads (lamps, pumps, larger motors) directly from a microcontroller output pin
- Home-automation and IoT projects controlling household appliances from an Arduino, ESP32, or Raspberry Pi
- Isolating a low-voltage control circuit from a higher-voltage or higher-current switched circuit, especially with the optocoupler variant
Frequently Asked Questions
Why does this relay module turn on when the input signal goes LOW, not HIGH?
The onboard driver transistor's base is biased through a resistor from the module's own 5V rail. Pulling the input pin LOW (to ground) is what actually allows current to flow through that base resistor and turn the transistor on, which then energizes the relay coil — so a LOW signal, counterintuitively, means "relay on" on most of these modules.
Why can't a microcontroller pin drive the relay coil directly, without this module's driver circuitry?
A typical relay coil draws far more current (often 70-80mA at 5V) than a microcontroller GPIO pin can safely source (commonly limited to 20-40mA), and switching an inductive coil directly also risks damaging the pin from voltage spikes without a flyback diode — the module's onboard transistor and diode exist specifically to handle both of these problems.
What is the optocoupler on some relay modules actually for?
It electrically isolates the microcontroller's low-voltage control side from the relay's coil-driving side, so that any fault or voltage spike on the relay/load side is far less likely to damage the microcontroller — a meaningful safety margin when switching mains voltage or larger loads.
Comparison Notes
Compared to the bare 5V relay in this category, this module bundles the driver transistor, flyback diode, and (often) optocoupler that the bare relay entry explains you must add yourself — convenient for quick projects, at the cost of a larger footprint and less control over the exact driver circuit.