A potentiometer, informally a pot, is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor or rheostat
The measuring instrument called a potentiometer is essentially a voltage divider used for measuring electric potential (voltage); the component is an implementation of the same principle, hence its name.
Potentiometers are commonly used to control electrical devices such as volume controls on audio equipment. Potentiometers operated by a mechanism can be used as position transducers, for example, in a joystick. Potentiometers are rarely used to directly control significant power (more than a watt), since the power dissipated in the potentiometer would be comparable to the power in the controlled load.
Configuration
Red wire to Arduino VCC
Black Wire to Arduino GND
Green Wire to Arduino A0
int sensorPin = A0; // select the input pin for the potentiometer int ledPin = 9; // select the pin for the LED int sensorValue = 0; // variable to store the value coming from the sensor void setup() { // declare the ledPin as an OUTPUT: pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); Serial.println(sensorValue/4); analogWrite(ledPin,sensorValue/4); delay(700); }