Battery level on Pytrack/Lopy



  • Hi,

    I would like to display the current battery level of my Pytrack/Lopy4. I'm not using a lipo battery. I'm using an usb external battery.

    I saw this link but it's for a lipo battery.
    I looked for it in the documentation but couldn't find anything.

    Any help, hint or datasheet links appreciated !

    Thanks



  • @jcaron Perfect thanks



  • @melkoutch you can read the battery voltage which is connected to an ADC on both the Expansion board and the Pysense/Pytrack (though not the same way).

    Note that there is no exact direct relationship between voltage and remaining charge, this may vary with current temperature, average and instantaneous current, etc.

    Also LiPo batteries have a discharge graph where most of the graph in the middle is very flat around 3.7V so it’s not easy to get an exact value from that.

    It’s probably going to be more like a low battery warning when the voltage gets below 3.7V than an accurate battery level reading.



  • @jcaron Thanks for answering ! So if I switch to lipo battery, I just have to measure the battery pin out the get the battery level, right ?



  • @melkoutch First, this is a lot less efficient, as you'll have quite a few losses in the conversion from the battery output to USB levels and from USB levels to the 3.3V used internally. IIRC there are also additional circuits involved that use more power when powered via USB than via the battery connector.

    Next, there's no way for the Pytrack or LoPy to find the battery level in this case: the battery pack will convert the battery output to standard USB voltage (5V), so there's no information available from the Pytrack or LoPy to find the battery level.



Pycom on Twitter