# Is it possible to get li-ion battery charge level?

**URL:** <https://forums.pimoroni.com/t/is-it-possible-to-get-li-ion-battery-charge-level/21130>\
**Category:** Support\
**Created:** [January 5, 2023, 4:45pm UTC](https://forums.pimoroni.com/t/is-it-possible-to-get-li-ion-battery-charge-level/21130 "2023-01-05T16:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Figle](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@Figle](https://forums.pimoroni.com/u/Figle)\
**Post date:** [January 5, 2023, 4:45pm UTC](https://forums.pimoroni.com/t/is-it-possible-to-get-li-ion-battery-charge-level/21130/1 "2023-01-05T16:45:49Z")

</div>

Hello,

Would it be possible to read or estimate lithium ion battery charge with MicroPython? I’m using Galactic Unicorn, LiPo Amigo Pro and a 8800 battery. I just want to program the display to alert me when I should recharge it.

Thanks!

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 5, 2023, 7:45pm UTC](https://forums.pimoroni.com/t/is-it-possible-to-get-li-ion-battery-charge-level/21130/2 "2023-01-05T19:45:02Z")

</div>

There is some battery code here, that can likely be adapted. I’m using it on my Tufty.  
That being said, I “think” there are some complications when you try to run it on a Pico W based device.

[pimoroni-pico/micropython/examples/pimoroni\_pico\_lipo at main · pimoroni/pimoroni-pico (github.com)](https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/pimoroni_pico_lipo)

> [@Pico W not reading GPIO24](https://forums.pimoroni.com/t/pico-w-not-reading-gpio24/20510):
>
> Hi, i’m trying to detect if my pico w is being powered by USB. charging = Pin(24, Pin.IN) charging.value() charging .value() is always 0, I don’t understand! It’s plugged into usb, has a lipo shim and pico display attached Has anyone successfully detected usb power using micropython on pi pico w ?
