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!
Bench Challenge: Safety Test: Uncheck 'Flyback Diode Installed', spin up the 12V motor, then turn GPIO OFF to witness the 68V inductive kickback arc!