Lab

MOSFET: how it works, with live circuits

A MOSFET is a transistor that a voltage turns on and off. Learn its symbol, its pins and N vs P channel, then flip two live MOSFET switch circuits in the DCACLab simulator.

Open the lab

The two circuits below work without an account. On a computer or tablet the full lab is limited without an account; a free account lets you try it in full first. NGSpice charts need an account; saving needs a plan. Create a free account

What is a MOSFET?

MOSFET stands for metal-oxide-semiconductor field-effect transistor. Its pins are the gate (G), the drain (D) and the source (S). Current flows between drain and source through a channel, and the gate-source voltage decides whether the channel is open. An oxide layer insulates the gate, so it draws no steady current. The lab's MOSFETs are enhancement mode: off with the gate at the source voltage, on once the gate passes a threshold.

The MOSFET symbol and its three pins

These are the symbols the lab draws in its Symbols view. The gate is the plate above the channel, wired to the G pin on the left; the channel is the broken line, broken because the part is off until the gate turns it on. The arrow points in on the N-channel symbol and out on the P-channel one. On the lab's part the pins sit in a row, G, D, S from left to right; its Swap D/S setting shows them as G, S, D, as on the N-channel switch below.

N-channel MOSFET symbol with the gate, drain and source labelled G D S
N-channel MOSFET
P-channel MOSFET symbol with the gate, drain and source labelled G D S
P-channel MOSFET

N-channel vs P-channel MOSFET

Both are switches, but they turn on in opposite ways:

The MOSFET as a switch

Both circuits run on a 9 V battery and light a red LED through 470 Ω. A toggle switch drives the gate through 220 Ω, a 10 kΩ resistor holds it off while the switch is open, and the meter shows the LED current.

N-channel low-side switch

The LED sits between the battery's + and the drain; the source goes to ground. A 10 kΩ pull-down holds the gate at 0 V, so the MOSFET starts off.

Preview of N-Channel MOSFET Low-Side Switch with an LED
Open in the lab Embed Run the circuit right here. To edit it in the full lab, sign in; free accounts have a time limit there.
  1. Click the switch. The gate rises to about 8.8 V, far above the 2.1 V threshold: the LED lights and the meter reads about 15.7 mA.
  2. Click it again. The pull-down brings the gate back to 0 V and the meter reads 0.
  3. The 0.9 mA in the gate resistor goes into the pull-down, not into the gate.

P-channel high-side switch

The source goes to the battery's +, and the LED sits between the drain and ground. A 10 kΩ pull-up holds the gate at the source voltage, so the MOSFET starts off; the switch pulls the gate to ground.

Preview of P-Channel MOSFET High-Side Switch with an LED
Open in the lab Embed Run the circuit right here. To edit it in the full lab, sign in; free accounts have a time limit there.
  1. Click the switch. The gate drops to about 0.2 V, a gate-source voltage of about −8.8 V: the LED lights and the meter reads about 15.7 mA.
  2. Click it again. The pull-up brings the gate back to 9 V and the LED goes out.
  3. Same load, same current, but the gate is pulled up for the N-channel part and down for the P-channel part.

With NGSpice turned on in the full lab, which uses another LED model, both circuits read about 14.0 mA.

How a MOSFET works

The lab uses the simple square-law (Level-1) equations. With Vgs the gate-source voltage, Vds the drain-source voltage, Vth the threshold and β the part's strength:

In the N-channel circuit Vgs − Vth is about 6.7 V but the LED allows only 15.7 mA, so the MOSFET sits deep in the linear region with about 0.02 V across it: almost all of the voltage reaches the load.

A Level-1 model is for learning, not for picking a real part: it has no part numbers, gate charge or heating. Circuits made in the current lab also have a MOSFET's body diode, which conducts only when drain and source are wired the wrong way round.

MOSFET vs BJT

More MOSFET circuits

Each runs on its own page without an account.

Try more MOSFET circuits from the community

Built and shared by DCACLab users, checked in the current lab:

Frequently asked questions

What does a MOSFET do?

It controls a current with a voltage: a voltage from gate to source opens a channel from drain to source. Most often it switches LEDs, motors and other loads.

Which is better for switching, N-channel or P-channel?

N-channel on the low side, between the load and ground. P-channel on the high side, between the supply and the load, turned on by pulling its gate below the source.

Why does the gate need a pull-down resistor?

The gate draws no current, so when nothing drives it, it keeps its charge and the MOSFET can stay on. A pull-down (a pull-up on a P-channel part) holds the gate off whenever the switch lets go.

Is the MOSFET simulator free online?

Yes. The circuits on this page run free in your browser with no account. With a free account the full lab is free to try, then switches to a limited mode; without an account it opens limited on a computer or tablet. On a phone there is no limit.

Does the MOSFET simulator work on a Chromebook?

Yes. DCACLab runs in the web browser, with nothing to install.

Build your own MOSFET circuit

Open the lab and wire the N-channel low-side switch yourself.

Open the lab