Electrical – 3.3V Supply using lipo

batteriespower supply

I'm trying to design a supply circuit for a board that should deliver 3.3V using a LiPo battery, the battery should be that charged using a micro USB cable.
here is what I've done so far.
enter image description here

the LM3940 regulates the supply voltage to 3.3V and the MCP73831 is a battery charger. the Target voltage supplies the whole circuit.

after doing some research I figured out that need to take the load sharing in consideration, I found the following schematic for that :

enter image description here

My question is how big is the voltage on the MCU pin (my target voltage should be 3.3V)
the way I see it , if **Vin ** is equal to 5V the output voltage is also 5V ?
should I connect the the MCU pin to the voltage regulator ?
thanks for any hint !

UPDATE
made changes based on Andrew answer
enter image description here

Best Answer

Your first circuit is a fine example of how to create a bad and potentially explosive circuit. If the battery is low it gets hit with 3.3V and as much current as the LDO can supply rather than being carefully charged. When the battery isn't low the charger is powering the circuit rather than the voltage regulator. The charger has no idea how much power is actually going into the battery and the circuit is being powered by up to 4.2V rather than 3.3V.

In the second circuit when VIN is high Q1 is off effectively isolating the battery from the MCU pin allowing the battery charger to do it's job. Power flows to the MCU pin via a diode, assuming 5V input with an LDO down to 3.3V the 0.2-0.3V drop in the diode shouldn't be an issue.

When VIN is off R2 causes Q1 to switch on and allows battery power to flow from the battery to the MCU pin.

Q1 needs to be sufficiently large to handle the current with appropriate voltage thresholds so that it is fully on and off under the normal operating conditions.

So yes, connect the MCU pin to the input of your regulator and you should get a clean regulated supply until your battery discharges to about 3.5V (assuming a 0.2V drop out LDO). Once your LDO drops out of regulation you should shut the system off since it's no longer reliable. You should definitely shut off before the battery gets below about 3.1V or you risk damage to the battery pack.

3.5V will normally be about 30% charge remaining but it is very temperature dependent. You could hit that voltage at 90% charged in low temperatures.