I'm using an ATmega32u4 (Arduino-board) and internal reference to measure the VCC voltage (handheld device with LiPoly-battery). For a very long time I'm getting 3.27V before it drops when it is near the end. How usually the measured battery voltage is converted to a state of charge in %?
Electronic – Convert LiPoly-Voltage to charge state
lipo
Related Solutions
The "best" way to measure battery capacity is by current and voltage monitoring during both charge and discharge and subsequent calculation - versions of this are generally known as "gas gauging". For almost all applications current monitoring is enough for capacity measurement.
Voltage alone can give some indication but "has problems":
Here are some discharge curves - these are for a std LiIon cell but results will be similar for a Lithium Polymer ("LiPo"). Curves shown here (not a n easy to read graph :-( ) are 1C, 0.5C and 0.2C but a similar family of curves exists up to whatever C capacity will tolerate.
Using a low discharge rate or no discharge to read the cell voltage is liable to give you less accuracy, not more. Compare the 0.2C and 1C curves. The low discharge curve is muc flatter across the middle of the capacity range. Between say 90% and 95% exhausted the rate of change is still much the same as from 40% to 90% BUT for the 1C discharge the rate of decline in voltage is now much steeper. Monitoring the 1C curve would give you a good idea of where you were from about 90% on, whereas the low discharge curve is up to about 96% before things "start to get alarming".
BUT these curves are for one temperature and battery temperature can have a significant effect and will depend on ambient temperature and recent discharge history and also cycle life of cell and probably calendar life as well.
Below: Typical lithium Ion 1 cell 'battery' discharge curve.
Gas gauging takes a bit more effort to get going but is liable to be more accurate for any degree of effort once operational.
The normal approach is just measuring current in & current out, and a LiIon battery (including LiPo) ic close to 100% efficient in that respect. Many ICs exist to do that
An example only is the cheapest in stock at Digikey at $2.801 is STC3100. This is I^2C controlled. Designed to operate at up to 2.5 Amp but could be scaled to higher currents with different sense resistor.
They say
■ Battery voltage monitoring
■ Internal temperature sensor
■ Coulomb counter with 12/14-bit AD converter, +/- 80 mV input voltage range
■ Internal or external 32768 Hz time base
■ I2C interface for gas gauge monitoring and
device control
■ 32-RAM bytes
■ 8-byte unique device ID
■ One general-purpose I/O
And
The STC3100 monitors the critical parameters of a single-cell Li-Ion battery (voltage, temperature and current) and includes hardware functions to implement a gas gauge for battery charge monitoring, based on a programmable 12- to 14-bit A/D converter. With a typical 30 milliOhms external sense resistor, the battery current can be up to 2.5 A and the accumulator system provides a capacity up to +/-7000 mAh with a resolution of 0.2 mAh
From the above data sheet
What colour is the magic smoke when it vents with flame ? :-)
Rushing immensely, more later, but ...
What you describe seems to run a severe risk of doing damage.
To be ure, first you need to specify the allowed MAX charge rate for each LiPo.
You have 1.0 + 1.2 = 2.2 Ah in parallel so 5A = 5/2.2 = 2.27C.
This MAY be OK if cells are specd as 2C or more and are balanced in draw.
If specd at say 10C then it all may survive.
If specd at 1C it is very very bad.
BUT when a cell pair plateaus at 8.4V it's current will start to drop and if the charger is able to make 5A the extra current WILL flow into the still in current more other battery pair.
If max charge rates are not >> 2C then what you describe is at best an extremely poor compromise and at worst a disaster either in magic smoking or in cell lifetimes.
If max charge rates are around 2C then what you describe is at best a beating of some of the cells regularly and at worst a journey towards magic smokedom.
In an arrangement like this with different capacity pairs wired in parallel you need to carefully monitor individual cell pair or even cell voltages to prevent discharge-damage. This is going to make balancing more important, although I have been impressed with how well cells from the same batch seem to track when I have checked it (not often).
Operating cells of different capacities in parallel is an immednsely bad idea usually unless you manage and turn off each pair individually.
Apart from one pair endpointing before the other and throwing more charge or discharge onto the other there is a lack of certainty re how cells load share.
eg Say you have a 1000 and 1200 mAh cell and load both with 1000 mA. The large cell will see this as less of a percentage load so it's natural terminal voltage will be larger and it will "happily" supply the extra current. but there is no guarantee that it will o this in the ratio of the tywo capacities. The large cell may prove very "sacrificial and provide most of the load for most of its capacity. BUT when it finally falters the small cell will then take up most of the load and may now be overloaded. And there is no certainty that the LARGE cells will not now expire and be driven into a damaging mode. Probably not, but. too many uncertainties.
Why run cells of different sizes and in this 2 x 2 pattern?
Key question: What are the max allowable charge current rates for the 1000 and 1200 mAh cells.
Without this information the question become svery hard to give a good answer to.
Best Answer
A Lipo cell goes from 4.2V to 3.0V as it discharges. However the discharge curve is not linear, and increased current will pull the voltage lower. It is possible to get a reasonably accurate state of charge measurement if you take these factors into account.
Here are example curves for a 3C rated Lipo cell discharged at different currents:-
At 0.2C (5 hour discharge time) it goes does down fairly linearly from about 4.1V to 3.6V. At 1C (1 hour discharge time) the curve is similar, but the start and end points are lower.
If your device has predictable current draw then you may be to do a test discharge and measure the voltage as it runs down to get a profile, which can then be used to estimate state of charge in normal operation.
As you can see from the graph above, 3.27V is almost empty for a Lipo battery. Are you sure it is Lipoly and not some other chemistry (eg. LiFePO4)?
EDIT: You say that your ATmega32u4 is measuring the 'VCC voltage' which might actually be the output of the 3.3V regulator, not the battery! To measure voltages higher than VCC you must use a voltage divider to get inside the ADC input's voltage range.