Transistor and MOSFET switches
Size the base resistor for a BJT switch, work out a MOSFET's conduction and switching losses and junction temperature from its datasheet, check whether 3.3 V or 5 V drive is enough, design a high-side P-channel switch with an NPN driver, and handle inductive loads.
Added
How to use it
Values accept engineering notation (4k7, 25m, 48n). Presets fill in typical datasheet
figures for common parts; check the datasheet of the part you buy.
-
BJT switch — an NPN driven from a microcontroller pin into saturation. The base current is the load current divided by a forced β of about 10 (hard saturation whatever the actual hFE), so Rb = (Vdrive − Vbe(sat)) ÷ (Ic/βforced + Vbe/Rbe), rounded down to E24. The tool checks that the pin can supply the base current, that hFE(min) × Ib exceeds the load current, and gives the dissipation Vce(sat)·Ic + Vbe·Ib.
-
MOSFET — conduction loss I²·Rds(on)·duty with Rds(on) rising about 0.5% per °C, iterated with Tj = Ta + P·θJA. With a switching frequency it adds the switching loss ½·V·I·(tr + tf)·f, where the transition times come from the Miller charge: tr ≈ Qgd·Rg ÷ (Vdrive − Vplateau) and tf ≈ Qgd·Rg ÷ Vplateau (see Vishay AN608A and TI SLUA618), and the gate-drive power Qg·Vgs·f. The drive check compares your gate voltage with the Vgs at which Rds(on) is specified: a MOSFET is only "logic level" for a given drive if its Rds(on) is guaranteed at that voltage — Vgs(th) is where it barely starts to conduct.
-
High-side P-channel — to switch the positive supply, an NPN (or a small N-MOSFET) pulls the P-channel gate down and R1 pulls it back to the source. On supplies above about 12 V a second resistor R2 limits |Vgs| = Vs·R1/(R1 + R2) to stay inside Vgs(max).
-
Inductive loads — the energy ½·L·I² stored in a relay coil, solenoid, or motor must go somewhere at turn-off: a flyback diode across the load releases it slowly (τ = L/R); a diode plus Zener releases it in about L·I/Vz if the transistor can take supply + Vz.
For heatsinks and thermal interfaces, see the thermal tool; for driving LEDs, the LED driver tool.
Driving a motor with a full bridge? See H-bridge and DC motor driver for ripple, braking and bridge losses; to measure the current, current sensing.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.