Arduino Uno pinout
The Arduino Uno (ATmega328P) pinout: what each pin does, from GPIO, analog inputs and PWM to UART, I2C and SPI, with the notes that catch people out.
The board
- Microcontroller: ATmega328P, 8-bit AVR
- Clock: 16 MHz
- Flash: 32 KB (0.5 KB is the bootloader)
- SRAM / EEPROM: 2 KB / 1 KB
- Logic level: 5 V
- Digital pins: 14 (D0–D13), 6 with PWM
- Analog inputs: 6 (A0–A5), 10-bit: 0–1023
- Serial: Serial on D0 (RX) and D1 (TX), shared with USB
- I2C (Wire): SDA A4, SCL A5 (also on the SDA/SCL pins by AREF)
- SPI: SS D10, MOSI D11, MISO D12, SCK D13
- External interrupts: D2 (INT0), D3 (INT1)
- On-board LED: D13 (LED_BUILTIN)
Pins
| Pin | Functions | Notes |
|---|---|---|
| 0 | D0, PD0, RX | Serial receive, wired to the USB serial chip. |
| 1 | D1, PD1, TX | Serial transmit, wired to the USB serial chip. |
| 2 | D2, PD2, INT0 | External interrupt INT0: attachInterrupt(digitalPinToInterrupt(2), handler, mode). |
| 3 | D3, PD3, ~PWM, OC2B, INT1 | analogWrite() PWM from Timer2 (OC2B), about 490 Hz. External interrupt INT1: attachInterrupt(digitalPinToInterrupt(3), handler, mode). |
| 4 | D4, PD4 | |
| 5 | D5, PD5, ~PWM, OC0B | analogWrite() PWM from Timer0 (OC0B), about 980 Hz. |
| 6 | D6, PD6, ~PWM, OC0A | analogWrite() PWM from Timer0 (OC0A), about 980 Hz. |
| 7 | D7, PD7 | |
| 8 | D8, PB0 | |
| 9 | D9, PB1, ~PWM, OC1A | analogWrite() PWM from Timer1 (OC1A), about 490 Hz. |
| 10 | D10, PB2, ~PWM, OC1B, SS | analogWrite() PWM from Timer1 (OC1B), about 490 Hz. SPI SS: keep it an output while the board is the SPI controller, or SPI stops. |
| 11 | D11, PB3, ~PWM, OC2A, MOSI | analogWrite() PWM from Timer2 (OC2A), about 490 Hz. Hardware SPI MOSI for the SPI library. |
| 12 | D12, PB4, MISO | Hardware SPI MISO for the SPI library. |
| 13 | D13, PB5, SCK, LED | Hardware SPI SCK for the SPI library. Drives the on-board LED (LED_BUILTIN). |
| A0 | A0, PC0, ADC0 | Analog input: analogRead(A0) reads ADC channel 0. Also a digital pin: pinMode(A0, OUTPUT) and digitalWrite(A0, HIGH) work. |
| A1 | A1, PC1, ADC1 | Analog input: analogRead(A1) reads ADC channel 1. Also a digital pin: pinMode(A1, OUTPUT) and digitalWrite(A1, HIGH) work. |
| A2 | A2, PC2, ADC2 | Analog input: analogRead(A2) reads ADC channel 2. Also a digital pin: pinMode(A2, OUTPUT) and digitalWrite(A2, HIGH) work. |
| A3 | A3, PC3, ADC3 | Analog input: analogRead(A3) reads ADC channel 3. Also a digital pin: pinMode(A3, OUTPUT) and digitalWrite(A3, HIGH) work. |
| A4 | A4, PC4, ADC4, SDA | Analog input: analogRead(A4) reads ADC channel 4. Also a digital pin: pinMode(A4, OUTPUT) and digitalWrite(A4, HIGH) work. I2C SDA for the Wire library. |
| A5 | A5, PC5, ADC5, SCL | Analog input: analogRead(A5) reads ADC channel 5. Also a digital pin: pinMode(A5, OUTPUT) and digitalWrite(A5, HIGH) work. I2C SCL for the Wire library. |
| GND | GND | Ground (0 V). |
| GND | GND | Ground (0 V). |
| GND | GND | Ground (0 V). |
| 5V | 5V | 5 V supply: from USB, or from the regulator when the board is powered through VIN. |
| IOREF | IOREF | Tells shields the I/O voltage of the board (5 V). Not a supply to draw from. |
| 3.3V | 3V3 | 3.3 V supply from the on-board regulator. Keep the load small. |
Good to know
- Each I/O pin can source or sink about 20 mA (40 mA is the absolute maximum); keep the whole chip under 200 mA.
- analogWrite() works on the pins marked ~PWM: about 490 Hz, or 980 Hz on the Timer0 pins. Timer0 also runs millis() and delay().
- attachInterrupt() works on D2 and D3 only; every pin can raise a pin-change interrupt through the PCINT registers.
- D0 and D1 carry Serial to the computer. Leave them free while you use the Serial Monitor.
- The port tags give the register bit behind each pin: D13 is PB5, so PORTB |= (1 << PB5) drives it high without digitalWrite().
- Arduino Nano pinout
- Arduino Mega pinout
- ATtiny85 pinout
- ESP32-C3 DevKitM-1 pinout
- ESP32-S3 DevKitC-1 pinout
- ESP32-C5 DevKitC-1 pinout
- ESP32-C6 DevKitC-1 pinout
- ESP32-H2 DevKitM-1 pinout
- ESP32-P4 Function-EV pinout
- Blue Pill (STM32F103C8) pinout
- Nucleo-F030R8 pinout
- Nucleo-G071RB pinout
- Nucleo-F401RE pinout
- Nucleo-F446RE pinout
- Nucleo-F767ZI pinout
- Nucleo-H743ZI2 pinout
- Nucleo-WBA55CG pinout
- Nucleo-L552ZE-Q pinout
- Black Pill (STM32F411CE) pinout
- Raspberry Pi Pico pinout
- Raspberry Pi Pico W pinout
- Raspberry Pi Pico 2 pinout
- Raspberry Pi Pico 2 W pinout