What is a MOSFET and How Do You Use One as a Switch?
Free Daily Electronics Newsletter
Tutorials, news, and one component explained simply — every day.
Difficulty: Intermediate
You’ve probably used a regular mechanical switch hundreds of times today—light switches, keyboard keys, your phone’s power button. But what if you need to switch something on and off thousands of times per second? Or control a 20-amp motor with a tiny 5V signal from your Arduino? That’s where MOSFETs come in, and they’re absolutely everywhere in modern electronics. In fact, MOSFETs are secretly running your life, from your laptop’s CPU to your phone’s battery management system.
MOSFETs—Metal-Oxide-Semiconductor Field-Effect Transistors—are essentially electronic switches that you can control with voltage instead of physically flipping a lever. Unlike mechanical switches, they have no moving parts, can switch millions of times per second, and can handle everything from milliamps to hundreds of amps. Understanding how to use them opens up a whole world of projects, from motor controllers to LED dimmers to power supplies.
[Editor’s note: Circuit symbol diagram for N-channel MOSFET showing Gate, Drain, Source, and body diode is required here]
Understanding the MOSFET: Three Pins, One Purpose
A MOSFET has three pins: the Gate, Drain, and Source. Think of it like a water faucet—the Gate is the handle you turn, the Drain is where water flows in, and the Source is where it flows out. When you apply voltage to the Gate, you create an electric field that opens a “channel” between the Drain and Source, allowing current to flow.
Comparison of N-channel and P-channel MOSFET circuit symbols. N-channel (left) turns on with positive gate voltage and conducts drain-to-source. P-channel (right) turns on with negative gate voltage (gate lower than source) and has reversed current flow. The arrow indicates the body diode direction.
There are two main types of MOSFETs you’ll encounter:
- N-channel MOSFETs: Turn on when you apply a positive voltage to the Gate relative to the Source. These are the most common and easiest to use with microcontrollers.
- P-channel MOSFETs: Turn on when the Gate voltage is pulled lower than the Source. These are useful for high-side switching but slightly trickier to use.
For most hobbyist projects, you’ll use N-channel MOSFETs because they’re simpler to drive with Arduino or ESP32 GPIO pins. Popular choices include the IRLB8721 (logic-level, 30V, 62A) or the FQP30N06L (60V, 32A). The “logic-level” designation is crucial—it means the MOSFET will fully turn on with 5V or even 3.3V at the Gate, which is what your microcontroller outputs.
[Editor’s note: Comparison diagram of N-channel and P-channel MOSFET symbols side by side with current flow arrows is required here]
How MOSFETs Work as Switches
The magic happens in that thin layer of metal oxide between the Gate and the channel. When you apply voltage to the Gate, it creates an electric field that attracts charge carriers in the semiconductor material, forming a conductive path between Drain and Source. No Gate voltage? No field, no conduction—the switch is off.
MOSFET switching behavior: When gate voltage (Vgs) is 0V, the channel is non-conductive (OFF). When Vgs exceeds the threshold voltage (Vth), a conductive channel forms allowing current to flow from drain to source (ON). The graph shows drain-source current (Ids) increasing as gate-source voltage rises above the threshold.
Here’s what makes MOSFETs brilliant as switches:
Voltage-controlled, not current-controlled: The Gate draws essentially zero current once charged (just a tiny bit during switching). This means your Arduino can control a 20-amp motor while only providing a few milliamps to charge the Gate capacitance. Compare this to bipolar junction transistors (BJTs), which require continuous base current to stay on.
Low on-resistance: When fully on, a good MOSFET has extremely low resistance between Drain and Source—often just a few milliohms. This means minimal voltage drop and power loss. A mechanical relay might drop 0.1V at 10A (1W wasted as heat), but a MOSFET with 10mΩ resistance drops only 0.1V at 10A (1W total—much better thermal management).
Fast switching: MOSFETs can switch in nanoseconds. This is essential for PWM control of motor speed and LED brightness, where you’re rapidly switching the power on and off thousands of times per second to control average power delivery.
[Editor’s note: Graph showing Gate voltage vs Drain-Source current, illustrating threshold voltage and saturation region is required here]
The Basic MOSFET Switch Circuit
Let’s build the simplest useful MOSFET circuit: switching an LED strip from an Arduino. Here’s what you need to know:
Complete MOSFET switch circuit showing proper gate drive: A microcontroller GPIO pin controls the gate through a 10kΩ protection resistor (limits inrush current). A pull-down resistor ensures the MOSFET stays off when the GPIO is floating. When the gate voltage exceeds threshold, current flows from the load through drain-to-source to ground, switching the high-power load with a low-power control signal.
The load goes between the positive supply and the Drain. The Source connects to ground. When you pull the Gate high (5V from your Arduino), the MOSFET turns on, completing the circuit and allowing current to flow through your LED strip to ground.
Always use a Gate resistor. Place a 10kΩ resistor between your microcontroller pin and the MOSFET Gate. This limits inrush current and protects your microcontroller. Some people skip this with modern MOSFETs, but it’s cheap insurance.
Add a pull-down resistor. Connect a 10kΩ resistor from Gate to Source (ground). This ensures the MOSFET stays firmly off when your microcontroller pin is floating or during power-up. Without it, you might get unwanted turn-on from electrical noise.
Include a flyback diode for inductive loads. If you’re switching a motor, solenoid, or relay coil, place a diode (like a 1N4007) across the load with the cathode (stripe) toward the positive supply. When you turn off an inductive load, it generates a voltage spike that can destroy your MOSFET—the diode provides a safe path for this energy.
[Editor’s note: Complete MOSFET switching circuit diagram showing Arduino GPIO, Gate resistor, pull-down resistor, N-channel MOSFET, LED strip load, flyback diode, and power supply connections is required here]
Editor’s Note: This article requires completion and must include proper circuit diagrams before publication. Technical articles about specific components need circuit symbols and schematic diagrams, not stock photos. Please provide SVG diagrams for all indicated locations and complete the article content.
