
In the first example (adc_read.c) the voltage across the potentiometer is read as a raw ADC input which is a value between 5. This means you can measure input voltages between 0V and 3.3V (Maximum) at a resolution of 0.81mV (3.3 / 4095) although in MicroPython this is scaled to 16-bit value from 0 to 65535. The Pico has a single 12-bit resolution, 4-channel ADC with a 3.3V internal reference and available inputs on 0-3 (GPIO 26-29), the internal chip temperature sensor is on input 4. Make sure the Raspberry Pi is powered down and the power supply removed before making any connections, then check them carefully before powering on.

It is important not to exceed the 3.3V maximum for the ADC input or any GPIO pin Any 10 – 50k Ohm potentiometer would be suitable. To keep things simple, the analogue input will come from the central terminal of a 10k Potentiometer connected across the Pico’s 3.3V output and ground so it acts as a variable voltage divider.

All three examples use the same basic circuit, with the Pico connected to your PC, a Raspberry Pi 4B or Pi 400 using a microUSB cable for power and programming.
