0

Mini LiPo Charger with Arduino
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Mini LiPo Charger with Arduino

by adafruit_support_bill on Wed Mar 17, 2021 12:22 pm

How much variability are you seeing? The actual SoC and usable battery capacity will vary based on various factors including temperature and discharge rate. The SoC reported by the LC709203F chip is an estimate based on several indirect measurements combined with several assumptions about the battery's charge/discharge characteristics.

You can read the manufacturer's explanation of their measurement method starting on page 13 of the data sheet.

https://www.onsemi.com/pdf/datasheet/lc709203f-d.pdf

adafruit_support_bill
 
Posts: 81551
Joined: Sat Feb 07, 2009 10:11 am

Re: Mini LiPo Charger with Arduino

by FloriR on Thu Mar 18, 2021 5:10 am

I let it run overnight and the display fluctuates a lot, but it goes down continuously. At the end of the night the display showed 40% and saw that it was updating. Then I turned the project off, all of a sudden it said 11% as the battery level.... Is it because the capacity is not proportional to the voltage and therefore the battery is even fuller than it currently appears?

Here is how I adjusted the demo example sketch for my purpose to test the fuel gauge. I don´t use a thermistor, that's why I erased the temp related code.

Code: Select all | TOGGLE FULL SIZE
#include "Adafruit_LC709203F.h"

Adafruit_LC709203F lc;

void setup() {
  Serial.begin(115200);
  delay(10);
  Serial.println("\nAdafruit LC709203F demo");

  lc.begin();

  Serial.println(F("Found LC709203F"));
  delay(100);
  Serial.print("Version: 0x"); Serial.println(lc.getICversion(), HEX);

  lc.setPackSize(LC709203F_APA_2000MAH);

 
}

void loop() {
  Serial.print("Batt Voltage: "); Serial.println(lc.cellVoltage(), 3);
  Serial.print("Batt Percent: "); Serial.println(lc.cellPercent(), 1);
  Serial.println(lc.cellPercent(),0);
 

  delay(2000);  // dont query too often!
}


That's what my serial monitor shows:

Code: Select all | TOGGLE FULL SIZE
10:04:31.035 -> Adafruit LC709203F demo
10:04:31.035 -> Found LC709203F
10:04:31.174 -> Version: 0x2717
10:04:31.174 -> Batt Voltage: 3.683
10:04:31.174 -> Batt Percent: 9.4
10:04:31.174 -> 9


That's what it says with the normal demo:

Code: Select all | TOGGLE FULL SIZE
10:06:55.598 -> Adafruit LC709203F demo
10:06:55.598 -> Found LC709203F
10:06:55.641 -> Version: 0x2717
10:06:55.641 -> Thermistor B = 3950
10:06:55.641 -> Batt Voltage: 3.683
10:06:55.641 -> Batt Percent: 9.4
10:06:55.641 -> Batt Temp: -42.0


A photo of my wiring below.

Is there any adjustment that I can do to get the fuel gauge properly working?
Attachments
Wiring_Adafruit-LiPo.png
Wiring_Adafruit-LiPo.png (30.58 KiB) Viewed 249 times

FloriR
 
Posts: 12
Joined: Sat Feb 27, 2021 4:28 am

Re: Mini LiPo Charger with Arduino

by adafruit_support_bill on Thu Mar 18, 2021 6:01 am

What was the reported battery voltage when it said 40%?

adafruit_support_bill
 
Posts: 81551
Joined: Sat Feb 07, 2009 10:11 am

Re: Mini LiPo Charger with Arduino

by FloriR on Thu Mar 18, 2021 6:09 am

I don't know, the display showed 40 % and when I opened the serial monitor my project restarted and dropped to 11 %..... Sorry for that. Is the subdivision of the span 3.6V to 4.2 V linear to the capacity so it is possible to solve the problem with quick math?

The last few percent of battery seem to last longer, in the intermediate range 40 - 80% the level drops very quickly. Actually, I had hoped that the Fuel Gauge with the library linearizes this interaction and thus provides a "reliable" result. Meaning battery 50% equals still half runtime.

FloriR
 
Posts: 12
Joined: Sat Feb 27, 2021 4:28 am

Re: Mini LiPo Charger with Arduino

by adafruit_support_bill on Thu Mar 18, 2021 7:02 am

Is the subdivision of the span 3.6V to 4.2 V linear to the capacity so it is possible to solve the problem with quick math?

