A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. It's commonly used to control electrical devices like volume knobs or as a sensor for measuring displacement, position, or voltage. By adjusting the position of the wiper, the output voltage changes, making it useful in both analog circuits and user interfaces for variable control.
Never use as a series resistor in high-power circuits!
Type: | Rotary, linear, digital |
---|---|
Resistance range: | 100 Ω to 10 MΩ |
Resistance tolerance: | ±10% (typical) |
Power rating: | 0.1 – 2 Watts |
Track material: | Carbon, Cermet, Wirewound, Conductive Plastic |
Rotation angle: | 270° (typical), up to 360° or multi-turn |
Life expectancy: | 10000 to 1000000 cycles |
Operating temperature: | -40°C to +125°C |
📄 Potentiometer datasheet (895 kB)
Pin No. | Pin Name | Description |
---|---|---|
1 | Fixed End | This end is connected to one end of the resistive track |
2 | Variable End | This end is connected to the wiper, to provide variable voltage |
3 | Fixed End | This end is connected to another end of the resistive track |
The setup is similar to all the microcontrollers, the PIN X
should be connected
to a analog input pin of the microcontroller.
#define PIN_POT A2
int valueOld = 0, value = 0;
byte sensitivity = 10;
void setup() {
Serial.begin(9600);
}
void loop() {
value = analogRead(PIN_POT);
if (abs(valueOld - value) >= sensitivity) {
valueOld = value;
Serial.println(value);
}
}