Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to monitor battery capacity

Status
Not open for further replies.

afinko

Newbie level 3
Joined
Feb 21, 2011
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,320
Hi,

I have own hardware with Analog Devices DSP and STM32 CORTEX-M3.
It is powered from battery and it has graphical OLED display.
I am wondering how to add "battery icon" on display.
I can measure the battery voltage by ADC. It is 4.1V LI-On battery
2000mAh.

As you can see here:
**broken link removed**
the voltage of battery is not linear with the actual battery capacity (what
capacity still left). Moreover, the battery voltage is very depending on actual
battery current load.

Any ideas how to program the software that can show the classical "battery
icon" that can be seen on all mobile phones / cameras? Some software flow diagram, or even ideas would be great...

I know that there are some special IC with Battery Gas Gauge / Coulomb Counter. But I am looking for some simpler software way.

Just 3 states FULL/MEDIUM/LOW icons would be great.
It do not have to be very precise ...

I asked for that question on DSPRelated, but I didn't received satisfied answer.

Thanks in advance.

Afi
 

afinko,

When I done somethink like that, on automotive batteries, I had to implement inverse function of discharge curve to estimate residual charge.
Despite don´t be so constant, it´s not really confortable, due like you pointed, the discharge behaviour is fairly constant.

+++
 

I solved the issue by very simple way. It is not extremely precise, but in praxis works well.

I measured the Battery Voltage vs Capacity characteristic, see the attachment:
View attachment Battery Voltage vs Capacity.pdf
Battery Volatge vs Capacity.jpg
It is common 3.7V LiOn 2000mAh battery.

I measured it right after charging with the LTC1733 to 4.2V, every one second with CORTEX M3 internal ADC. The current load was switching between 3mA and 400mA every 10 seconds, managed by software.

I decide to use 4 states of battery:
Full Power, Half Power, Low Power, Battery Very Low.

The best way to describe the the software would be to paste here the code:

/*******************************************************
* Function Name : Read_Batt
* Description : Read Battery state
* Input : None
* Output : Int: 3 -> Full Power, 2 -> Half Power, 1 -> Low Power, 0 -> Battery Very Low
********************************************************/
int Read_Batt(void){
float Volt_act;

Volt_act = Read_Battery_Vol(); // Read actual battery voltage [V]

if (Volt_act < 3.62) // Is "Battery Very Low"?
{
Volt_base = Volt_act;
Batt_state = 0;
return Batt_state;
}

if ((Volt_base - Volt_act > 0.1) || (Volt_act - Volt_base > 0.1))
{
Volt_base = Volt_act;
Batt_state = 3;
if (Volt_act < 3.9)
{
Batt_state = 2;
if (Volt_act < 3.72)
{
Batt_state = 1;
if (Volt_act < 3.62)
{
Batt_state = 0;
}
}
}
}
return Batt_state;
};


There are global variables:
float Volt_base;
int Batt_state;
That were initialized only once, during initialization of ADC (when the board switched ON):
Volt_base = 0.0;
Batt_state = 0;


Hope it could help someone.
 

Measure the load and charge currents. Fully charge the battery. Use the model of energy in and out
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Measure the load and charge currents. Fully charge the battery. Use the model of energy in and out
Yes, accurate battery monitoring, e.g. for notebook computer batteries uses always charge balancing. It's usually buit-in to "intelligent" batteries. Battery voltage is additionally measured to compensate for capacity losses due to battery wear.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top