← Wiki · Component

MOSFET

A transistor that works as a switch controlled by voltage. An N-MOSFET switches a load to ground; a P-MOSFET switches the supply side.

What it does#

A MOSFET has three pins: gate, drain and source. The voltage from gate to source (Vgs) decides whether drain and source are connected. No current flows into the gate (except to charge it), so a GPIO can switch amperes.

  • N-MOSFET (AO3400A): source to GND, load between the supply and the drain. Gate high → on. This is the low-side switch.
  • P-MOSFET (AO3401A): source to the supply, load from drain to GND. Gate pulled below the source → on.

Choosing one#

  • Logic level: it must be fully on at the gate voltage you have. AO3400A is specified at Vgs = 2.5 V, so 3.3 V drives it well. Many big power MOSFETs need 10 V.
  • Vds above the supply with margin; Id above the load current.
  • Rds(on) sets the heat: P = I² × Rds(on).

Example: switch a 12 V load#

Example circuit: PWM → 100 Ω → gate. R2 (100 kΩ) keeps it off while the MCU boots. D1 catches the kickback of an inductive load (motor, solenoid, LED strip wiring).
PWM → 100 Ω → gate. R2 (100 kΩ) keeps it off while the MCU boots. D1 catches the kickback of an inductive load (motor, solenoid, LED strip wiring). Open the mosfet_low_side example from this page in PCB Canvas: “Insert into my schematic”.

Example: reverse polarity protection#

Example circuit: The P-MOSFET's body diode lets current through at first, then the gate (at GND) turns it fully on. A reversed supply keeps it off.
The P-MOSFET's body diode lets current through at first, then the gate (at GND) turns it fully on. A reversed supply keeps it off. Open the pmos_reverse_polarity example from this page in PCB Canvas: “Insert into my schematic”.

AO3401A’s gate allows ±12 V; above 12 V input add a zener (and resistor) between gate and source.

Pitfalls#

  • Floating gate. Without the pull-down the load may switch on by itself while the GPIO is not yet driven.
  • Source and drain swapped turns the body diode into a permanent short. Check the SOT-23 pin order (1 = G, 2 = S, 3 = D for AO3400A).
  • Heat: a SOT-23 dissipates well under 1 W. At 3 A use a bigger package.

Footprint#

SOT-23, hand-solderable. AO3400A (C20917), AO3401A (C15127) and 2N7002 (C8545) are JLCPCB basic parts.