The LiPo discharge curve is not linear. The first 10% of the discharge curve will show a rapid drop from the 4.2v full-charge voltage down to a bit above the nominal 3.7v cell voltage. From there, you will see a very gradual decline to a little below 3.7v. Then the last 10% of the curve will again show a sharp drop-off.

Since the battery voltage is the only input that the fuel gauge has to work with, small fluctuations around the nominal voltage on the flat part of the curve can have a large effect on the estimated SoC.
Attachments
discharge curve.png
discharge curve.png (88.07 KiB) Viewed 247 times

adafruit_support_bill
 
Posts: 81551
Joined: Sat Feb 07, 2009 10:11 am

Re: Mini LiPo Charger with Arduino

by FloriR on Thu Mar 18, 2021 7:20 am

Yes, that is exactly what I thought. Do you have a way for me here to display the state of charge % in this range cleanly, so that this intermediate range is displayed more nicely and not the small change in voltage is in another resulting percentage range. Otherwise the Fuel Gauge makes unfortunately only limited sense.

Because currently the state of charge shows 5.3% at 3.629V and the device has been running at this level for a long time.
Or do you have a better way to show the battery level than the SOC in %, because the voltage drop in the area between 20 to 80 % is so small?

FloriR
 
Posts: 12
Joined: Sat Feb 27, 2021 4:28 am

Re: Mini LiPo Charger with Arduino

by adafruit_support_bill on Thu Mar 18, 2021 8:00 am

The voltage is just an input to the estimation algorithm. The LC709203F chip uses "HG−CVR" (Hybrid Gauging by Current-Voltage Tracking with Internal Resistance) to estimate the relative state of charge.

The other common method for estimating state of charge is 'coulomb counting'. The means precisely monitoring the current flowing into and out of the battery. I believe that Sparkfun has a breakout for a coulomb-counting gauge chip.

Both techniques are indirect measures and both need to make some assumptions about the battery itself to arrive at an estimate.

I don't have much hands-on experience with the LC709203F. I'll check with the rest of the engineering team to see if anyone has some tips on getting the best from this chip.

Having more complete information about your system behavior would be helpful. In particular, full details from both before and after a large jump in the reported charge level.

adafruit_support_bill
 
Posts: 81551
Joined: Sat Feb 07, 2009 10:11 am

Re: Mini LiPo Charger with Arduino

by FloriR on Thu Mar 18, 2021 9:49 am

Here is a short overview about the "weird" behaviour:

-----
Loading device continiously connected: Loaded from 13:45:00 (4.4 % and 3.605 V) to 14:29:35 (12.6 % and 3.916 V);

18.03.2021 --- 14:29:35
Ladezustand: 12.6 %
Ladespannung: 3.916 V

Device only switched OFF and ON, loading device connected:

18.03.2021 --- 14:34:25
Ladezustand: 65.3 %
Ladespannung: 3.805 V
-> Lower voltage and higher percentage compared to 14:29:35? Percentage +50%, only device switched off and on?


Switched OFF and ON; No loading device connected:
18.03.2021 --- 14:35:55
Ladezustand: 43.4 %
Ladespannung: 3.799 V


18.03.2021 --- 14:36:35
Ladezustand: 35.4 %
Ladespannung: 3.790 V

Between two measurements switched OFF and ON

Switched OFF and ON; Loading device connected:

18.03.2021 --- 14:37:30
Ladezustand: 69.3 %
Ladespannung: 3.904 V

----

FloriR
 
Posts: 12
Joined: Sat Feb 27, 2021 4:28 am

Re: Mini LiPo Charger with Arduino

by gulliver22 on Mon May 31, 2021 9:26 pm

I saw inconsistent results, where you stop discharging the battery, and when you start again the percentage left has dropped significantly. example:

Discharge for 2 hours, 31 minutes, then stop discharge. Remaining percentage shows 58.2%
Restart discharge, remaining percentage now shows 7.4%?
Continue discharging for 44 minutes, stop discharge. Now shows 2.4% remaining.
Restart discharge, remaining percentage now shows 4.3%?
Continue discharging for 13 minutes, stop discharge. Now shows 2.6% remaining.
Restart discharge, remaining percentage now shows 3.0%?
Continue discharging for 61 mins, shows 0.0% well before battery voltage drops low enough for 5 LED load to turn off by battery management IC.

gulliver22
 
Posts: 3
Joined: Sat May 22, 2021 2:00 pm

Please be positive and constructive with your questions and comments.