STC3115_I2C.h Software Source Code

STC3115



Below is the STC3115_battery.h software source code.

The STC3115 is a fuel gauge IC for lithium ion batteries made by STMicroelectronics.

The STC3115_battery.h source code contains battery parameters, which must be adjusted according to the battery and applications you are using.

Battery parameters which are to be defined is the nominal capacity of the battery in mAh and the internal impedance of the battery in mOhms.

Application parameters to be defined include the operating mode, whether the alarm is enabled, the SOC alarm in % (if alarm is enabled), the voltage alarm in mV (if alarm is enabled), the RSENSE resistor value, the end charge current in mA, and the application cutoff voltage in mV.

The STC3115 can be placed in one of two operating modes.

These are referred to as VMODE.

VMODE 0 is mixed mode, where the Coulomb counter is active, voltage gas gauge runs in parallel.

VMODE 1 is voltage gas gauge with power saving, where the Coulomb counter is not used and there is no current sensing.

The advantage of VMODE 1 is that it provides the lowest power consumption, being that there is no Coulomb counter being used. This, of course, saves battery life.

It is possible to switch between the two operating modes to get the best accuracy during active periods, and to save power during standby periods while still keep tracking of the SOC information (according to the datasheet).

The RSENSE resistor must be specified in order for the correct current sense calculations to be performed.

The end of charge current would be obtained from your battery charger IC and its specifications. On the datasheet for the charger IC should be an end of charge current. You would specify this in mA.

Also obtained from the charger IC datasheet is the cutoff voltage. In many datasheets, this is termed the power-on-reset threshold. Below this value, the charger is disabled.

The datasheet for the STC3115 can be found here: STC3115 Gas Gauge IC

This source code is designed for guidance only.







Related Resources



HTML Comment Box is loading comments...