Pandabyte Potentiometer Module: Analog Input Guide
by pandabyte in Circuits > Arduino
39 Views, 0 Favorites, 0 Comments
Pandabyte Potentiometer Module: Analog Input Guide
Pandabyte Potentiometer Module is a simple input module used for learning analog input control with microcontrollers such as Arduino compatible boards, ESP32, or Raspberry Pi Pico.
The module uses a 10KΩ rotary potentiometer that outputs a variable analog voltage based on knob rotation.
A key feature of this module is that it supports two connection methods:
- Traditional 3-pin header for standard jumper-wire connections
- OR
- 4-pin Grove connector for quick plug-and-play prototyping without complex wiring
In this guide, you will learn:
- Module pin configuration
- Analog input reading
- Voltage level monitoring
- Circuit connections and Arduino programming examples
Supplies
Hardware:
- PandaByte Potentiometer Module
- Development Board (We will use PandaByte xC3m ESP32C3 Dev board)
- Grove Shield/Expansion Board
- Cables: Dupont, USB, and Grove
Software:
- Arduino IDE
Circuit Connections
Perform the connection based on the table.
Programming
Program 1: Read the potentiometer analog value and display it on Serial Monitor.
int potPin = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
int potValue = analogRead(potPin);
Serial.print("Potentiometer Value: ");
Serial.println(potValue);
delay(200);
}
Program 2: Display Voltage Level Convert the analog reading into voltage.
int potPin = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
int potValue = analogRead(potPin);
float voltage = (potValue / 4095.0) * 3.3;
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
delay(200);
}
Output
Program 1: Read Analog Value
- The Serial Monitor will display changing ADC values as the knob is rotated.
- Typical range:
- 0 → Minimum rotation
- 4095 → Maximum rotation (ESP32 12-bit ADC)
Program 2: Display Voltage Level
- The Serial Monitor will display the output voltage of the potentiometer.
- Voltage changes continuously as the knob rotates.
Important Info
- The module uses a 10KΩ potentiometer.
- The output is an analog voltage between GND and VCC.
- The IN pin must be connected to an ADC-capable GPIO pin.
- ADC resolution depends on the microcontroller:
- ESP32 commonly uses 12-bit ADC (0–4095)
- Arduino UNO uses 10-bit ADC (0–1023)
- Not all GPIO pins support analog input. Verify the board pinout before use.