To use a standard 10kΩ linear potentiometer (such as a Bourns 3852A or Alpha B10K) with an Arduino, wire the two outer lugs to 5V and GND, and connect the center wiper pin to an analog input (A0-A5). Before uploading your sketch, verify the carbon track integrity and wiper voltage output using a multimeter. A healthy 10kΩ pot will read exactly 10,000Ω (±20%) across the outer lugs, and sweep smoothly from 0.00V to 5.00V at the wiper when powered.

While copying and pasting analogRead() code is easy, hardware faults and ADC (Analog-to-Digital Converter) noise cause 90% of potentiometer debugging headaches. This guide focuses on the bench-level measurement techniques required to verify your potentiometer is actually working before you blame your code.

Multimeter Setup and Probe Placement

Testing a potentiometer requires two distinct multimeter configurations: a resistance check (unpowered) to verify the carbon track, and a DC voltage check (powered) to verify the wiper output to the Arduino ADC.

⚠️ Safety & CAT Rating Warning: Arduino circuits operate at 5V or 3.3V DC. A CAT I rated multimeter is perfectly safe and sufficient for this low-voltage electronics work. Never set your meter to Ohms (Ω) while the Arduino is powered. Injecting voltage into the meter's resistance test circuit will blow the internal mA fuse or destroy the meter's ADC.

Meter Configuration Block

  • Lead Jacks: Black lead in COM, Red lead in VΩmA.
  • Dial Position 1 (Track Check): Ohms (Ω). Ensure Arduino is completely unpowered (USB unplugged).
  • Range 1: Auto-ranging, or manual 20kΩ setting.
  • Dial Position 2 (Wiper Check): DC Volts (V⎓). Arduino powered via USB or barrel jack.
  • Range 2: Auto-ranging, or manual 20V DC setting.

