BeginnerSwitches & Drivers

Small Relay Driver with Flyback Protection

Use an NPN transistor to switch a low-voltage relay coil and clamp its turn-off voltage with a diode.

Estimated time: 30–45 minutes · Skills: Low-side switching, base resistor, flyback-diode polarity

Parts from the database

Other supplies

Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.

Connections

  1. Confirm the exact transistor lead order and relay coil pins in their datasheets.
  2. Connect relay coil from +5 V to transistor collector, emitter to ground. Put 1N4001 across the coil, banded cathode at +5 V and anode at collector.
  3. Connect +5 V through a pushbutton and 1 kΩ to the base; add 10 kΩ from base to ground.
  4. Measure/verify coil current and share the supply ground.

Build steps

  1. Identify relay coil and contact pins with power off.
  2. Build the coil switch without an external contact load.
  3. Power and press the button; listen for the click and measure coil voltage.
  4. Recheck diode polarity before repeated switching.

Software and firmware setup

This is a hardware-only circuit; no firmware is required.

Test your build

Relay clicks while pressed; the diode clamps the coil's collapsing magnetic field.

Troubleshooting

  • No click: check coil, transistor pins, and ground.
  • Hot transistor: stop and compare coil current with exact device limits.
  • Supply dips: the coil may exceed adapter capacity.

Safety and limitations

Keep relay contacts disconnected from household mains. This guide is for an isolated 5 V coil only.

Manufacturer and platform documentation

Community Notes for This Project

These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.

Set up the comments service to load community notes.

Share a tip or question about this build

← Browse all projects