I have a question about why I'm seeing different analogue measurements when using the same external hardware but swapping out the Pico for a Pico W, let me explain:
This awesome guide: https://stfn.pl/blog/22-pico-battery-level/ taught me how to make a a voltage divider, I set it up using a Pico that I had spare and it worked great, I could reliably measure 12v battery levels using this setup:
![Image]()
And this code:I was surprised at how well the project went as some of this was new to me. Anyway, I needed to add wireless capabilities to this to publish data elsewhere, so I purchased a new Pico W for this purpose.
Now, I setup the same code, using the same wiring and resistors on the new Pico W but I observe lower / incorrect values being returned, to this extent:
Bench power supply is say 12.6v
The Pico shows 12.6v
The Pico W shows 8.4v
I've rounded the values there.
Both Picos are running identical code and I've tested the resistance of the resistors, I've adapted the setup so I can easily alternate the same wires & resistor setup between the Pico or Pico W and the disparity in results above are consistent.
I do have other brand new Pico W available to me I could try, but can those more electrically talented than I give me some clues on what may be going on here? Same code, same hardware (external to Pico), same external voltage being tested (from a bench supply), but different results Pico vs Pico W?
I guess the MicroPython Firmware version between the two could be different, but I wouldn't have really expected that to vary the output signal like this?
Thanks for your time and help.
This awesome guide: https://stfn.pl/blog/22-pico-battery-level/ taught me how to make a a voltage divider, I set it up using a Pico that I had spare and it worked great, I could reliably measure 12v battery levels using this setup:

And this code:
Code:
from machine import Pin, ADCfrom time import sleepanalogue_input = ADC(28)VOLTAGE_DROP_FACTOR = 4.572while True: sensor_value = analogue_input.read_u16() voltage = sensor_value * (3.3 / 65535) * VOLTAGE_DROP_FACTOR print(voltage) sleep(5)Now, I setup the same code, using the same wiring and resistors on the new Pico W but I observe lower / incorrect values being returned, to this extent:
Bench power supply is say 12.6v
The Pico shows 12.6v
The Pico W shows 8.4v
I've rounded the values there.
Both Picos are running identical code and I've tested the resistance of the resistors, I've adapted the setup so I can easily alternate the same wires & resistor setup between the Pico or Pico W and the disparity in results above are consistent.
I do have other brand new Pico W available to me I could try, but can those more electrically talented than I give me some clues on what may be going on here? Same code, same hardware (external to Pico), same external voltage being tested (from a bench supply), but different results Pico vs Pico W?
I guess the MicroPython Firmware version between the two could be different, but I wouldn't have really expected that to vary the output signal like this?
Thanks for your time and help.
Statistics: Posted by acawley — Wed May 08, 2024 7:22 pm — Replies 2 — Views 20