Transistors
MOSFET
A switch controlled by voltage. Put a few volts on the gate and a channel opens between drain and source that can carry amps. The gate itself draws almost no current, so a microcontroller pin can drive it.
Think of it as: A tap: a light touch on the handle (gate) controls a big flow of water.
Pins
- G (gate)
- : The control input. Insulated from everything else, like a tiny capacitor.
- D (drain)
- : Connects to the load (motor, LED strip). On a TO-220 the metal tab is also the drain.
- S (source)
- : For an N-channel low-side switch, this goes to ground.
Big power MOSFETs come in TO-220 or D-PAK packages that bolt to a heatsink; small ones are SOT-23 chips. Always check the pin order in the datasheet: it varies between parts.
What to look for inside
- This is a cross-section of an N-channel MOSFET switching a 12 V, 0.5 A load. The gate voltage slowly rises from 0 V to 5 V and falls again.
- Below the threshold (about 1 V here) there is no channel and the switch is off.
- Above it, + charge on the gate pulls electrons up under the oxide, forming a thin conducting channel (cyan) from source to drain.
- On the way up and down it passes through a half-on state where it gets hot (red glow). Switching quickly through that region is what keeps it cool.
The numbers that matter
| Spec | Typical |
|---|---|
V_GS(th) Where it just starts to turn on. Not where it is fully on: look at R_DS(on) for that. | 1 V to 4 V |
R_DS(on) at V_GS Resistance when fully on. Check the value at the gate voltage you actually have. | 5 mΩ to 100 mΩ |
V_DS max The highest voltage it can block when off. | 20 V to 100 V |
I_D max / power Heat is I² × R_DS(on). Big currents need a heatsink. | amps · watts |
Gate charge Q_g How much charge it takes to switch. Bigger means slower switching from a weak pin. | 5 nC to 70 nC |
Where you’ll use it
- A microcontroller switching a motor, LED strip, heater or solenoid (low-side switch).
- Reverse-polarity protection with almost no voltage loss (P-channel).
- The fast switches inside buck converters and motor drivers.
Common mistakes
- Leaving the gate floating. It picks up noise and turns half on and overheats. Add a 10 kΩ pull-down from gate to source.
- Using a standard MOSFET from a 3.3 V pin. It only half turns on and gets hot.
- No flyback diode across a motor or relay coil. The spike at turn-off can destroy the MOSFET.
Lessons that use it
- Lesson 3.2: MOSFET as a Switch: Gate Voltage & Heat
- Lesson 4.2: Open-Drain vs Push-Pull Outputs (I2C Pull-Ups)
- Lesson 5.2: Input Protection: Reverse Polarity, TVS & Fuses
- Lesson 6.1: How to Read a Datasheet: Thermal Resistance Explained
Go deeper
Saturation region: the current grows with the square of the gate overdrive.
Ohmic region: fully on, it behaves like a small resistor.
Conduction heat, and roughly how long a switch takes.