There are many instructions "How to Convert a Computer ATX Power Supply to a Lab Power Supply". Often they suggest they suggest to place to staus LEDs to indicate it the power supply is turned on or in standby-mode or without electricity. The purple wire is on +5V if the power supply is connected to electricity (this includes standby and power-on) and the gray wire is on +5V if the power supply is turned on:
(Sorry, this is in German, there is no other public domain picture available.)
Instead of having a green and a red light at the same time turned on (e.g. doing it this way), I wanted to a red LED for standby and a green LED for power-on (this could be even nicer using a two-color LED). To do so, I used a NPN transistor (a BC547B, PDF datasheet) and some resistors to build a NOT gate:
It actually works: when you connect the power supply, the red LED lights up and when you connect the green wire to ground (not in the circuit diagram) the power supply turns on, the greed LED lights up and the red LED goes off. However, there is a strange voltage on the gray wire, which I cannot understand (and it might be the cause why the LEDs are not very bright). Between the gray wire and ground there are 2.5V. How does that happen?
Note that I verified that the gray wire is on +5V if I disconnect the right part:
I am not very sure about the the resistor R2. In the beginning I used 1kOhm. But after playing a bit on the breadboard, I noticed that the green LED gets a bit brighter if I increase the resistor. I cannot explain that, maybe I made a mistake somewhere...