Potentiometer
10 kΩ variable resistor
A resistor with a slider. Turning it changes how much voltage comes out of the middle pin — from 0 to 3.3 V. Ideal for learning analog reading (ADC).
Open the course →How it works
The outer pins (1 and 3) connect to 3V3 and GND — a small current flows through the whole resistor. The middle pin (W, wiper) slides along the resistor and "picks up" a voltage proportional to its position: 0 V at one end, 1.65 V in the middle, 3.3 V at the other end. The ESP32 converts that voltage with analogRead() into a number 0–4095 (12 bits).
Pins and wiring
| Pin | What it is | Where it connects / why |
|---|---|---|
| Pin 1 | End of the resistor | → GND (or 3V3; if you swap, only the direction of rotation inverts). |
| Pin 2 (W, wiper) | Middle — output voltage | → ADC pin on the ESP32 (e.g. GPIO 34). |
| Pin 3 | The other end | → 3V3. NEVER 5 V — the ADC tolerates max 3.3 V. |
Specifications
Resistance10 kΩ (B10K = linear)
Power0.1 W
Angle~300°
Output0 – 3.3 V
ADC resolution4096 steps (~0.8 mV)
Tips and typical mistakes
- The ESP32 ADC is not quite linear in the outer 5 % — values 0–100 and 3950–4095 "stick". That is normal.
- If the value "jumps", put 100 nF between wiper and GND or average 10 readings.
- Use ADC1 pins (32–39) if you plan WiFi in the same project.