Learn

Arduino Uno pinout: every pin on the R3, and the chip pin behind it

Beginner

Or see every lesson.

  • 455parts on the bench
  • 43boards running now
  • 1.00xreal time, on every board
Arduino Uno: a knob on A0live0.000 s 0.00x
Click to open it in the editor
A potentiometer on A0 sets the brightness of an LED on PWM pin 9, with the reading printed.

This is the pinout of the Arduino Uno R3, the board most kits ship, with an ATmega328P in a socket and a second chip, an ATmega16U2, between it and the USB port. Every hole on its two headers is in the table below with the chip pin behind it, what it can do and what to watch for. After the table come the power pins and their limits, the PWM pins and the timers behind them, Serial, I2C, SPI and the ICSP headers, and a list of which pin to use for what.

The circuit above is an Uno in Mokxi with a potentiometer on A0 setting the brightness of an LED on pin 9, with the reading printed. The table is read from the same board model the simulator runs, and where the simulator does less than the board, the page says so. The Uno R4 keeps these holes and changes the chip behind them; its pinout is linked at the end.

Every pin, with its ATmega328P pin

The top header reads, left to right, SCL, SDA, AREF, GND, then 13 down to 0. The bottom header reads IOREF, RESET, 3V3, 5V, GND, GND, VIN, then A0 to A5. SDA and SCL beside AREF are the same two traces as A4 and A5, added on the R3 so that a shield finds I2C in the same place on every board. Pins 0 to 7 are port D, 8 to 13 are port B and A0 to A5 are port C, which is what a sketch that writes PORTB itself needs to know.

In code, digital pins are their numbers and the analog pins are A0 to A5, which are also digital pins 14 to 19. The Nano is the same chip with the same numbers, plus A6 and A7.

Arduino Uno R3: the top header left to right, then the bottom
PinChip pinWhat it can doWatch out for
SCLPC5I2C SCL: the same trace as A5.Used by any I2C device.
SDAPC4I2C SDA: the same trace as A4.Used by any I2C device.
AREF-The analog reference input.Not a GPIO. Never above 5 V.
GND-Ground. Three holes.-
13PB5Digital. SPI SCK, also on the ICSP header. The L LED, lit when HIGH.-
12PB4Digital. SPI MISO, also on the ICSP header.-
11PB3PWM on timer 2, 490 Hz. SPI MOSI, also on the ICSP header.tone() takes timer 2 on a real board.
10PB2PWM on timer 1, 490 Hz. SPI SS.The Servo library takes timer 1 on a real board.
9PB1PWM on timer 1, 490 Hz.The Servo library takes timer 1 on a real board.
8PB0Digital.-
7PD7Digital.-
6PD6PWM on timer 0, 976 Hz.Timer 0 also runs millis().
5PD5PWM on timer 0, 976 Hz.Timer 0 also runs millis().
4PD4Digital.-
3PD3PWM on timer 2, 490 Hz. INT1: attachInterrupt.tone() takes timer 2 on a real board.
2PD2Digital. INT0: attachInterrupt.A good first choice for a button.
1PD1TX: Serial out, to the USB-to-serial chip.Leave free, or uploads and the serial monitor break.
0PD0RX: Serial in, from the USB-to-serial chip.Leave free, or uploads and the serial monitor break.
IOREF-Tells a shield the board’s logic level: 5 V.Not a GPIO.
RESETPC6Reset: low restarts the chip, as the button does.Not a GPIO.
3V3-A small 3.3 V output for a sensor, 50 mA at most.Not for a motor or a servo.
5V-5 V out, from USB or the regulator.Not a GPIO.
VIN-Power in for the onboard regulator, 7 to 12 V.Mokxi ignores it; the board is on USB.
A0PC0Analog. Digital 14.-
A1PC1Analog. Digital 15.-
A2PC2Analog. Digital 16.-
A3PC3Analog. Digital 17.-
A4PC4Analog. Digital 18. I2C SDA.Used by any I2C device.
A5PC5Analog. Digital 19. I2C SCL.Used by any I2C device.

Power pins and their limits

