Strange behaviour showing the battery level

Posted on
  • Hello, I tried to transmit the battery level of a puck using NRF.setServices.
    My source code is the following:

        0x180F : {
        0x2A19 : {
          readable : true,
          notify: true,
          value: [ Puck.getBatteryPercentage() ]

    This morning the battery level was 58%, a few hours later it was 64% (using NRF Connect App). How could this happen and how can I get the real battery level?

    Kind regards

  • I think that may be to be expected. Is it likely that the temperature changed a lot in those few hours?

    I just did a quick Google and found the attached image. You can see the voltage changes a lot depending on temperature - the battery percentage can only really be calculated based on the battery voltage, and the discharge curve is very shallow for most of the battery's life which compounds the problem.

    It's not unique to Puck.js - if you've ever been somewhere cold with a digital camera, the battery will tend to show as mostly discharged until it warms up.

    The obvious question is why I don't add temperature correction - but the correction needed will depend on the brand of battery used.

    1 Attachment

    • image-avt-pow-IoTDesigningSensor-image3.jpg
  • A temperature correction would be nice of course. You could focus on Varta batteries because they are one of the best products for a fair price.

  • You could focus on Varta batteries

    They're also not the ones Puck.js ships with - I use Panasonic.

    If you run Puck.js at -10 degrees C all the time, the battery really will be unusable sooner because of the lower voltage, so in many ways having temperature correction isn't a help.

    I'm not adding it - but you're welcome to create your own function that does the temperature correction for the batteries you're using - it's just a few lines of code.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Strange behaviour showing the battery level

Posted by Avatar for MobiTech @MobiTech