A potentiometer is a resistor with a wiper: a resistive track along which a moving contact (the wiper) picks off an adjustable fraction of the voltage applied across its two ends, in other words an adjustable voltage divider.

What is it for?
It is the simplest manual adjustment on a project: a value you turn and the program reads. It serves as a setpoint input (fixing a threshold, a speed, a brightness, an angle), as a calibration knob turned by hand, or as an adjustable voltage divider on a bench. Its output is a DC voltage, read by the board’s analog-to-digital converter (analogRead()).
How does it work?
Three pins: the two ends of the resistive track (wired between +5 V and GND) and the wiper in the middle (the output). The wiper position sets the ratio of the voltage divider: the output voltage varies continuously from 0 V (wiper on the GND side) to the supply voltage (wiper on the +5 V side).
The taper can be:
- linear (B). The voltage follows the rotation proportionally. This is the usual case for a setpoint.
- logarithmic (A). The voltage varies little at first then quickly (or the other way round); designed for audio volume, modelled on the response of the ear.
Shapes and variants
- Rotary (a knob), linear/slider (a fader), trimmer (a one-off adjustment made with a screwdriver, then left alone).
- Rheostat versus potentiometer: wired on two wires (one end plus the wiper), it is a plain variable resistor (a rheostat). Wired on three wires, it is a divider that outputs a voltage. To read a setpoint on an ADC, the three wires are the ones you want.
Pitfalls
An unwired end means a floating wiper. If only one end is connected, the output is no longer a defined divider: the reading drifts. Wire both ends (VCC and GND).
It is not a power controller. A potentiometer divides a voltage unloaded (into the high-impedance input of an ADC). Running the current of a load through it heats and destroys the track (to drive power, see PWM and an output stage).
A log taper read as linear. An audio potentiometer (A) gives a variation that is not proportional to the angle: surprises are guaranteed if the code expects a linear one. Choose a linear (B) model for a setpoint.
A worn contact. An old potentiometer produces value jumps as it is turned (dust, track wear). Filter the reading or replace the component.
See also
- Reading an analog sensor — reading it on Arduino (wiring, conversion) or in MicroPython
- ADC — what turns the wiper voltage into a number
- Logic levels — the voltage divider principle
- Driving a PWM output — the potentiometer as an intensity or speed setpoint (MicroPython version)
- Driving a servo — the potentiometer as a speed or position setpoint (MicroPython version)
- Driving a DC motor — the potentiometer as a speed setpoint (MicroPython version)