Slide potentiometer
The same track laid out straight, with a knob you push along it.
- 3 pins
- 1 setting
- In 4 projects
- In 2 lessons
The Slide potentiometer in brief
What it is, and every setting the properties panel gives it.
The slide potentiometer is the 45 mm fader off a mixing desk, a straight carbon track with a knob in a slot. Its three pins are 1 at the bottom of the travel, 2 the wiper and 3 at the top,. On an Uno, pin 1 goes to GND, pin 3 to 5 V and the wiper to A0, which reads 0 at the bottom and 1023 at the top; on an ESP32, put the ends on 3.3 V, never 5 V, and the wiper on an ADC1 pin such as GPIO 34, which reads 0 to 4095. Mokxi models the track as two resistors split at the knob, R x f from pin 1 and R x (1 - f) from pin 3, with R 10 k by default (the value property), so the wiper’s source impedance peaks at 2.5 k mid-travel and is zero at either end. The law is linear, as kit faders are, so there is no taper property. The classic mistake is swapping the ends, so the fader reads 1023 at the bottom. Wiper contact resistance, end resistance, tolerance, noise and scratchiness are not modeled.
- Family
- Inputs
- Pins
- 3
- value
- 10000
- the track resistance in ohms, 10 000 by default, as the modules come.
3 pins
Named as the editor names them, so a wire lands where you expect it.
How to use a slide potentiometer with an Arduino
A slide pot wires exactly like a rotary one: pin 1, the bottom of the travel, to GND, pin 3, the top, to 5 V, and the wiper, pin 2, to A0. analogRead then gives 0 with the knob at the bottom and 1023 at the top, in a straight line, because a kit fader is linear. In this servo fader the sketch averages four readings, maps 0 to 1023 onto 0 to 180 degrees and sends the servo on pin 9 the matching pulse every 20 ms.
Drag the fader’s knob while it runs and the horn walks after it at the servo’s own speed. If the fader works backwards, the two ends are swapped: either swap the wires on pins 1 and 3 or map 1023 to 0 in the code. A fader wired from the wiper to one end only is a variable resistor, and on its own it gives the ADC nothing to divide.
On an ESP32, put the fader’s ends on 3.3 V, not 5 V, and the wiper on an ADC1 pin such as GPIO 34; analogRead there goes from 0 to 4095.
long sum = 0;
for (int i = 0; i < 4; i++) {
sum += analogRead(FADER);
}
int reading = (int)(sum / 4);
int angle = (int)map(reading, 0, 1023, 0, 180);
horn.write(angle);What is true about the Slide potentiometer, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
Electrically it is the same track model as the rotary pot: R x f from pin 1,
R x (1 - f) from pin 3, and a source impedance of R x f x (1 - f) at the wiper,
zero at either end of travel. There is no third element and no special case for a
rheostat wiring; both fall straight out of the two resistors. The travel here is
linear, unlike the rotary pot, because that is how the kit fader modules are built.
Not modeled
No audio taper. A fader with a proper audio law is a real thing on some mixing
desks, but the module a kit ships with is linear, and taper lives on the rotary
potentiometer instead.
Everything the rotary pot leaves out is left out here too: an ideal track with no wiper contact resistance, no end resistance, no tolerance on the value, no temperature coefficient, no noise and no scratchiness, and a position that is a clean 0 to 1023 with no jitter in it.
From Slide potentiometer, in full.
See the Slide potentiometer in a project
4 built-in projects use it. Each opens in the editor, already wired.
Where it turns up in a lesson
2 lessons place it in their own circuits.
The boards it is shown on
Each of these 2 boards has a built-in project with the Slide potentiometer in it.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the Slide potentiometer
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.