Skip to content
MakerBuddy

What Is a Potentiometer and How Does It Work?

A potentiometer is a resistor with a sliding contact that turns the position of a knob into a voltage. This guide explains its three pins, the main types, how a microcontroller reads one and how the MakerBuddy knob steers a servo with no code.

By the MakerBuddy teamPublished 20 min read

A cut-away rotary potentiometer shows its dark curved track and an orange wiper turned partway between the 0 V and 3.3 V ends, with its three pins wired to an ESP32 board that drives a blue SG90 servo whose arm sits partway along a 0° to 180° arc
A cut-away rotary potentiometer shows its dark curved track and an orange wiper turned partway between the 0 V and 3.3 V ends, with its three pins wired to an ESP32 board that drives a blue SG90 servo whose arm sits partway along a 0° to 180° arc

What is a potentiometer? It is a resistor with three pins and a contact that slides along it. Turn the knob and the sliding contact, called the wiper, moves along a strip of resistive material inside. The two outer pins connect to the ends of the strip. The middle pin connects to the wiper. Put a voltage across the outer pins and the middle pin gives out part of it: nothing at one end of the turn, all of it at the other, and a share in between that matches the knob's position. So a potentiometer turns a position into a voltage.

People also call it a pot, a pot meter or a variable resistor. On the MakerBuddy board, the small knob next to the 34-Potentio label is a potentiometer. The board reads it as a number from 0 to 100, and you can use it to steer a servo motor without writing any code.

What is a potentiometer? The short definition

Here is the potentiometer meaning in one line: an adjustable voltage divider that you set by hand. The Wikipedia article on the potentiometer (opens in a new tab) describes a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. SparkFun's voltage divider tutorial (opens in a new tab) puts it more simply: a variable resistor that can make an adjustable voltage divider.

The part goes by several names, and each one hints at how it is used:

  • Pot or pot meter: short for potentiometer. Same part.
  • Variable resistor: the general name for any resistor you can change. A potentiometer is one kind.
  • Rheostat: a potentiometer wired with only two of its pins, so it changes a current instead of a voltage.
  • Trimmer, trimpot or preset: a small potentiometer on a circuit board, often turned with a screwdriver.
  • Slider or fader: a potentiometer that moves in a straight line instead of turning.

In a circuit diagram a potentiometer is drawn as a resistor with an arrow pointing at its middle. The arrow is the wiper. If resistance itself is new to you, start with what resistance is and what a resistor actually does. The guide to electronics for beginners and the 12 ideas you need before your first circuit puts the potentiometer next to fixed resistors and light sensors.

How a potentiometer works: the track, the wiper and three pins

Open a potentiometer and you find three things.

  1. 1

    The track.

    A curved strip of resistive material. The Bourns PTV09 9 mm potentiometer datasheet (opens in a new tab) lists a carbon element, and the Bourns 3362 trimmer datasheet (opens in a new tab) a cermet one. Pins 1 and 3 connect to its two ends.

  2. 2

    The wiper.

    A springy metal contact pressed onto the track. It is fixed to the shaft, so turning the knob slides it along the track.

  3. 3

    Pin 2, the middle pin.

    It connects to the wiper.

Now think about the resistance between each pair of pins.

  • Pin 1 to pin 3: always the full value printed on the part, for example 10 kΩ. Turning the knob does not change it.
  • Pin 2 to pin 1: grows from almost nothing to almost the full value as you turn one way.
  • Pin 2 to pin 3: does the opposite. The two parts always add up to the full value.

That last point is the whole trick. The wiper cuts the track into two resistors in series, and turning the knob moves the cut. Two resistors in series with a voltage across them make a voltage divider.

Inside a rotary potentiometer, the wiper on the shaft slides along a curved resistive track; pins 1 and 3 connect to the track's ends and pin 2 to the wiper. As a circuit symbol, pin 3 goes to 3.3 V, pin 1 to GND and pin 2, the wiper, to an ESP32 analog pin, so pin 2 voltage = 3.3 V × R2 ÷ (R1 + R2): 0 V at the ground end, 1.65 V halfway and 3.3 V at the supply end.
Inside a rotary potentiometer, the wiper on the shaft slides along a curved resistive track; pins 1 and 3 connect to the track's ends and pin 2 to the wiper. As a circuit symbol, pin 3 goes to 3.3 V, pin 1 to GND and pin 2, the wiper, to an ESP32 analog pin, so pin 2 voltage = 3.3 V × R2 ÷ (R1 + R2): 0 V at the ground end, 1.65 V halfway and 3.3 V at the supply end.

