/MicroPython_LC709203F

MicroPython Library for I2C LC709203F battery status and fuel gauge

Primary LanguagePythonMIT LicenseMIT


MicroPython Library for I2C LC709203F battery status and fuel gauge

About The Project

This library was adapted to MicroPython by Christian Reichl based on the CircuitPython library from ladyada (Limor Fried) Adafruit Industries.

Tested with the following boards:

Raspberry Pi Pico with Adafruit LC709203F and 10kΩ Thermistor

Please note:

Don't forget to connect a battery to one of the JST connectors on the Adafruit LC709203F. If no battery is connected it will cause an I2C error and the program will stop! Raspberry Pi Pico with Adafruit LC709203F and 10kΩ Thermistor

Pycom Board with Adafruit LC709203F and 10kΩ Thermistor

Please note:

Don't forget to connect a battery to one of the JST connectors on the Adafruit LC709203F. If no battery is connected it will cause an I2C error and the program will stop! Pycom Board with Adafruit LC709203F and 10kΩ Thermistor

Usage Example

Examples of using this module are in examples folder. There is a separate example for Pycom and Pico, because the commandos of the boards are slightly different.

Load the main.py script with the library LC709203F_CR.py on a microcontroller with MicroPython and execute the main.py script. Don't forget to connect a battery to one of the JST connectors on the Adafruit LC709203F. If no battery is connected it will cause an I2C error and the program will stop!

If everything works correctly, then you should get the following output: output

Please note:

It is normal that the temperature is not correct in the first few seconds. If everything is connected correctly, the sensor will output a temperature of 25.05 °C for the first few seconds. If the 10kΩ Thermistor is not connected, it will output -41.95 °C. The sensor updates the temperature about every 10 seconds.

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)