Diagnostics in 0.8.0 rc4 - battery charge

Hi All,
I’m looking at the info in the diagnostics on an electron. As part of a publish event that runs after every wakeup in my user code, I have the Electron send it’s battery State Of Charge using - fuel.getSoC().

I see a difference between my event’s SOC (75%) and the Battery charge percentage in the diagnostics window (90%) of the console. How is the battery charge being calculated in the diagnostics event that runs when the device first connects?

I’d like to use the best quality data I can get for the SOC, so I want to understand the difference between the two pieces of data - it’s a pretty significant difference in the two values.

Thx
J

1 Like

From my Electron 0.8.0 rc4 testing, I found the fuel.getSoC() is not very accurate. Plus, if you use deep sleep it resets the fuelgauge/SoC. I’m presently using fuel.getVCell, e.g. 3.2V ~ 0% SoC and 4.2V ~ 100% SoC.

I assume Particle diagnostics is also using battery voltage too. Do others agree? Happy to be wrong here.

PS Particle team, I love the new Diagnostics feature… Thank you! :+1:

1 Like

The fuel gauge chip on the Electron is Voltage based anyway so ignoring it’s SOC readings and mapping SOC to 3.2 to 4.2v will work just fine with the linear discharge curve of the LiPo batteries.

The fuel gauge has been notorious for not ever reaching 100% but 85-95% normally, so people would map that 0-85% to 0-100% so they could see the 0-100% SOC readings.

I have no idea what Particle is doing in Consol for battery charge readings but maybe @suda, @jeiden or @Bdub would have an idea?

2 Likes