Thank you very much for the suggestion.
Yeah in my case LTC4417 definitely will fit for this task, it has all the bells and whistles (all kind of protections, a high input voltage range, power path priority selection, etc.). Unfortunately in my country I could get that chip for a relatively high price ~11$ (the combined price of almost all my device components is relatively the same).
However I come to a simpler device by linear - LTC4412. There was an example in its datasheet (
http://cds.linear.com/docs/en/datasheet/4412fa.pdf) that almost covers my needs (On page 10 under
Ideal Diode Control with a Microcontroller - see the attached
Fig 4.png with snapshot of the schematic). There is a suggestion to control the power source selection via MCU on the CTL pin of LTC4412.
Here what is written in the data sheet:
With a logical low input on the CTL pin, the primary input supplies power to the load regardless of the auxiliary voltage. When CTL is switched high, the auxiliary input will power the load whether or not it is higher or lower than the primary power voltage. Once the auxiliary is on, the primary power can be removed and the auxiliary will continue to power the load. Only when the primary voltage is higher than the auxiliary voltage will taking CTL low switch back to the primary power, otherwise the auxiliary stays connected. When the primary power is disconnected and V
IN falls below V LOAD, it will turn on the auxiliary MOSFET if CTL is low, but V LOAD must stay up long enough for the MOSFET to turn on. At a minimum, C OUT capacitance must be sized to hold up V LOAD until the transistion between the sets of MOSFETs is complete. Sufficient capacitance on the load and low or no capacitance on V IN will help ensure this.
As I only need a priority set on the external power source, I decided to provide a high voltage to that CTL pin, when external source is present via strong pull-up/weak pull-down resistor configuration and diodes for reverse polarity protection of that pin. I also added LED to light up when the battery is connected in reverse polarity.
Please see the attached
Power Selector.png for a schematic with my current idea.
However I'm not completely sure if that is the correct solution, I have certain concerns if there will be some issues like battery drainage by that UC, when the device is powered off. Also I have no idea how to implement the over-voltage and over-current protection of the external power source connection and it's positive and negative terminals.
I'll be glad on any opinion. I'm open to other schematic suggestions and UC's as well (If they are relatively cheap and does not involve a plethora of hard to find components).
Thanks in advance for your response