OHMYARD

DISCOVER  ·  EXPERIMENT  ·  BUILD

TRACK 4 · SEMICONDUCTORS & POWER11/16
NOV 27, 2026
14:20:00
ESP32 MCUGPIO: 3.3V ONCLICK GPIO PINIRLZ44NG D SN-MOSFET (0 mA Gate)12V FAN · 320 mA🛡 FLYBACK DIODE ON3.3V Logic (0.0mA) → Switching 12V Motor (320mA)
Drag or WASD to pan · Q / E to rotate · Scroll to zoom

NPN Transistor / MOSFET Low-Side Switch & Flyback Diode — Engineering Notes & Troubleshooting

An ESP32 or Arduino pin can only output ~20 mA at 3.3V — nowhere near enough for a 12V motor. Use a transistor as a solid-state electronic valve, and ALWAYS place a flyback diode across inductive coils to trap deadly turn-off voltage spikes!

I_B = (V_gpio − 0.7V) ÷ R_B | V_spike = −L · (dI / dt)

Bench Challenge: Safety Test: Uncheck 'Flyback Diode Installed', spin up the 12V motor, then turn GPIO OFF to witness the 68V inductive kickback arc!

Frequently Asked Questions

Why do we put the NPN transistor or N-MOSFET on the low side (between motor and GND) instead of the +12V high side?

An NPN / N-MOSFET turns on based on V_BE or V_GS referenced to its Emitter/Source. Tying Emitter/Source directly to GND lets a 3.3V MCU pin easily exceed the threshold voltage even when switching a 12V or 24V load!

OHMYARD · ALL 16 INTERACTIVE LABS & SIMULATORS

1. Closed Loop & Faults
/closed-loop
2. Ohm's Law & Thermal
/ohm-law
3. Series vs Parallel
/series-parallel
4. X-Ray Breadboard
/breadboard-simulator
5. LED Resistor & E24
/led-resistor-calculator
6. Voltage Divider & Load
/voltage-divider
7. Multimeter Trainer
/multimeter-simulator
8. RC & Oscilloscope
/rc-oscilloscope
9. 555 Timer Pulse Lab
/555-timer
10. Diode & Rectifier
/diode-rectifier
11. Transistor & Flyback
/transistor-switch
12. PWM Dimmer & Fan
/pwm-dimmer
13. Op-Amp Comparator
/opamp-comparator
14. H-Bridge & Shoot-Through
/h-bridge-motor
15. Buck vs LDO Power
/buck-converter
16. Digital Logic Gates
/logic-gates