Arduino Uno

The board that launched a million projects. The Arduino Uno R3 pairs the 8-bit ATmega328P with a friendly USB bootloader and a clean pin layout. This guide covers the full board anatomy, a complete pinout with every pin explained, power & programming, the UART/SPI/I2C buses, and finishes with code examples and beginner mini-projects.

Complete Learning Path — Arduino Uno

From board anatomy and the ATmega328P, to a full pinout with every pin detailed, power, digital & analog I/O, PWM, the buses, uploading, code examples and mini-projects

What is the Arduino Uno?

The Arduino Uno is an open-source microcontroller development board built around the 8-bit ATmega328P. It gives you an easy way to read sensors, drive outputs and run your own code — programmed over a single USB cable with the free Arduino IDE.

Everything on the board exists to serve that one chip: connectors to power it, a crystal to clock it, a USB chip to program it, and rows of header pins to connect it to the world.

Labelled Arduino Uno R3 board anatomy: ATmega328P, USB-B port, DC jack, 5 V regulator, ATmega16U2, 16 MHz crystal, headers and status LEDs
A map of the Uno R3: the ATmega328P runs your code; everything else powers it, clocks it or connects it.
ATmega328P
8-bit AVR MCU
16 MHz
Clock speed
14 + 6
Digital + analog pins
5 V
Logic level

The Brain: ATmega328P

At the centre of the board sits the ATmega328P — a complete little computer on one chip: a CPU, three kinds of memory, and a set of built-in peripherals, all clocked at 16 MHz.

Block diagram of the ATmega328P: AVR CPU, 32 KB flash, 2 KB SRAM, 1 KB EEPROM, GPIO, 10-bit ADC, timers and UART/SPI/I2C
Inside the ATmega328P: CPU + 32 KB flash / 2 KB SRAM / 1 KB EEPROM + GPIO, ADC, timers and serial buses.
  • Flash (32 KB) — stores your program; about 0.5 KB is used by the bootloader.
  • SRAM (2 KB) — working memory for variables while the program runs.
  • EEPROM (1 KB) — small non-volatile store that survives power-off (settings, calibration).
  • Peripherals — 10-bit ADC, three timers (for PWM & timing), and hardware UART, SPI and I2C.

Full Arduino Uno Pinout

Here is the complete pinout. Every pin carries an Arduino number, its AVR port name (PBx / PCx / PDx) and any alternate function — ADC, PWM (~), SPI, I2C or UART.

Detailed Arduino Uno R3 pinout: every pin with its Arduino number, port register and alternate functions (ADC, PWM, SPI, I2C, UART, power)
The full Uno R3 pinout — digital pins on the right, power & analog on the left, colour-coded by function.

Prefer a simpler view? This colour-coded map groups the pins by what they do:

Simplified Arduino Uno pinout showing digital, PWM, analog and power pins colour-coded
Quick overview: digital (0–13), PWM ~, analog (A0–A5) and power pins.

Every Pin Explained

Let's go through each group of pins and exactly what it does.

Digital pins (D0–D13)

14 general-purpose pins that read or write two states only — HIGH (5 V) or LOW (0 V). Set direction with pinMode(), then use digitalWrite() or digitalRead(). Each pin handles ~20 mA (40 mA absolute max). Several have special roles:

D0 (RX) & D1 (TX)

Hardware serial/UART. Shared with USB upload & the Serial Monitor — avoid using them as I/O while using Serial.

D2 & D3

External interrupts (INT0, INT1) — respond instantly to a signal with attachInterrupt().

D3, 5, 6, 9, 10, 11

PWM (~) outputs — analogWrite(0–255) for dimming, speed & tone.

D10–D13

SPI bus — 10 = SS, 11 = MOSI, 12 = MISO, 13 = SCK.

D13

Wired to the on-board “L” LED — perfect for a first test with no extra parts.

Analog input pins (A0–A5)

6 pins connected to a 10-bit ADC that converts 0–5 V into a number from 0 to 1023 using analogRead(). They can also be used as digital pins 14–19. Two are special:

  • A4 = SDA and A5 = SCL — the hardware I2C bus.
  • AREF lets you supply an external analog reference voltage for the ADC.

Power pins

PinWhat it does
VINRaw input — feed 7–12 V here to power the board (or read the jack voltage).
5VRegulated 5 V output to power sensors and modules.
3.3V3.3 V from the on-board LDO, up to ~50 mA.
GNDGround (0 V) — there are several GND pins.
IOREFTells shields the board's logic voltage (5 V on the Uno).
RESETPull LOW to restart the sketch (same as the reset button).
Quick rule of thumb

A pin can be one thing at a time. If you use SPI, pins 10–13 are busy; if you use I2C, A4/A5 are busy; if you use Serial, D0/D1 are busy. Plan which pins each part of your project needs.

Powering the Uno

