Introduction: Use Potentiometer Module on Arduino

Potentiometer module using a rotary potentiometer, potentiometer knob that can be changed to adjust the potentiometer resistance.

Step 1: Hardware List and Wiring Ddiagram

Hardware list

Arduino UNO *1

Rotary potentiometer  *1

Male to Female Dupont Line *3

Wiring Diagram as shown:

Step 2: Test Code


int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;

void setup() {
  pinMode(ledPin, OUTPUT); 
  Serial.begin(115200);
}

void loop() {
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue); 
  //Serial.write(sensorValue);
  digitalWrite(ledPin, HIGH); 
  delay(100);         
  digitalWrite(ledPin, LOW);  
  delay(100);                 
}

Step 3: Test Result

By adjust Rotary Potentiometer‘s knob, we can see Arduino A0′s value changed, as shown

Comments

About This Instructable

1,594views

17favorites

License:

More by Yanny Guo:Use pcDuino as Photo Booth ControllerUse Si4703 FM Breakout Board on Arduino UnoUse SIM900 GPRS/GSM Shield on pcDuino
Add instructable to: