power switching fundamentals
High-side and low-side switching with NMOS and PMOS: how each is wired, what the gate has to do, where it breaks, and a fully worked LED driver. Every schematic marks G, D and S. Part values in the worked example are illustrative of common SOT-23 classes; check your actual datasheet.
Enhancement-mode symbols. The broken channel line means "off at VGS = 0". The body arrow points in for N-channel and out for P-channel. The PMOS is drawn source-up, the way it sits in a high-side switch.
| NMOS | PMOS | |
|---|---|---|
| Carriers | Electrons | Holes (≈ 2–3× lower mobility) |
| Turn-on condition | V_GS > +V_th (gate above source) | V_GS < −|V_th| (gate below source) |
| Normal current direction | Drain → source | Source → drain |
| Where the source sits in a switch | Most negative node (ground for low-side) | Most positive node (supply for high-side) |
| Body diode | Anode at S, cathode at D | Anode at D, cathode at S |
| RDS(on) for the same die area | 1× | ≈ 2–3×; so for equal RDS(on) a PMOS is bigger, has more Qg, and costs more |
| Availability | Everything from 12 V to kV, mΩ-class | Good up to ~100 V; thin above that |
Both conduct in either direction once the channel is on. The channel is just a resistor; the direction labels above are how the parts are normally used so the body diode blocks when the switch is off.
The two "natural" switches follow directly: NMOS on the low side (source = ground, gate driven straight from logic) and PMOS on the high side (source = supply, gate pulled below the supply). The other two combinations put the source on the load node, which moves. A moving source means the gate drive has to move with it, which is the whole difficulty of NMOS high-side drive, and why PMOS low-side is almost never used.
A quick check for any schematic: find the source, ask what voltage it sits at when the switch is on, then add (NMOS) or subtract (PMOS) the VGS the datasheet specifies RDS(on) at. That is the gate voltage your driver must produce.
Try each one live in the MOSFET Switch Simulator: ON/OFF buttons, adjustable supply and load, and drive options that reproduce each failure below.
Indicator and illumination LEDs, solenoids, relays, fans, the low half of every bridge, automotive low-side drivers (LSDs).
Load switches, sensor and peripheral power rails, reverse-battery protection (installed "backwards", see §7), rails up to ~60 V and a few amps.
Drive the gate only to +V and the FET becomes a source follower: VS = +V − VGS(at that current), and it dissipates I·VGS. At 5 A and 3 V that is 15 W in a part sized for 0.5 W.
The high half of every half-bridge (buck converters, motor inverters, GaN stages), automotive smart high-side switches (HSDs) and eFuses, which integrate the NMOS, charge pump, current limit, thermal shutdown and a current-sense output.
It combines the worst of both: P-channel RDS(on) plus a floating-source drive problem. It appears only where a negative rail already exists (some audio and analog switching). It is a common interview question precisely because the answer is "don't, and here is why".
| Topology | Source tied to | Gate off / on | Drive | Load ref. | Typical use |
|---|---|---|---|---|---|
| NMOS low-side | Ground | 0 V / +2.5…10 V | Direct from logic | Floating at +V | LEDs, relays, solenoids, bridge low side |
| PMOS high-side | +V | +V / +V − 4.5…10 V | Level shift (small NMOS + divider) | Ground | Load switches, sensor rails, reverse-battery |
| NMOS high-side | Load (moves to +V) | V_S / +V + 5…10 V | Bootstrap, charge pump, isolated | Ground | Half-bridges, smart HSDs, eFuses, high current |
| PMOS low-side | Load (moves to 0 V) | V_S / below 0 V | Negative rail | Floating | Almost never |
| Question | Points to low-side | Points to high-side |
|---|---|---|
| Does the load have other ground-referenced connections? | No (LED, coil, heater) | Yes (sensor, module with comms) |
| Is the load at the end of a harness? | Short, inside an enclosure | Yes: a chassis short on an off high-side output is harmless |
| Should the load be dead when off (service, corrosion)? | Not needed | Yes; a low-side-off load still sits at +V, which drives electrochemical corrosion on wet connectors |
| Current and cost | High current, lowest cost | Pay for PMOS area or an NMOS driver |
| Current measurement | Ground-referenced shunt, simple amp | High-side shunt amp or the HSD's sense output |
| Safety-relevant loads (holding brakes, STO) | Switch both sides: a single short to ground or to supply cannot energize the load | |
Qualitative RDS(on) vs VGS. Near threshold the resistance is steep and part-to-part spread is large; past the spec point it flattens.
| Parameter | What it tells you | Switch design rule |
|---|---|---|
| VDS(max) | Breakdown, drain to source | ≥ 1.5–2× bus, plus inductive and transient overshoot. 12 V → 30 V; 24 V → 40–60 V; 48 V → 80–100 V. Automotive 12 V with load dump → 40 V+ or a clamp. |
| VGS(max) | Gate oxide limit, typically ±20 V; ±8–12 V on logic-level parts | Never exceed, even transiently. Clamp with a zener when the drive could. |
| VGS(th) | Threshold at 250 µA, min/max spread ≈ 1 V | Off-state margin: noise on the gate must stay below the minimum. |
| RDS(on) @ VGS | On-resistance at a stated VGS and 25 °C | Use the value at your guaranteed VGS; multiply by 1.4–1.8 for hot (positive tempco). |
| ID | Often a thermal calculation at TC = 25 °C, or package-limited | Ignore the headline. Compute I²·RDS(on),hot and check temperature with your copper. |
| Qg, Qgs, Qgd | Gate charge; Qgd is the Miller charge | Sets driver current, switching time and gate-drive power. |
| Ciss, Coss, Crss | Input, output and reverse-transfer capacitance; all fall with VDS | Crss (= Cgd) couples dv/dt into the gate: false turn-on risk. |
| VSD, trr, Qrr | Body diode forward drop (~0.7–1.2 V) and recovery | Matters for freewheeling and dead time. GaN has no body diode and zero Qrr but ~2–3 V reverse conduction. |
| RθJA, RθJC | Thermal resistance | RθJA is for a specific test board; your board decides the real number. SOT-23 ≈ 100–250 °C/W. |
| SOA | Safe operating area, VDS vs ID vs time | Critical for linear operation, inrush and hot-swap. Modern trench parts have weak DC SOA. |
| EAS | Single-pulse avalanche energy | Only for unclamped inductive turn-off; better to clamp than to rely on it. |
Turn-on into a clamped or resistive load. Teal: VGS. Amber: VDS. Dashed: ID.
RDS(on) rises with temperature (about 1.5–1.8× from 25 °C to 150 °C). In a fully enhanced switch that is self-balancing, which is why paralleled MOSFETs share current. Near threshold, in linear operation, the threshold's negative tempco dominates: hot spots conduct more and can run away. That is why linear-mode use (current sinks, inrush limiting) needs a check against the DC SOA curve, not just Rθ.
At turn-off the coil keeps its current and drives the drain above +V until something conducts. Put a freewheel diode across the load (cathode to +V). The drain is clamped to +V + VF. Decay is slow (relays drop out late); for fast decay use a zener in series with the diode, or an active clamp (zener from drain to gate) and size the FET for the energy ½LI².
At turn-off the load node swings negative. Freewheel diode from ground (anode) to the load node (cathode). Smart HSDs instead clamp internally at roughly Vbat minus 40–50 V for fast demagnetization; check that energy against their EAS spec.
A PMOS in the supply line with D toward the battery, S toward the load and G to ground through a resistor, with a zener G–S. Correct polarity: the body diode conducts first, lifts the source, VGS goes negative and the channel shorts the diode. Reverse polarity: the diode blocks and VGS ≈ 0, so it stays off. An NMOS in the ground return (S to battery −, G to +V) does the same with lower loss.
An "off" PMOS high-side switch conducts from drain to source through its diode if the load side is higher than +V. To isolate both ways, use two MOSFETs source-to-source with a common gate (the ideal-diode and load-switch controller topology).
Low-side: a short of the load-to-drain wire to chassis turns the load on uncontrollably; a short of +V to chassis is a supply fault. High-side: a short of the output to chassis is an overcurrent the switch can detect and limit. A short to supply on a high-side output back-powers the load; diagnose it by measuring the output while off.
Integrated NMOS + charge pump + current limit + thermal shutdown + diagnostics (current-sense output proportional to load current, open-load detection in off state). This is the automotive answer for most body loads, and the basis of the eFuse and HSD/LSD work on the GM aggregator.
Task. Drive three white LEDs in series at 100 mA from a 12 V rail (±5%), dimmable by PWM from a 3.3 V MCU GPIO. Design it low-side (Option A), then high-side (Option B), compare, and then fix the current accuracy with a constant-current sink (Option C).
| Given | Value | Notes |
|---|---|---|
| Supply V+ | 12 V ± 5% (11.4–12.6 V) | Regulated rail. A raw automotive 12 V (9–16 V, load dump) would change the answer: use Option C or a dedicated driver. |
| LED | V_F 3.0 V typ (2.8–3.2 V) @ 100 mA | Illustrative mid-power white LED. Abs-max ≈ 150 mA. VF falls ≈ 2–4 mV/°C as it heats. |
| LED count | 3 in series | String VF: 9.0 V typ, 8.4–9.6 V |
| Target current | 100 mA | |
| GPIO | 3.3 V, V_OH ≥ 2.9 V at 8 mA | Recommended ≤ 8–12 mA per pin; high-impedance during reset. |
Current path: +12 V → RS → D1 → D2 → D3 → Q1 drain → Q1 source → ground. Q1: G from the GPIO through 220 Ω, S to ground, D to the cathode of D3.
Why low-side here. An LED string has no other ground connection, so switching its return is harmless. The gate drive is referenced to ground, so the 3.3 V GPIO drives it directly. Cheapest and simplest.
Series resistor. Headroom left for RS is supply minus string minus the FET's drop.
Corner analysis. With only 3 V of headroom, small supply and VF errors become large current errors.
| Corner | V+ | String VF | Headroom | ILED | P(RS) |
|---|---|---|---|---|---|
| Minimum | 11.4 V | 9.6 V | 1.8 V | 60 mA | 0.11 W |
| Nominal | 12.0 V | 9.0 V | 3.0 V | 100 mA | 0.30 W |
| Maximum | 12.6 V | 8.4 V | 4.2 V | 140 mA | 0.59 W |
Current spread is −40% / +40%. 140 mA stays under the 150 mA abs-max, but only just; brightness varies visibly between units. Two LEDs with 60 Ω would give 83–117 mA (±17%) at 50% efficiency instead of 75%. The real fix is constant current (Option C). For the exercise we proceed with 30 Ω.
Resistor rating. Worst case 0.59 W. With 50% derating, use a 1 W part (2512), or two 15 Ω 1206 parts in series (0.29 W each, which also spreads the heat).
Pick Q1. Illustrative 30 V logic-level NMOS in SOT-23 (AO3400A class):
| Spec | Value | Check |
|---|---|---|
| VDS(max) | 30 V | 2.4× the 12.6 V max rail ✓ |
| VGS(max) | ±12 V | Drive is 3.3 V ✓ |
| VGS(th) | 0.65–1.45 V | Max 1.45 V ≪ 2.9 V worst-case drive ✓; min 0.65 V vs off-state gate ≈ 0 V ✓ |
| RDS(on) @ 2.5 V | ≤ 52 mΩ | Guaranteed below our 2.9 V minimum drive ✓ |
| Qg / Qgd | ≈ 4 nC @ 3.3 V / ≈ 1.5 nC | Used in step 7 |
| RθJA | ≈ 125 °C/W | Used in step 8 |
Why not a 2N7002: VGS(th) up to 2.5 V and RDS(on) up to several ohms specified at 5–10 V. At 2.9 V drive a high-threshold unit may barely conduct. It would "work on the bench".
Gate network.
PWM frequency and switching. Choose 20 kHz: above audible (no ceramic-capacitor singing) and far above flicker. On a robot with cameras, low PWM frequencies alias with exposure time and show as banding; 20 kHz or synchronizing PWM to the camera avoids it.
Dimming resolution: edges take ~0.5 µs of a 50 µs period, so duty below ~2% is not clean. A 64 MHz timer gives 3,200 counts per period (≈ 11.6 bits), more than the edges can use. If you need deep dimming, drop to 1–2 kHz or add analog dimming.
Q1 thermal.
Q1 is loafing. The heat in this circuit is in RS (0.3 W) and the LEDs (0.9 W).
Off-state and faults. When off, the drain floats up toward 12 V through the LEDs' leakage, which is under Q1's 30 V rating. If the wire from D3 to the drain is on a harness and shorts to chassis, the LEDs turn on at 100 mA, still limited by RS: annoying, not dangerous. If the LED module is remote, add a TVS at the drain for ESD.
Q1 PMOS: S to +12 V, D to RS, G to the R1/R2 node. Q2 small NMOS: D to R2, S to ground, G from the GPIO. The LED string is ground-referenced.
Why you might want it. The LED module is remote (on an arm, a panel or an indicator light). With high-side switching the harness is dead when off, and a chassis short on the output is an overcurrent you can detect rather than an LED stuck on.
Same series resistor: 30 Ω, same corner spread. Only the switch moved.
Gate divider. R1 = R2 = 10 kΩ.
Check against an illustrative −30 V PMOS (AO3401A class): RDS(on) specified at −4.5 V (≈ 60 mΩ) ✓, |VGS| 6.3 V ≪ VGS(max) ✓. On a 24 V rail the same divider would put −12 V on the gate, at the limit of a ±12 V part: change the ratio or add a zener.
Q2 selection. It sinks 0.6 mA, so RDS(on) barely matters, but it must turn on from 2.9 V. Pick a part with VGS(th) max ≤ 1.5 V (BSS138 class, 0.8–1.5 V). 100 Ω series and 100 kΩ pull-down keep it off during MCU reset, which keeps Q1 off too.
Speed: the cost of resistor drive.
At 20 kHz the 50 µs period is mostly transition: unusable. At 1 kHz:
Acceptable, but the LED then flickers on camera. To go faster: R1 = R2 = 1 kΩ (10× faster, 72 mW static divider loss), a complementary NPN/PNP emitter-follower referenced to +V, or a high-side load switch / driver IC.
Q1 losses. RDS(on),hot ≈ 60 mΩ × 1.4 = 84 mΩ → 0.84 mW conduction; ~8 mW switching at 1 kHz. Still a few °C in SOT-23.
| A · NMOS low-side | B · PMOS high-side | |
|---|---|---|
| Parts | Q1, RG, RPD | Q1, Q2, R1, R2, 100 Ω, 100 kΩ |
| Practical PWM | 20 kHz+ | ≈ 1 kHz with 10 kΩ divider |
| Static drive loss | 33 µA from GPIO | 0.6 mA from 12 V (7.2 mW) |
| Load when off | Floats near +12 V | 0 V (dead) |
| Output wire short to chassis | LED stuck on | Overcurrent while on; harmless while off |
| Best for | On-board indicators and backlights | Remote or harness-connected lamps |
Q1 NMOS in its linear region: D to D3 cathode, S to RSENSE, G from the op-amp output through RG. The op-amp drives the gate until V(RSENSE) = VSET.
Current set point. I = VSET / RSENSE = 0.1 V / 1 Ω = 100 mA, independent of supply and VF. Sense power: 0.1² × 1 = 10 mW. Accuracy ≈ RSENSE 1% + VSET 1% + op-amp offset (1 mV / 100 mV = 1%) ≈ ±3%, versus ±40% before.
Q1 now dissipates what RS used to.
In SOT-23 (125 °C/W) that is +51 °C, too hot at 85 °C ambient. Use SOT-223 or DPAK on a copper pour (≈ 40–60 °C/W → +16 to +25 °C). Check the DC SOA line at 4.1 V / 0.1 A: this is linear operation, where trench FETs are weakest.
Op-amp and stability. Inputs must include ground (rail-to-rail input or ground-sensing); the output must reach Vth + a bit (≈ 2 V). The op-amp is driving a capacitive load (Ciss), so add RG of 100 Ω–1 kΩ and, if needed, a small capacitor from output to the inverting input for compensation. Dim by scaling VSET (analog) or by gating VSET on and off (PWM at constant peak current).
For the resistor-ballast versions (A and B). Change the inputs to see how headroom drives the current spread.
The source sits at ground, so VGS equals the logic output: no level shift, no floating supply. NMOS also has 2–3× lower RDS(on) per area than PMOS. The cost is that the load floats at +V when off and its ground is switched.
It becomes a source follower. The source settles at V+ − VGS at the load current, so the load loses several volts and the FET dissipates I·VGS: 5 A × 3 V = 15 W. The gate needs V+ + 5–10 V, from a bootstrap, a charge pump or an isolated driver.
GPIO high is 3.3 V, so VGS = 3.3 − 12 = −8.7 V: on. GPIO low gives −12 V: also on, and at the limit of a ±12 V part. It can never turn off. Adding a pull-up to 12 V doesn't help: the GPIO's ESD diode clamps the gate at ≈ 3.9 V and back-feeds the MCU rail through the pull-up. Fix: a small NMOS or NPN level shifter with a divider (Option B in §8).
The body diode. NMOS: anode at S, cathode at D. If D is below S, the diode conducts and the switch can't turn off. The exception is deliberate: reverse-polarity protection installs the FET "backwards" so the diode conducts first and the channel then bypasses it.
With its ground open, the sensor's internal ground floats up toward its supply. Current then finds a path out through the I²C pins' ESD diodes into the MCU's pull-ups and I/O, partially powering the part, corrupting the bus and stressing both chips. Switch such loads high-side, or use a load switch on the supply.
High-side. When off, the harness is at 0 V, so a chafed wire touching chassis does nothing and connectors aren't biased for corrosion. When on, a short is an overcurrent the switch can detect and limit. With low-side, a short from the switched wire to chassis turns the load on and you can't turn it off.
No. It is where only 250 µA flows, with about 1 V of spread and a negative tempco. It defines the off-state noise margin. Design the on-state to the VGS where RDS(on) is guaranteed.
From three limits: peak driver current (Vdrive/Rtotal within the pin or driver rating), switching time (t ≈ Qgd/IG, which sets switching loss and EMI), and damping of the gate loop's L–C ringing. Then split turn-on and turn-off resistors if dv/dt false turn-on is a risk.
Yes, as fully enhanced switches: RDS(on) rises with temperature, so a hotter device carries less current. Give each its own gate resistor to stop oscillation between them and lay them out symmetrically. In linear mode it does not self-balance, because the threshold's negative tempco dominates; use source resistors or one bigger part.
The coil drives the drain up until the FET avalanches; ½LI² is dumped in the FET. Fine if the energy is within EAS and repetitive ratings, otherwise it fails short. Use a freewheel diode (slow decay) or a zener / active clamp (fast decay, energy in the clamp or FET by design).
Almost never. It needs a gate voltage below ground to turn fully on and it has P-channel RDS(on). Without a negative rail it acts as a source follower and wastes |VGS|·I.
A single fault (a short to supply on the low side or to ground on the high side) can't energize the brake coil and release the joint. Two independent switches, one per side, each driven by separate channels, is the usual Cat 3 structure and lets each be tested for stuck-on.