What is a MOSFET and How Does It Work?

A MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) is a voltage-controlled semiconductor device used to switch or amplify electronic signals. Unlike Bipolar Junction Transistors (BJTs) that require continuous base current to stay on, a MOSFET requires almost zero steady-state gate current. Once the gate capacitance is charged, it holds the channel open purely via an electric field. This makes MOSFETs the undisputed heavyweights for high-current switching driven by low-current microcontrollers like the Arduino Uno or ESP32.

Pinout and Symbol Anatomy

A standard discrete MOSFET has three primary terminals:

  • Gate (G): The control pin. Applying a voltage here relative to the Source creates an electric field that opens the channel.
  • Drain (D): The terminal where current enters (for N-channel) or exits (for P-channel) the main load path.
  • Source (S): The terminal connected to the common reference (usually Ground for N-channel, VCC for P-channel).

The Body Diode: If you look at a MOSFET schematic symbol, you will see an arrow pointing from the Source to the Drain (on an N-channel). This represents the intrinsic parasitic body diode. It conducts current in the reverse direction even if the MOSFET is turned off. In motor control and battery protection circuits, this diode is either a critical safety feature or a nuisance that requires an external series diode to block.

For the ubiquitous TO-220 through-hole package, holding the component with the text facing you and the pins pointing down, the pinout from left to right is Gate, Drain, Source.

MOSFET Operating Regions and Selection Guide

To select and bias a MOSFET correctly, you must understand its three operating regions. Confusion often arises here because MOSFET terminology is the exact opposite of BJT terminology: in a MOSFET, the "Linear" region is where it acts as a closed switch, while the "Saturation" region is where it acts as an amplifier.

Operating Region Bias Condition (N-Channel) Behavior Typical Use Case
Cutoff VGS < VGS(th) Channel is closed. No drain current flows (except negligible leakage). Switch OFF state.
Linear (Ohmic/Triode) VGS > VGS(th) and VDS is low Channel is fully open. Acts like a low-value resistor (RDS(on)). Current is limited only by the external load. Switch ON state (PWM, relays, motors).
Saturation (Active) VGS > VGS(th) and VDS is high Channel is pinched off. Drain current is constant and controlled entirely by VGS, regardless of VDS. Linear amplifiers, constant current sources.

How to Bias for Switching: When using a MOSFET as a switch, you want to drive it hard into the Linear (Ohmic) region. You do this by applying a Gate-to-Source voltage (VGS) that is significantly higher than the threshold voltage (VGS(th)). If VGS(th) is 2.0V, applying 2.5V will barely turn it on, leaving it in the high-resistance Saturation region where it will overheat and fail. You must apply the VGS value specified in the datasheet's RDS(on) test conditions (usually 4.5V, 5V, or 10V).

Safe Default Part Numbers for Your Workbench

Stop buying the IRF520 for Arduino projects. Its VGS(th) is up to 4.0V, meaning a 5V Arduino barely turns it on, and a 3.3V ESP32 won't turn it on at all. Stock these proven, logic-level and standard defaults instead:

Part Number Type VDS (Max) ID (Continuous) RDS(on) @ VGS Logic Level? Approx. Price
IRLZ44N N-Channel 55V 47A 22mΩ @ 5V Yes $1.50
IRLB8721 N-Channel 30V 62A 4.5mΩ @ 4.5V Yes $2.10
IRF540N N-Channel 100V 33A 44mΩ @ 10V No (Needs 10V) $1.20
IRF4905 P-Channel -55V -74A 20mΩ @ -10V No (Needs -10V) $1.80
Bench Tip: Always check the "RDS(on) vs. VGS" graph in the manufacturer's datasheet (like the Vishay IRLZ44N datasheet). The threshold voltage (VGS(th)) listed on the first page only guarantees a microscopic 250µA of current. To get the rated low resistance, you must hit the VGS test condition, typically 4.5V or 10V.

Complete Application Circuit: 12V DC Motor PWM Switch

Here is a bulletproof, real-world circuit for driving a 12V DC motor using an ESP32 (3.3V logic) and an IRLZ44N N-channel MOSFET. This setup handles up to 10A continuously without a heatsink.

Component List

  • 1x IRLZ44N N-Channel MOSFET
  • 1x 100Ω Gate Resistor (limits inrush current into the gate capacitance, protecting the ESP32 GPIO)
  • 1x 10kΩ Pull-down Resistor (keeps the gate low during microcontroller boot-up)
  • 1x 1N5819 Schottky Flyback Diode (handles inductive kickback from the motor)
  • 1x 12V DC Motor

