MOSFET as a Switch: Logic-Level Gates, Losses and Gate Drive

For loads beyond a few hundred milliamps, a MOSFET is usually a better switch than a BJT. Its gate is insulated, so it needs essentially no steady current to stay on, and when fully on it behaves like a very small resistor, Rds(on), often a few tens of milliohms. This tutorial explains how an N-channel enhancement MOSFET switches, why the threshold voltage on the datasheet is misleading, and how to calculate the heat your MOSFET will produce.

How an N-Channel MOSFET Switches

The three terminals are gate (G), drain (D) and source (S). Raising the gate-to-source voltage Vgs above a threshold forms a conducting channel between drain and source. For switching, the MOSFET is placed in the low-side position: load from supply to drain, source to ground, exactly like an NPN switch.

      +12 V
        |
      Load       (diode across load if inductive)
        |
        D
IN --[100R]--G   N-MOSFET
        |    S
      [10k]  |
        |    |
       GND  GND

The 100 Ω gate resistor limits the brief charging current into the gate capacitance and damps ringing. The 10 kΩ pull-down holds the gate low, so the MOSFET stays off when the input is floating. Without it, a floating gate can pick up charge and leave the MOSFET half-on and overheating.

Threshold Voltage vs Logic-Level Drive

The datasheet parameter Vgs(th) is the gate voltage at which a tiny current, typically 250 µA, starts to flow. It is the point where the MOSFET is just beginning to turn on, not where it is fully on. The useful figure is Rds(on) at a stated Vgs. A MOSFET is only suitable for direct logic drive if the datasheet guarantees Rds(on) at your logic voltage.

PartTypeVds ratingRds(on) specified atDirect 5 V drive?
IRF540NStandard gate100 VVgs = 10 VNo, needs 10 V gate drive
IRFZ44NStandard gate55 VVgs = 10 VNo, needs 10 V gate drive
IRLZ44NLogic level55 VVgs = 10 V, 5 V and 4 VYes
AO3400Logic level, SOT-2330 VVgs = 10 V, 4.5 V and 2.5 VYes, also from 3.3 V

Calculating Losses

A MOSFET loses power in two ways: conduction loss while it is on, and switching loss during each transition when both voltage and current are present at the same time.

Conduction loss:  P_cond = I^2 x Rds(on) x D        (D = duty cycle, 1 for always on)
Switching loss:   P_sw  ~ 0.5 x V x I x (t_rise + t_fall) x f_pwm
Gate current:     I_gate(avg) = Qg x f_pwm
Junction temp:    Tj = Ta + P_total x RthJA

Worked example: 12 V LED strip, 3 A, steady on

An IRLZ44N driven at Vgs = 5 V switches a 3 A LED strip. Its datasheet lists a maximum Rds(on) of about 25 mΩ at 5 V; check the exact figure in the datasheet you are using, and allow for Rds(on) rising when hot.

P_cond = 3^2 x 0.025 = 0.225 W
Allow for heating (Rds(on) can rise by about 1.5x at high temperature):
P_cond(hot) ~ 0.34 W
TO-220 without heatsink, RthJA ~ 62 °C/W:
Temperature rise ~ 0.34 x 62 = 21 °C   -> no heatsink needed

Worked example: PWM dimming at 20 kHz

Now the same strip is dimmed with 20 kHz PWM. Suppose the gate drive gives rise and fall times of 200 ns each through the 100 Ω gate resistor.

P_sw = 0.5 x 12 x 3 x (200e-9 + 200e-9) x 20 000
     = 0.5 x 36 x 400e-9 x 20 000 = 0.144 W
Total at 100% duty ~ 0.225 + 0.144 = 0.37 W

Switching loss scales with frequency. At 200 kHz it would be ten times larger, 1.44 W, which is why high-frequency converters use dedicated gate driver ICs to switch in a few nanoseconds. For LED dimming and motor speed control, a few kilohertz to about 25 kHz is common.

High-Side Switching and Protection

To switch the positive side of a load, use a P-channel MOSFET with its source on the supply, turned on by pulling the gate below the source. If the supply exceeds the logic voltage, drive the P-channel gate through a small NPN or N-MOSFET stage with a pull-up resistor from gate to source, and keep Vgs within its rating (often ±20 V).

  • Inductive loads (motors, solenoids) need a flyback diode; for fast PWM use a Schottky.
  • The body diode inside the MOSFET conducts in reverse; it does not protect against inductive spikes in the forward direction.
  • Keep gate leads short; long wires add inductance and cause ringing.
  • Handle MOSFETs with ESD care; the thin gate oxide is easily damaged.

Troubleshooting

  • MOSFET hot at low current: it is not fully enhanced. Measure Vgs and compare with the Rds(on) test condition.
  • Load stays partly on when input is disconnected: add or check the gate pull-down resistor.
  • MOSFET fails when a motor stops: add a flyback diode and check the Vds rating against supply spikes.
  • Load flickers at PWM edges: ringing on the gate; increase the gate resistor slightly and shorten the wiring.

Summary

An N-channel logic-level MOSFET is the simplest efficient switch for loads from a few hundred milliamps to tens of amps. Choose it by Rds(on) at your actual gate voltage, not by Vgs(th). Calculate conduction loss I^2 Rds(on) and switching loss 0.5 V I (tr + tf) f, then check the temperature rise. Add a gate resistor, a pull-down and a flyback diode, and the circuit will be reliable.