C5 · Lesson 34 · Transistor switches
What it costs to switch a load, and how to switch the positive side
An ideal switch wastes nothing: no voltage across it when it's on, no current through it when it's off. A transistor comes close, but not all the way. It drops a little voltage while it conducts, it passes through a moment of full voltage and full current every time it changes state, and if the load is a coil, it has to survive the coil's attempt to keep its current flowing. This lesson puts numbers on those losses, turns them into a temperature, and shows how to switch the positive side of a load from a low-voltage logic pin.
- A high-side switch: a PMOS between the 12 V supply and the load, so the load's other end stays grounded. A logic pin can't pull the PMOS gate up to 12 V, so an NPN does the work: when the pin goes high, the NPN pulls the gate down and the PMOS turns on.
- The scope shows the gate and the load. Note the inversion twice over: pin high, gate low, load on.
- Lower RL to draw more current: the output barely drops, because the PMOS is fully on with 12 V of gate drive.
Predict
A MOSFET with an on-resistance of 20 mΩ carries 5 A continuously. How much power does it dissipate?
0.5 W: . Small for a 60 W load, but enough to warm a small package by about 30 °C. Conduction loss grows with the square of the current, so at 10 A it would be 2 W.
Name it
Losses
Conduction loss, while on for a fraction D of the time:
Switching loss. During each transition the voltage and current overlap. For a resistive or clamped load, roughly
so it grows with switching frequency. That's why fast switching matters, and why a MOSFET's gate must be driven hard.
Gate drive. A MOSFET's gate is a capacitor holding a charge (tens of nanocoulombs for a power device). Switching it in time t needs a current of about , and the driver spends of power.
Heat
Power becomes temperature through thermal resistance, °C per watt from the junction to the air:
A small TO-220 package in free air is about 60 °C/W; a heat sink brings the total down to a few °C/W. Keep well under the rating, typically 150 °C.
Inductive loads
A coil's current can't change instantly, so if a switch opens on it, the coil drives its terminal as high as it takes to keep the current flowing, : hundreds or thousands of volts in a microsecond, enough to destroy the transistor. A flyback diode across the coil gives the current a path, clamping the switch at the supply plus 0.7 V; the coil's stored energy, , is then dissipated in the coil's resistance and the diode at each turn-off.
High-side switching
To switch the positive side, use a PNP or PMOS with its emitter or source at the supply. It needs its base or gate pulled down from the supply, which a logic pin can't do directly when the supply is higher than the pin, so a small NPN (or NMOS) does it, with a pull-up resistor turning the switch off. Keep within the gate's rating (often ±20 V); with higher supplies, a Zener or divider limits it.
Worked example
A MOSFET ( = 20 mΩ, = 50 ns, = 62 °C/W) switches 5 A from 12 V at 20 kHz and 50% duty. Find its losses and junction temperature at 25 °C ambient.
Show the solution
- Conduction loss.
- Switching loss.
- Junction temperature. The total is 0.31 W, so No heat sink is needed.
Answer it loses 0.25 W in conduction and 0.06 W in switching, 0.31 W in all, and the junction reaches 44 °C, so no heat sink is needed.
Worked example
A 100 mH relay coil carries 100 mA. What happens if its switch opens in 1 µs with no flyback diode?
Show the solution
- Voltage to stop the current that fast.
- What really happens. The transistor breaks down long before, absorbing the coil's energy in its junction every time:
- The fix. A diode across the coil caps the switch at 12.7 V instead.
Answer the coil would try to reach 10 kV, so the transistor breaks down and absorbs 0.5 mJ at every turn-off; a flyback diode caps it at 12.7 V.
Worked example
A MOSFET dissipates 3 W with = 1.5 °C/W to its case and 0.5 °C/W through the insulating pad. How good must the heat sink be to keep the junction below 125 °C in 40 °C air?
Show the solution
- Total thermal resistance allowed. The thermal resistances add in series from junction to air, so
- Heat sink. Take off the 1.5 and 0.5 °C/W: A small clip-on fin will do.
- Without a heat sink. A package rated = 62 °C/W would reach 40 + 3 × 62 = 226 °C.
- Why it matters. Datasheet limits assume a junction temperature, so the heat path is part of the circuit's design.
Answer the heat sink needs ≤ 26.3 °C/W, which a small clip-on fin provides.
Check
A MOSFET with = 5 mΩ carries 2 A for a fraction 0.6 of the time. What is its conduction loss?
Write units the way you normally would: 1.5 W, 1500 mW and 0.0015 kW are the same answer.
Check
A switch turns 2 A on and off from 12 V at 200 kHz, with rise and fall times of 100 ns each. What is its switching loss?
Write units the way you normally would: 1.5 W, 1500 mW and 0.0015 kW are the same answer.
Check
A transistor dissipates 0.5 W with a total thermal resistance of 62 °C/W, at 25 °C ambient. What is its junction temperature?
Check
A 10 mH coil carrying 0.1 A has its current interrupted in 10 µs with no flyback path. What voltage would it need?
Write units the way you normally would: 1.5 kV, 1500 V and 0.0015 MV are the same answer.
Check
A 10 mH solenoid carrying 0.1 A is switched off 100 times a second through a flyback diode. How much power goes into the diode and coil resistance at turn-off?
Write units the way you normally would: 1.5 W, 1500 mW and 0.0015 kW are the same answer.
Check
A MOSFET with 10 nC of gate charge must switch in 20 ns. What gate current does the driver need?
Write units the way you normally would: 1.5 A, 1500 mA and 0.0015 kA are the same answer.
Check
A BJT low-side switch drives 0.05 kΩ from 5 V, from a 5 V pin. With a forced β of 10, what base resistor?
Write units the way you normally would: 1.5 kΩ, 1500 Ω and 0.0015 MΩ are the same answer.
Check
A transistor dissipates 5 W with = 0.5 °C/W and = 0.5 °C/W, in 40 °C air.
(a)
What heat-sink rating keeps the junction at or below 125 °C?
(b)
How hot would the junction be with an ideal heat sink, = 0?
Check
A MOSFET switches current I from voltage V at frequency f and duty D, with on-resistance R and equal rise and fall times t.
Step 1
What's its conduction loss?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What's its switching loss?
Step 3
At what frequency are the two losses equal?
Explain why
Why does switching an inductive load without a flyback diode destroy transistors?
A coil stores energy in its magnetic field and resists any change in its current. When the transistor turns off, the current through the coil has to keep flowing for a moment, and with nowhere else to go the coil raises its voltage until something conducts. That something is the transistor itself, broken down by hundreds or thousands of volts, absorbing the coil's stored energy in a tiny region of its junction. A diode across the coil gives the current a harmless loop at less than a volt above the supply, where it dies away through the coil's resistance.
Practice
Keep practicing
11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.