Electricity/MOSFETs/A MOSFET as a switch

A MOSFET as a switch

Two words on the datasheet decide whether a MOSFET works from a 3.3 V pin, and the failure when they are wrong has no symptom you can see. Then four parts, none of them the MOSFET, that make the circuit reliable.

The most common MOSFET module sold for Arduino has an IRF520 on it. The IRF520's threshold is specified as anywhere from 2.0 to 4.0 V, and its on-resistance is quoted at 10 V on the gate. A 3.3 V pin cannot reach either number.

Set the part and the gate voltage, and watch the two bars on the right.

What the gate voltage costs you
IRLZ44N · 3.3 V on the gate
What the load wants2.0 A
Through the load
1.99 A
Across the MOSFET
0.08 V
Heat
0.15 W
Fully on, and it costs almost nothing. 39 mΩ from drain to source at 1.99 A is 0.08 V and 0.15 W of heat. A saturated transistor drops about 0.2 V whatever the current, which at 1.99 A would be 0.40 W. That number is RDS(on), it is the only figure of merit a switching MOSFET really has, and it is quoted at a gate voltage. Read that gate voltage before you buy the part.

Nothing in that failure is visible on a bench. The motor turns. The wiring is correct. A meter on the gate reads 3.3 V, which is what the sketch asked for. The only evidence is the part being too hot to hold, and by then it has been like that for an hour.

RDS(on), at a gate voltage

The one number a switching MOSFET is judged on is its resistance when fully on — milliohms, against the 0.2 V a saturated transistor drops whatever the current. At 2 A that is the difference between 100 mW of heat and 400 mW.

But the number is always quoted at a stated gate voltage, and that is the half people skip. The IRLZ44N is 25 mΩ with 5 V on the gate, and 22 mΩ if you give it 10. The IRF520's 0.27 Ω is only ever quoted at 10 V. Both datasheets are honest; only one of those numbers is a promise you can keep from a microcontroller.

Look for "logic-level". It means the datasheet specifies RDS(on) at 4.5 or 5 V rather than 10 V, and it is the only thing that makes a part safe to drive from a pin. The IRLZ44N and the AO3400 are logic level. The IRF520 and the IRF540 are not, whatever the module they are soldered to claims.

Three numbers to check before you buy one:

What to readWhy
VGS(th)The range, not the typical. A 1.0–2.0 V part is drivable; a 2.0–4.0 V part is not, from 3.3 V.
RDS(on) at 4.5 VIf the table only has a 10 V column, the part is not logic level.
ID and VDSTwice your load current and twice your rail. Both are cheap to over-specify.

Four parts that are not the MOSFET

The part itself is the easy half. Press the button.

The four parts that are not the MOSFET
0 of 4 fitted
A pin, a MOSFET and a motor. This will work exactly once. Press the button and add the four parts that make it work every time.

That is the schematic to copy. To say it once more as a list:

  • 100 Ω in series with the gate, against the current spike when the gate capacitance charges.
  • 10 kΩ from gate to source, so the load is off while the board resets.
  • A diode across any coil, stripe to the positive end — see diodes and flyback.
  • One ground, shared, between the board and the load's supply. Without it there is no VGS at all.

So which part, when

  • Under half an amp, and a pin to spare — a transistor and a base resistor is still fine, and cheaper. See a transistor as a switch.
  • Half an amp to ten — a logic-level N-channel MOSFET on the ground side. This page.
  • More than that, or PWM above a few kilohertz — the gate capacitance is now a real load, and the answer is a gate driver chip or a motor-driver module with the MOSFETs already inside it.

Edit this page — content/fundamentals/electricity/a-mosfet-as-a-switch.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum