This circuit showcases the control of a bi-colour LED from a single output pin using two PNP transistors. You can access the Java Script simulation link here:
👉 https://tinyurl.com/22y3w9er
The circuit comprises two NPN transistors for switching, one bi-colour LED, two resistors for base current control, another two resistors for collector current setting for each transistor, and two voltage sources. The first voltage source at the top outputs 24V to drive the LEDs, while the second voltage source supplies 3.3V at the base of the transistors to simulate logic control output from microcontrollers.
In the OFF position of the switch, both transistors are in the OFF state, and the LED on the right side is ON via a 10k resistor with an LED driving current of 2.2mA. When the switch is ON, both transistors are in the ON state, driving the LED on the left side, while the other LED is switched off because the transistor on the right side is on, pulling down the LED anode voltage.