Arduino UNO R3 Pinout: GPIO, PWM, ADC, SPI, I2C and Interrupts

Arduino UNO R3 pinout guide: ATmega328P GPIO, PWM, ADC, UART, I2C, SPI, interrupts, power pins, current limits and safe wiring explained.

Quick answer: the Arduino UNO R3 is a 5 V development board built around the 16 MHz ATmega328P. It exposes 14 digital I/O pins, six analogue inputs, six PWM outputs, one hardware UART, one I²C/TWI bus and one SPI controller. Use D3, D5, D6, D9, D10 or D11 for PWM; A4/A5 for I²C; D10–D13 or the ICSP header for SPI; and D2/D3 for Arduino’s normal external-interrupt interface.

UNO R3 is old by modern microcontroller standards, but it remains one of the easiest boards to wire because the pin functions are fixed, well documented and based on a single ATmega328P. Its limitations are equally clear: only 2 KB SRAM, no built-in Wi-Fi or Bluetooth, a 10-bit ADC and 5 V logic.

This guide focuses on the official Arduino UNO R3 / ATmega328P pinout, the electrical limits that matter in real projects and the differences you need to remember when connecting it to ESP32, ESP8266, STM32 or Raspberry Pi boards.

Arduino UNO R3 Specifications

FeatureArduino UNO R3
Main microcontrollerATmega328P
Architecture8-bit AVR
Clock16 MHz
Operating voltage5 V
Digital I/O14 pins: D0–D13
PWM outputs6: D3, D5, D6, D9, D10, D11
Analogue inputs6: A0–A5
ADC resolution10 bit
Hardware UART1
I²C / TWI1
SPI1
External interrupt pinsD2 and D3
Flash32 KB, about 0.5 KB used by bootloader
SRAM2 KB
EEPROM1 KB
Recommended external input7–12 V
USB interface on official boardATmega16U2 USB-to-serial

UNO R3 Pinout Quick Reference

Arduino pinATmega328P functionImportant uses / notes
D0PD0 / RXDHardware UART RX; shared with USB serial path
D1PD1 / TXDHardware UART TX; shared with USB serial path
D2PD2 / INT0Digital I/O, external interrupt
D3PD3 / INT1 / OC2BDigital I/O, external interrupt, PWM
D4PD4General digital I/O
D5PD5 / OC0BPWM
D6PD6 / OC0APWM
D7PD7General digital I/O
D8PB0General digital I/O
D9PB1 / OC1APWM
D10PB2 / SS / OC1BPWM, SPI SS
D11PB3 / MOSI / OC2APWM, SPI MOSI
D12PB4 / MISOSPI MISO
D13PB5 / SCKSPI SCK, onboard LED
A0PC0 / ADC0Analogue input or digital I/O
A1PC1 / ADC1Analogue input or digital I/O
A2PC2 / ADC2Analogue input or digital I/O
A3PC3 / ADC3Analogue input or digital I/O
A4PC4 / ADC4 / SDAAnalogue input, I²C SDA
A5PC5 / ADC5 / SCLAnalogue input, I²C SCL

Digital GPIO Pins D0 to D13

All 14 numbered pins can be used as digital inputs or outputs with pinMode(), digitalRead() and digitalWrite(). They use 5 V logic.

const int ledPin = 7;
const int buttonPin = 4;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
  bool pressed = digitalRead(buttonPin) == LOW;
  digitalWrite(ledPin, pressed ? HIGH : LOW);
}

Internal pull-ups are useful for buttons and dry contacts. Use external resistors where a circuit needs a defined state independent of firmware or a stronger bias than the AVR’s internal pull-up provides.

UNO R3 GPIO Is 5 V Logic

This is one of the most important differences between UNO R3 and modern 3.3 V boards such as ESP32, RP2350 and most STM32 development boards.

  • UNO outputs can approach 5 V.
  • Do not connect a 5 V UNO output directly to a non-5-V-tolerant 3.3 V input.
  • Use a resistor divider, logic-level converter or suitable interface when required.
  • Check each breakout board separately; some include level shifting, others do not.

