Part

Slide potentiometer

The same track laid out straight, with a knob you push along it.

See every part
  • 3 pins
  • 1 setting
  • In 4 projects
  • In 2 lessons
Drawn live by the editor's own code, at the size you see it.
At a glance

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.
Pins

3 pins

Named as the editor names them, so a wire lands where you expect it.

Pin
What it does
1
The bottom of the travel.
2
The wiper.
3
The top of the travel.
How to use 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.

Part pin
Board pin
1
GND
2
A0
3
5 V

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.

Arduino Uno: a fader driving a servolive0.000 s 0.00x
Click to open it in the editor
This is the simulator itself, running here. Click anything to open it in the editor.
The reading and the angle, from the servo fader sketch
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);
How it is modeled

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.

Projects

See the Slide potentiometer in a project

4 built-in projects use it. Each opens in the editor, already wired.

Lessons

Where it turns up in a lesson

2 lessons place it in their own circuits.

Boards

The boards it is shown on

Each of these 2 boards has a built-in project with the Slide potentiometer in it.

Wire up the Slide potentiometer

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.