Loading simulator…
A 3.3 V GPIO cannot turn a 12 V PNP high-side switch off simply by driving its base to 3.3 V. The solution uses an NPN transistor to translate the low-voltage control into a safe drive signal for a PNP transistor connected to the 12 V supply.
Q2 to switch the supply. The supplied PNP Q2 has its emitter at VCC = 12 V and collector feeding R_LOAD = 240 Ω. The load return stays directly connected to system ground.CTRL_IN rises to 3.3 V, the NPN Q1 switches on and sinks current from Q2’s base through the added R_DRIVE = 2.2 kΩ. This pulls the PNP base below its emitter, turning Q2 on.R_B = 4.7 kΩ limits the GPIO-to-Q1 base current to roughly . R_OFF = 10 kΩ pulls Q2’s base back toward its 12 V emitter when Q1 is off, reliably removing PNP base drive.V_LOAD approaches 12 V and exceeds 11 V. When CTRL_IN = 0 V, Q1 turns off, R_OFF turns off Q2, and V_LOAD falls near zero.Test CTRL_IN at 0 V and 3.3 V. Confirm when off and when on, with I_GPIO < 1 mA. Inspect the transistor regions during the ON test: the validator requires both Q1 and Q2 in saturation.
R_DRIVE sets PNP base drive, while R_OFF ensures a reliable OFF state; neither resistor is redundant.