Probe Placement Guide

  1. Total Resistance: Place probes on Lug 1 and Lug 3 (the outer pins). The center wiper (Lug 2) is ignored for this test.
  2. Track Sweep: Place one probe on Lug 1 and the other on the center Wiper (Lug 2). Slowly rotate the shaft through its full mechanical travel.
  3. Live Voltage Output: Power the Arduino. Place the black probe on the Arduino GND pin (or the pot's GND lug) and the red probe directly on the center Wiper lug or the breadboard node connecting to the analog pin.

Expected Readings: Good vs. Bad Potentiometer Values

Use this reference table to diagnose your component. If your readings fall into the "Bad/Failing" column, replace the potentiometer or check your breadboard connections before troubleshooting your C++ code.

Test Point & Meter Mode Expected Reading (Good) Failing / Bad Reading Common Mistakes Giving Misleading Readings
Lug 1 to Lug 3
(Ohms / Unpowered)
~10.00 kΩ
(Acceptable: 8kΩ - 12kΩ due to 20% tolerance)
OL (Open Loop), 0.00Ω, or wildly fluctuating numbers Measuring while circuit is powered; probes slipping off lugs onto the metal casing.
Lug 1 to Wiper
(Ohms / Unpowered)
Smooth sweep from ~0Ω to ~10kΩ without dropouts Sudden jumps (e.g., 2kΩ instantly jumping to 8kΩ) Dirty carbon track causing wiper bounce; moving the shaft too fast for the meter's sampling rate.
Wiper to GND
(DC Volts / Powered)
Smooth sweep from 0.00V to 5.00V (or 3.3V on 3V3 boards) Voltage stuck at 5V, 0V, or floating randomly (e.g., 1.2V to 3.8V when untouched) Floating GND connection; measuring the wrong pin; using an A-taper (audio) pot and misinterpreting the non-linear curve.

Wiring the Potentiometer and Filtering ADC Noise

Once your multimeter confirms the potentiometer is healthy, wire it to the microcontroller. The Arduino Uno's ATmega328P ADC expects a source impedance of 10kΩ or less to properly charge its internal sample-and-hold capacitor. A standard B10K fits this requirement perfectly.

Hardware Wiring Steps

  1. Insert the B10K potentiometer into the breadboard.
  2. Connect the Left Lug to the Arduino 5V pin (using red jumper wire).
  3. Connect the Right Lug to the Arduino GND pin (using black jumper wire).
  4. Connect the Center Wiper to Arduino analog pin A0 (using yellow or signal jumper wire).
  5. Pro-Tip: Add a 0.1µF ceramic capacitor between the Wiper pin and GND on the breadboard. This hardware low-pass filter physically smooths out high-frequency noise before it reaches the ADC.

Arduino Code with Exponential Moving Average (EMA) Filter

Raw analogRead() values from a potentiometer often jitter by ±2 to ±5 bits due to electromagnetic interference and ADC quantization noise. Instead of relying solely on hardware capacitors, apply an Exponential Moving Average (EMA) filter in software. This provides a rock-solid reading for UI controls or motor speed mapping.

// Pin Definitions
const int POT_PIN = A0;

// Filter Variables
float filteredValue = 0.0;
const float alpha = 0.15; // Smoothing factor (0.0 to 1.0). Lower = smoother but slower response.

void setup() {
  Serial.begin(115200);
  
  // Prime the filter with an initial physical reading to prevent startup lag
  filteredValue = analogRead(POT_PIN);
}

void loop() {
  // 1. Read the raw ADC value (0 to 1023 for 10-bit ADC)
  int rawValue = analogRead(POT_PIN);
  
  // 2. Apply Exponential Moving Average (EMA) filter
  filteredValue = (alpha * rawValue) + ((1.0 - alpha) * filteredValue);
  
  // 3. Map the smoothed 10-bit value to a standard 8-bit PWM range (0-255)
  int pwmOutput = map((int)filteredValue, 0, 1023, 0, 255);
  
  // Output for Serial Plotter debugging
  Serial.print("Raw:");
  Serial.print(rawValue);
  Serial.print(" | Smoothed:");
  Serial.print((int)filteredValue);
  Serial.print(" | PWM:");
  Serial.println(pwmOutput);
  
  delay(20); // 50Hz sample rate
}

FAQ: Troubleshooting Potentiometer and Arduino ADC Issues

Why is my Arduino analogRead jumping randomly with a potentiometer?

Random ADC jumps (often swinging ±10 to ±30 bits) are usually caused by three issues. First, a "floating" ground wire on the breadboard introduces 50/60Hz mains hum into the wiper line. Second, the carbon track inside cheap potentiometers accumulates dust, causing momentary open circuits as the wiper passes over dead spots. Third, the ATmega328P ADC is highly sensitive to source impedance. If you are using a 100kΩ or 1MΩ potentiometer, the internal sample-and-hold capacitor cannot charge fully within the ADC clock cycle, resulting in massive read errors. Always use a 10kΩ B-taper potentiometer for Arduino analog inputs.

Can I use an A-taper (audio) potentiometer instead of a B-taper (linear)?

You can wire it identically, but the data mapping will be non-linear. A B-taper (linear) potentiometer changes resistance at a constant rate relative to shaft rotation, meaning a 50% physical turn yields exactly 2.5V (an ADC reading of ~512). An A-taper (logarithmic/audio) potentiometer changes resistance slowly at one end of the sweep and rapidly at the other. If you use an A-taper for a linear UI control (like a robot arm joint or a linear LED dimmer), the control will feel "dead" for the first half of the twist and hyper-sensitive at the end. Always check the silkscreen on the back of the pot: "B10K" means linear, "A10K" means audio/logarithmic.

How do I wire a potentiometer to an ESP32 without burning out the ADC?

The ESP32's GPIO pins and ADC inputs are strictly 3.3V tolerant. If you wire the outer lugs of a potentiometer to the ESP32's 5V (VIN) pin and sweep the wiper to the maximum, you will feed 5V into a 3.3V ADC pin, which can permanently damage the silicon or cause severe non-linear clipping above ~2.5V due to the ESP32's internal ADC attenuation curve. To use a potentiometer with an ESP32, wire the outer lugs to the 3V3 output pin and GND. Furthermore, the ESP32 ADC is notoriously non-linear at the extremes (near 0V and near 3.3V). For precision ESP32 projects, use a 10kΩ pot but restrict your software mapping to the 10%–90% physical sweep range to avoid the ADC's dead zones.