You can power the Uno three ways: over USB (5 V), from a 7–12 V DC jack, or through the VIN pin. An on-board regulator makes the clean 5 V the chip needs.

Arduino Uno power paths: USB 5 V or a 7-12 V DC jack through the voltage regulator to the 5 V and 3.3 V rails
USB or jack → regulator → clean 5 V (and 3.3 V from a second LDO). The board auto-selects the source.
Don't overload the pins

The 5 V pin can supply a few hundred mA; the 3.3 V pin only ~50 mA. Motors and LED strips need their own supply with a common ground — never run them straight off an I/O pin.

Digital I/O

Digital pins are the simplest: output a HIGH/LOW to drive an LED or relay, or read a HIGH/LOW input from a button or sensor.

Arduino digital I/O: an output pin driving an LED through a resistor, and an input pin reading a button with a pull-down resistor
Output drives an LED (via a 220 Ω resistor); input reads a button with a 10k pull-down so the pin never floats.
// digital output + input
void setup() {
  pinMode(13, OUTPUT);      // LED pin
  pinMode(2, INPUT);        // button pin
}
void loop() {
  int pressed = digitalRead(2);      // HIGH or LOW
  digitalWrite(13, pressed);         // LED follows the button
}

PWM Output (~)

The Uno can't output a true analog voltage, but it can fake one with PWM — switching a pin on and off fast. The fraction of time it stays ON (the duty cycle) sets the average level.

Arduino PWM: three duty cycles (25%, 50%, 75%) and their average voltages, set with analogWrite
Higher duty → higher average voltage. Use analogWrite(pin, 0–255) on the six ~ pins.
// fade the LED on a PWM pin (~9)
void setup() { pinMode(9, OUTPUT); }
void loop() {
  for (int v = 0; v <= 255; v++) { analogWrite(9, v); delay(5); }
  for (int v = 255; v >= 0; v--) { analogWrite(9, v); delay(5); }
}

Analog Input (ADC)

The six analog pins measure a continuous voltage. The 10-bit ADC turns 0–5 V into a number from 0 to 1023 — ideal for potentiometers, light sensors and temperature sensors.

Arduino analog input: a potentiometer feeding A0, and the 10-bit ADC mapping 0-5 V to 0-1023
A potentiometer on A0 → the ADC reads 0–1023. Convert to volts with v * 5.0 / 1023.0.
// read a sensor and print volts
void setup() { Serial.begin(9600); }
void loop() {
  int raw = analogRead(A0);          // 0..1023
  float volts = raw * 5.0 / 1023.0;
  Serial.println(volts);
  delay(200);
}

Communication: UART, SPI & I2C

Three standard buses let the Uno talk to other chips — sensors, displays, memory cards and even other Arduinos.

Arduino communication buses: UART on D0/D1, SPI on D10-D13, and I2C on A4/A5
UART (D0/D1), SPI (D10–D13) and I2C (A4/A5) — three ways to connect devices.

How Code Gets onto the Uno

You write a sketch in the Arduino IDE, and one USB cable does the rest. No separate programmer needed.

Arduino upload flow: write in the IDE, compile, send over USB via the ATmega16U2, and the bootloader writes it to flash
Write → compile → USB (via the ATmega16U2) → the bootloader writes it to flash → run.

Every sketch has two functions: setup() runs once at power-up, and loop() repeats forever.

void setup() {
  // runs once — set up pins, start Serial, etc.
}
void loop() {
  // runs over and over — your main program
}

Code Examples

A few short, copy-paste sketches that cover the everyday building blocks.

1. Blink the on-board LED

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);       // pin 13
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

2. Print to the Serial Monitor

void setup() {
  Serial.begin(9600);
  Serial.println("Hello from the Uno!");
}
void loop() {
  Serial.println(millis());           // ms since power-up
  delay(1000);
}

3. Read a button (internal pull-up)

void setup() {
  pinMode(2, INPUT_PULLUP);           // no external resistor needed
  pinMode(13, OUTPUT);
}
void loop() {
  // pressed = LOW with a pull-up
  if (digitalRead(2) == LOW) digitalWrite(13, HIGH);
  else                        digitalWrite(13, LOW);
}

Beginner Mini-Projects

Put it together. Each project needs only a few cheap parts and the code is complete — upload and go.

Arduino Blink project: an LED and 220 ohm resistor on pin 13 with the blink sketch
Project 1 wiring — the classic Blink. Pin 13 already has an on-board LED, so this works even with no parts.

Project 1 — Blink an LED

Parts: 1 LED, 1 × 220 Ω resistor. LED anode → resistor → pin 13; cathode → GND.
void setup() { pinMode(13, OUTPUT); }
void loop() {
  digitalWrite(13, HIGH); delay(500);
  digitalWrite(13, LOW);  delay(500);
}

Project 2 — Push-button controlled LED

