# How to detect lipo battery % charge left?

I am currently working with a few robotic projects where i use lipo batteries. Currently I am working with a 1500 mah 3s lipo.

With my current setup I am using a arduino uno and a power distribution board. I put my lipo charger in my power distribution board which has two connections where I put two cables that goes to the VLN and GND.

(If needed I can make a quick schematic to explain it better!)

How can I now see the current battery percentage of the lipo?

I came across a project that uses this codesnippet:

``````long previousMillis = 0;

long interval = 1000;

int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);

unsigned long currentMillis = millis();

if (currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
if (voltage <= 3.5)
Serial.println("Low Battery");
else
Serial.println(voltage, DEC);
}
``````

This snippet works with the A0 and I do not have anything connected there so I assume not.

Appreciate every help! :)

• Typically LIPOs have 3.7v at full charge. This code monitors the LIPO voltage and flags the battery as "low" if the voltage drops below 3.5v. Commented Mar 24, 2017 at 19:36
• @Mazaryk 3.7V is the nominal voltage for regular lithium batteries. 4.20-4.35 Volt when fully charged. However lithium-iron-phosphate batteries do have a full charge at around 3.7 V. Commented Mar 24, 2017 at 19:44
• @Gerben, You are right. I meant to say "discharge". :) Commented Mar 24, 2017 at 19:53

LiPo batteries do not work well for percentage of charge remaining when using voltage as a reference. Lithium chemistry batteries hold a voltage quite close to level up to the point of near-exhaustion. That is to say, you can deplete such a battery by 80%, leaving only 20% capacity and have a few tenths of a volt reduction, depending on the configuration of your battery pack.

Unfortunately, should you continue to deplete the battery, damage may result. Some will say that damage WILL result.

The only certain way to determine a battery capacity is to use a smart charger and/or a smart discharger (often combined into one) to profile a battery.

For example, I have a 2000 mAh battery. After a few conditioning runs, either in use or on the smart dis/charger, the battery shows as having 1600 mAh capacity to 80% discharge.

Using a device to monitor the discharge rate, one can determine that if one uses 1550 mAh of the capacity, one is quite close to the risky cut-off point. To continue discharging, there is risk involved in the lifespan of the battery.

LiPo batteries will have greater than 4 volts reading immediately off the charger and will "flatten" to optimum voltage in a short time and hold very close to that level, depending on the current load, until it virtually vanishes at the cut-off point.

One can approximate a safe voltage for the cut-off point, but one risks the chance of an inaccurate volt meter. Collecting ampere-hours as a reference for cut-off is the most accurate method and also allows more capacity with less chance of damage.

Characterize a few such batteries by putting them through a charge / discharge cycles so you can link their voltage with remaining capacity.

• The data sheet for the battery might already contain a nice discharge curve. Commented Mar 24, 2017 at 21:03