Measure battery state with Cosmic Unicorn + Amigo Pro

I have a Cosmic Unicorn, LiPo Amigo Pro and a 8800 battery. I’m currently trying to figure out how to get the battery state. I went through many places for example Measure battery state, Plus 2W + Amigo Pro - #11 by alphanumeric or even pimoroni’s examples pimoroni-pico/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py at main · pimoroni/pimoroni-pico · GitHub but still can’t figure out how to do it. And I’m at my wit end…

Can someone give me some pointers how to fetch the battery state out of Amigo Pro via the Cosmic Unicorn?

I’m going to tag along to see how you make out. I struggled with trying to do it, as mentioned in the thread you linked too. I did eventually get it to work but it wasn’t easy.
@hel Hel Gibbons may be able to help?

Do you just have the LiPo Amigo connected up via the battery connector? If you want to read the vsys of the Unicorn to estimate the battery voltage I’d expect something like this to work:

Note that as this method measures the system voltage, it won’t report the true voltage of the battery whilst the LiPo Amigo has USB power.

1 Like

What you see is the voltage under load, and that value while not being perfect is “good enough” to judge if it is time to reload the LiPo.

The “percentage”-figure is more problematic (or better: not useful), because there is no linear relationship between voltage and available capacity:

This is for two AA-batteries, but you have the same sort of graphic for a LiPo.