The Arduino Uno is the board most people learn on. Its pins are labelled on the board, but the labels don't tell you which ones do PWM, which are shared with USB, or how much current they can take. This page covers all of that for the Uno R3.
Digital pins 0 to 13
| Pin | Extra functions | Notes |
|---|---|---|
| 0 | Serial RX | Shared with the USB serial link. Leave it free while uploading. |
| 1 | Serial TX | Shared with the USB serial link. |
| 2 | Interrupt 0 | Good for buttons and encoders. |
| 3 | PWM, interrupt 1 | |
| 4 | ||
| 5 | PWM | About 980 Hz PWM. |
| 6 | PWM | About 980 Hz PWM. |
| 7 | ||
| 8 | ||
| 9 | PWM | |
| 10 | PWM, SPI SS | |
| 11 | PWM, SPI MOSI | |
| 12 | SPI MISO | |
| 13 | SPI SCK, LED | The on-board "L" LED is connected here. |
PWM pins are marked with a ~ on the board. analogWrite() runs at about 490 Hz on pins 3, 9, 10 and 11, and about 980 Hz on pins 5 and 6.
Analogue pins A0 to A5
A0 to A5 read voltages from 0 to 5 V with a 10-bit ADC, so analogRead() returns 0 to 1023. They also work as ordinary digital pins. A4 is I²C SDA and A5 is I²C SCL. On the R3, the same two signals also appear on the two pins beside AREF, so you can use either.
The power header
- Vin: the voltage from the barrel jack, or an input if you power the board here. The recommended input is 7 to 12 V.
- 5V: the regulated 5 V supply. From USB it's limited by the computer's port and the board's fuse.
- 3.3V: a 3.3 V output for small sensors, up to 50 mA.
- GND: ground. There are three GND pins on the board.
- IOREF tells shields the board's logic voltage (5 V on the Uno). RESET restarts the board when pulled low. AREF is an optional reference voltage for the ADC.
Current limits
The ATmega328P datasheet gives an absolute maximum of 40 mA per I/O pin and 200 mA in total through the chip's VCC and GND pins. Absolute maximums are damage thresholds, not working values, so Arduino's long-standing guidance is to stay around 20 mA per pin. Ten pins at 20 mA each already reaches the 200 mA total. Use a transistor for motors, relays and anything bright. Our LED resistor calculator sizes resistors for single LEDs.
Things that catch people out
- Uploads fail when something is connected to pins 0 and 1. Disconnect it while uploading.
- The Servo library takes over the timer behind pins 9 and 10, so
analogWrite()on those pins stops working while servos are attached. tone()interferes with PWM on pins 3 and 11.- Floating inputs read random values. Use
pinMode(pin, INPUT_PULLUP)for buttons and wire the button to GND.
The newer Uno R4 boards keep the same header layout, but use a different chip with different current limits and features. Check Arduino's documentation for the R4 before reusing R3 numbers.
Sources
The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.