Parts: 1 push-button, 1 LED, 1 × 220 Ω resistor. Button between pin 2 and GND (using the internal pull-up), LED on pin 13.
void setup() {
  pinMode(2, INPUT_PULLUP);
  pinMode(13, OUTPUT);
}
void loop() {
  if (digitalRead(2) == LOW)   // button pressed
    digitalWrite(13, HIGH);
  else
    digitalWrite(13, LOW);
}

Project 3 — Potentiometer LED dimmer

Parts: 1 potentiometer, 1 LED, 1 × 220 Ω resistor. Pot ends to 5 V & GND, wiper to A0; LED on PWM pin ~9.
void setup() { pinMode(9, OUTPUT); }
void loop() {
  int raw = analogRead(A0);              // 0..1023
  int level = map(raw, 0, 1023, 0, 255); // scale to PWM
  analogWrite(9, level);                  // brightness follows the knob
}

Project 4 — Automatic night light (LDR)

Parts: 1 LDR, 1 × 10k resistor (voltage divider to A0), 1 LED + 220 Ω on pin 13. LED turns on when it gets dark.
void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  int light = analogRead(A0);      // bright = high, dark = low
  Serial.println(light);
  if (light < 300) digitalWrite(13, HIGH);  // dark → LED on
  else             digitalWrite(13, LOW);
  delay(100);
}

Specifications

The Arduino Uno R3 at a glance.

Arduino Uno R3 specifications table: ATmega328P, 16 MHz, 5 V, 32 KB flash, 14 digital pins, 6 analog inputs
Key numbers for the Uno R3 — MCU, clock, memory, pins, voltage and current.

Key Terms — Glossary

TermMeaning
MicrocontrollerA single chip with CPU, memory and I/O — here, the ATmega328P.
SketchAn Arduino program, with setup() and loop().
GPIOGeneral-purpose input/output pin.
PWM (~)Pulse-width modulation; fakes an analog level via duty cycle.
ADCAnalog-to-digital converter; 10-bit (0–1023) on the Uno.
UARTSerial port on D0/D1, shared with USB.
SPIFast 4-wire bus on D10–D13.
I2C2-wire bus on A4 (SDA) / A5 (SCL).
BootloaderSmall program that lets the Uno flash itself over USB.
VINRaw voltage input (7–12 V) to power the board.

Frequently Asked Questions

Quick answers to the questions people ask most about the Arduino Uno.

What is the Arduino Uno?

An open-source microcontroller board built around the 8-bit ATmega328P at 16 MHz, with 14 digital pins, 6 analog inputs, 32 KB flash and 5 V logic. It is programmed over USB with the free Arduino IDE and is the most popular board for learning electronics.

How many pins does the Arduino Uno have?

14 digital I/O pins (0–13), six of which (3, 5, 6, 9, 10, 11) do PWM, plus 6 analog inputs (A0–A5, which double as digital 14–19), and power pins: 5V, 3.3V, VIN, GND, IOREF, RESET and AREF.

Which pins are PWM on the Uno?

Pins 3, 5, 6, 9, 10 and 11, marked with a tilde (~). Use analogWrite(pin, 0–255) to set the duty cycle for dimming, motor speed or tone.

What microcontroller does the Uno use?

The Microchip ATmega328P: an 8-bit AVR with 32 KB flash, 2 KB SRAM, 1 KB EEPROM, a 10-bit ADC, three timers and hardware UART, SPI and I2C, clocked at 16 MHz.

What voltage and current can the pins handle?

The Uno uses 5 V logic. Each I/O pin can source or sink about 20 mA (40 mA absolute maximum). Always use a series resistor with an LED, and give motors or LED strips their own supply.

How do I upload code to the Arduino Uno?

Write a sketch in the Arduino IDE, connect the Uno over USB, choose the board and port, and click Upload. The ATmega16U2 turns USB into serial and the bootloader writes your program to flash — no external programmer needed.

What is the difference between digital and analog pins?

Digital pins read/write only HIGH (5 V) or LOW (0 V) with digitalRead()/digitalWrite(). Analog pins A0–A5 measure a continuous 0–5 V as 0–1023 with analogRead().

Can the Uno use SPI and I2C at the same time?

Yes. SPI is on pins 10–13 and I2C is on A4/A5, so they don't clash. Just remember those pins are then reserved for the bus and can't also be used as ordinary I/O.

Conclusion & Key Takeaways

The Arduino Uno is the perfect first board: a capable ATmega328P wrapped in a beginner-friendly layout you can program with one USB cable.

ATmega328P

16 MHz, 32 KB flash.

14 + 6 pins

Digital + analog.

PWM ~

6 pins, analogWrite.

Buses

UART, SPI, I2C.

USB upload

Bootloader, no programmer.

5 V logic

~20 mA per pin.

Continue Learning