The voltage divider formula

SparkFun's voltage divider tutorial (opens in a new tab) gives the formula as Vout = Vin × R2 ÷ (R1 + R2). For a potentiometer, R2 is the part of the track between the wiper and ground, and R1 is the part between the wiper and the supply. R1 + R2 is always the full value. So the formula becomes:

Vout = Vin × (wiper-to-ground resistance ÷ full value)

The same tutorial notes that with the wiper in the middle, the output is half the input. The guide to the voltage divider formula and its sensor uses goes deeper. If volts are new, read what voltage is, explained simply first.

Worked example: a 10 kΩ potentiometer on 3.3 V

Wire pin 1 to ground and pin 3 to 3.3 V, the voltage an ESP32 runs on. Then turn the knob through five positions. These are ideal values for a linear potentiometer, worked out with the formula above.

Wiper position, from the ground end
At the ground end
Wiper to ground (R2)
0 Ω
Wiper to 3.3 V (R1)
10 kΩ
Middle pin: 3.3 × R2 ÷ 10 kΩ
0 V
Wiper position, from the ground end
A quarter of the way
Wiper to ground (R2)
2.5 kΩ
Wiper to 3.3 V (R1)
7.5 kΩ
Middle pin: 3.3 × R2 ÷ 10 kΩ
0.825 V
Wiper position, from the ground end
Halfway
Wiper to ground (R2)
5 kΩ
Wiper to 3.3 V (R1)
5 kΩ
Middle pin: 3.3 × R2 ÷ 10 kΩ
1.65 V
Wiper position, from the ground end
Three quarters of the way
Wiper to ground (R2)
7.5 kΩ
Wiper to 3.3 V (R1)
2.5 kΩ
Middle pin: 3.3 × R2 ÷ 10 kΩ
2.475 V
Wiper position, from the ground end
At the supply end
Wiper to ground (R2)
10 kΩ
Wiper to 3.3 V (R1)
0 Ω
Middle pin: 3.3 × R2 ÷ 10 kΩ
3.3 V

Notice that 10 kΩ cancels out. A 1 kΩ or a 100 kΩ potentiometer gives the same voltages. The value changes the current instead. By Ohm's law, a 10 kΩ track on 3.3 V carries 3.3 ÷ 10,000 = 0.00033 A, or 0.33 mA, whatever the knob's position. A 1 kΩ track would carry ten times as much. Arduino's own AnalogReadSerial example (opens in a new tab) uses a 10 kΩ potentiometer, which is a sensible middle choice.

Real parts are not perfect. The PTV09 datasheet (opens in a new tab) gives a standard tolerance of ±20% on the full value and a residual resistance of 500 ohms or ±1% at most. So a "10 kΩ" part can measure anywhere from 8 to 12 kΩ, and the wiper never quite reaches zero at the ends. The voltage at each position stays close to the table, because both halves of the track change together.

Potentiometer vs variable resistor vs rheostat

Every potentiometer is a variable resistor. What changes is how many pins you use.

With all three pins, it divides a voltage. That is what a microcontroller needs, because an analog pin measures voltage, not resistance. With only the wiper and one end connected, it becomes a simple variable resistor, often called a rheostat, and it changes how much current flows. DigiKey's complete guide to potentiometers (opens in a new tab) describes a rheostat as a two-terminal device for current control, usually high-wattage and wire-wound, and notes that a potentiometer can act as one if a terminal is left unconnected.

