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.
PWM switches a pin fully on and off. Why an LED looks dimmer, why a motor slows, why 50% duty looks 76% bright, and what frequency to use, with numbers.
Four switches reverse a motor, but the details decide whether it works: shoot-through and dead time, brake vs coast, why an L298 loses 2.5 V and PWM ripple.