Electronics Design AU
ComponentsSolved

N-channel MOSFET not switching fully — driving gate from 3.3 V GPIO and it keeps getting warm

4 min read3 replies
Original Question

Asked by stale_biscuit_03 ·

Trying to switch a 12 V, ~1.5 A load (a small DC motor) from an ESP32 GPIO pin. I found an N-channel MOSFET in my parts drawer — it's an IRLZ44N — and wired up what I thought was a basic low-side switch: GPIO → 100 Ω gate resistor → gate, source to GND, drain to load's low side, 12 V supply to the load's high side.

When I pull the GPIO high (3.3 V), the motor runs, but the MOSFET gets noticeably warm within 30 seconds even though the load should be well within its current rating. The datasheet says Rds(on) is 22 mΩ typical, which should be fine for 1.5 A.

I added a gate pull-down resistor (10 kΩ to GND) so the gate doesn't float when the GPIO is an input. That didn't change the heating.

Is my MOSFET just garbage or am I missing something? I'm not doing any PWM, just straight on/off switching from the GPIO.

From the knowledge baseWhat Is a Transistor and How Does It Work?

3 Replies

fet_selector
Accepted Answer

The IRLZ44N is the problem — specifically, what 3.3 V does to its Rds(on).

The 22 mΩ figure in the datasheet is specified at Vgs = 10 V. Look at Figure 2 in the IRLZ44N datasheet (Output Characteristics) and you'll find that at Vgs = 3.3 V, the device is partially on. The threshold voltage Vgs(th) for this part is 1.0–2.0 V (typical 1.5 V), so it's past threshold, but 3.3 V is nowhere near fully enhanced. At Vgs = 3.3 V and Id = 1.5 A, Rds(on) is typically in the range of 100–250 mΩ, not 22 mΩ.

At 1.5 A and say 200 mΩ: P = I² × R = 1.5² × 0.2 = 0.45 W. That's why it's warm.

The fix is to use a logic-level MOSFET specified for Vgs = 2.5 V or 3.3 V. Good options for your load:

  • IRLML2502 — 20 V, 4 A, Rds(on) = 45 mΩ at Vgs = 2.5 V. Small SOT-23, easy to source.
  • 2N7002 — 60 V, 300 mA, Rds(on) < 5 Ω at 2.5 V. Too high for your load but fine for signal switching up to ~100 mA.
  • DMN2058UW — 20 V, 3.5 A, Rds(on) = 50 mΩ at Vgs = 2.5 V. SOT-323.
  • BSS138 — 50 V, 200 mA, Rds(on) = 3.5 Ω at Vgs = 2.5 V. Again, too resistive at low Vgs for 1.5 A, but often misused exactly the way you're using the IRLZ44N.

For a 1.5 A load with 3.3 V drive, the IRLML2502 or similar part rated ≥ 3 A at Vgs ≤ 2.5 V is the right pick. Confirm in the datasheet: look for an Rds(on) curve or table at Vgs = 2.5 V, not 10 V.

Your gate resistor (100 Ω) and pull-down (10 kΩ) are both correct for a slow GPIO switching application. The only change needed is the MOSFET itself.

The BJT vs MOSFET comparison and the transistor fundamentals page cover the Vgs threshold and Rds(on) trade-offs in more detail if you want to understand why the drive voltage matters so much.

beans4dinner

Worth mentioning the flyback diode situation while you're fixing this.

A DC motor is an inductive load. When you turn the MOSFET off, the motor's inductance tries to maintain current — and if there's no path for that current to go, the drain voltage spikes hard above your 12 V rail. Depending on your PCB layout and lead length, that spike can easily exceed the MOSFET's Vds breakdown and kill it (or just degrade it over time until it fails hard).

Put a Schottky diode across the motor terminals: anode to drain (motor low side), cathode to the 12 V supply. A 1N5819 or SS14 is fine for this load. Reverse breakdown on an IRLML2502 is 20 V, so you have some headroom, but the spike can still exceed that at higher motor speeds or with any cable inductance in the loop.

If you're doing PWM later, the diode is non-negotiable — the switching frequency will pump the kick energy into the MOSFET at every cycle.

grumpy_otter7

One more practical note on the gate resistor. 100 Ω is reasonable for simple on/off switching, but if you do end up adding PWM at any point, that resistor combined with the gate capacitance limits how fast the MOSFET switches.

Slow switching means more time in the linear region each cycle — more heating, more noise radiated from the switching node. For motor PWM at a few kHz it's usually not a disaster with a small logic-level MOSFET, but at 20 kHz and above you'd want to look at your gate resistance versus the gate charge (Qg) on the datasheet.

For a 3.3 V GPIO driving a 1.5 A load: swap to a proper logic-level part as fet_selector says, keep your pull-down so the gate can't float if the MCU reconfigures the pin as an input, and add beans4dinner's flyback diode. That combination should be reliable.

One layout thing: keep the gate drive path short and keep the gate resistor close to the MOSFET gate pin, not close to the MCU. The idea is to dampen ringing at the switching node (the drain), not at the MCU end where it doesn't matter.