Electronic – Recharging a lipo battery while using it

3.3vcharginglipomicrocontrollervoltage-regulator

Right now I am designing a circuit that will charge a lipo battery via usb, using the mcp73831 (at 100mA).
The battery voltage(nominal 3.7v) will be regulated to 3.3v to power a microcontroller like an attiny85 or esp8266 for example.

Below is what I have so far, my question is: Are there any flaws/mistakes I made, and how can I charge the lipo battery while simultaneously powering the mcu? Because right now I can only charge OR use the mcu, depending on the spdt switch.
enter image description here

Best Answer

Most LiPo chargers don't charge a LiPo battery with a load attached correctly, because the load current interferes with the charging algorithm.

Charger ICs that can support a load while still charging correctly exist, but your MCP73831 isn't one of them. The MCP73871 is; it supports load sharing and can supply a load while charging the battery.

You could add a load sharing circuit to your MCP73831 if you want to get rid of the switch; see MCP73831 Li ion battery charger problem with load sharing circuit for an example of how to go about it. There's also a Microchip application note that describes how to do it.