# How can I use an IC family or adapter to switch automatically from solar cell to batteries & reverse?

simulate this circuit – Schematic created using CircuitLab

How can I use an IC family or adapter to switch automatically from solar cell to batteries & reverse ?

if no load => solar cells charges the batteries

if there is a load
then
if p2 > p1 then trigger makes comparator connects load power from CELL
else (p1 > p2) then trigger makes comparator connects load power from  batteries
else
CELLS charges the batteries
fi
fi


Is there some specialized IC to manage something like this as "comparator" is this a bad approach of the need? (and then if you have ideas please provides them).

This is not really similar to : this question ...