Electronic – Designing Power on failure system

designembeddedpower electronicspower supplyswitch-mode-power-supply

I came a cross a design problem which I need your suggestions in it.

I have 3 power sources, Main Supply which is 9-32DC, a battery pack 12VDC, and PoE Module, all are connecte to tripel output 12, 3.3, 5VDC voltage regurlators, and finally a microcontroller.

I would like to detect a power failure on the three of them, and also use one of them on power failure.

I thought about first the user must use the Main Supply first, then the uC use its ADC to check for the voltage on the battery pack, use a voltage divider to lower the voltage then measure the value and check if its lower than a value, however this method is also I want to use it for charging the batteries it self!.
The same scenario I will do with the main supply and the PoE, but the problem with the resistors that they must have high power, the current that can be drawn I assume its more than 9A. I'm also not sure which VRef should I feed the microcontroller with, it's very problematic issue too.
Do you guys havae an opinion or suggestion for better design ?

Best Answer

Combine the three power sources with diodes and a simple linear regulator down to 5 or 3.3V, at fairly low current, for a microcontroller. That way, as long as any single one of the three supplies is active, the microcontroller is powered. Now it can measure which power supplies are working and decide how to route power.