Transistor Switching Circuits
A microcontroller pin supplies a few milliamperes at 3.3 or 5 V. A relay coil, a solenoid valve, a small motor, or a strip of LEDs needs tens of milliamperes to several amperes, often at 12 or 24 V. A transistor operated as a switch bridges that gap. It does not amplify in proportion to its input. It spends its time fully off or fully on and passes between the two states as quickly as the circuit allows.
The idea is simple, and the failures lie in the details: a base resistor sized for typical rather than minimum gain, a MOSFET chosen by its threshold voltage, a gate left floating while the controller resets, or a relay coil switched with no path for its stored energy. This article is a practical design guide. It sizes base and gate resistors from data-sheet limits, places the switch on the low or the high side of the load, clamps inductive loads, estimates losses and junction temperature, and adds protection. Device physics, biasing, and small-signal models belong to Bipolar Junction Transistors and Field-Effect Transistors.
The worked examples name the part, the manufacturer, and the test condition behind each data-sheet limit, and they mark values that are only illustrative assumptions. Data sheets are revised, so confirm each limit against the current edition.
The Transistor as a Switch
Two States and the Transition Between Them
In the off state, a bipolar junction transistor (BJT) is in cutoff: its base-emitter junction is not forward biased, and only leakage current flows. A MOSFET is off when its gate-source voltage sits well below its threshold. The switch then blocks the full supply voltage while passing nanoamperes to microamperes, so its dissipation is usually negligible.
In the on state, a BJT is driven into saturation. Both of its junctions are forward biased, and the collector-emitter voltage falls to VCE(sat), a few hundred millivolts or less for a small-signal part at moderate current. A MOSFET is driven into its ohmic, or triode, region, where it behaves as a resistance RDS(on) between drain and source. On-state dissipation is IC × VCE(sat) for the BJT and ID2 × RDS(on) for the MOSFET.
Between the two states, the transistor carries substantial current and blocks substantial voltage at the same time, and the instantaneous power, their product, peaks there. A switch that lingers in the transition dissipates far more than one that is fully on or fully off, so the design goal is a short transition and a deep on state. The terminology collides here: a saturated BJT is fully on, but a MOSFET in its saturation region is in its constant-current region, the one a switch should cross quickly.
Low-Side and High-Side Positions
A low-side switch sits between the load and ground. The load connects to the positive supply, and the transistor completes the return path. Its emitter or source is at ground, the same reference the controller uses, so a logic signal can drive it directly. Most microcontroller-driven switches are low-side for that reason.
A high-side switch sits between the positive supply and the load, and the load returns to ground. Its emitter or source does not sit at ground. For an N-channel MOSFET it rises nearly to the supply when the switch is on, so the gate drive must rise above the supply. Designers choose high-side switching when the load must stay tied to ground: a sensor that shares ground with other circuits, or vehicle wiring, where a chafed wire touching the chassis should trip a fuse or a current limit rather than switch the load on, as it would with a low-side switch.
What the Switch Must Survive
- Off-state voltage: the supply plus any transient, including the inductive kick when the switch opens.
- On-state current: the steady current plus inrush, such as a cold lamp filament, a stalled motor, or a discharged capacitor.
- Drive: the base current or gate voltage the controller can deliver at its worst-case supply voltage and temperature.
- Speed: how often the switch operates, which sets switching loss and the need for fast edges.
- Heat: conduction loss plus switching loss, carried through the package to the board or a heat sink.
- Faults: short circuits, reversed supply connections, and transients arriving from outside the board.
Designing a BJT Low-Side Switch
A small NPN transistor with a base resistor is the simplest transistor switch and still the cheapest for loads of tens of milliamperes. Its design takes three decisions: how hard to saturate the transistor, which base resistor delivers that drive in the worst case, and how to hold the transistor off when the controller is not driving it.
Saturation and Forced Beta
The DC current gain, hFE, is the ratio IC/IB in the active region. A saturated transistor no longer obeys it: the external circuit limits the collector current, and extra base current only pushes VCE lower. The ratio the circuit actually imposes is the forced beta:
βforced = IC / IB
A reliable switch keeps βforced well below the minimum hFE guaranteed at the operating current, at the lowest operating temperature, and with the collector-emitter voltage near saturation. Each qualifier matters. The MMBT2222A data sheet from Diodes Incorporated guarantees an hFE of at least 100 at 150 mA with VCE = 10 V, but only 35 at the same current with VCE = 1.0 V. At 10 mA, its guaranteed minimum falls from 75 at room temperature to 50 at −55 °C.
Small-signal data sheets commonly guarantee VCE(sat) at a forced beta of 10. Nexperia's PMBT3904 data sheet guarantees at most 200 mV at IC = 10 mA with IB = 1 mA, and at most 300 mV at 50 mA with 5 mA. Common design practice therefore uses a forced beta of about 10; designs short of base current sometimes use 20 or more and give up that guarantee.
Sizing the Base Resistor
The base resistor converts the drive voltage into base current:
RB = (VOH − VBE(sat)) / IB
Size it for the worst case at turn-on, using the lowest output-high voltage VOH the controller guarantees and the highest base-emitter saturation voltage the transistor allows. Then check the best case, which draws the most current from the pin.
In this example, a microcontroller pin switches a 12 V relay whose data sheet lists a 400 Ω coil. The transistor is a Nexperia PMBT3904, and the controller is a Microchip ATmega328P running from 5 V.
- Collector current. With the transistor saturated, the coil draws about 12 V / 400 Ω = 30 mA, and somewhat more from a high supply or with a coil at the low end of its resistance tolerance.
- Base current. At βforced = 10, IB = 3.0 mA. The PMBT3904's saturation-voltage guarantees at 10 mA and 50 mA, both at a forced beta of 10, bracket this current. Its guaranteed minimum hFE at VCE = 1 V is 100 at 10 mA and 60 at 50 mA, well above the forced beta.
- Worst-case drive. The ATmega328P data sheet guarantees at least 4.2 V at the pin while it sources 20 mA from a 5 V supply at up to 85 °C. The PMBT3904 data sheet limits VBE(sat) to 950 mV at 50 mA. Then RB ≤ (4.2 − 0.95) V / 3.0 mA ≈ 1,083 Ω. A 1.0 kΩ resistor delivers at least 3.25 mA.
- Pull-down. A 10 kΩ resistor from base to emitter diverts at most 0.95 V / 10 kΩ = 95 μA, which leaves at least 3.15 mA for the base.
- Best case. With the pin at 5.0 V and VBE(sat) at its 650 mV minimum, specified at 10 mA, the pin sources (5.0 − 0.65) V / 1.0 kΩ = 4.35 mA, well inside the 20 mA test condition.
- Dissipation. P ≈ IC × VCE(sat) + IB × VBE(sat) ≈ 30 mA × 0.3 V + 4.35 mA × 0.95 V ≈ 13 mW. At the data sheet's 500 °C/W for a standard footprint, the junction runs about 7 °C above ambient.
- Clamp. A diode across the coil, with its cathode at the 12 V supply, absorbs the turn-off transient. A small-signal switching diode rated well above 30 mA is enough.
From a 3 V supply, the ATmega328P guarantees only 2.3 V at 10 mA up to 85 °C, so RB ≤ (2.3 − 0.95) V / 3.0 mA = 450 Ω; a 390 Ω resistor draws at most about 6 mA.
Base Pull-Down and Turn-Off Speed
Many microcontroller pins become high-impedance inputs during reset; the ATmega328P data sheet states that its port pins are tri-stated when a reset condition becomes active. A floating base can collect enough leakage current or coupled noise to turn the transistor partly on. The base-emitter resistor of 10 to 100 kΩ that holds the transistor off also gives stored base charge a path out when the drive is removed.
A saturated transistor stores excess charge in its base and cannot turn off until that charge is gone. The MMBT2222A data sheet limits storage time to 225 ns at 150 mA with 15 mA of base current forced in both directions; a base resistor returned to 0 V removes charge less forcefully, so a simple switch takes longer. That delay does not matter for a relay, but under pulse-width modulation (PWM) at kilohertz rates it stretches every turn-off. The remedies are to drive no harder than necessary, to add a small speed-up capacitor across the base resistor, or to keep the transistor out of deep saturation with a Schottky clamp from base to collector.
Where a Single Transistor Runs Out
At higher currents, the base drive becomes the obstacle. The MMBT2222A data sheet guarantees VCE(sat) of at most 1.0 V at IC = 500 mA, but only with IB = 50 mA, which exceeds the ATmega328P's absolute maximum of 40 mA per pin. The resulting collector dissipation of up to 0.5 W also exceeds the 310 mW the same data sheet allows on a minimum recommended pad, where the junction-to-ambient thermal resistance is 403 °C/W. Loads of hundreds of milliamperes are better served by a MOSFET, a Darlington array, or a driver IC.
Designing a MOSFET Low-Side Switch
An N-channel enhancement MOSFET draws no steady gate current, and its on-state loss follows the square of the load current through a resistance that can be a few milliohms. That makes it the usual low-side switch from about a hundred milliamperes to tens of amperes. Its pitfalls all involve the gate.
Threshold Voltage Is Not a Turn-On Voltage
VGS(th) is the gate-source voltage at which the drain current reaches a small test value: 250 μA for Infineon's IRF540N, and 10 μA for its IRLML6344. At threshold, the MOSFET is barely conducting. The on-resistance quoted on the first page of a data sheet applies only at the gate voltage printed beside it.
The IRF540N shows the trap. Its data sheet guarantees RDS(on) of at most 44 mΩ at VGS = 10 V and gives no limit at lower gate voltages, and its threshold can fall anywhere from 2.0 to 4.0 V. Driven from a 3.3 V pin, a sample near the top of that range stays essentially off, and a sample near the bottom conducts with a resistance the data sheet does not bound. Such a circuit can pass a bench test with one sample and fail in production with another.
Parts marketed for logic-level gate drive specify RDS(on) at lower gate voltages. The IRLZ44N data sheet, which carries that label, guarantees at most 22 mΩ at 10 V, 25 mΩ at 5.0 V, and 35 mΩ at 4.0 V. The part suits 5 V logic but not 3.3 V logic, for which its data sheet guarantees nothing. For 3.3 V drive, choose a part whose on-resistance is guaranteed at 2.5 V or lower.
Choosing RDS(on) at the Actual Gate Voltage
In this example, a 3.3 V microcontroller pin switches a 12 V LED strip that draws 2.0 A, inside an enclosure at 50 °C.
- Part. Infineon's IRLML6344, a 30 V N-channel MOSFET in a SOT-23 package, guarantees RDS(on) of at most 29 mΩ at VGS = 4.5 V and at most 37 mΩ at VGS = 2.5 V, with a threshold of 0.5 to 1.1 V. On-resistance falls as gate voltage rises, so the 37 mΩ limit also bounds the resistance at 3.3 V.
- Ratings. The 30 V drain-source rating covers the 12 V supply with margin, and the ±12 V gate-source rating covers the drive.
- Conduction loss. P = ID2 × RDS(on) = (2.0 A)2 × 0.037 Ω ≈ 0.15 W at a 25 °C junction.
- Temperature. The data sheet gives a maximum of 100 °C/W junction to ambient with the part surface mounted on 1 square inch of copper, so the junction runs about 15 °C above ambient, near 65 °C. On-resistance rises with temperature. Assuming, for margin, a hot resistance of 1.5 times the 25 °C maximum, the loss becomes 0.22 W and the junction about 72 °C, still far below the 150 °C limit.
- Layout. The thermal figure assumes that square inch of copper. A minimal footprint runs hotter, so give the drain connection generous copper.
Gate Resistor and Pull-Down
The gate behaves as a capacitor: the IRLML6344 has a typical input capacitance of 650 pF, measured with no gate bias and 25 V from drain to source, and it presents more during switching because of the Miller effect. Driven directly, it draws a surge limited only by the pin's output resistance and the gate-loop inductance, which can ring with the capacitance. A series gate resistor of a few tens to a few hundred ohms at the MOSFET limits the peak current, damps the ringing, and slows the edges slightly, which reduces electromagnetic interference.
A pull-down resistor from gate to source, typically 10 to 100 kΩ, holds the MOSFET off while the pin is high impedance during reset, programming, or brownout. Without it, leakage or coupled noise can charge the gate to a voltage that leaves the transistor partly on, in its linear region, where it overheats while the load glows dimly. Place it at the MOSFET, so that it still holds the gate low when a cable to the controller is unplugged.
Estimating Switching Time from Gate Charge
During each transition, the gate voltage pauses at the Miller plateau, Vplateau, while the drain voltage swings and the drive supplies the gate-drain charge Qgd. With a resistive drive of total resistance Rtotal, the gate current on the plateau is approximately
IG(on) = (Vdrive − Vplateau) / Rtotal at turn-on, and IG(off) = Vplateau / Rtotal at turn-off,
and each transition takes about
t ≈ Qgd / IG
Rtotal includes the gate resistor, the pin's output resistance, and the MOSFET's internal gate resistance. Qgd comes from the data sheet's gate-charge table, and Vplateau from its gate-charge curve at the operating current.
For the LED strip, take the IRLML6344's typical Qgd of 2.4 nC, measured at 15 V and 5.0 A, a larger swing than this circuit's, and assume a plateau near 2.0 V. For the pin, an ATmega328P running from 3 V guarantees at least 2.3 V while sourcing 10 mA at up to 85 °C, which implies an output resistance of no more than 70 Ω; assume the same for this 3.3 V pin. With a 100 Ω gate resistor and the MOSFET's typical internal gate resistance of 1.7 Ω, Rtotal ≈ 172 Ω. At turn-on, IG ≈ (3.3 − 2.0) V / 172 Ω ≈ 7.6 mA, and the drain voltage falls in about 2.4 nC / 7.6 mA ≈ 0.32 μs. At turn-off, IG ≈ 2.0 V / 172 Ω ≈ 11.6 mA, and the transition takes about 0.21 μs.
Edges this fast cost little at the kilohertz rates common in LED dimming. For a resistive load whose voltage and current ramp linearly, each transition dissipates about V × I × t / 6, so even a full microsecond of edge time per cycle at 1 kHz costs (1/6) × 12 V × 2 A × 1 μs × 1,000 Hz ≈ 4 mW. Slow drive, high frequency, and inductive loads change that balance.
High-Side Switching
P-Channel and PNP Switches
A P-channel MOSFET used as a high-side switch has its source at the supply and its drain at the load. It turns on when the gate is pulled below the source by more than the magnitude of its threshold, and off when the gate returns to the source voltage; a PNP transistor works the same way. The gate must therefore swing between the rail and a point well below it, while the controller's output swings between ground and its own, often lower, supply.
Consider a 3.3 V controller switching a 5 V rail with Nexperia's PMV48XP, a 20 V P-channel MOSFET whose threshold lies between −0.75 and −1.25 V. If the pin drives the gate directly, a logic high puts the gate at 3.3 V, so VGS = 3.3 − 5.0 = −1.7 V, beyond the threshold. The MOSFET never turns fully off.
The usual fix adds one transistor as a level shifter. A 10 kΩ resistor from gate to source holds the MOSFET off. A PMBT3904 NPN transistor pulls the gate to ground when the controller drives its base through a second 10 kΩ resistor; its base current of about (3.3 − 0.85) V / 10 kΩ ≈ 0.25 mA saturates it easily against the 0.5 mA the pull-up resistor draws. With the gate near ground, VGS ≈ −4.8 V, and the PMV48XP guarantees RDS(on) of at most 55 mΩ at −4.5 V. A 1 A load then dissipates at most 55 mW in the MOSFET, a rise of about 13 °C at the data sheet's maximum of 245 °C/W on a standard footprint. The logic sense is preserved: a high pin turns the load on.
The pull-up resistor sets the turn-off speed. With a typical total gate charge of 8.5 nC at −4.5 V and an average charging current of roughly 2.5 V / 10 kΩ = 0.25 mA, the gate takes about 34 μs to return to the rail. That suits switching a peripheral on and off, but not PWM at tens of kilohertz, which needs a push-pull stage or a gate driver.
On a 12 or 24 V rail, pulling the gate to ground would apply the whole rail from gate to source. The PMV48XP, for example, is rated for ±12 V gate to source, and its 20 V drain rating also rules out a 24 V rail. Choose a part rated for the rail, and limit the gate swing with a resistive divider, such as two equal resistors that apply half the rail, or with a Zener diode from gate to source. General translation of logic signals between voltage domains is covered in Level Shifters and Translators.
N-Channel High-Side Switches
For a given die size, an N-channel MOSFET achieves lower on-resistance than a P-channel part, because electrons are more mobile than holes, so high-current high-side switches usually use N-channel devices. The catch is the gate. With the switch on, the source sits within a fraction of a volt of the supply, so the gate must rise above the supply by the full turn-on voltage.
A gate driven from ground-referenced logic does not work. The MOSFET becomes a source follower: the load voltage stops a threshold voltage or more below the gate, and the transistor dissipates the difference in its linear region.
Two circuits generate the higher gate voltage. A bootstrap circuit charges a capacitor while the switch node is low and lifts it with the source when the switch turns on. It is simple, but it recharges only while the switch is off, so it cannot hold the switch on indefinitely; it suits PWM rather than static on-off control. A charge pump builds a voltage above the supply from its own oscillator, so it can hold a switch on indefinitely, at the cost of delivering only small currents. Gate Driver Circuits covers bootstrap sizing, the limits of bootstrapping, and isolated gate supplies.
Integrated High-Side Switches and Load Switches
Smart high-side switches integrate the N-channel MOSFET, its charge pump, and protection in one package. Texas Instruments' TPS1H100-Q1, for example, is a 40 V, 100 mΩ single-channel automotive switch with an input compatible with 3.3 V and 5 V logic, a current limit programmed by an external resistor, thermal shutdown, open-load and short-circuit diagnostics, and a negative voltage clamp for inductive loads. TI lists certification of its immunity to the electrical transients of ISO 7637-2 and ISO 16750-2.
Integrated load switches do the same job for low-voltage rails inside equipment, such as powering down a sensor or a radio between uses. TI's TPS22918 switches 1 to 5.5 V at up to 2 A through a typical on-resistance of 52 mΩ at 5 V, accepts a control signal of 1 V or more, and sets its output rise time with a capacitor on its CT pin. The controlled rise time matters because a switch that closes abruptly onto a discharged capacitor draws a current limited only by resistance and inductance, which can pull down the input rail and reset the controller. Ramping 5 V onto 100 μF over 5 ms holds the charging current to C × ΔV / Δt = 100 μF × 5 V / 5 ms = 100 mA.
Switching Inductive Loads
The Stored Energy Needs a Path
A relay coil, a solenoid, or a motor winding stores energy ½LI2 in its magnetic field. When the switch opens, the inductance keeps the current flowing and drives the switch terminal to whatever voltage lets it continue. With no deliberate path, the voltage rises until the transistor breaks down or stray capacitance absorbs the energy; Transient Response of RC, RL, and RLC Circuits derives this inductive kick. Every switch that drives an inductive load therefore needs a clamp, and each clamp trades the voltage the switch must withstand against how quickly the current stops.
If the clamp holds the coil at a constant voltage Vclamp, that article shows that the current reaches zero after
tz = (L/R) ln(1 + I0R / Vclamp)
where L and R are the coil's inductance and resistance and I0 is the current at turn-off. For a clamp from the drain to ground, the voltage across the coil during the decay is the clamp voltage minus the supply voltage, because the supply stays connected to the other end of the coil.
Clamp Options Compared
The table compares three clamps for an illustrative 12 V solenoid with L = 50 mH and R = 24 Ω. It carries I0 = 0.5 A, stores 6.25 mJ, and has a time constant L/R of 2.08 ms. Each diode's forward voltage is taken as 0.8 V, and each clamp is treated as a constant voltage.
| Clamp | Peak switch voltage | Current reaches zero | Energy absorbed by the clamp |
|---|---|---|---|
| Diode across the coil | About 12.8 V | 5.8 ms | 0.68 mJ; the coil resistance absorbs the rest |
| Diode in series with a 24 V Zener diode, across the coil | About 36.8 V | 0.82 ms | 4.8 mJ |
| 36 V Zener diode or TVS from drain to ground | 36 V | 0.84 ms | 7.1 mJ, including 2.4 mJ drawn from the supply during the decay |
A plain diode, often called a flyback or freewheeling diode, protects the switch best: the switch sees only the supply plus one diode drop. It is also the slowest way to stop the current, and a relay released by a slowly decaying current opens its contacts late and slowly. TE Connectivity's application note Coil Suppression Can Reduce Relay Life (13C3264) warns that the slow release can leave contacts welded when they switch heavy loads, and it recommends a Zener diode in series with a general-purpose diode as the best compromise.
The diode-Zener pair stops the current about seven times faster in this example, and the switch must be rated above the supply plus the Zener voltage. A Zener diode or a transient voltage suppressor (TVS) from drain to ground is just as fast, but it absorbs more energy than a clamp across the coil, because the supply keeps pushing current through the coil until the current reaches zero. Size that clamp for the peak power of each turn-off and for the average power, which is the energy per turn-off multiplied by the switching rate.
Whatever its type, the clamp carries the full load current at the instant of turn-off, so rate it for that current and for a reverse voltage above the supply. When the coil sits at the end of a cable, place the clamp at the coil, so the decaying current circulates locally instead of flowing through the wiring.
Avalanche Instead of a Clamp
Some MOSFETs can absorb the energy themselves by conducting in avalanche breakdown. Infineon describes its IRLZ44N as fully avalanche rated: the data sheet allows 210 mJ in a single pulse starting from a 25 °C junction, and it gives a separate repetitive avalanche energy of 11 mJ, limited by the maximum junction temperature. Many small MOSFETs carry no avalanche rating at all; the IRLML6344 data sheet lists none. Relying on avalanche is therefore a deliberate design decision that needs the rating, its derating with temperature, and a thermal check at the switching rate. A clamp remains the default.
Motors and Pulse-Width Modulation
A small DC motor switched by a low-side MOSFET needs a freewheeling diode across its terminals, just as a relay does. Under PWM, the diode carries the motor current through every off interval and is reverse biased again at every turn-on. A diode with slow reverse recovery conducts backward for a moment at each turn-on, adding a current spike to the transistor and loss to every cycle. Schottky diodes, which store no minority-carrier charge, are the usual choice; rate the diode for the full motor current. A small ceramic capacitor across the motor terminals is a common way to suppress brush noise, but under PWM the switch must charge it at every turn-on, so keep it small. Reversing, braking, and current regulation need an H-bridge or a dedicated driver, which Motor Drivers and Controllers covers.
Driving Common Loads from a Microcontroller Pin
Know the Pin's Limits
Three limits in the controller's data sheet matter: the absolute maximum current per pin, the current at which output voltages are guaranteed, and the total current through the supply pins. For the ATmega328P, Microchip lists an absolute maximum of 40 mA per I/O pin and 200 mA through the VCC and ground pins, and it guarantees output levels at 20 mA with a 5 V supply and at 10 mA with a 3 V supply. A note adds that the pins are not ensured to source more current than those test conditions, and further notes cap the combined current of groups of pins. Design to the guaranteed conditions. The absolute maximum is a damage threshold, not an operating point.
Two further rules apply to every load in this section. Hold each switch off during reset with a pull-down, as described earlier. Return heavy load current directly to the supply rather than through the controller's ground connection; otherwise, the switching current shifts the controller's ground reference and can corrupt inputs or cause a reset.
LEDs
An indicator LED can run directly from a pin through a series resistor:
R = (VOH − VF) / IF
For a 3.3 V pin and an LED whose data sheet gives VF = 2.0 V at 5 mA, R = (3.3 − 2.0) V / 5 mA = 260 Ω. The next standard value, 270 Ω, gives about 4.8 mA.
Anything larger needs a transistor. A 12 V LED strip with built-in series resistors is a resistive load, switched in its ground return by a low-side MOSFET as in the IRLML6344 example, and PWM on the same MOSFET dims it. High-power LEDs without built-in resistors need a constant-current driver rather than a bare switch, because their current rises steeply with small changes in voltage and temperature.
Relays
Read the coil voltage and resistance from the relay data sheet; the coil current is their ratio. A 12 V, 400 Ω coil draws 30 mA and 360 mW, and the BJT example above drives it with a PMBT3904 and a 1.0 kΩ base resistor. Always fit a clamp across the coil, and choose between a plain diode and a diode-Zener pair by the release time the contacts need. For several relays, a Darlington or MOSFET driver array replaces the discrete parts. Contact ratings, must-operate and must-release voltages, and solid-state alternatives are covered in Switches and Relays.
Solenoids and Valves
Solenoids draw hundreds of milliamperes to amperes and call for a MOSFET. Two refinements are common. The first is a fast-release clamp, a diode-Zener pair or a drain clamp, because a valve that must close promptly suffers from a slow current decay. The second is a reduced hold current: a solenoid needs full current to pull its plunger in, but less to hold it once the magnetic gap has closed. TI's DRV120, for example, is a low-side driver that ramps the solenoid current quickly to a set peak, keeps it there for a set time, and then regulates a lower hold current with PWM to reduce power dissipation.
Small DC Motors
A small brushed motor running in one direction needs only a low-side MOSFET and a Schottky freewheeling diode. Size the MOSFET for the stall current, which flows at every start and whenever the motor jams. It is roughly the supply voltage divided by the winding resistance, and motor data sheets often list it. Starting current can also sag a shared supply enough to reset the controller, so decouple the motor supply and keep the motor's return current out of the controller's ground path.
Darlington Arrays and Low-Side Driver ICs
The ULN2003A
Texas Instruments' ULN2003A, whose data sheet dates from 1976, packages seven NPN Darlington pairs with a common emitter, open collectors, and a clamp diode from each output to a shared COM pin. Each input has a 2.7 kΩ series base resistor, which TI states allows direct operation from TTL or from CMOS logic at 5 V or 3.3 V. Each output is rated for 500 mA and 50 V, and outputs can be paralleled for more current.
A Darlington pair cannot saturate the way a single transistor does, because its output collector cannot fall below the driving transistor's saturation voltage plus the output transistor's base-emitter voltage. At 25 °C, TI guarantees VCE(sat) of at most 1.1 V at 100 mA, 1.3 V at 200 mA, and 1.6 V at 350 mA. With the output held at 2 V, the guaranteed on-state input voltage is at most 2.4 V at 200 mA, 2.7 V at 250 mA, and 3 V at 300 mA. For inductive loads, connect COM to the load supply so the internal diodes clamp each coil; TI notes that COM may be left open for resistive loads. The clamps are plain diodes, with the slow release that implies.
Dissipation in a Shared Package
The 500 mA rating applies to one output, not to the package. All seven channels share one die. TI's application section sums VOL × IL over the active channels and recommends keeping the junction below 125 °C. Four solenoids at 200 mA, each at the 1.3 V maximum, dissipate 4 × 0.2 A × 1.3 V = 1.04 W. In the SOIC package, rated 88.6 °C/W junction to ambient, the junction rises about 92 °C and reaches about 132 °C at 40 °C ambient, above that limit; the PDIP package, at 66.7 °C/W, reaches about 109 °C. Four 30 mA relay coils, by contrast, dissipate at most about 0.13 W.
MOSFET Arrays and Protected Drivers
TI describes its TPL7407L as a pin-to-pin CMOS improvement on seven-channel Darlington arrays such as the ULN2003A. It has seven NMOS outputs rated 40 V and 600 mA per channel, internal freewheeling diodes, input pull-down resistors, and inputs for 1.8 to 5.0 V logic. Unlike the ULN2003A's COM pin, which serves only the clamp diodes, the TPL7407L's COM pin also supplies its gate drive, and TI recommends connecting it to 8.5 to 40 V; a lower COM voltage reduces the gate drive and raises the on-resistance. Its low-level output voltage at 100 mA is at most 320 mV, against 1.1 V for the ULN2003A, so each channel dissipates at most 32 mW instead of 110 mW. The lower voltage rating is the trade-off. Protected low-side MOSFETs go further, adding current limiting, thermal shutdown, and an active clamp in one package. They earn their extra cost wherever a shorted load or a stalled actuator is a realistic fault.
Switching Losses, Heat, and Safe Operating Area
Conduction and Switching Loss
A MOSFET switching a steady current I at duty cycle D has a conduction loss of D × I2 × RDS(on), evaluated at the hot resistance. Nexperia's PMV16XN data sheet, for example, guarantees at most 20 mΩ at 25 °C and 29 mΩ at 150 °C, both at VGS = 4.5 V.
Switching loss comes from the overlap of voltage and current during each transition. For a load clamped by a freewheeling diode, the current transfers at full voltage and the voltage then swings at full current, so the average loss at switching frequency f is approximately
Psw ≈ ½ V I (ton + toff) f
where the transition times ton and toff follow from gate charge and gate current, as shown earlier. The gate drive itself costs Qg × Vdrive × f. That power divides among the driver's output resistance, the gate resistor, and the MOSFET's internal gate resistance in proportion to their resistances, so little of it heats the MOSFET.
In the next example, a hypothetical MOSFET switches a 12 V, 3 A motor with a freewheeling diode at 20 kHz and 50 percent duty cycle from a 5 V drive. Assume a gate-drain charge of 10 nC, a plateau at 2.5 V, and a hot RDS(on) of 20 mΩ, so the conduction loss is 0.5 × (3 A)2 × 0.020 Ω = 0.09 W. Assume also a TO-220 package in free air at 62 °C/W, the maximum junction-to-ambient figure in the IRLZ44N data sheet. The estimates ignore the pin's output resistance and the current-rise interval.
| Gate drive | Each transition | Switching loss | Total loss | Junction at 25 °C ambient |
|---|---|---|---|---|
| 1 kΩ from a logic pin | 4.0 μs | 2.9 W | 3.0 W | About 210 °C, a failure |
| 100 Ω from a logic pin | 0.4 μs | 0.29 W | 0.38 W | About 48 °C |
| Driver IC delivering 1 A | About 10 ns | 7 mW | 0.10 W | About 31 °C |
A 1 kΩ resistor chosen to protect the pin multiplies the switching loss tenfold over 100 Ω, and the 100 Ω drive draws 25 mA on the plateau, more than many pins guarantee. At nanosecond edges, loop inductance and diode recovery dominate and the simple estimate turns optimistic, but the pattern holds: fast PWM needs a gate driver.
From Watts to Junction Temperature
In steady state, TJ = TA + P × RθJA. The thermal resistance depends on the board as much as on the part: the MMBT2222A data sheet gives 403 °C/W on a minimum recommended pad and 357 °C/W on a 15 mm square of copper. On a heat sink, add the junction-to-case, case-to-sink, and sink-to-ambient resistances instead; the IRLZ44N data sheet gives a maximum of 1.4 °C/W junction to case and a typical 0.50 °C/W case to sink for a flat, greased surface. Keep margin below the maximum junction temperature, 150 °C for the IRLML6344 and 175 °C for the IRLZ44N, at the hottest ambient the product will see.
Safe Operating Area and Linear Operation
A transistor held between on and off, carrying current and blocking voltage at once, is bounded by its safe operating area (SOA) graph. Nexperia's application note AN11158, Understanding Power MOSFET Data Sheet Parameters (revision 7.0, February 2025), stresses that the curves assume an initial mounting-base temperature of 25 °C and a single rectangular pulse, and that power-handling capability falls when the mounting base starts hotter.
The same note explains why a MOSFET is not immune to thermal runaway in linear operation. Below a critical current, the zero-temperature-coefficient point, the fall in threshold voltage with temperature outweighs the rise in resistance, so a hotter region of the die draws more current and heats further. Nexperia calls the effect insignificant for short switching events but important and potentially hazardous as a transition lengthens, for example when switching is slowed to reduce electromagnetic interference. Slow edges, current limiters, and soft-start circuits all hold a MOSFET in that regime, so check each against the SOA curve for its actual pulse length and temperature. Bipolar transistors add a limit of their own, second breakdown, which Bipolar Junction Transistors describes.
Protection
Current Limiting
Fuses and resettable polymer fuses respond to heating, so they protect wiring against sustained overloads but can let a small transistor fail first. An electronic limit adds a sense resistor RS in series with the emitter or source, and a second small transistor whose base-emitter junction sits across it. When the voltage across RS reaches about 0.6 V, the second transistor turns on and diverts drive from the switch, holding the current near 0.6 V / RS. The circuit works only if a base or gate resistor limits the drive current it must divert. A 1 A limit needs 0.6 Ω, which dissipates 0.6 W at the limit, and the threshold falls as the sensing transistor warms, because VBE decreases with temperature.
A current-limited switch driving a short circuit becomes a linear element. With a 12 V supply shorted at a 1 A limit, the switch dissipates more than 11 W, exactly the long, high-voltage pulse that the SOA graph restricts. Practical limiters therefore add a timer that turns the switch off, fold the limit back as the voltage across the switch rises, or rely on thermal shutdown, as smart switches do.
Reverse Polarity
A reversed supply forward-biases the body diode of a low-side MOSFET and the protection diodes of every integrated circuit on the rail, driving current backward through the load. A series diode blocks it simply, but a Schottky diode dropping 0.5 V at 2 A dissipates 1 W and costs half a volt of headroom. A P-channel MOSFET in the supply line, oriented so that its body diode conducts under correct polarity and with its gate returned to ground, turns fully on when the polarity is correct and blocks when it is reversed; at 20 mΩ, it dissipates (2 A)2 × 0.020 Ω = 80 mW. On a rail higher than the MOSFET's gate-source rating, return the gate to ground through a resistor and clamp it with a Zener diode from gate to source. Supply Protection Techniques compares these circuits with ideal-diode controllers and describes the reversed-voltage test of ISO 16750-2.
Transients and Electrostatic Discharge
Outputs that leave the board meet electrostatic discharge at connectors, surges on long cables, and, in vehicles, the conducted transients defined in ISO 7637-2 and ISO 16750-2. A TVS at the connector that clamps below the switch's voltage rating, and a switch rated with margin above the highest supply voltage, handle most of them.
Common Mistakes
- Choosing a MOSFET by its threshold voltage. Use the RDS(on) guaranteed at a gate voltage the drive actually reaches.
- Leaving a gate or base floating. Controller pins can float during reset and programming, so fit a pull-down.
- Driving a P-channel gate straight from a lower-voltage controller. A 3.3 V high on a 5 V rail leaves VGS at −1.7 V, enough to keep many parts conducting.
- Driving an N-channel high-side gate from ground-referenced logic. The MOSFET becomes a source follower and overheats.
- Omitting the clamp on a coil or motor. The first turn-off can drive the transistor into avalanche.
- Sizing a base resistor from typical values. Use the minimum hFE near saturation, the minimum VOH, and the maximum VBE(sat).
- Using a large gate resistor in a fast PWM circuit. In the 20 kHz example, 1 kΩ raises switching loss from 0.29 W to nearly 3 W.
- Treating a per-channel rating as a package rating. Several ULN2003A channels at a few hundred milliamperes each can overheat the package.
- Exceeding the gate-source rating on a higher rail. Pulling a P-channel gate to ground on a 24 V rail exceeds the ±12 V rating of a part such as the PMV48XP.
- Sharing a ground path between the load and the controller. The load current shifts logic levels and can reset the controller.
- Ignoring inrush and stall current. Lamps, motors, and capacitive loads draw far more than their running current at turn-on.
Summary
A transistor switch is designed from limits, not typical values: forced beta, minimum output voltage, and maximum base-emitter voltage for a bipolar switch; RDS(on) at the actual gate voltage for a MOSFET; and junction temperature at the hottest ambient for both. Put the switch on the low side unless the load must stay grounded, and give a high-side switch the level shifter, bootstrap, or charge pump its gate needs. Give every gate or base a defined off state, and give every inductive load a clamp matched to the release time it needs. Count switching loss when the drive is weak or the frequency high, check the safe operating area wherever the transistor lingers between states, and move to arrays, drivers, or smart switches when a discrete part no longer suffices.