A MOSFET is a voltage-controlled transistor, designed to open or close the passage of current with very low losses.
If the BJT was the revolution of the 20th century, the MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) is one of the great engines of the 21st century.
While the BJT is a robust but “power-hungry” device, the MOSFET is a device of precision and efficiency. It is the component that allows your computer to have millions of transistors on a chip without burning out, or that allows you to control a 50-amp motor with a fingernail-sized silicon chip.
But, unlike the BJT, the MOSFET has very strict rules regarding voltage. Let’s look at them.
Gate, drain and source
A discrete MOSFET has three main terminals:
- Gate (G): the control terminal.
- Drain (D): where current enters (equivalent to the collector).
- Source (S): where current exits (equivalent to the emitter).
The big difference: voltage control
Here lies the paradigm shift.
- In a BJT, we injected current into the base to open the valve.
- In a MOSFET, the gate is electrically isolated from the rest of the transistor by an ultra-thin layer of glass oxide.
No current flows into the gate (Ideally). To activate a MOSFET, we only need to apply voltage to the gate.
This voltage creates an electric field (like a magnet) that attracts electrons and creates a conductive “channel” between the drain and source.
Since it doesn’t consume current through the gate, the MOSFET does not load the output of the microcontroller.
You can control a giant MOSFET directly from an Arduino pin without fear of burning the pin (although we’ll see a nuance about this later).
Types: N-channel and P-channel
Just like NPN and PNP, we have two variants:
N-Channel (N-MOS): activated by applying a positive voltage to the gate relative to the source (
P-Channel (P-MOS): activated by taking the gate to a voltage lower than the source. It is often used in high-side switching of moderate complexity.
An effective mnemonic: N-channel goes on the negative side and P-channel on the positive side.
Standard MOSFET vs logic level
For the MOSFET to have that very low resistance (
Many see: “Vgs(th) = 2V to 4V”. And they think:
“Great! My Arduino outputs 5V (or my ESP32 outputs 3.3V), so it will work”.
I’m sorry to tell you you’re wrong 👇
It is not the voltage at which it works as a switch. It is the voltage at which it “starts to notice something”.
- Standard MOSFET (e.g., IRF520, IRF540): they start conducting at 4V, but need 10V at the gate to fully saturate and have low resistance. If you apply 5V, it will remain “partially open”, have high resistance, and burn out.
- Logic level MOSFET (e.g., IRLZ44N, AO3400): they are chemically designed to fully saturate with 4.5V or even 3.3V.
If you use a microcontroller (Arduino, ESP32, Raspberry Pi Pico, etc.), always buy logic level MOSFETs.
They often start with IRL instead of IRF (although it’s not a universal rule: always check the datasheet).
Conduction losses
When a MOSFET operates as a closed switch in its ohmic region, we can approximate it using
With 10 A and 10 mΩ:
That watt is only the conduction loss at the temperature used to specify the resistance.
The current-carrying capability is limited by the package, cooling, and safe operating area. The large current figure on the front page does not alone describe what we can achieve on our board.
The mistake with
To know if it will work with a GPIO, we look for
- One model might specify it only at 10V and not be suitable at 5V or 3.3V.
- Another might guarantee it at 4.5V, 2.5V, or 1.8V and be designed for logic control.
Don’t rely solely on the “logic level” label or the commercial name. Verify
Comparison with the BJT
| Characteristic | BJT | MOSFET |
|---|---|---|
| Control | Current (base) | Voltage (gate) |
| Control consumption | Medium (needs constant current) | Almost zero (only when changing state) |
| Power loss | High ( | Very low ( |
| Speed | Medium | Very high |
| Fragility | Robust | Sensitive to static |
- Use BJT (BC547, 2N2222) for simple tasks, small LEDs and low-cost signals.
- Use MOSFET (logic level) for motors, powerful LED strips, heated beds, and anything consuming more than 500mA.
Control from a microcontroller
A small, slow MOSFET can be controlled from a GPIO in some applications. To decide, we must review:
- The total gate charge
. - The switching frequency.
- The maximum charge and discharge current of the pin.
- The amount of time the MOSFET will spend in the linear zone during each edge.
For large loads or fast PWM, a gate driver is usually needed. The driver reduces transition times and, with them, part of the switching losses.
It is also common to add:
- A resistor in series with the gate to control spikes and oscillations.
- A resistor between gate and source to ensure the
OFFstate when the controller is disconnected. - Protection against overvoltages and ESD when the environment requires it.
The value of these resistors depends on the MOSFET, the driver, and the desired speed; 10 kΩ can be a starting point for the pull-down, not a universal constant.
Usage precautions
Although the MOSFET seems perfect, it is delicate in two aspects:
- The floating gate: as the gate is a capacitor, if you disconnect the wire, the charge gets trapped and the MOSFET stays on.
- Solution: always put a pull-down resistor (10kΩ) between gate and GND to ensure it turns off if the Arduino resets.
- Electrostatic discharge (ESD): the gate oxide layer is so thin that a static spark from your finger can puncture it and destroy the component. Handle them with care.