Can you charge and use a LiPo battery at the same time?

can I charge the battery while the arduino is still on, but on power savig mode?

You can draw power from a Li-Ion battery whilst charging it, but it isn't recommended. This is because the load on the battery affects the ability to detect the different phases of charging, and determine the end-of-charge condition.

Instead you should provide a bypass facility so that if external power is applied the external power is routed to the Arduino to power it, but when the power is removed the battery provides the power to the Arduino.

The circuit I usually use is:

schematic

simulate this circuit – Schematic created using CircuitLab

When 5V is applied the battery charges up. Q1 is held off. The 3.3V regulator is then powered through D1. When the 5V is removed Q1 is turned on by R1 pulling the gate low and the battery powers the 3.3V regulator.


Application Note AN1149 by Microchip Inc:

It is NOT encouraged to attach the system load directly to Li-Ion batteries when using a stand-alone Li-Ion battery charge management controller with automatic termination feature.

enter image description here

Why not?

1. The charge may never end.

Most Li-Ion battery chargers are based on Constant Current and Constant Voltage (CC-CV) modes. The termination is based on the ratio of charge current and preset constant current (Fast Charge). If the system draws current from the battery, the charge current will never meet the termination value. This causes the non-termination of the charge management circuit.

2. The total system current is limited by the charge current.

It is because the charger will deliver total system and battery charging current through the output pin. This solution may be feasible for some applications that run on constant current, but it is not recommended.


So what's the alternative?

A load-sharing switch with a P-MOSFET:

Plugged in

Q1 is OFF When Gate is High and No Current Flows from the Battery Cell to the System Load

Battery-powered

Q1 is ON When the Gate is Low and Current Flows from the Battery Cell to the System Load.

The App Note contains some really good practival advice on component selection, I highly recommend it.