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.
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.
- 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.
Prefer a simpler view? This colour-coded map groups the pins by what they do:
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
| Pin | What it does |
|---|---|
| VIN | Raw input — feed 7–12 V here to power the board (or read the jack voltage). |
| 5V | Regulated 5 V output to power sensors and modules. |
| 3.3V | 3.3 V from the on-board LDO, up to ~50 mA. |
| GND | Ground (0 V) — there are several GND pins. |
| IOREF | Tells shields the board's logic voltage (5 V on the Uno). |
| RESET | Pull 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.
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.
// 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.
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.
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.
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.
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.
Project 1 — Blink an LED
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(500); digitalWrite(13, LOW); delay(500); }
Project 2 — Push-button controlled LED
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
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)
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.
Key Terms — Glossary
| Term | Meaning |
|---|---|
| Microcontroller | A single chip with CPU, memory and I/O — here, the ATmega328P. |
| Sketch | An Arduino program, with setup() and loop(). |
| GPIO | General-purpose input/output pin. |
| PWM (~) | Pulse-width modulation; fakes an analog level via duty cycle. |
| ADC | Analog-to-digital converter; 10-bit (0–1023) on the Uno. |
| UART | Serial port on D0/D1, shared with USB. |
| SPI | Fast 4-wire bus on D10–D13. |
| I2C | 2-wire bus on A4 (SDA) / A5 (SCL). |
| Bootloader | Small program that lets the Uno flash itself over USB. |
| VIN | Raw 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.