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: reverse polarity protection#
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.