Celtic Engineering Solutions LLC — Logo
Home Three Checkpoint Assessment Past Projects
Tools ▾
Tools Hub Relay Coil Calculator Voltage Divider Calculator Pullup Resistor Calculator LED Resistor Calculator Ohm’s Law Calculator
Resources Blog Frequently Asked Questions Contact
Celtic Engineering Solutions LLC — Facebook Celtic Engineering Solutions LLC — Instagram Celtic Engineering Solutions LLC — YouTube Celtic Engineering Solutions LLC — LinkedIn
Relay Coil Driver Tool | Celtic Engineering Solutions
Celtic Engineering Toolbox

Relay Coil Driver Tool

Quickly size the transistor, base resistor, and flyback diode for a relay coil driven from a logic output. Enter coil voltage and either resistance or rated current; the tool shows coil power and practical drive margins.

Relay coil driver calculator
Use this for low-side NPN or N-channel MOSFET drivers on typical 5 V and 12 V coils. It assumes a single relay coil, not a bank or array.
How to use this tool
This is a sizing helper, not a full relay app note. It focuses on the coil side of the problem: drive current, transistor stress, and the flyback path.
  1. Enter the coil supply voltage (5 V, 12 V, 24 V, etc.) and your MCU/control voltage (often 3.3 V or 5 V).
  2. Provide either:
    • Coil resistance from the datasheet, or
    • Coil rated current (A). Leave the other field blank.
  3. Adjust the saturation margin (default 2×) and forced gain (default β = 10) if you have house preferences.
  4. Click Calculate driver values.
  5. The tool reports:
    • Coil current and power
    • Minimum transistor collector current rating
    • Suggested base current and base resistor (for bipolar drivers)
    • Flyback diode current and voltage suggestions
Example – 12 V relay with 400 Ω coil
• Coil voltage = 12 V, control = 5 V
• Coil resistance = 400 Ω, current field left blank

The tool reports a coil current of ≈ 30 mA, coil power ≈ 0.36 W, suggests a transistor with at least 90 mA rating (3× margin), and recommends a base resistor in the tens of kΩ for a typical small NPN.
What the relay coil math is doing

The coil behaves (roughly) like a resistor while it is energized. From the datasheet values:

  • Icoil = Vcoil / Rcoil (if you supplied resistance)
  • Rcoil = Vcoil / Irated (if you supplied current)
  • Pcoil = Vcoil × Icoil

To keep a bipolar transistor safely in saturation, the driver base current should be roughly:

  • IB ≈ (Icoil × margin) / βforced

For a 5 V logic output and ~0.7 V base-emitter drop, the base resistor is then:

  • RB ≈ (Vctrl − 0.7) / IB
Rule of thumb. A 2× saturation margin and βforced = 10 is conservative for small signal NPN devices. For logic-level MOSFETs, the tool’s current figures still help, but gate drive sizing is outside this simple model.
Relay coil design checklist

Use this quick list after the calculator gives you numbers:

  • Transistor current rating. Choose at least 3× the expected coil current. Check both steady-state and any inrush from unusual coils.
  • Transistor voltage rating. VCE (or VDS) should exceed the coil supply, with extra margin for system transients.
  • Base/gate drive limits. Confirm the calculated base current is within the MCU pin capabilities or use a driver stage.
  • Flyback diode placement. Place it physically close to the coil terminals and oriented to block during normal operation but conduct during turn-off.
  • Power dissipation. Verify transistor and coil power against their package ratings, especially in hot enclosures.
Examples from Celtic Engineering Solutions
Example A
5 V logic driving a 12 V relay
A microcontroller at 5 V needed to drive a small 12 V relay with a 400 Ω coil.

The tool reported Icoil ≈ 30 mA, so a transistor with at least 100 mA collector rating was selected. With βforced = 10 and a 2× margin, base current of around 6 mA was sufficient, leading to a base resistor in the ~700 Ω range. A standard 1N4148 was enough for flyback at this current.
Example B
3.3 V MCU with higher-current relay
A 3.3 V controller needed to drive a relay coil that pulled about 120 mA at 12 V.

The tool highlighted that base current for a single NPN would exceed the MCU pin limit. The design instead used a logic-level MOSFET sized from the coil current and a diode rated for ≥200 mA repetitive current, with the calculator values used to sanity-check the coil power and current.
Coil numbers look odd or borderline?
If your relay current is high, your enclosure is hot, or your supply is noisy, it’s worth a quick review. Send the datasheet page and the numbers from this tool, and we’ll let you know if we’d drive the coil differently.
Send one question about your relay driver →
Celtic Engineering Solutions LLC
Licensed Electrical Engineering • Prototyping • Product Design
Based in Murray, Utah
Visit our Facebook page
Visit our LinkedIn profile
GetResponse