Background: I'm attempting to control an ATX power supply. I want to read its 5V power good signal and send it to a 3V3 Raspberry Pi Pico GPIO input, and simultaneously power an indicator LED.
I think I've worked out the individual components of this circuit but I'm having trouble putting it all together.
- Dropping 5V logic to 3V3 logic: a 6.8k and 3.3k voltage divider works, although I'm not sure if those are appropriate magnitudes. I don't know if it's sensible to use a voltage divider for something that is always powered either. The ATX spec guarantees minimum 2.4V logic high, which would be divided to 1.6V, above the 1.3V minimum HIGH threshold for the Pico. The Pico is not 5V tolerant.
- Driving an LED: I suspect it's not best practice to drive directly from the signal, especially if I want to also use that signal for logic. I guess I should use a 2N3904 transistor from the +5VSB rail. I have seen it done though.
- I gather the transistor base should have say, a 1K resistor. Can I use R1 from the voltage divider for this?
From the ATX spec:
|PWR_OK signal characteristics||.|
|Signal Type||+5V TTL compatible|
|Logic level low||<0.4V while sinking 4ma|
|Logic level high||2.4V-5V output while sourcing 200μa|
|High state output impedance||1kΩ from output to common|
Here's my initial circuit:
The simulator reports 750mV at LOGIC, which isn't going to work. Playing around suggested a digital buffer might be appropriate. I have no real idea, but this provides 2.9V to LOGIC, which is sufficient:
Changing the buffer for another resistor and dropping the values by 2 orders of magnitude gets me closer to the right voltage but I'm really just guessing at this point.
- Am I on the right track? Can it be simplified?
- I also considered using the LED in series to drop the voltage for the logic input, but I want the option of not populating the LED in the circuit.
- Am I doing something weird to step down 5V to 3V3 only to use 5V for the LED again?
- I hope to use this circuit "for real" so I'm interested in doing things correctly and reliably rather than relying on something that will mostly probably work.