Sub topic 5
Potentiometer terminals and how they work
This chapter assumes you can wire a breadboard, you know what voltage and ground are, and you have uploaded a sketch before. It covers what is inside a potentiometer, what each of its three terminals does, and how that produces a voltage your Arduino can read. Wiring to A0 comes in the next chapter.
What a potentiometer is
A potentiometer (often called a "pot") is a variable resistor with three terminals. Turning a knob or sliding a lever changes how its internal resistance is split between those terminals.
Inside, a pot has two parts:
- A resistive track, a strip of resistive material (carbon, conductive plastic, or wire wound in a coil) shaped as an arc. Its two ends are connected to the outer terminals.
- A wiper, a sliding metal contact pressed against the track. It is connected to the middle terminal and moves along the track as you turn the shaft.
The total resistance between the two outer terminals is fixed. It is the number printed or stamped on the part, for example 10k for 10 kilohms (10,000 ohms). The wiper does not change that total. It only picks a point along the track.
The three terminals
| Terminal | Position | Connects to | Role |
|---|---|---|---|
| Terminal 1 | Outer | One end of the track | Tied to one supply rail |
| Terminal 2 (wiper) | Middle | The sliding contact | Output, goes to the analog pin |
| Terminal 3 | Outer | Other end of the track | Tied to the other supply rail |
The two outer terminals are interchangeable electrically. Which one goes to 5 V and which goes to GND decides only the direction of the knob. Swap them and the reading falls as you turn clockwise instead of rising.
When the wiper is at some position, the track is split into two sections. Call the resistance from terminal 1 to the wiper R1 and from the wiper to terminal 3 R2. Then:
R1 + R2 = R_total
Turning the shaft increases one and decreases the other by the same amount, so the sum stays constant.
Why it works as a voltage divider
If you connect terminal 1 to 5 V and terminal 3 to GND, a small current flows through the whole track. The voltage falls steadily along the track from 5 V at one end to 0 V at the other. The wiper touches a point on the track and picks up the voltage at that point. The voltage divider formula gives the result:
Vwiper = Vsupply × R2 / (R1 + R2)
Because R1 + R2 is fixed, the output depends only on the wiper position:
| Wiper position | R1 | R2 | V_wiper (5 V supply) |
|---|---|---|---|
| Fully toward terminal 1 | 0 | R_total | 5 V |
| Halfway (linear pot) | R_total / 2 | R_total / 2 | 2.5 V |
| Fully toward terminal 3 | R_total | 0 | 0 V |
So a pot used this way converts a mechanical angle into a voltage between 0 V and the supply. That voltage is what analogRead() will later convert to a number from 0 to 1023.
A worked calculation
Take a 10 kΩ linear pot supplied with 5 V. The wiper has moved so that R2 = 2.5 kΩ and R1 = 7.5 kΩ.
- R1 + R2 = 7.5 kΩ + 2.5 kΩ = 10 kΩ, which matches the rated total.
- V_wiper = 5 V × 2.5 kΩ / 10 kΩ = 1.25 V.
- On a 10-bit ADC with a 5 V reference, the expected reading is about 1.25 / 5 × 1023, which is about 256.
You can check the math against what you see later in the Serial Monitor.
Resistance value and current draw
The rated resistance matters for two reasons.
First, current. With 5 V across the track, Ohm's law gives I = V / R. For a 10 kΩ pot, I = 5 / 10,000 = 0.5 mA. That is trivial for an Arduino, and it is why 10 kΩ is the usual choice. A 1 kΩ pot would draw 5 mA continuously, which wastes power on battery projects. A 1 MΩ pot would draw almost nothing, but it has a different problem.
Second, source impedance. The Arduino's ADC (the analog-to-digital converter) briefly charges a small internal capacitor when it samples. The ADC on classic AVR boards such as the Uno is specified for signal sources of about 10 kΩ or less. The wiper's output resistance is at most R_total / 4 (the worst case is at mid-travel, where R1 and R2 are in parallel). For a 10 kΩ pot that is 2.5 kΩ, which is well inside the limit. A 100 kΩ pot can reach 25 kΩ at mid-travel and may give readings that are slightly off or that depend on what was read just before.
Linear and logarithmic tapers
The "taper" describes how resistance changes with shaft angle.
- Linear taper (often marked B, as in B10K): resistance changes in proportion to the angle. Halfway is half the resistance. Use this for sensor-style input where you want the number to follow the angle evenly.
- Logarithmic or audio taper (often marked A, as in A10K): resistance changes slowly at first and quickly toward the end. It suits volume controls because human hearing responds to loudness logarithmically.
If you use an audio-taper pot by mistake, your readings will not hit 512 at mid-travel. They will sit much lower, often around 100 to 200, and then rise quickly near the end. Check the marking on the pot body when the response looks uneven.
Letter codes vary between manufacturers, and some regions use the opposite convention. Treat the marking as a hint and confirm with a multimeter if it matters: measure between the wiper and one outer terminal at mid-travel and compare it to half the rated value.
Physical forms
Pots come in several shapes, but the three-terminal logic is the same.
- Rotary panel pots have a shaft and three solder lugs. Most turn about 270 degrees.
- Trimmer pots are small, adjusted with a screwdriver, and meant for set-and-forget calibration.
- Slide pots move the wiper in a straight line.
- Multi-turn pots take 10 or more turns for fine adjustment.
- Breadboard-friendly pots have pins spaced at 0.1 inch (2.54 mm).
On a typical rotary pot, hold the shaft toward you with the terminals pointing down. The middle terminal is the wiper. If you are unsure, measure with a multimeter in resistance mode. The two outer terminals show the full rated value regardless of the knob position. The middle terminal shows a value that changes as you turn.
Common mistakes
- Using the wrong terminal for the output. If you connect the analog pin to an outer terminal, you read a constant value (near 0 or near 1023, depending on the wiring) that does not change when you turn the knob.
- Leaving the wiper pin unconnected. A floating analog pin picks up noise from nearby wires and your hand and gives drifting, unrelated values.
- Connecting both outer terminals to 5 V, or both to GND. The track then has no voltage across it and the wiper stays at one voltage for every knob position.
- Connecting the outer terminals to 5 V and GND through the wrong pins, such as connecting one end to the 3.3 V pin on a 5 V board. The output still works, but its range is limited to 3.3 V, so the readings top out near 675 on a 5 V reference.
- Wearing the track out. Cheap pots develop dead spots over time. If readings jump or drop out when the shaft passes a certain angle, the track or wiper is dirty or worn.
Measuring it yourself
Before wiring to the Arduino, use a multimeter to confirm what you learned.
- Set the multimeter to resistance (Ω).
- Measure across the two outer terminals. You should see the rated value, within the part's tolerance (commonly ±20 percent for cheap pots), and it should not change as you turn the knob.
- Measure between the wiper and one outer terminal. Turn the knob and watch the value sweep from near 0 to the rated value.
- Measure between the wiper and the other outer terminal. It moves in the opposite direction.
- Add the two readings at any knob position. The total should equal the outer-to-outer value.
This last check is the clearest proof of the fixed-total behavior that makes the voltage divider work.
Summary of the model
- The outer terminals connect to the ends of a fixed resistive track.
- The wiper (middle terminal) taps a point along the track.
- With 5 V and GND on the outer terminals, the wiper outputs a voltage proportional to its position.
- A 10 kΩ linear pot is the standard choice for Arduino inputs.
Exercise
A 10 kΩ linear pot has 3.3 V on one outer terminal and GND on the other. The wiper is positioned so that the resistance between the wiper and the GND terminal is 4 kΩ. What is the wiper voltage, and what current flows through the track?
Show answer
The wiper voltage is 3.3 V × 4 kΩ / 10 kΩ = 1.32 V, because the divider output is the supply voltage times the resistance on the GND side divided by the total. The track current is 3.3 V / 10 kΩ = 0.33 mA. The wiper position does not change the track current, since the total resistance across the supply stays 10 kΩ (assuming the wiper output draws almost no current).
Exercise
You wire a pot with 5 V and GND on the outer terminals and connect A0 to the wiper. Turning the knob clockwise makes the reading fall from 1023 toward 0, but you want it to rise. What is the simplest hardware fix, and why does it work?
Show answer
Swap the connections on the two outer terminals, so the one that was on 5 V goes to GND and the one that was on GND goes to 5 V. The track is symmetric, so this reverses which end of the knob travel is at the high voltage. The wiper voltage is then high when the knob is turned clockwise instead of low.
Exercise
A student uses a 100 kΩ pot and sees readings that shift slightly depending on which analog pin was read just before A0. Give the likely cause and two ways to fix it.
Show answer
At mid-travel the wiper's output resistance reaches about 25 kΩ, which is too high for the ADC's sampling capacitor to charge fully in the available time, so leftover charge from the previous channel affects the result. Fixes include replacing the pot with a 10 kΩ one, adding a small capacitor (about 0.1 µF) from the wiper to GND, or reading A0 twice and discarding the first result.