STC3115 FAQ - st-sw/STC3115GenericDriver GitHub Wiki
Frequently Asked Questions
Device: STC3115 fuel gauge from STMicroelectronics
Keywords: STC3115 FAQ / Fuel gauge / Gas gauge / battery monitoring
General
> What is the battery SOC ?
SoC means State Of Charge. It refers to the battery capacity in percentage (%).
The SOC of a battery is very difficult to estimate in specific use cases as a battery doesn't have a linear behavior (e.g. a short Current peak with a big voltage drop should not decrease the SOC from 90% to 50%). So a specific algorithm is needed to estimate the battery state of charge with the best accuracy throughout a bunch of different use cases.
The most critical estimation is to get the 0% and 100% accurately:
- Detect 0% not too late to avoid the application is powered down without saving the user data.
- Detect 0% not too early to avoid stopping the application too early whereas the battery has still enough power to supply the application.
- Detect 100% not too early to avoid to not charge the battery at its full capacity (this is usually managed by the battery charger IC, based on a charging current threshold value)
- Detect 100% not too late to avoid damaging the battery
> What is Voltage monitoring accuracy ?
0.25% @25°C
> What is Current monitoring accuracy ?
It depends on the layout around the Sense resistor, The resistor precision, and the temperature. But the Voltage monitoring at the resistor terminal is still 0.25%.
For best accuracy, the fuel gauge must be soldered the closest possible to the battery.
> What is the State of Charge (SoC) accuracy ?
The State of charge accuracy is a partly based on Voltage and Current monitoring. But it is dependents on HW implementation and layout, resistor precision, and SW implementation.
If you follow ST recommendation, you can achieve less than 1% accuracy with standard charge/discharge cycle.
With more complex charge/discharge patterns (like several consecutive charges and discharges, without waiting for a full charge or full discharge), you can reach an accuracy of less than 3%.
> What are the main features of STC3115 ?
The STC3115 is a system side gas gauge which is especially designed for system with removable batteries as well as soldered batteries.
It embeds several features to achieve accurately the monitoring of removable batteries as well as soldered batteries:
- Avoid SOC jump (e.g. avoid jumping from 90% to 40% when starting a high current application which generate a temporary voltage drop)
- battery swap detection is performed thanks to BATD pin to detect a battery removal, exchange… and restart tracking from point 0.
- An initial OCV measurement is performed at battery insertion (before application start-up), this allow the battery SOC to be accurately detected under low current conditions.
- A RAM area is integrated into the STC3115 to save context at application switch OFF to be able to recover battery information.
These features allow to provide an accurate battery monitoring without adding battery complexity and extra cost.
> What kind of battery can I used with the gas gauge ?
STC311x devices are designed for li-ion, li-polymer batteries or primary cells.
Li-ion and li-polymer chemistry have generally the specificity to have a sloping OCV curve which is monitorable by the voltage mode (low power mode).
> I have initialized the device properly. I read the registers but I can’t get a correct value for SoC or Temperature or Counter. Why?
There should be a hardware issue.
Check the BATD/CD pin level
Check the power supply voltage (VCC> 2.7V)
Check the device soldering.
Check the sense Resistor is connected.
Check the I2C communication is working.
> I configured the fuel gauge, but it doesn't seem to work. It is not reporting a good State of Charge and the current is wrong. What to do ?
First check if the STC3115 is running. You can use the REG_COUNTER information for this purpose. If the Gas gauge is running, the REG_COUNTER is incremented every 0.5s.
- After STC3115 powered-up, the gas gauge start the first measurements (V, I, T), and stays in Standby mode with REG_COUNTER frozen (not counting) and keeping the value 3.
- Once STC3115 is configured to be run (bit GG_RUN=1), the internal counter increases periodically, and it is >3 (greater than 3).
once bit GG_RUN is set to 1, the monitoring process starts:
- Battery Voltage is available after 0.5s
- Battery Current is available after 1s
- Device Temperature is available after 4s
- Conversion counter is incremented every 0.5s
> The STC3115 doesn't run. What is the cause ?
The BATD (Battery Detection) feature is used to check the battery presence at init. The BATD must be low level (‘0’) in normal conditions.
Be sure that BATD pin is at low level. When BATD pin is high level, the fuel gauge detects that the battery is not connected, and it resets itself continuously until a battery is connected or the BATD pin is forced to level '0'.
You can read the "BATFAIL" bit in register REG_CTRL (@Address 0x01) to verify that the issue is due to battery detection. If BATFAIL == 1, it means the STC3115 has detected an error, and it will not start.
If you don't use the Battery detection feature, you can force BATD pin to GND (pull-down resistor).
> How to disable BATD feature (Battery Detection) ?
Make sure to connect the BATD pin to the battery for proper functioning.
If you don't want to use the battery detection feature, you have to force the BATD pin to GND:
You can find more information about BATD pin in Application note AN4324, chapter:
“4.2 BatD pin system integration”
> Can I safely remove the BATD feature? For the most part once the battery is connected to the device, it will never be removed.
In this case, if the battery will almost never been removed, you can disabled the BATD feature. But note that this pin is actually :BATD/CD , which has 2 features:
- BATD (Battery Detect)
and - CD (Charger Disable)
The CD feature is used to improve accuracy of the initial OCV measurement.
See chapter: "6.5 Improving accuracy of the initial OCV measurement with the advanced functions of BATD/CD and RSTIO/BATD pins"
If you remove the BATD/CD feature, you won’t have also the CD feature available (at least if you already use it).
> The battery is fully charged, but the fuel gauge doesn't report 100% even after waiting 1 hour.
The fuel gauge need to be configured depending on the battery characteristics connected to it.
The battery configuration is managed thanks to 2 registers:
- VM_CNF : Voltage Mode CONFiguration
- CC_CNF : Coulomb Counter CONFiguration (used in Mixed mode only)
If these parameters are incorrect, the reported battery SoC will be wrong. Most of the time, it is the battery internal impedance Rint which is incorrect. There are several ways to measure the Rint of a battery. Modify Rint in the formula, and the reported SoC will change too.
Check also the OCV curve points are correct (see OCV registers), and it corresponds to the battery connected.
OCV is the Open Circuit Voltage (when no current flows through the battery).
> Do we need to change the CC_CNF register during monitoring of the battery ?
CC_CNF is fixed and does not need to be change on short term. It can be updated on long term to fit with battery aging. The aging compensation mechanism is well described in the ST design note.
By default, CC_CNF value has to be set with the equation mentioned in the datasheet, and must be in line with the fresh battery parameters.
> Is the gas gauge internal RAM cleared after a Soft reset ?
Yes. All registers (including RAM registers) are cleared with a Reset.
If you need to keep the RAM values after a reset, you need to copy them first to another memory (before reset), and then copy them back in RAM registers after reset. If the Fuel gauge will be powered down (e.g when battery is empty) and you need to keep the lastest values of RAM registers, thus you have to copy the RAM values in a non-volatile memory first, and then power down the fuel gauge. Once the Gas gauge is powered up again (e.g battery charged starting at mininum 2.7V), you can load the save value in the STC3115 RAM registers, so that the algorithm can continue to run properly with the latest battery information (in case the battery has not been removed).
> Why the mixed mode of STC3115 switches sometimes to Voltage mode?
The mixed mode of STC3115 (voltage + current) switches automatically to Voltage mode only when the flowing current is too small. Because in this case, the Voltage mode result is more preponderant and accurate than Current result (close to 0 mA). The REG_CURRENT_THRES register contains the threshold value when it switches from one mode to the other one.
You can read the GG_VM bit to check which mode is currently used by the algorithm.
> How to improve the initial battery accuracy ?
- Do not charge the battery at the same time than Gas gauge perform the 1st measurements. You can use the CD pin (Charge Disable) for that purpose.
- Use a relaxed battery. If the battery has just been stressed (charged or discharged at high current), the chemistry inside the battery won't be stable, and it will result in a inaccurate Capacity and Voltage. Let the battery relax for 30min to get ready to be used in proper condition.
Initial accuracy is given by:
- VM_CNF and CC_CNF registers. Provide an accurate value for these registers based your the battery characteristics and hardware configuration used.
- The OCV_TAB registers. It is the direct translation of measured voltage to SOC under a necessary assumption of relaxed battery.
> The SOC computed by the Gas gauge is wrong. The 100% (battery full) is reached much too soon. How to correct this ?
The accuracy to reach 100% and 0% is dependant on VM_CNF register.
The formula is:
VM_CNF = Ri x Cnom / 977.78
The Battery Impedance (Ri) to specify in the formula is in reality the equivalent impedance seen from the STC311x point of view. So it means it includes the Battery internal impedance, but also the extra impedance on the board (tracks impedance, ...).
> Is it possible to change the I2C address on the STC3115 ?
I have 2 batteries, so I use 2 fuel gauges but I only have one I2C bus on my microcontroller.
No, I2C address is not configurable.
If you use several gas gauge devices with the same I2C address, you must use independant I2C buses.
If you don't have enough I2C interfaces on your Microcontroller, you can use an emulated I2C on standard GPIO to have a second I2C bus. It works well on several platforms (even in commercial products).
> What is the maximum SOC value (in %) when charging?
At battery insertion, the SOC register (REG_SOC) is capped at 100%.
But in case of battery charging, the SOC register is capped at 125%.
This 125% limit going over the 100% is used to be able to track the battery even if its capacity is higher than the one specified. (This is not the normal case).
This over limit case usually occurs when the REG_VM_CNF configuration register is incorrect (i.e. not corresponding to the specific hardware).
The equation for the register is:
VM_CNF = Ri × Cnom ⁄ 977.78
If the VM_CNF provides incorrect OCV value, it means either Ri or Cnom is incorrect.
Please note that Ri is the impedance seen from STC311x point of view. It means it includes the Battery internal impedance, but also the track impedance between the IC and the battery.
Increasing the Ri value in VM_CNF formula can avoid to have a SOC above 100%.
> What is REG_CURRENT_THRES register ?
When the gas gauge is configured in mixed mode (Voltage+Current), it switches automatically from "Mixed mode" to "Voltage mode only" when the current is too small. Because in this case, the Voltage value has a more important impact on the Battery State of Charge estimation than the low current (around 0 Amps). Also the STC311x has a limited accuracy to measure very small current (near 0 A). Current mode is more useful for higher current.
REG_CURRENT_THRES register is the threshold value when the Gas gauge algorithm switches between Mixed mode and Voltage mode.
> In the REG_MODE register, does the gauge need to be forced active by setting the GG_RUN bit?
It looks like the gauge overwrites this bit occasionally.
Yes.
At power up, the gas gauge performs a first battery measurement. Then it stays in Standby mode (GG_RUN = 0).
To enable the gas gauge monitoring, you must put the Gas gauge in Operation mode (GG_RUN = 1), otherwise nothing will be measured and monitored.
In a normal behavior, this register bit (GG_RUN) should not change. But if an error occurs (BATFAIL, ALM_SOC, ALM_VOLT, or UVLOD), the gas gauge will stop (standby mode), wait for the error to be resolved and cleared, and then the gas gauge has to be active again (GG_RUN = 1).
# Hardware specific
> I don't get the 1% accuracy for the SoC reported.
The IC layout is very important to get the best accuracy with the Gas gauge. Follow the layout recommendation in the App Note.
The input parameters used for STC3115 configuration are also important to get the best accuracy.
> How critical is the internal resistance of the battery?
I don’t know what the value is. So, I used the generic 200 Ohms value that the driver uses if the internal resistance is unknown. How much will this affect the results if it is off by 2 for example (i.e. if the internal resistance is actually 100 Ohms)?
The 200 value is in mOhms and is the standard value we can observe for classical batteries. This value has a huge effect only if current is huge and STC3115 configured in power saving mode (Voltage mode).
For a first test, to keep the 200 value is enough. But it must be changed for better accuracy.
> We didn’t follow the layout recommendations for the STC311x.
So some of the priority 1 rules in AN4324 have not been met. Most specifically, the dedicated, short traces for the current sense resistor (both the CG and the GND sides) have not been provided. And the GND side of the current sense resistor is directly connected to the ground plane without a separate trace to the STC3115 GND pin. How severely can this affect the performance of the STC3115?
Commonly the non-separation of the STC3115 GND line from ground plane generates about 10% error on current measurement. This is in case STC3115 is located close to sense resistor, it will be much higher if the sense is far from STC3115, increasing by a lot the sense resistor equivalent impedance. If the current you have to sense is low (below 100mA) in your application, then you can use STC3115 in power saving mode (voltage mode only) with a well configured OCV curve. It will workaround the current measurement issue.
# Software specific
> What is the minimum Software configuration to do at init to get the State of Charge ?
The initialization sequence is described in the file:
“STC3115 init sequence pseudo-code.txt”
Note that if the battery specific information is not added in the init sequence, you will still get a SoC value, but the accuracy will be wrong. Compute the proper battery information to set in STC3115 register to get the best accuracy.
> How to use the Soft-reset.
In a standard case, the Software reset should not be used often. Only when critical errors occur, or during SW development for easier debug (without removing the battery every time).
Notice: The information contained on this page can be changed, corrected, enhanced, modified, and improved at any time without notice.
(End of file)