This part has a page of its own, with a note on using it and a circuit to try: the part page.
Potentiometer
The three-pin rotary potentiometer every kit has a handful of. A carbon track from pin 1 to pin 3, with a wiper on pin 2 that runs along it as the shaft turns.
Ends to the rails and the wiper to an ADC, and it is a voltage you can twiddle; one end strapped to the wiper, and it is a rheostat, a resistance you can twiddle. Both wirings work here, because the model is the track itself, not a special case for either use.
Pins
| Pin | What it does |
|---|---|
1 |
One end of the track. |
2 |
The wiper. |
3 |
The other end of the track. |
Properties
value: the track resistance in ohms, 10 000 (10 k) by default. taper: linear
(every pot in an Arduino kit) or log (a volume control).
While it runs
Drag the knob on the canvas to turn it.
What the model gets right
The wiper's source impedance is the two halves of the track in parallel (zero at
either end of travel, 2.5 k at center for a 10 k pot), which is real, and is why a
pot with a load on its wiper does not read as a perfectly clean divider. Whatever is
on the ends is what the wiper swings between, so a pot on a 3.3 V board reads 0 to
3.3 V with no special case anywhere. taper bends the position into the fraction
along the track without changing anything else about the model.
What it does not model
No mechanical stops beyond the travel limits, and no wear on the track over time.
The track is ideal: no wiper contact resistance, no end resistance where the track
meets its terminals, no tolerance on the total value (a real pot is ±20%), no
temperature coefficient, no noise, and none of the scratchiness a worn pot has as the
wiper crosses it. The position is a clean 0 to 1023 with no jitter, so an ADC reading it
never wobbles the way a real one does and a sketch that would need smoothing on the
bench does not need it here. taper bends the position into the fraction along the
track; the log law is an approximation of a real audio taper rather than a curve off any
datasheet.
Common mistakes
Reading the wiper with a heavy load and expecting a perfectly linear voltage. The divider's own 2.5 k source impedance at center travel is real, so a load comparable to that will visibly bend the reading, exactly as it would on the bench.
See it in action
Dimmer, Nano dial and ATtiny85 dimmer all read a potentiometer on an ADC pin. Open them at /templates.
The analogRead and ADC resolution page puts a knob on an Uno's A0 and compares the count it prints with a meter on the same pin.