Electronics 01
How to Drive a Relay or Motor from Arduino with a Transistor
Wire a relay, DC motor or 12 V LED strip to an Arduino or ESP32 pin with a PN2222A or a MOSFET: base resistor math, flyback diode, pin limits and heat.
Wire a relay, DC motor or 12 V LED strip to an Arduino or ESP32 pin with a PN2222A or a MOSFET: base resistor math, flyback diode, pin limits and heat.
A relay coil can kick back 1,000 V at turn-off. A flyback diode stops it but slows contact release about 5x. Here is the math and the diode plus zener fix.