Source: https://mokxi.com/parts/potentiometer
Updated: 2026-09-27

Part

# Potentiometer

A 10k knob you can turn. Ends to the rails, wiper to an ADC.

or see every part

- 3 pins
- 2 properties

Drawn live by the editor's own code, at the size you see it.

Reference

## Every one of its 3 pins

Pin

What it does

1

One end of the track.

2

The wiper.

3

The other end of the track.

This part

## What it does

A potentiometer is a resistive track with a wiper that slides along it. With the two ends on the supply and ground, the wiper sits at a voltage in proportion to where it is, which makes it a voltage divider you can set by hand; with one end tied to the wiper, it becomes a variable resistor. Mokxi models the track itself rather than either use, so both wirings work and the wiper has the source resistance a real one has, up to a quarter of the track value at the center, which bends the reading under a heavy load. On a 5 volt Arduino the wiper reads 0 to 1023 on an analog pin; on a 3.3 volt board it swings 0 to 3.3 volts with nothing special to change. The value and the taper, linear or log, are properties. The track is ideal, with no wiper noise, so a reading that would wobble on a desk is steady here.

How to use it

## How to use a potentiometer with an Arduino

One end to 5 V, the other to GND, the middle leg (the wiper) to an analog pin. analogRead() then gives 0 to 1023 across the travel. To use it as a brightness, scale it to 0 to 255 for analogWrite() on a PWM pin, by dividing by four or shifting right by two.

A real pot’s reading wobbles by a count or two, so average a few readings or smooth them before driving anything the eye or ear will notice.

Part pin

Board pin

Pin 1 (one end)

5 V

Pin 2 (the wiper)

A0

Pin 3 (the other end)

GND

On an ESP32, put the ends on 3.3 V and GND; its ADC reads 0 to 4095, and the ESP32 knob example shows how its attenuation sets the top of the scale.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

A knob dimming an LED on pin 9

Reference

## The 2 properties you can set

Property

Default

What it means

value

10000

the track resistance in ohms, 10 000 (10 k) by default.

taper

linear (or log)

linear
(every pot in an Arduino kit) or log (a volume control).

How it is modeled

## What is true about the Potentiometer, here

### What is modeled

The wiper's source impedance is the two halves of the track in parallel (zero at
either end of travel, 2.5 k at center for a 10 k pot), which is real, and is why a
pot with a load on its wiper does not read as a perfectly clean divider. Whatever is
on the ends is what the wiper swings between, so a pot on a 3.3 V board reads 0 to
3.3 V with no special case anywhere. taper bends the position into the fraction
along the track without changing anything else about the model.

### Not modeled

No mechanical stops beyond the travel limits, and no wear on the track over time.

The track is ideal: no wiper contact resistance, no end resistance where the track
meets its terminals, no tolerance on the total value (a real pot is ±20%), no
temperature coefficient, no noise, and none of the scratchiness a worn pot has as the
wiper crosses it. The position is a clean 0 to 1023 with no jitter, so an ADC reading it
never wobbles the way a real one does and a sketch that would need smoothing on the
bench does not need it here. taper bends the position into the fraction along the
track; the log law is an approximation of a real audio taper rather than a curve off any
datasheet.

From Potentiometer, in full.

Projects

## See the Potentiometer in a project

Shown here on: Arduino Uno R3, ATtiny85, Arduino Nano, ESP32 DevKit V1, Arduino Uno R4 Minima, Seeed XIAO ESP32-C3

Learn

## Where it turns up in a lesson

### In a learn article

- Arduino Stepper Motor: 28BYJ-48 and ULN2003
- Arduino Potentiometer: analogRead and a Dimmer
- Analog vs Digital Pins, and ADC Resolution
- An Op-Amp as a Comparator, With Hysteresis
- ESP32 analogRead: 12 Bits, Attenuation and ADC2
- How to Debug Arduino Code: Prints to Breakpoints
- How Many LEDs Can One Arduino Pin Drive?

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio, no real internet), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

STM32F411 Black Pill

The Black Pill on our own Cortex-M4 core. Pick a program and press Run.

BBC micro:bit V2

The nRF52833 board with its 5x5 LED matrix, buttons A and B and a speaker. Wire the rings to a breadboard.

See every part

## Wire up the Potentiometer

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

Start building Open the editor
