Why the top of the turn bends
Once the LED lights, it draws current through the track above the wiper, and that track drops the extra voltage. The wiper ends up below the plain divider: on 5 V by up to about 1.3 V, bending the upper part of the reading hard; on 3.3 V by up to about 0.46 V, less but still plain to see.
A divider only divides when nothing is attached
The divider's arithmetic, SIGNAL = VCC × (track below ÷ whole track), rests on one assumption: the same current flows through the track above the wiper and the track below it. Nothing leaves at the wiper.
On this board, once the LED conducts, something does. The upper track now carries two currents: the one that carries on down the lower track, and the LED's. More current through the same resistance means more voltage dropped across it, so the wiper sits lower than the arithmetic says.
How much, and where
The dashed line is the plain divider. The solid line is the wiper with the LED attached, and the red band between them is the error. Until the wiper reaches about 2.0 V, the two are the same line: the LED is dark and takes nothing.
On 5 V that point comes about two-fifths of the way round, and from there the solid line flattens. The error grows to about 1.3 V, roughly 260 counts on an Uno, near 85 % of the turn. Then it closes up fast: at the very end the wiper sits on VCC with no track above it, nothing drops, and the reading jumps to 1023. So on an Uno most of the upper half of the turn crawls, and the last few degrees sprint.
On 3.3 V the LED lights later, about three-fifths of the way round, and draws less, so the error is smaller: about 0.46 V at worst, near 90 % of the turn. That is still about 14 % of the range, roughly 580 counts on a 12-bit board. The same crawl and sprint, over a shorter stretch.
Why the wiper gives way
Seen from the wiper, the potentiometer behaves like a voltage source, the plain divider's value, with a resistor in series: the two halves of the track in parallel. In the middle of the turn that is 2.5 kΩ; near the ends it is less. Anything that draws current from the wiper loses voltage across that resistance. Where the error peaks on 5 V, the LED draws about a milliamp through a little over a kilohm of it, and that is more than a volt.
An analog input draws almost nothing, which is why it reads the divider faithfully. The LED is the only load here, and it is on the board.
What it costs, and what to do
A knob that reads crooked is not broken, but a sketch that assumes a straight
line is wrong over the upper part of the turn, on every board. If you map an
Uno's reading to a percentage with map(), the knob at three-quarters reads
about 52 %. The first 30 % of the turn moves an Uno's reading about 300
counts; the 30 % from 60 % to 90 % moves it about 210.
Three honest ways round it:
- Run VCC from 3V3. On an Uno, the range becomes about 0 to 675 and the bend shrinks to about 0.46 V, roughly 95 counts. The LED is a little dimmer. On the three 3.3 V boards this is already the wiring, and the bend is already that size.
- Calibrate. Record the reading at a few marks and draw straight lines between them. Calibrating the turn does it with five.
- Use the lower part. If the fine control only matters at the low end, the reading is straight until the LED lights: the first two-fifths of the turn on 5 V, the first three-fifths on 3.3 V.
All of this is a model, not a measurement: the LED as a fixed 2.0 V drop with its 1 kΩ, on a 10 kΩ linear track. Real LEDs turn on gradually, so the corner at 2.0 V is softer in life. Seeing the bend draws your own board's curve.
When it does not work
No, that is the LED. From about two-fifths of the way round on 5 V it draws current through the upper track and pulls the wiper down, most of all around 80 to 90 % of the turn. At the very end the wiper touches VCC directly and the reading jumps to 1023.
At the end of the turn there is no track left above the wiper: it sits on VCC itself, and VCC can supply the LED without dropping anything. The error is largest where there is still a lot of track above the wiper and the LED is already on.
Yes, and it shrinks the bend, though it does not remove it. The range becomes 0 to 3.3 V, about 0 to 675 on an Uno, the LED is a little dimmer, and the worst error falls from about 1.3 V to about 0.46 V, roughly 95 counts, over the last two-fifths of the turn. Calibrate as well if the position matters.
No. They come from a model: the LED as a 2.0 V drop with its 1 kΩ, on a 10 kΩ linear track. Real LEDs turn on gradually and vary, so your curve will differ in detail. The shape, flattening from about two-fifths of the turn and steep at the end, is what to expect.
A sketch that sweeps the knob and plots the curve, so you can see your own.
Seeing the bend →Edit this page — content/books/rotary-potentiometer/why-the-top-of-the-turn-bends.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Rotary Potentiometer
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.