Pins used
Potentiometer (3 pins)
Both ends and the wiper
Rheostat or variable resistor (2 pins)
The wiper and one end
Trimmer (3 pins, set once)
Both ends and the wiper
What it sets
Potentiometer (3 pins)
A voltage, from 0 to the supply
Rheostat or variable resistor (2 pins)
A current, by adding resistance
Trimmer (3 pins, set once)
A voltage or a resistance for calibration
Current through it
Potentiometer (3 pins)
Small, set by the full track
Rheostat or variable resistor (2 pins)
The whole load current
Trimmer (3 pins, set once)
Small
Typical job
Potentiometer (3 pins)
A knob a microcontroller reads
Rheostat or variable resistor (2 pins)
Older speed and brightness controls
Trimmer (3 pins, set once)
Fine-tuning inside a device

The Wikipedia potentiometer article (opens in a new tab) describes trimmers as meant to be adjusted only when the equipment is calibrated during manufacture or repair.

Types of potentiometers, and the two main types

The two main types are rotary and linear. DigiKey's guide to potentiometers (opens in a new tab) splits mechanical potentiometers into rotary ones, which turn on a shaft, and linear ones, which slide. It also names shaftless trimmers, adjusted with a screwdriver, and digital potentiometers, which are chips. Those four make the usual answer to "what are the four types of potentiometers".

Type
Rotary potentiometer
How you adjust it
Turn a knob on a shaft
Example from a datasheet
Bourns PTV09 (opens in a new tab): 280° ±10° mechanical angle, 10,000-cycle rotational life, 0.05 W
Where you meet it
Volume knobs, speed and brightness knobs, game controllers
Type
Slide (linear) potentiometer
How you adjust it
Push a slider in a straight line
Example from a datasheet
Same track inside, laid out straight
Where you meet it
Faders on mixing desks and lighting desks
Type
Trimmer (trimpot, preset)
How you adjust it
A screwdriver slot or a tiny knob
Example from a datasheet
Bourns 3362 (opens in a new tab): 270° mechanical angle, 200-cycle rotational life
Where you meet it
Calibration on circuit boards; the MakerBuddy knob is a small trimmer-style knob
Type
Digital potentiometer (digipot)
How you adjust it
Commands from a microcontroller
Example from a datasheet
A chip with no moving parts
Where you meet it
Volume and settings changed by software

Look at the rotational life. The panel potentiometer in that table is rated for 10,000 cycles and the trimmer for 200. Trimmers are built to be set, not twiddled all day. That is one reason to turn a small board knob gently.

The four types of potentiometer side by side: a rotary pot you turn on a shaft, met in volume, speed and brightness knobs; a slide pot you push in a straight line, met in faders on mixing desks; a trimmer set with a screwdriver slot or tiny knob, met in calibration on circuit boards; and a digital pot chip set by commands from a microcontroller. Rotary and slide are the two main types.
The four types of potentiometer side by side: a rotary pot you turn on a shaft, met in volume, speed and brightness knobs; a slide pot you push in a straight line, met in faders on mixing desks; a trimmer set with a screwdriver slot or tiny knob, met in calibration on circuit boards; and a digital pot chip set by commands from a microcontroller. Rotary and slide are the two main types.

Linear and audio (log) taper

The taper is the shape of the change as you turn. In a linear taper, equal turns give equal changes. DigiKey's potentiometer guide (opens in a new tab) says that at the mid-position a linear part has half its full-scale resistance. In a logarithmic or audio taper, the change is slow at first and fast near the end. That suits volume controls, because our ears do not hear loudness in a straight line. The Wikipedia article (opens in a new tab) gives the goal: on a volume knob marked 0 to 10, a setting of 5 should sound about half as loud as 10.

For anything a microcontroller reads as a position, choose linear. An audio-taper part gives a reading that crawls for most of the turn and then rushes.

How to read the markings on a potentiometer

Most parts carry a three-digit resistance code: two digits, then the number of zeros. The PTV09 datasheet's resistance table (opens in a new tab) lists 103 as 10,000 Ω and 503 as 50,000 Ω. A letter often shows the taper, but it is not a world standard. The Wikipedia marking table (opens in a new tab) shows parts from Asia and the US using A for logarithmic and B for linear, while European parts often use A for linear. So "B103" or "B10K" usually means a 10 kΩ linear part from an Asian maker. When it matters, check the datasheet.

How a microcontroller reads a potentiometer

