ADWSystems
Member
I have a microcontroller powered by a 5V power supply. The system requires multiple other power supply voltages including 9, 12 and 24 volts. Obviously if I don't have 120VAC and 5V the microcontroller isn't going to power up. But if the 9, 12, and/or 24V supplies don't power on (or fail) the microcontroller has no way to know. I was thinking of rigging up an optocoupler and a zener diode to provide an input the power supply is online and ready.
I was thinking something like this.
24V power supply, 1V Vf for the zener and the LED, leaves 22V over the 22K resistor for 10mA through the LED. The optocoupler is has a normalized CTR of 1 at 10mA. Then 1mA through the output transistor to input to the microcontroller.
It seems too easy, so I must be doing something wrong.
I was thinking something like this.

24V power supply, 1V Vf for the zener and the LED, leaves 22V over the 22K resistor for 10mA through the LED. The optocoupler is has a normalized CTR of 1 at 10mA. Then 1mA through the output transistor to input to the microcontroller.
It seems too easy, so I must be doing something wrong.