Transistor Sizing for Relay Coils: Base Resistor, Saturation, and the Flyback Loop in One Working Sheet

Sizing a transistor to drive a relay coil looks like a two-line exercise — pick a transistor, pick a resistor — and the smoke follows when the worst-case numbers are skipped. A relay coil is an inductor that draws its steady current plus an inrush at pull-in, and the transistor must be saturated across that whole range, the base resistor must feed enough current from the logic rail, and the flyback loop must be closed or the coil’s stored energy goes through the transistor instead of around it. This article puts the whole design on one working sheet: the collector current, the saturation check, the base-resistor calculation from the datasheet’s minimum hFE, two worked logic-rail examples, and the upgrade path when a transistor simply stops being the right tool.

Five Lines to Sizing: Ic, Saturation, Base Resistance, Flyback, and Margin

The working sheet has five lines, and each line is one number with a check attached. Line one is the collector current Ic the transistor must carry — the relay coil’s steady current, and the pull-in inrush if the design wants full margin. Line two is the saturation check: the transistor must be driven into saturation so the collector current is not limited by the transistor but by the coil.

Line three is the base current, derived from the datasheet’s minimum hFE rather than a comfortable guess. Line four is the flyback loop across the coil, sized and oriented so the stored energy discharges safely. Line five is the margin — the factor between the calculated values and the part ratings, which is what keeps the design alive across temperature, supply drift, and manufacturing tolerance.

The five lines are the whole design in one view, and the rest of this article fills in each line with numbers. A design that runs all five has a relay stage that saturates, drives, and survives; a design that skips line five buys the smoke.

The worksheet in table form is the five lines made into a fill-in template:

Line Quantity Formula / source This design
1 Collector current Ic Relay datasheet (steady + inrush) 0.2 A
2 Minimum hFE Transistor datasheet (worst-case) 50
3 Base current Ib Ic / hFE_min 4 mA
4 Base resistor (Vlogic − 0.7) / Ib 1 kΩ (5 V)
5 Margin factor Temperature + tolerance multiplier ×1.5–2

The template is the design captured in a single sheet, and every number on it is traceable to a datasheet or a measurement. A relay stage whose sheet is fully populated survives the board; one whose cells are empty of worst-case numbers is a lottery ticket. The margin line is the one most often left blank, and it is the line that converts a bench design into a field-reliable one — the same discipline the rectifier derating method applies on the power side, applied here to the drive stage.


Good-Ark transistor family including the small-signal NPN and PNP devices whose hFE and saturation are sized in the relay-coil drive worksheet, from the transistor category
Good-Ark transistor family including the small-signal NPN and PNP devices whose hFE and saturation are sized in the relay-coil drive worksheet, from the transistor category

Reading hFE_min from the Data Sheet Instead of a Random 100x

The base resistor is the line where most designs fail, and the failure is a data-sheet reading error. Designers reach for “hFE ≈ 100” as a rule of thumb, but the honest number is the datasheet’s minimum hFE, not the typical — a part’s gain falls with temperature, collector current, and age, and the base circuit must work at the minimum, not the marketing figure.

The datasheet’s hFE minimum is the value the design uses. With a target collector current Ic and the minimum hFE, the base current is Ic / hFE_min. The base resistor then drops the logic rail voltage down to the base-emitter level while feeding that current: Rb = (Vlogic − VBE) / Ib, with VBE around 0.7 V for a silicon device.

The rule that protects the design is the same as every other margin: multiply the base current and the collector current by a safety factor for temperature and tolerance, then pick standard resistor values that keep the transistor in saturation under the worst case. The temperature side of that margin is real — a hot transistor’s hFE falls, so a base current that saturated the part at 25 °C may only half-saturate it at 85 °C, raising the collector-emitter voltage and the dissipation. Reading the margin line at the worst ambient, not the bench temperature, is what keeps the relay stage from drifting out of saturation in service. The NPN test and pin mapping article covers identifying the part out of the drawer; the sizing sheet here assumes the part is already chosen and the datasheet is open.

Base Resistor for 5 V and 24 V Logic Rails: Two Examples