GPIO Current Limits

Arduino specifies 20 mA per I/O pin as the normal operating figure. The ATmega328P datasheet also defines absolute maximum limits, but an absolute maximum is a damage boundary, not a design target.

  • Use GPIO for logic signals and modest LED currents.
  • Do not drive relay coils directly.
  • Do not drive motors or solenoids directly.
  • Use a transistor/MOSFET and flyback protection for inductive loads.
  • Respect total device and port current limits as well as the per-pin figure.

PWM Pins

UNO R3 has six hardware PWM outputs: D3, D5, D6, D9, D10 and D11. Arduino marks them with a tilde.

const int pwmPin = 9;

void setup() {
  pinMode(pwmPin, OUTPUT);
}

void loop() {
  analogWrite(pwmPin, 128); // about 50% duty cycle
}

analogWrite() produces PWM, not a real analogue voltage. UNO R3 has no DAC.

The PWM channels are generated by hardware timers. Changing timer prescalers to alter PWM frequency can affect other Arduino functionality; Timer0, for example, is involved in timekeeping used by functions such as millis() and delay().

Analogue Inputs A0 to A5

UNO R3 has six 10-bit analogue inputs. analogRead() returns values from 0 to 1023.

int raw = analogRead(A0);
float voltage = raw * (5.0 / 1023.0);

With the default reference, the nominal range is ground to the 5 V analogue reference. Real accuracy depends on supply/reference quality, source impedance, noise and calibration.

A0 to A5 Can Also Be Digital GPIO

The analogue header is not analogue-only. A0–A5 can also be used as digital input/output pins.

pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);

Using the symbolic names A0 to A5 is clearer than relying on their internal digital-number aliases.

AREF Pin

AREF is the external ADC reference input. It allows a reference other than the default supply reference when configured correctly with analogReference().

Do not blindly apply an external voltage to AREF without configuring the ADC reference correctly.

I2C Pins: A4 SDA and A5 SCL

SignalUNO R3 pin
SDAA4
SCLA5

UNO R3 also has separate header positions labelled SDA and SCL near AREF. These are electrically the same signals as A4 and A5. They are not a second I²C bus.

#include <Wire.h>

void setup() {
  Wire.begin(); // SDA=A4, SCL=A5
}

void loop() {
}

I2C Pull-Ups and Logic Levels

I²C needs pull-up resistors, and many breakout boards already include them. When mixing UNO with 3.3 V sensors or another 3.3 V MCU, check where those pull-ups are connected.

A breakout that pulls SDA/SCL to 5 V is not automatically safe for every 3.3 V device.

SPI Pins

SPI signalUNO pin
SSD10
MOSID11
MISOD12
SCKD13

The same SPI signals are available on the 6-pin ICSP header. Shields often use the ICSP header because its physical location stays more consistent across different Arduino families.

D10 is the AVR hardware SS pin. Even when a peripheral uses another GPIO as chip-select, keep D10 configured appropriately in controller/master-mode applications.

D13 Is Also the Onboard LED Pin

D13 serves as SPI SCK and is connected to LED_BUILTIN. That is ideal for Blink, but it means the LED circuitry is attached to a pin you may also use for high-speed SPI.

It normally works without issue, but remember the extra board connection when debugging signal-integrity or loading problems.

Hardware Serial: D0 RX and D1 TX

SignalUNO pin
RXD0
TXD1

The ATmega328P has one hardware USART. On the official UNO R3, D0/D1 are also connected to the onboard ATmega16U2 USB-to-serial interface.

An external device driving D0/D1 can therefore interfere with sketch upload or Serial Monitor communication.

  • Keep D0/D1 free when you rely heavily on USB serial debugging.
  • Disconnect external UART devices during upload if they interfere.
  • Use SoftwareSerial only where its timing/performance limitations are acceptable.

