I am designing four traffic lights that I can control with a single digital switch. When the signal is 1, two traffic lights should be green, and the other two red, and they should reverse when the digital signal is 0. I'm using a simple transistor switch to achieve this:
This one works in the simulation, but I tried it on the breadboard, and it won't work properly unless I swap the green LED with the red one and vice versa. Otherwise, the red LED stays on regardless of the applied base voltage, while the green one stays off.
Moreover, the whole implementation doesn't work in the simulation. Only the first and the third gates switch properly. The second and the fourth ones have the above-mentioned issue:
Now, I'm aware that the red and green LEDs have different forward voltages (1.7V for red and 2.2V for green), but I don't know how to fix this problem.