A microcontroller cannot see where a knob is pointing. It measures the voltage on the middle pin with its analog-to-digital converter, or ADC, and turns that voltage into a number. The difference between a smooth voltage and on/off values is the subject of analog vs digital signals.

On an Arduino UNO, Arduino's AnalogReadSerial tutorial (opens in a new tab) wires one outer pin to ground, the other to 5 V and the middle pin to A0. It reads 0 when the shaft is turned all the way one way and 1023 when it is turned all the way the other way.

The ESP32 works at 3.3 V and reads more finely. Espressif's Arduino-ESP32 ADC reference (opens in a new tab) says analogRead() returns a 12-bit value from 0 to 4095 by default. Two ESP32 details matter for a potentiometer:

  • Use an ADC1 pin. Espressif's ESP-IDF GPIO reference (opens in a new tab) states that ADC2 pins cannot be used when Wi-Fi is used. GPIO 32 to 39 are on ADC1. The same page lists GPIO 34 to 39 as input only, which is fine for reading a knob.
  • Expect flat ends. The Arduino core's default attenuation is 11 dB, set in the core's esp32-hal-adc.c source (opens in a new tab). For that setting, the ADC reference (opens in a new tab) gives a measurable input range of 150 mV to 3100 mV on the classic ESP32. Below about 0.15 V the reading stays at 0, and above about 3.1 V it stays at 4095. So the last bit of the turn at each end changes nothing. That is normal.

The guide to the ESP32 ADC and reading analog sensors accurately covers calibration and noise in more depth.

Worked example: from raw number to percent, brightness and angle

Raw numbers from 0 to 4095 are awkward to use. Arduino's map() function rescales them. The Arduino map() reference (opens in a new tab) gives the whole function:

