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: http://www.edaboard.com/attachments/53877d1298974140-battery-voltage-vs-capacity-pdf http://www.edaboard.com/attachments/53878d1298975464t-battery-volatge-vs-capacity-jpg It is a 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.
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →
How to monitor battery capacity
Started by ●February 14, 2011
Reply by ●March 1, 20112011-03-01







