Bench NotesUno handbook

Using Analog Pins as Digital Outputs

Why A0–A5 can supply power to a potentiometer, as the workshop projects do, and where the trick stops working.

BeginnerPotentiometerSerial

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 pinConnects toNotes
A0Pot outer legOUTPUT, LOW (0 V)
A2Pot wiperAnalog input
A4Pot outer legOUTPUT, HIGH (5 V)
Wiring for Using Analog Pins as Digital OutputsArduino Uno A0 (LOW) to Potentiometer outer leg; Arduino Uno A2 to Potentiometer wiper; Arduino Uno A4 (HIGH) to Potentiometer outer leg.Connections (each line is one wire)Arduino UnoPotentiometerA0 (LOW)outer legA2wiperA4 (HIGH)outer leg
Original wiring diagram. Each line is one jumper wire; boxes on a line are series resistors.

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

Header placementA 10 kilohm potentiometer with its outer legs in A0 and A4 and its wiper in A2. The sketch drives A0 LOW and A4 HIGH so the pot gets 0 and 5 volts.Arduino Uno R3 — parts plugged straight into the headerGND13121110A0A1A2A3A410 kΩ potentiometerA0 = LOW (0 V), A2 = wiper, A4 = HIGH (5 V)
The potentiometer plugged directly into the analog header.

The sketch

pot_powered_from_pins.ino
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.