cpp
long map(long x, long in_min, long in_max, long out_min, long out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

The same page warns that map() uses integer maths, so fractions are cut off, not rounded. Take a knob near halfway that reads 2048:

  • As 0 to 100: 2048 × 100 ÷ 4095 = 50.01, so 50.
  • As a servo angle, 0 to 180: 2048 × 180 ÷ 4095 = 90.02, so 90°.
  • As LED brightness, 0 to 255: 2048 × 255 ÷ 4095 = 127.53, so 127, not 128.

These are the same numbers the MakerBuddy board works out, as Lesson 9, Analog Inputs shows.

A sketch that steers a servo with a potentiometer

This Arduino sketch reads a potentiometer on GPIO 34 and moves an SG90 servo on GPIO 19, the MakerBuddy board's servo socket. It is written for the Arduino-ESP32 core 3.x, which drives pulses with ledcAttach() and ledcWrite().

cpp
// Knob to servo for the MakerBuddy board (Arduino-ESP32 core 3.x).
// Uploading this replaces the MakerBuddy firmware until you upload it again.

const int KNOB_PIN = 34;    // the knob's middle pin (wiper), an ADC1 pin
const int SERVO_PIN = 19;   // the SG90's signal wire
const int DEADBAND = 3;     // ignore changes smaller than 3 degrees

int lastAngle = -1;

int readKnob() {
  long total = 0;
  for (int i = 0; i < 4; i++) {
    total += analogRead(KNOB_PIN);  // each read is 0 to 4095
  }
  return total / 4;                 // the average of four reads
}

void setServoAngle(int angle) {
  int pulseUs = map(angle, 0, 180, 500, 2500);         // 0.5 ms to 2.5 ms
  uint32_t duty = (uint32_t)pulseUs * 65535 / 20000;   // share of a 20 ms frame
  ledcWrite(SERVO_PIN, duty);
}

void setup() {
  Serial.begin(115200);
  ledcAttach(SERVO_PIN, 50, 16);    // 50 pulses a second, 16-bit duty
}

void loop() {
  int raw = readKnob();
  int percent = map(raw, 0, 4095, 0, 100);
  int angle = map(raw, 0, 4095, 0, 180);

  if (lastAngle < 0 || abs(angle - lastAngle) >= DEADBAND) {
    setServoAngle(angle);
    lastAngle = angle;
  }

  Serial.printf("raw %4d   knob %3d   servo %3d degrees\n", raw, percent, lastAngle);
  delay(100);
}

What each part does, and why:

  • Four reads, averaged. One ADC read wobbles a little. Averaging four steadies it. The MakerBuddy firmware does the same.
  • The deadband. Without it, a flickering reading makes the servo twitch. Ignoring changes under 3° stops that. The board's own knob-to-servo link uses a 3° deadband too.
  • The pulse. A servo reads the width of a pulse sent 50 times a second, so each frame is 20 ms. The sketch maps 0° to 180° onto 500 to 2500 microseconds, the range the board's firmware uses. Who controls the board's servo, and when, is explained in servo control on the technical details page. With 16-bit duty, 1500 microseconds works out as 1500 × 65535 ÷ 20000 = 4915.
  • The serial line. Open the Serial Monitor at 115200 baud to watch the numbers and see the flat ends for yourself.

Uploading any sketch replaces the MakerBuddy firmware. To get the dashboard and rules back, upload the firmware again, as updating the board explains.

The MakerBuddy knob: a potentiometer on GPIO 34

The turning knob is built into the MakerBuddy IoT Kit V1.0 board, next to the 34-Potentio label, so there is nothing to wire. The board comes in purple or green, and both colours are the same board. Here is what the board does with it:

  • Reads it on GPIO 34, an ADC1 pin, so it keeps working while the board is on Wi-Fi.
  • Averages four reads and scales them to 0–100, once a second. The dashboard's Potentiometer card shows that number and updates about every 2 seconds.
  • Lets rules test it. In the rule editor it appears as Potentiometer, a sensor like any other.
  • Shows it on the text screen. Type {pot} into the 1602 screen's custom text and it shows the live value.

One honest quirk. As Lesson 9 explains, the knob on the V1.0 board runs from 5 V. Near the end of its turn, that is more than the ESP32's converter can measure, so the reading can reach 100 before the knob reaches the end. It is the supply, not a broken knob. The visual guide to the types of sensors used in student projects shows where the knob fits among the kit's other inputs.

What the knob can control

The dashboard's Potentiometer Mapping card links the knob straight to one output. You choose one of four settings:

Setting
None
What turning the knob does
Nothing. The knob is only read
Output range
Not used
Setting
LED PWM
What turning the knob does
Makes the blue light dimmer or brighter
Output range
0 to 255
Setting
RGB LED
What turning the knob does
Moves the colour light through red, yellow, green, cyan, blue and magenta
Output range
0 to 100, turned into a colour
Setting
Servo
What turning the knob does
Turns the servo motor
Output range
0° to 180°

The full rules for this card are in the knob and motor settings. Two are worth knowing before you start. Each time the board restarts, the knob goes back to None, on purpose, so a motor never moves by surprise. And if a running rule is using the same part, you cannot pick that part until the rule lets go of it.

Worked example: steer the servo with the knob, no code

This is the MakerBuddy angle on the whole post: the board's potentiometer, read as 0 to 100, turning a motor. It follows Lesson 9, Analog Inputs.

  1. 1

    Unplug the USB cable.

    Plug the SG90 servo into the socket marked 19. It fits only one way, so never force it.

  2. 2

    Plug the USB cable back in.

    When the board starts, the servo turns to 0°.

  3. 3

    Open the dashboard and connect

    to your board.

  4. 4

    Find the Potentiometer Mapping card and choose Servo.

    The Servo Motor card now locks and says "Potentiometer mapping owns the servo."

  5. 5

    Turn the knob slowly from one end to the other.

    Keep your fingers clear of the servo arm.

  6. 6

    Predict, then check.

    Before each turn, work out the angle with the sum from the worked example above. Then compare.

Potentiometer card
0
LED PWM setting
0 (off)
Servo setting
0°
Potentiometer card
25
LED PWM setting
about 64
Servo setting
about 45°
Potentiometer card
50
LED PWM setting
about 128
Servo setting
90°
Potentiometer card
75
LED PWM setting
about 191
Servo setting
about 135°
Potentiometer card
100
LED PWM setting
255 (full)
Servo setting
180°

What you will notice, and why:

  • The servo moves in steps, about once a second. The board updates the link once a second. The servo then glides to the new angle over half a second.
  • Tiny turns do nothing. The board ignores changes smaller than 3°, so the motor does not buzz while the knob sits still.

The servo also has a potentiometer inside it. The knob you turn sets the target angle. The servo's own potentiometer, fixed to its output shaft, reports the angle the shaft has really reached, and its circuit drives the motor until the two match. The guide that explains how a servo motor works and what its three wires do shows that loop, and Lesson 14, Introduction to Motors builds on it.

With Potentiometer Mapping set to Servo, the MakerBuddy board reads the knob on GPIO 34, averages four reads of 0 to 4095, maps the value to 0 to 180° (knob 50 gives 90°), and once a second ignores changes under 3° and glides the SG90 in socket 19 to the new angle over 0.5 s. Inside the servo, a second potentiometer on the output shaft reports the real angle, and the servo's circuit drives the motor until it matches the target.
With Potentiometer Mapping set to Servo, the MakerBuddy board reads the knob on GPIO 34, averages four reads of 0 to 4095, maps the value to 0 to 180° (knob 50 gives 90°), and once a second ignores changes under 3° and glides the SG90 in socket 19 to the new angle over 0.5 s. Inside the servo, a second potentiometer on the output shaft reports the real angle, and the servo's circuit drives the motor until it matches the target.

Use the knob to test a rule

The knob is the easiest sensor for testing a rule, because you can make the condition true or false with one finger. Here is a rule written step by step:

  1. 1

    Name

    Knob alarm.

  2. 2

    Mode

    Condition.

  3. 3

    When

    Potentiometer is greater than 80.

  4. 4

    Step 1

    Colour light red, wait 0 seconds.

  5. 5

    Step 2

    Buzzer on, wait 0.5 seconds.

  6. 6

    Step 3

    Buzzer off, wait 1 second.

  7. 7

    Step 4

    Colour light off, wait 0 seconds.

Turn the knob past 80. The match has to hold for 0.3 seconds before the rule starts, and then the board flashes red and beeps each round while the knob stays high. Turn it back below 80 and the rule finishes its round, then stops. The automation rules reference gives every option. Splitting the knob's turn into zones is the job of Lesson 27, Range Logic.

The knob is built into every MakerBuddy IoT Kit, with the servo and the other plug-in parts in their own labelled sockets.

What potentiometers are used for

The uses fall into three groups.

  • Controls you turn or slide. Volume and tone knobs, often with an audio taper. Brightness and speed knobs. Faders on mixing desks.
  • Position sensors. The Wikipedia potentiometer article (opens in a new tab) lists joysticks among the uses and describes potentiometers as position feedback in servo control. A hobby servo, like the kit's SG90, works this way.
  • Settings inside a device. Trimmers set once during manufacture or repair, then left alone.

What they have in common: a person or a mechanism sets a position, and a circuit needs to know it as a voltage. More electronics basics like this are on the MakerBuddy blog.

How to test a potentiometer

You need a multimeter set to resistance (Ω). Do this with the part out of the circuit, or with its power off. The beginner's guide to using a multimeter explains the meter itself.

  1. 1

    Measure across the two outer pins.

    You should see roughly the marked value. A part marked 10 kΩ with a ±20% tolerance, like the PTV09 (opens in a new tab), can read anywhere from 8 to 12 kΩ. An open circuit (OL on most meters) means the track is broken.

  2. 2

    Measure from the middle pin to one end while turning slowly.

    The reading should rise or fall smoothly across the whole turn.

  3. 3

    Measure from the middle pin to the other end.

    It should move the opposite way, and the two readings should add up to about the outer value.

A bad potentiometer shows itself in step 2. The reading jumps, flickers, or drops to OL for part of the turn. That usually means a worn or dirty track. On an audio system you would hear it as a crackle when you turn the knob.

On the MakerBuddy board, the dashboard is your meter. Turn the knob from end to end and watch the Potentiometer card. It should pass through many small steps, not just two values like a button. If it is stuck at one number, see the mistakes below before you blame the knob.

Common potentiometer mistakes, with causes and fixes

The reading never changes

Cause: the middle pin is not the one going to the analog input. If an outer pin goes to the input, it sits at ground or the supply whatever you do. Fix: wire the middle pin, the wiper, to the analog pin, and the two outer pins to ground and the supply.

The reading goes the wrong way

Cause: the outer pins are swapped, so clockwise lowers the number. Fix: swap the two outer wires. Or reverse it in code: the Arduino map() reference (opens in a new tab) notes that the lower bound of a range may be larger than the upper one, so map(raw, 0, 4095, 100, 0) flips the direction.

The last part of the turn does nothing

Cause: the ADC's measurable range, which on the ESP32 at 11 dB stops at about 3.1 V according to the Arduino-ESP32 ADC reference (opens in a new tab). On the MakerBuddy V1.0 board, the knob's 5 V supply adds to the effect at the top end. Fix: nothing is broken. Use the number you see, not the knob's angle.

The reading drops to nothing once Wi-Fi starts

Cause: the potentiometer is on an ADC2 pin. Espressif's GPIO reference (opens in a new tab) says ADC2 pins cannot be used when Wi-Fi is used. Fix: move it to an ADC1 pin, GPIO 32 to 39. The MakerBuddy knob is on GPIO 34 for this reason.

The potentiometer got hot dimming a lamp or a motor

Cause: it was used as a rheostat, with the whole load current going through the track. Small potentiometers handle very little power. The PTV09 (opens in a new tab) is rated at 0.05 W. Say only 100 Ω of track is left in a 5 V circuit: the current is 5 ÷ 100 = 0.05 A, and the power is 5 × 0.05 = 0.25 W, five times the rating. Fix: let the potentiometer set a signal, and let a transistor or PWM handle the load. The guide to PWM and dimming an LED shows how.

FAQ

What is a potentiometer in simple words?

A potentiometer is a knob or slider that gives out a voltage matching its position. Inside, a sliding contact moves along a strip of resistive material between two pins. The middle pin picks off part of the voltage across the strip: none at one end, all of it at the other.

Is a potentiometer a variable resistor?

Yes. It is a variable resistor with a third pin on the wiper. With all three pins it divides a voltage, which is what a microcontroller can read. With only two pins it acts as a plain variable resistor that changes a current.

What are the two main types of potentiometers?

Rotary and linear. A rotary potentiometer turns on a shaft, like a volume knob, and a linear one slides in a straight line, like a fader. Lists of four types usually add trimmers, set with a screwdriver, and digital potentiometers, which are chips controlled by a microcontroller.

How do I know if my potentiometer is bad?

Measure it with a multimeter set to resistance. Across the outer pins it should read close to its marked value. From the middle pin to one end, the reading should change smoothly as you turn. Jumps, flickers or an open circuit at some point in the turn mean a worn or broken track.

Does a potentiometer control voltage or current?

Wired with all three pins, it controls a voltage: the middle pin gives out a share of the supply. Wired with two pins as a rheostat, it changes resistance and so the current. Small potentiometers are rated for very little power, so use them to set a signal, not to carry a motor's or a lamp's current.

What do the three pins on a potentiometer do?

The two outer pins connect to the ends of the resistive track. One goes to ground and the other to the supply. The middle pin connects to the wiper and gives out the voltage that matches the knob's position.

Sources

Keep reading

Electronics Basics

Analog vs Digital Signals: The Difference Every Maker Should Know

An analog signal can take any value in a range; a digital signal has a fixed set of values, usually just HIGH and LOW. See the two side by side, how a microcontroller reads each, and every sensor in a student kit sorted into one group or the other.

20 min read

Electronics Basics

What Is Current? Electric Current, Amps and Why It Matters

Electric current is the flow of charge around a circuit, measured in amps. Learn what an amp is, AC vs DC, the currents you meet every day, and why a tiny chip pin needs help to run a relay or a motor.

20 min read

Electronics Basics

What Is Resistance? And What a Resistor Actually Does

Resistance is how strongly something slows an electric current, measured in ohms. Learn what a resistor actually does, how to read its value, and where every resistor sits on the MakerBuddy board.

20 min read

Learn with MakerBuddy

32 free lessons, one kit, no wiring to start.

Every part in these guides has its own lesson. Read them free, or get a kit for your class.