Breadboard coin-motor driver that runs when you plug in power and fails randomly: floating base, direct ground return, 1xAA, no common ground, hooked resistor leads
Rule: an NPN low-side motor switch (GPIO -> 220 ohm -> base, 10k base->GND, motor+ to supply, motor- to collector, emitter GND, flyback diode stripe to motor+) that spins as soon as the motor lead is plugged in, and works only sometimes, is almost always one of: (1) base floating (pull-down missing or a resistor leg resting on top of the breadboard instead of in a hole, hooked/long legs); (2) motor- wired to the ground column instead of the collector (blue wire in the same column strip as a black ground jumper); (3) supply too weak: one 1.5 V AA instead of 2xAA, sags under coin-motor start-up current; (4) battery minus not tied to ESP32 GND, so the GPIO has no common reference; (5) TO-92 pinout assumed wrong: PN2222A is E-B-C, P2N2222A is C-B-E, read the marking and check with a multimeter. Debug order with a multimeter: ground continuity ESP32 GND to battery minus (must beep), motor- to ground (must NOT beep), pull-down reads 10k, unplug GPIO and confirm motor stays off, drive the base from 3V3 through 220 ohm to prove the transistor, then run a 300 ms on / 700 ms off blink on the GPIO. Photos from a PDF: render pages to PNG with PyMuPDF and crop at higher dpi when the agent Read tool lacks poppler.