External Interrupts: D2 and D3

UNO pinAVR external interrupt
D2INT0
D3INT1
volatile bool eventFlag = false;

void onEvent() {
  eventFlag = true;
}

void setup() {
  pinMode(2, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(2), onEvent, FALLING);
}

void loop() {
  if (eventFlag) {
    eventFlag = false;
    // handle event here
  }
}

Keep interrupt service routines short. Set a flag or capture a quick value, then perform slower work in loop().

Pin-Change Interrupts

ATmega328P also has pin-change interrupt hardware across more pins than D2/D3. These are different from the dedicated INT0/INT1 interrupts used by the standard Arduino attachInterrupt() workflow.

Pin-change interrupts are useful for advanced AVR projects but normally require lower-level code or a suitable library.

Power Pins

PinPurpose
VINExternal input to onboard regulator path
5VMain regulated 5 V rail
3.3V3.3 V output; official board specification is 50 mA maximum
GNDGround
RESETPull low to reset ATmega328P
IOREFLogic reference; 5 V on UNO R3
AREFADC reference input

Arduino recommends approximately 7–12 V for the external regulator input through VIN/barrel power. Higher input voltage creates more regulator heat, particularly if the board is also powering external loads.

Use a proper external regulated supply when the project needs meaningful load current rather than expecting the UNO linear regulator to power everything.

USB Power vs VIN

UNO can be powered from USB or from the external input path. The board includes source-selection circuitry.

VIN and the 5 V pin are not interchangeable: VIN feeds the regulator path, while the 5 V header is the regulated rail. If you intend to inject regulated 5 V directly, understand the board power schematic and possible USB back-powering risks.

Why the Official UNO R3 Has Two Microcontrollers

The classic official board contains the ATmega328P that runs your sketch and an ATmega16U2 that implements the USB-to-serial interface.

The ATmega16U2 is not extra application processing power. Many compatible boards replace it with CH340, CP2102 or another USB bridge; that can change drivers and USB behaviour but not the normal ATmega328P I/O map.

UNO R3 DIP vs SMD

The classic UNO R3 uses a socketed DIP ATmega328P, so the MCU can be replaced. SMD variants solder the same family of MCU directly to the PCB.

The header pinout and software model remain effectively the same; the practical difference is replaceability of the main chip.

Memory Limits

UNO R3 has only 2 KB SRAM, which is often the first hard limit as a sketch grows.

  • Large strings consume RAM quickly.
  • Large framebuffers are impractical.
  • JSON documents can exhaust memory.
  • Networking stacks need external hardware and careful memory management.

The board also provides 32 KB Flash and 1 KB EEPROM, which is still perfectly adequate for many local-control projects.

UNO R3 vs ESP32

FeatureArduino UNO R3Typical ESP32 DevKit
CPU8-bit AVR @ 16 MHz32-bit MCU, often far faster
SRAM2 KBHundreds of KB
Logic5 V3.3 V
Wi-FiNoYes on common ESP32 variants
BluetoothNoYes on many variants
Pin complexityVery simpleMore boot/special-function restrictions
Best fitTeaching and simple local controlConnected IoT and larger firmware

For Wi-Fi, Bluetooth, Home Assistant or web-connected projects, ESP32 is vastly more capable. For simple 5 V electronics and learning microcontroller basics, UNO R3 remains easier.

See the ESP32 DevKitC V4 pinout guide for the corresponding ESP32 GPIO rules.

UNO R3 vs STM32 Blue Pill

The STM32F103 Blue Pill is dramatically faster and offers more RAM, 12-bit ADCs, more serial interfaces and native CAN hardware, but it uses 3.3 V logic and has a more complex pin/peripheral map.

UNO wins on beginner simplicity and 5 V compatibility; Blue Pill wins on microcontroller capability.

UNO R3 vs ESP8266 D1 Mini

A classic Wemos D1 Mini adds Wi-Fi and far more processing/memory but uses 3.3 V logic and has boot-strapping pins.

