# \[20$ reward\]\[WANTED\] Annoying problem on Battery Measurement

**URL:** <https://forums.pimoroni.com/t/20-reward-wanted-annoying-problem-on-battery-measurement/26464>\
**Category:** Support\
**Created:** [November 3, 2024, 6:01am UTC](https://forums.pimoroni.com/t/20-reward-wanted-annoying-problem-on-battery-measurement/26464 "2024-11-03T06:01:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeon](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@Xeon](https://forums.pimoroni.com/u/Xeon)\
**Post date:** [November 3, 2024, 6:01am UTC](https://forums.pimoroni.com/t/20-reward-wanted-annoying-problem-on-battery-measurement/26464/1 "2024-11-03T06:01:19Z")

</div>

Hi everyone, I have a simple but annoying problem here, if you help me solve this thing out, I’ll give you 20$ as a tip.

In short, I have a **Pimoroni Pico Lipo** with a **regular lipo battery** , the only thing I wanna do is to measure the battery percentage, but the outcome is abnormal. Here’s the code:

```auto
from machine import ADC

voltageInput = ADC(29)
voltageConversionFactor = 3 * 3.3 / 65535

voltage = voltageInput.read_u16() * voltageConversionFactor

print(voltage)

```

The code above will print something like 0.20 in the shell, which is far away from 3.3 - 4.2V.  
The Pimoroni Offical also provided [a demo code](https://github.com/pimoroni/pimoroni-pico/blob/main/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py) to measure the battery percentage, but that will print -185% on my Pico, which is far away from 100%.

I spent hours on this problem and tried everything I can. I also notice a previous post which has [a similar problem](https://forums.pimoroni.com/t/charging-lipo-batteries-with-pico-lipo/21499). That user got -194% as result when he tried to measure the battery.

Is this a hardware design flaw?? I’m totally confused, any explain helps, thanks!

---

<div class="post-metadata">

**Author:** ![Xeon](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@Xeon](https://forums.pimoroni.com/u/Xeon)\
**Post date:** [November 3, 2024, 10:42am UTC](https://forums.pimoroni.com/t/20-reward-wanted-annoying-problem-on-battery-measurement/26464/2 "2024-11-03T10:42:08Z")

</div>

Hi all, this problem is solved by a friendly discord user named RebelMike, a true geniuse (or I’m too stupid).

If you have the same problem, just **try ADC(Pin(29)) instead of ADC(29)**. This case has well demostrated that human still can not be replace by GPT (I spent hours asking GPT).

I’m getting in touch with him to give him the bounty :)
