MOSFET as a Switch: Drive a 12 V Load from a 5 V Logic Signal

Author: Abloom Instruction Date: November 10, 2026

A microcontroller pin runs at 5 V and can supply only a few tens of milliamps — it cannot drive a 12 V, 2 A motor directly. The usual answer is a MOSFET used as a switch: a small voltage on its gate turns on a channel that can carry amps from a separate, higher-voltage supply. Unlike a BJT switch, which needs a continuous base current, a MOSFET is voltage-controlled — once it is on, the gate draws practically no current at all.

Low-side N-channel MOSFET switch circuit: a 5 volt logic pin through a 220 ohm gate resistor drives the MOSFET gate, the drain connects to a 12 volt motor with a flyback diode, the source to ground, with a 10 kilo-ohm pull-down resistor; beside it a graph of drain current against gate voltage showing off below 2 volts and fully on at 5 volts

Figure 1: An N-channel MOSFET as a low-side switch (a), and its drain current against gate voltage (b). Below the threshold voltage the MOSFET is off; at 5 V it is fully on and acts like a small resistor. The transfer curve is drawn for a typical example device — real devices vary, so always check the datasheet. (Schematic, not to scale.)

How a MOSFET switch works

A MOSFET has three terminals: gate (G), drain (D) and source (S). The gate is insulated from the channel, so it behaves like a small capacitor — a voltage on the gate creates an electric field that opens or closes the channel between drain and source:

Below the threshold voltage VGS(th) (about 2 V for a logic-level device) the channel is closed: the MOSFET is off and no drain current flows. Well above the threshold — 5 V from a logic pin — the channel is fully open: the MOSFET is on and behaves like a small resistor, RDS(on), between drain and source. Between the two, it is partly on, drops a large voltage, and gets hot — a switch must never sit there.

Because the gate is insulated, the only gate current is the brief pulse that charges the gate capacitance when the MOSFET switches. There is no steady gate current, unlike the continuous base current a BJT needs.

Worked example — a 5 V pin switching a 12 V, 2 A motor

Drive a 12 V motor drawing 2 A from a 5 V logic pin, using a logic-level N-channel MOSFET. Assume an on-resistance of RDS(on) = 0.04 Ω at VGS = 5 V (an example value for a logic-level device — check the real datasheet value for the part you use).

Step 1 — voltage lost in the MOSFET: When on, VDS(on) = ID × RDS(on) = 2 × 0.04 = 0.08 V. The motor therefore gets 12 − 0.08 = 11.92 V — practically the full supply.

Step 2 — power in the MOSFET: P = ID² × RDS(on) = 2² × 0.04 = 0.16 W. The motor takes 11.92 × 2 = 23.84 W, so the total is 24 W and the switch wastes less than 1% of it.

Step 3 — gate resistor and pull-down: A 220 Ω gate resistor limits the peak gate-charging current to about 5 / 220 = 23 mA, and it also damps ringing on the gate. The 10 kΩ pull-down resistor from gate to ground draws only 5 / 10,000 = 0.5 mA when the pin is high, and it holds the gate at 0 V — the MOSFET off — while the microcontroller pin is still starting up or disconnected.

Step 4 — will it get hot? Assume a junction-to-ambient thermal resistance of 62 °C/W (a typical value for a TO-220 package with no heatsink). The temperature rise is 0.16 × 62 ≈ 10 °C, so at a 25 °C room the junction sits near 35 °C — no heatsink needed. If the load current were 10 A instead, the loss would be 10² × 0.04 = 4 W and the rise about 248 °C — that would need a heatsink, or a MOSFET with a lower RDS(on).

Step 5 — the flyback diode: A motor is an inductor. When the MOSFET turns off, the motor's inductance tries to keep the 2 A flowing and can drive the drain voltage far above 12 V — enough to destroy the MOSFET. The diode across the motor gives that current a safe path: it is reverse-biased in normal operation and conducts only during switch-off, clamping the spike to about 12.7 V.

Why 5 V is not enough for every MOSFET

Figure 1(b) shows the trap. At VGS = 3 V this example device can pass only about 0.22 A — far short of the 2 A load. If you drove it with 3.3 V logic it would sit partly on, drop most of the 12 V across itself, and burn up. Two rules follow: use a logic-level MOSFET (one whose datasheet specifies RDS(on) at VGS = 5 V or 4.5 V), and drive the gate with the full logic voltage — never a half-hearted 3 V on a device that needs 5 V, and never 5 V on a standard MOSFET that needs 10 V to turn fully on.

MOSFET vs BJT as a switch

The BJT switch post showed a transistor driving a load with a base resistor. For the same 2 A load and a typical current gain β = 100, a BJT needs a continuous base current of IB = 2 / 100 = 20 mA the whole time it is on, and drops about VCE(sat) ≈ 0.2 V, wasting 2 × 0.2 = 0.4 W. The MOSFET needs no steady gate current at all and wastes only 0.16 W here. That is why MOSFETs have taken over switching jobs — motor drivers, LED strips, relays, and power supplies. BJTs still win where a tiny, cheap switch for a small load is enough, or where the drive voltage is too low for a MOSFET gate.

Key points to remember

  • An N-channel MOSFET as a low-side switch turns on with gate voltage: off below VGS(th) (≈ 2 V), fully on at 5 V, where it behaves like a small resistor RDS(on).
  • Worked example: 12 V, 2 A motor, RDS(on) = 0.04 Ω → VDS(on) = 0.08 V, MOSFET loss 0.16 W, motor gets 11.92 V — no heatsink needed (about 10 °C rise).
  • Use a 220 Ω gate resistor (≈ 23 mA peak gate current) and a 10 kΩ pull-down so the MOSFET stays off when the pin floats.
  • Always fit a flyback diode across an inductive load such as a motor or relay, with its cathode toward +12 V.
  • Use a logic-level MOSFET rated for full turn-on at your logic voltage — at 3 V this example device passes only 0.22 A, not enough for a 2 A load.
  • Compared with a BJT switch (20 mA continuous base current, 0.4 W loss at 2 A), the MOSFET needs no steady drive current and wastes less power.