Overview
A0–A5 are full digital pins as well as analog inputs. Several workshop projects use that to plug a potentiometer straight into the header with no breadboard: one outer leg in A0 (driven LOW), the wiper in A2, the other outer leg in A4 (driven HIGH).
You will need
- Arduino Uno R3
- 10 kΩ potentiometer with 5 mm leg spacing
Wiring
| Uno pin | Connects to | Notes |
|---|---|---|
| A0 | Pot outer leg | OUTPUT, LOW (0 V) |
| A2 | Pot wiper | Analog input |
| A4 | Pot outer leg | OUTPUT, HIGH (5 V) |
Why it is safe
The current through the pot is 5 V ÷ 10 kΩ = 0.5 mA, about 1/40 of what a pin should supply. The output pins hold their voltage almost perfectly at that load.
Limits
- Use a pot of 5 kΩ or more. A 1 kΩ pot would draw 5 mA; still legal, but the readings drift slightly as the pins sag.
- A4 and A5 are the I²C lines. If a project also uses an I²C display or sensor, choose other pins.
- On the Arduino Nano and Pro Mini, A6 and A7 are analog-only and cannot be outputs.
- Reading A2 next to a pin that switches does not disturb the result in practice, but sensitive analog measurements are better powered from 5V and GND.
Diagram
The sketch
const int POT_LOW_PIN = A0;
const int POT_WIPER_PIN = A2;
const int POT_HIGH_PIN = A4;
void setup() {
pinMode(POT_LOW_PIN, OUTPUT);
pinMode(POT_HIGH_PIN, OUTPUT);
digitalWrite(POT_LOW_PIN, LOW);
digitalWrite(POT_HIGH_PIN, HIGH);
Serial.begin(9600);
}
void loop() {
int reading = analogRead(POT_WIPER_PIN);
Serial.println(reading);
delay(100);
}What you should observe
- The Serial Monitor shows 0 with the knob fully toward A0 and 1023 fully toward A4.
- Open Tools → Serial Plotter for a live graph while you turn it.