Loading simulator…
A 3.3 V GPIO cannot conveniently drive a 12 V, roughly 80 mA load directly. An NPN transistor handles the larger load current, while a base resistor limits how much current the control pin must supply.
Q1 has its emitter returned to ground and its collector connected to R_LOAD = 150 Ω and the 12 V supply. A HIGH base drive allows Q1 to complete the load current path.Set the base current. For CTRL_IN = 3.3 V, with approximately 0.7 V across the base-emitter junction, the solution adds R_B = 1 kΩ. Estimated base current is:
This falls inside the 2–3 mA range.
CTRL_IN = 0 V, base current falls near zero, Q1 cuts off, and the load no longer has a complete path to ground.Test CTRL_IN = 0 V and 3.3 V. Check I_LOAD < 0.1 mA with the input LOW, and with I_B between 2 mA and 3 mA when HIGH.