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.
Parts from the database
Other supplies
- documented 5 V relay with coil current within the transistor ratingCommon build supply
- regulated 5 V supplyCommon build supply
- pushbuttonCommon build supply
- 1 kΩ base resistorCommon build supply
- 10 kΩ base pull-downCommon build supply
- multimeterCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- Confirm the exact transistor lead order and relay coil pins in their datasheets.
- 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.
- Connect +5 V through a pushbutton and 1 kΩ to the base; add 10 kΩ from base to ground.
- Measure/verify coil current and share the supply ground.
Build steps
- Identify relay coil and contact pins with power off.
- Build the coil switch without an external contact load.
- Power and press the button; listen for the click and measure coil voltage.
- 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.