Wiring Steps

  1. Gate Drive: Connect the ESP32 PWM GPIO pin to one end of the 100Ω resistor. Connect the other end to the MOSFET Gate.
  2. Pull-down: Connect the 10kΩ resistor between the MOSFET Gate and Ground. This ensures the motor stays off if the ESP32 resets and the GPIO floats.
  3. Source Connection: Connect the MOSFET Source pin directly to the shared system Ground (ESP32 GND and 12V Power Supply GND must be tied together).
  4. Load Connection: Connect one terminal of the 12V DC motor to the 12V power supply positive rail. Connect the other motor terminal to the MOSFET Drain pin.
  5. Flyback Protection: Place the 1N5819 diode in parallel with the motor. The cathode (stripe end) goes to the 12V positive rail, and the anode goes to the MOSFET Drain. Never skip this diode; inductive kickback will instantly punch through the MOSFET's drain-source junction.

Failure Modes and Multimeter Testing

MOSFETs generally fail in three ways: Gate oxide puncture from ESD (exceeding the ±20V VGS max rating), Thermal runaway from operating in the linear region with insufficient VGS drive, and Avalanche breakdown from inductive voltage spikes exceeding VDS. When they fail, they almost always fail "short" (Drain-to-Source shorted), which can dangerously lock your load in the ON position.

How to Test an N-Channel MOSFET with a Multimeter

Set your multimeter to Diode Test Mode (not Ohms). The Ohms mode on most meters does not output enough voltage to forward-bias the body diode or charge the gate.

  1. Discharge: Touch the meter probes across all three pins (Gate, Drain, Source) simultaneously to discharge any residual gate capacitance.
  2. Test Body Diode (Forward): Place the Black (COM) probe on the Drain and the Red probe on the Source. You should read a standard diode drop, typically 0.4V to 0.6V.
  3. Test Body Diode (Reverse): Swap probes (Red on Drain, Black on Source). The meter should read OL (Open Loop).
  4. Charge the Gate: Keep the Black probe on the Source. Touch the Red probe to the Gate pin for a second. This uses the meter's internal 3V battery to charge the gate capacitance and turn the MOSFET on.
  5. Test RDS(on): Move the Red probe back to the Drain (Black remains on Source). The meter should now read ~0.00V (or beep in continuity mode), indicating the channel is shorted on.
  6. Discharge to turn off: Touch the Gate to the Source with your finger or a wire. The channel will close, and repeating step 5 will show OL again.

If the MOSFET reads 0.00V in both directions before charging the gate, or if it fails to turn on in step 5, the silicon is destroyed. Throw it in the bin.

Frequently Asked Questions

What is the difference between a MOSFET and a BJT transistor?

A BJT (Bipolar Junction Transistor) is a current-controlled device; it requires a continuous flow of base current to keep the collector-emitter path open, which wastes power and requires base resistors calculated via hFE. A MOSFET is a voltage-controlled device. It only requires a brief pulse of current to charge its internal gate capacitance. Once charged, it draws virtually zero steady-state current, making it vastly more efficient for high-power switching and PWM applications.

Can I drive a standard IRF520 MOSFET directly from an Arduino 5V pin?

Technically yes, but practically no. The IRF520 is not a logic-level MOSFET. Its VGS(th) is rated between 2.0V and 4.0V. At 5V, it will partially turn on, but its RDS(on) will be far higher than the datasheet's 10V test condition. If you pull 5A through it at 5V gate drive, it will dissipate massive heat and likely melt. Always use a logic-level MOSFET (like the IRLZ44N or IRLB8721) for 5V or 3.3V microcontroller outputs. For deeper theory on transistor selection, refer to the All About Circuits semiconductor guide.

Why do I need a pull-down resistor on the MOSFET gate?

Microcontroller GPIO pins are high-impedance (floating) during boot-up, reset, or firmware flashing. If the gate is floating, ambient electrical noise can couple into the gate pin, partially turning the MOSFET on and off at high frequencies. This causes the MOSFET to linger in the high-resistance Saturation region, generating massive heat and potentially destroying the component and your load. A 10kΩ pull-down resistor to ground ensures the gate is held firmly at 0V until the microcontroller explicitly drives it high.

What happens if I exceed the maximum Vgs rating?

The gate of a MOSFET is separated from the channel by an incredibly thin layer of silicon dioxide (the "oxide" in MOSFET). This layer is typically rated for a maximum of ±20V. If you apply 24V or a static shock exceeding this threshold, the electric field physically punctures the oxide layer. This creates a permanent short between the Gate and Source, instantly destroying the component. If you are switching high-side P-channel MOSFETs in 24V or 48V systems, you must use a Zener diode or a gate-driver IC to clamp the VGS to a safe 10V-15V range.