LC709203F Battery Monitor¶
The lc709203f
sensor platform allows you to use a LC709203F
(datasheet)
battery monitor with ESPHome. This device is available as a
standalone sensor and it is also one of the battery
monitor chips used on the ESP32 Feather dev boards.


Note
This device does not contain a temperature sensor. Only enable the temperature sensor option if you have attached a thermistor as shown in Temperature Sensor Information.
# Example configuration entry
sensor:
- platform: lc709203f
size: 2000
voltage: 3.7
battery_voltage:
name: "Battery Voltage"
battery_level:
name: "Battery"
temperature:
name: "Pack Temperature"
thermistor_b_constant: 0xA5A5
Configuration variables:¶
size (Optional): Size of the battery in mAH.
Valid values are integers between 100 and 3000.
Defaults to 500 mAH; we highly recommend that this value is set as appropriate for your battery pack.
See Pack Size and Nominal Voltage for help if you don’t know your pack size.
voltage (Optional): nominal voltage of the battery pack in V.
Valid values are
3.7
or3.8
Defaults to
3.7
. This is the correct value for the Adafruit batteries.See Pack Size and Nominal Voltage for help if you don’t know your pack voltage.
See Pack Voltage for more information on how this value is used.
battery_voltage (Optional): Configuration for the voltage sensor. All options from sensor.
battery_level (Optional): Configuration for the battery level sensor. All options from Sensor.
temperature (Optional): Configuration for the battery temperature sensor.
b_constant (Required): The B-constant of the thermistor you are using.
All options from Sensor.
update_interval (Optional, Time): The interval to check the sensor. Defaults to
60s
.
Home Assistant View:¶
When properly set up, the sensor will report values to Home Assistant as shown:

Pack Size and Nominal Voltage¶
The pack size and nominal voltage of your battery is typically printed on the battery as shown below.

Pack Voltage¶
You will need to configure your device with the correct nominal pack voltage. This
is used by the IC to improve the sensor’s accuracy. The nominal voltage is used to set the
change of the parameter
register per table 8 in the datasheet.

We assume that the device is a -01
or -03
device. This is the correct setup for the
Adafruit sensors and batteries.
Temperature Sensor Information¶
If you want to measure temperature of the battery, you must have a thermistor attached to the device as shown in figure 2 of the datasheet.

Acknowledgments¶
Special thanks to the authors and contributors for the MAX17043 and BME680 sensor components that I used extensively to learn how to create this component. Also, thanks to the authors of the Adafruit LC709203F Arduino library for example code showing how the communication and CRC calculations are done.