VIN feeds the onboard 5 V regulator, as the barrel jack does, and Arduino recommends 7 to 12 V there. 5V is the regulated rail, from the USB socket or from the regulator, and a clean 5 V put on it powers the board too. 3V3 comes from a small regulator of its own, rated at 50 mA, which is enough for a sensor and no use for a motor. IOREF tells a shield the logic level, 5 V on this board. The three GND holes are one ground.

Arduino rates each pin at 20 mA, and the ATmega328P’s absolute maximum is 40 mA per pin and 200 mA for the whole chip. In Mokxi the board is always powered from USB, VIN is an input it ignores, and the 5 V rail is an ideal source that cannot sag, so a circuit that would brown a real Uno out runs cleanly here.

PWM pins and their timers

Pins 3, 5, 6, 9, 10 and 11 do PWM with analogWrite, and the silkscreen marks them with a tilde. Each pair shares a timer: 5 and 6 are timer 0 at 976 Hz, 9 and 10 are timer 1, and 3 and 11 are timer 2, both at 490 Hz. Mokxi runs them on the same timers at the same rates.

The timers explain two things that catch people on a real Uno. The Servo library takes timer 1, so analogWrite on 9 and 10 stops working while a servo is attached. And tone() takes timer 2, so a buzzer playing a note stops PWM on 3 and 11.

Serial, the USB chip, I2C, SPI and the ICSP headers

Pins 0 and 1 are the hardware serial port, and on a real Uno they go to the ATmega16U2, which turns them into USB. Anything wired to them can stop an upload, so leave them free. Mokxi does not model the 16U2: Serial reaches the serial monitor directly.

I2C is A4 for SDA and A5 for SCL, and the SDA and SCL holes by AREF carry the same two signals. SPI is 10, 11, 12 and 13 for SS, MOSI, MISO and SCK. The six-pin ICSP header at the far end of the board carries MISO, SCK, MOSI, RESET, 5V and GND, the same SPI signals, for programming the ATmega328P directly; the second ICSP header, by the USB socket, is the 16U2’s. In Mokxi both buses run in software on their pins, because the chip’s I2C and SPI blocks are not modeled, and the ICSP headers are not drawn as pins.

Interrupts, the analog pins, and the R4

attachInterrupt works on pins 2 and 3, INT0 and INT1, and Mokxi models both, with the pin-change interrupts behind every other pin. Every analog pin reads ten bits, 0 to 1023, against the 5 V rail unless AREF says otherwise. Mokxi’s converter has no noise in it, so a divider reads the same count every time where a real one wobbles by one or two.

The Uno R4 Minima and WiFi keep every one of these holes and change what is behind them: a Renesas RA4M1, 8 mA per pin instead of 20, Serial on the USB socket and Serial1 on pins 0 and 1. A shield fits both boards; a compiled R3 program runs only on the R3.

Questions

Which Arduino Uno pins are PWM?

Pins 3, 5, 6, 9, 10 and 11, the six with a tilde. 5 and 6 run at 976 Hz and the other four at 490 Hz.

What are the Arduino Uno I2C pins?

A4 is SDA and A5 is SCL. The SDA and SCL holes beside AREF are the same two traces, so a shield can use either. `Wire.begin()` uses them.

Which pins are SPI on an Arduino Uno?

SS is 10, MOSI is 11, MISO is 12 and SCK is 13. The last three are on the ICSP header too.

Which Uno pin should I use for a button?

Pin 2 or 3 if you want an interrupt, otherwise any of 4, 7, 8 or 12, with `INPUT_PULLUP` and the button to ground. Not 0 or 1, which are Serial.

How much current can an Arduino Uno pin supply?

20 mA is the figure to design for, and 40 mA is the absolute maximum, past which the pin is damaged. The whole chip may pass 200 mA, so a row of LEDs at 20 mA each runs out quickly.

What voltage can I put on the Uno’s VIN pin?

7 to 12 V, which Arduino recommends. A 9 V supply works; below 7 V the regulator cannot make a steady 5 V, and above 12 V it gets hot.

Can I use the Uno’s analog pins as digital pins?

Yes. A0 to A5 are digital pins 14 to 19, so `digitalWrite(A0, HIGH)` works. The Uno has no A6 and A7; those are the Nano’s.

Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.