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.
Vref = 8 × Rs × I on an A4988, 5 × Rs × I on a DRV8825, and about 1.41 × the RMS current on a TMC2209 with 0.110 Ω resistors. How to read the sense resistor, why TMC numbers are RMS, and how to measure the pot.
Step a 5 V signal down to 3.3 V with two resistors: which values to use, the E24 pairs, how loading and pin speed limit it, and when you need a regulator.
Resistor values for every LED colour on Arduino 5V and ESP32 3.3V pins, with the pin limits, worked examples and why a white LED on 3.3V is a trap.
A load cell turns 0.05% of strain into a 1 mV/V bridge signal. How strain gauges and the Wheatstone bridge work, and what an HX711 really resolves.
Beta equation, Steinhart-Hart, divider resistor choice, ADC code to temperature and self-heating for a 10k NTC, checked against a real Vishay R/T table.
Dividing load current by hFE gives a base resistor that leaves many transistors half on. Size it for a forced beta of 10, with worked 2N2222 and BC547 examples.
Switches bounce for 1.6 ms on average and 6 ms or more at worst. How to size the debounce R and C from Schmitt thresholds, and why 10k with 100 nF is too short.
Drones have captured the imagination of hobbyists, engineers, and professionals alike. Building your own quadcopter drone can be an exciting and rewar