I'm currently trying to design an Uninterruptible Power Supply for my microcontroller (Raspberry Pi 3 Model B). I've read from the documentation that the microcontroller requires 5V and the amperage drawn by it will be dependent on the peripherals I use.
Under normal conditions the microcontroller will be powered with the 5V microUSB that it comes with but in the event of a power outage or the cord getting pulled out I want to use rechargeable Lithium-Ion Batteries as a backup power supply. I'd also like the circuit to be capable of charging the rechargeable lithium-ion batteries, with a way of preventing overcharging to the lithium-ion batteries.
I also want my microcontroller to be portable so that way I can use it outside. So I wanted to use a solar panel to provide power to the circuit, but in times where the solar panel is not providing enough power I wanted the rechargeable lithium-Ion batteries to supply the necessary power to the microcontroller. I'd also like the solar panel to recharge the lithium-ion batteries when the solar panel has excess power to give out that isn't necessary to the microcontroller. Again, the circuit needs to be capable of preventing overcharging to the lithium-ion batteries.
I've looked around and seen some others doing something similar but I haven't found anything that gives me a concrete explanation or schematic that I understand.
My attempt: (Note the 5V is the microUSB or Solar Panel and the 4V supply is the rechargeable lithium-ion batteries.) I understand the values aren't correct and that a DC-DC Boost converter might be required... I also need something in place to make sure that when the batteries are fully charged that reverse polarity does not occur, correct?
Any help is appreciated!