Work the two most common logic rails to make the sheet concrete. A coil draws 200 mA steady, and the datasheet’s hFE_min is 50. For a 5 V logic rail: Ic = 0.2 A, Ib = 0.2 / 50 = 4 mA, and Rb = (5 − 0.7) / 0.004 = 1075 Ω. A 1 kΩ standard resistor feeds slightly more current, keeping the transistor saturated with margin; the power in the resistor is tiny, about I² × R ≈ 16 mW, so a small part is fine.

For a 24 V rail with the same 200 mA coil: the base resistor must now drop most of 24 V, so Rb = (24 − 0.7) / 0.004 = 5825 Ω, rounding to 5.6 kΩ or 6.8 kΩ standard values. The resistor power grows to roughly 0.09 W, still a small part but requiring the rating check rather than the assumption — an overdriven base at 24 V wastes power and can overheat a 1/16 W chip.

The two examples show the pattern: the same coil needs a 1 kΩ base resistor at 5 V and a 5.6 kΩ resistor at 24 V, and the wrong choice in either direction fails — too little base current leaves the transistor half-saturated and dissipating, too much wastes rail power. The relay flyback article and the NPN vs PNP polarity guide are the companions this sizing assumes: the coil and the polarity are already decided by the application.

Keeping the Flyback Loop Tight Across the Load

The flyback loop is the line that is easy to forget and expensive to skip. A relay coil stores energy — L×I²/2 at the operating current — and when the transistor switches off, the coil wants to push that energy somewhere. If the flyback diode across the coil is absent or misoriented, the energy goes through the transistor’s own collapsing state, and the transistor absorbs a spike that burns it.

The loop must be tight: the diode sits across the coil, cathode to the coil’s positive side, and it must be rated for the coil current with the datasheet surge margin. The orientation and placement rules belong to the flyback diode guide, and the loop’s proximity on the board matters — the energy should discharge around the small loop, not through the harness. A tight loop keeps the transistor’s off-state clean and the relay’s release predictable.

The flyback choice also touches the release-time trade built in the relay article: a plain diode gives the slowest, safest release, while a diode-plus-resistor or Zener arrangement releases faster at the cost of a controlled spike. The sizing sheet does not choose between them; it requires that whichever one is chosen, the loop is electrically closed and mechanically close.


Good-Ark LV MOSFET devices used when the relay-coil drive upgrades from a BJT to a logic-level MOSFET at higher coil currents
Good-Ark LV MOSFET devices used when the relay-coil drive upgrades from a BJT to a logic-level MOSFET at higher coil currents

Upgrade Path: When a Logic MOSFET Quietly Beats the BJT

The BJT drive works, and it has a limit that announces itself at higher coil currents: the base current grows linearly with Ic / hFE_min, and the base power grows with the rail voltage. At a 500 mA coil on a 24 V rail, the base resistor drops nearly 24 V and wastes real watts — the point where a logic-level MOSFET becomes the quieter engineering answer.

A logic MOSFET is driven by the rail directly, with a much smaller base (gate) current and no base-wattage line in the sheet. The reduction is meaningful: the same 500 mA coil that needed a 23 V-dropping base resistor in the BJT version now needs only a logic-level gate drive, and the wasted watts disappear from the sheet entirely. The transistor also frees the selection from the hFE_min line, replacing it with the gate-charge and off-state leakage checks the gate drive design guide develops. The trade is a different one — leakage in the off state and the gate-charge and drive requirements — and the honest comparison trades the BJT’s base losses against the MOSFET’s off-state and gate costs. The 12 V output MOSFET selection method develops that drive-side analysis, and the gate drive design guide covers the timing side that matters when the relay must switch fast.

The upgrade decision follows a clean crossover: below a coil current where the base losses are trivial, the BJT is simpler and cheaper; above it, the logic MOSFET removes the base-wattage line and simplifies the board. The working sheet in this article is exactly the tool that locates the crossover, because it prices the base-resistor power for any coil on any rail. And once the decision is made — BJT or logic MOSFET — the transistor category and the LV MOSFET category supply the parts whose datasheet numbers complete the sheet’s remaining lines.

Copyright Suzhou Good-Ark Electronics Co., Ltd. All Rights Reserved