adafruit / Adafruit_CircuitPython_LC709203F

Library for I2C LC709203F battery status and fuel gauge
MIT License
4 stars 10 forks source link

Adding an PackSize for the 2200 mAh cylindrical battery: https://www.adafruit.com/product/1781 #23

Closed edanidzerda closed 1 year ago

edanidzerda commented 1 year ago

I'm using the 2200 mAh battery in my project with an ESP32-S2. While it is working perfectly using a value of PackSize.MAH2000, I wanted to be able to specify the perfect PackSize. I tested this one line patch on my ESP32-S2. I couldn't tell a difference in the output, although I only tested the "cell percent" from between 90.4 and 94.9.

Thanks for everyone's work on CircuitPython! It's really been a pleasure to work with.

edanidzerda commented 1 year ago

For the record, I did totally guess at the "value" of 0x2F. 2000 used 0x2D, so I left a space for 2100 if that used 0x2E... I found the datasheet https://cdn-shop.adafruit.com/product-files/1781/C2253_-_ICR18650_2200mAh_3.7V_with_PCM_20140728_APPROVED_8.18.pdf but I couldn't find anything that looked like the values in PackSize structure. 😞

jposada202020 commented 1 year ago

Just for reference, of the reviewer values comes from this graph. image And then convert to HEX

dhalbert commented 1 year ago

@jposada202020 so do you think the value chosen (0x2f == 47) is the best choice?

jposada202020 commented 1 year ago

@dhalbert I would prefer that we use (0x2f == 48) image

dhalbert commented 1 year ago

@edanidzerda Based on the graph measurements above, how about 0x30 (= 48 decimal)?

edanidzerda commented 1 year ago

I did more pixel peeping on the image that I would like to admit 😄 Based on the purple line being 3 pixels high, I agree: there is only room for one more 3 pixel line to fit "49" under the line on the chart for 50.

I pushed a commit updating to 0x30, let me know if there's anything else I can do to help.