Monday, 13 June 2016

ATX Bench Power Supply Status LED

Like lots of electronics hobbyists, I have an old ATX power supply salvaged from a PC that I use as a bench power supply.  It cost practically nothing and it works well enough.


However, like any self-respecting geek, I can't look at anything for any length of time without thinking of ways it could be improved. The target of my ruminations today is that LED in the centre of the picture. It was originally wired to that it would glow dimly when the PSU was in "standby" mode (i.e. connected to the mains, but not supplying output to the front panel) and brightly when the PSU was turned on.  This was easy to do (see below), but not a good idea.  It was practically impossible to tell at a glance whether the LED was "bright" or "dim".  It was just crying out to be changed.

Among other things, the ATX power supply outputs two useful signals:-
  • 5VSB : 5V standby, a low-current 5V source that is available when the rest of the power-supply is in standby mode.  This is on the purple wire of the ATX connector.
  • PWR_OK: A logic-level signal that goes high when the power supply has turned on and stabilised. This is on the grey wire of the ATX connector.
In my original version, I simply wired both of these to a red LED via two different resistors: 4.7K on the 5VSB line and 470Ω+1N4148 diode on the PWR_OK line.  If only the 5VSB line was powered, the LED glowed dimly (through the 4.7K resistor) but if both were high then the LED was powered via the 470Ω resistor and glowed more brightly.  The 1N4148 diode on the PWR_OK line was there to stop it sinking the current from the 5VSB line if it went properly low.

I decided I wanted to use a multicolour LED instead, red for "standby" and green for "on".  Here is what I came up with:-


When the power supply is in "standby" mode (5VSB on, PWR_OK off), current flows from 5VSB, through the red LED and R3 and hits the drain of Q2.  Because PWR_OK is low Q1 is switched off and its drain (and therefore the gate of Q2) is sitting at about 2-3V (the 5V from 5VSB minus the voltage drop through the green LED.  This is enough to turn on Q2 (which has a typical gate threshold voltage of 2.1V), so the red LED lights.  Virtually no current flows through the green LED to the gate of Q2, so it stays off.

When the power supply is turned on, the PWR_OK signal is asserted.  This turns on Q1 causing its drain voltage to drop to near ground.  This has the effect of turning on the green LED while simultaneously pulling the voltage at the gate of Q2 to ground, causing it (and therefore the RED LED) to turn off.

The 100K resistors are really precautionary: the gates of the MOSFETs draw no current at all.  They are only there to limit current if a MOSFET dies in a way that shorts its gate to ground.  They could be omitted and the circuit would still work just fine.

The whole thing fitted onto a bit of perfboard around 25mm2 which was encased in some transparent shrink-wrap. Its not pretty but it works well:-


There may well be better ways of doing this (suggestions welcome in the comments below).