Potentiometer ADC Reader
Potentiometer ADC Reader is a runnable microcontroller simulation example on SensBench — open the wired circuit, inspect the code, and compile real firmware in your browser, no install needed. Last updated Aug 14, 2026.
FREE SIMULATOR EXAMPLE · BEGINNER
Potentiometer ADC Reader
This example reads a potentiometer on the Arduino Uno’s A0 and prints the knob position as a percentage — the classic analog input demo. Turn the knob on the canvas and the reading sweeps from 0% to 100%.
| Board | Arduino Uno (ATmega328P) + analog SPICE circuit |
|---|---|
| Difficulty | beginner |
| Category | circuits |
| Libraries | None — just the Arduino core |
| Runs in | Sensbench browser simulator — free, no account |

The exact circuit you get when you open this example — already wired, ready to run.
The sketch
// Potentiometer reader
void setup() { Serial.begin(9600); }
void loop() {
int raw = analogRead(A0);
float pct = raw * 100.0 / 1023.0;
Serial.print("Position: "); Serial.print(pct, 1); Serial.println("%");
delay(200);
}
How it works
The pot’s three terminals are wired across 5 V and ground, with the wiper feeding A0. The wiper position sets the divider ratio, so the ADC sees a voltage from 0 to 5 V as the knob turns. The sketch reads the raw count and scales it to a percentage with raw × 100.0 / 1023.0.
The loop prints the percentage every 200 ms — fast enough to feel responsive as you drag the knob, slow enough to keep the serial output readable. The 200 ms update is also the natural refresh for the simulator’s knob interaction.
Before you build it for real
Most potentiometers are linear taper unless labeled audio — a log taper pot’s percentage reading will be wildly nonlinear, which surprises people using “volume” pots for position sensing. The wiper is a mechanical contact: it can bounce or wear, and a dirty track produces a noisy reading at some angles; the 200 ms sampling here does no filtering, so a real noisy pot shows jitter. And the 10-bit ADC quantization means smooth rotation produces stepped readings — about 5 mV per count, invisible on a percentage display but obvious in fine motor control.
Get the parts
Related examples
FAQ
Why read a percentage instead of raw counts?
Raw ADC counts (0-1023) are hardware-specific: another board with a 12-bit ADC would report 0-4095. A percentage normalizes the reading so the same code means the same thing everywhere — 50% is mid-turn regardless of the ADC. The map()-style scaling hides the hardware.
What is inside a potentiometer?
A potentiometer is a resistor track with a sliding wiper. The wiper divides the track into R1 and R2 — a voltage divider whose ratio tracks the knob position. Turn the knob fully, and the wiper moves the full track, sweeping A0 from 0 to 5 V.