Potentiometer

Your pot has a circular 'track' that acts as a resistor, in our case it's a 10 kΩ resistor. However, the difference with a pot, is that there is also a middle connection called the 'slider'. This connection is rotated when you turn the pot. So if you connect one end of the pot to 5V and the other to GND, then the voltage at the slider will vary between 0 and 5V as you turn it.

Experiment:

You can try a little experiment using just the variable resistor also known as a potentiometer (often called a 'pot' for short) and the Arduino Serial Monitor.

 

Connect up your breadboard as shown below:

Load the following code to the Arduino:

int potPin = 0;

 

void setup() 

{

  Serial.begin(9600);

}

 

void loop() 

{

  int reading  = analogRead(potPin);

  Serial.println(reading);

  delay(500);

}

Turn the knob on the variable resistor and you will see the number change between 0 and 1023.

Now open the Serial Monitor, and you will see a stream of numbers appearing.

Other Examples: