Whether I use the charger board or not, batteryMonitor.getVCell(); returns 5V and batteryMonitor.getSoC(); returns 256.00%. My battery is actually charged to 4.12v.
Why is this happening? How can it be resolved? Please and Thank You.
So I've tested 3 of 5 of these fuel gauges and none of them seem to work properly. I've also run the arduino I2C scanner sketch and none of them appear to be communicating. The oled appears on the scanner but not the fuel gauges.
You need to have pullups on SDA and SCL. Since your code does not seem to have enabled internal pullups for these you need to use external (around 4.7K) pullups. Have you done that or are internal pullups enabled behind the scenes in one of the libraries?
I have also the same problem: Purchased several 17043 lipo fuel gauges from ebay. I have also purchased the Sparkfun ones. Sparkfun works without any problems on all libraries I have tried. I have testet multiple modules of the clones: The difference is in the MAX17043: Where the Sparkfun has markings: Line1: 17043 Line2: 47A18. The clones have markings on Line1: 17043 Line2: 17A1U. The new Sparkfun have a black battery connector, the clones a white one. I have tried multiple libraries and also tried direct communications using I2C commands. An interesting thing showed up in the testing with an I2C scanner: The Sparkfun uses address 0X36 and the clones 0X32 (on the ones that showed up in I2C scans- not all do). I though an address change in the code would fix it, but unfortunately no: If I get values returned, they are "all over the place" - i.e. no consistent results.
I have also tried to change the I2C speed to slower speeds, but no change. I have also tried additional pull-up resistors on the SLC/SDA lines, but no change. I am pretty much out of options and ideas at this time..
I think the clone modules I purchased from 2 different vendors are made by the same manufacturer: They both contain what I assume is an jst battery cable where red and black wired are reversed. On the board it is pretty obvious where ground is compared with battery/power, but could trip some up I guess... All have the same markings on the max17043. Could they be counterfeit?
I have not gotten any relevant response from the first seller, and I will now contact the second seller to see their response. If anyone has purchased a clone that works - I appreciate a comment on the seller / channel.