UNO is easier for legacy 5 V shields. D1 Mini is far better when Wi-Fi is central to the project.

UNO R3 vs Raspberry Pi Pico 2

The Raspberry Pi Pico 2 / RP2350 is in a completely different performance class, with dual 150 MHz cores, hundreds of KB of SRAM, PIO and native USB host/device.

Pico 2 uses 3.3 V logic and is a much more advanced MCU platform; UNO remains simpler for legacy shields, introductory circuits and existing AVR code.

Common Mistake: Treating SDA/SCL as Extra Pins

The R3 SDA/SCL header duplicates A4/A5. It does not give you an additional I²C controller.

You can connect multiple I²C devices to the same bus when their addresses and electrical loading allow it.

Common Mistake: Driving 3.3 V Boards from UNO Outputs

UNO outputs are 5 V logic. Level-shift signals going into ESP32, RP2350 or other 3.3 V-only inputs unless the receiving pin is explicitly 5 V tolerant.

Common Mistake: Driving a Relay Coil Directly

A GPIO pin is a logic output, not a power driver. Use a transistor or MOSFET and the correct flyback protection for inductive loads.

Prebuilt relay modules may include the driver stage, but check their input logic and power requirements.

Common Mistake: Forgetting D0/D1 Are Shared

If uploads suddenly fail after adding a GPS, serial Bluetooth module or another MCU, disconnect anything actively driving D0/D1 and try again.

The external device and the USB-to-serial interface are sharing the same ATmega328P UART.

Common Mistake: Assuming analogWrite Is Analogue

analogWrite() is PWM on the six supported pins. UNO R3 has no true DAC. Use an external DAC or a suitable filtered PWM circuit if you need a real analogue output.

Common Mistake: Overloading the 3.3 V Pin

The official UNO R3 specification lists 50 mA for the 3.3 V rail. That is for small loads, not high-current radios or actuators.

A Sensible Default Pin Plan

  • Keep D0/D1 free for USB serial where possible.
  • Reserve D2/D3 for external interrupts if needed.
  • Use D5/D6/D9 for PWM first if SPI may be added later.
  • Reserve D10–D13 for SPI.
  • Reserve A4/A5 for I²C.
  • Use A0–A3 for normal analogue measurements.
  • Use D4, D7, D8 and unused analogue pins for general GPIO.

This is not mandatory, but it avoids most common conflicts.

Simple I2C Example

#include <Wire.h>

void setup() {
  Serial.begin(115200);
  Wire.begin();   // UNO R3: SDA=A4, SCL=A5
}

void loop() {
  // communicate with I2C sensors here
}

Simple SPI Setup

#include <SPI.h>

const int csPin = 10;

void setup() {
  pinMode(csPin, OUTPUT);
  digitalWrite(csPin, HIGH);
  SPI.begin();
}

void loop() {
}

Best General-Purpose Pins

If you are not using their alternate functions, almost all UNO pins are straightforward. For low-conflict GPIO, start with D4, D7 and D8, then add unused PWM and analogue pins.

Avoid D0/D1 when USB serial matters, keep D2/D3 available for interrupts if you need them, and reserve D10–D13 when SPI is part of the design.

Final Recommendation

The Arduino UNO R3 pinout is simple enough that most mistakes come from shared peripheral functions and electrical assumptions, not complicated boot rules.

Remember the core map: D3/D5/D6/D9/D10/D11 are PWM; D2/D3 are external interrupts; D10–D13 are SPI; A4/A5 are I²C; D0/D1 are the hardware UART; and A0–A5 are 10-bit ADC inputs that can also act as digital GPIO.

Keep the 5 V logic level in mind when mixing UNO with ESP32, STM32 or Raspberry Pi boards, and never treat a GPIO as a power driver. With those rules understood, UNO R3 remains one of the easiest development boards to wire and debug.

Related Guides

Official Resources

Share your love