Arduino Uno Reference
The ATmega328P-based development board. It is the default board in every CNAP template and the starting point for most beginner Arduino projects.
Pin names
Digital pins (top header)
| Pin ID | Label | Signal | Notes |
|---|---|---|---|
0 | D0 / RX | USART | Serial receive — avoid for GPIO when using Serial |
1 | D1 / TX | USART | Serial transmit — avoid for GPIO when using Serial |
2 | D2 | Digital | External interrupt INT0 |
3 | D3 | PWM | External interrupt INT1, analogWrite() |
4 | D4 | Digital | |
5 | D5 | PWM | analogWrite() |
6 | D6 | PWM | analogWrite() |
7 | D7 | Digital | |
8 | D8 | Digital | |
9 | D9 | PWM | analogWrite() |
10 | D10 / SS | SPI | SPI slave select, analogWrite() |
11 | D11 / MOSI | PWM / SPI | SPI data out, analogWrite() |
12 | D12 / MISO | SPI | SPI data in |
13 | D13 / SCK | SPI | SPI clock, built-in LED |
GND.1 | GND | Power | Ground (top header) |
AREF | AREF | — | Analog reference voltage |
A4.2 | A4 / SCL | I²C | I²C clock (shared with analog A4) |
A5.2 | A5 / SDA | I²C | I²C data (shared with analog A5) |
Power & analog pins (bottom header)
| Pin ID | Label | Signal | Notes |
|---|---|---|---|
IOREF | IOREF | — | Board operating voltage reference |
RESET | RESET | — | Pull LOW to reset the board |
3.3V | 3.3V | Power | 3.3 V output, max 50 mA |
5V | 5V | Power | 5 V output |
GND.2 | GND | Power | Ground |
GND.3 | GND | Power | Ground |
VIN | VIN | Power | External power input (7–12 V) |
A0 | A0 | Analog | analogRead(), 10-bit (0–1023) |
A1 | A1 | Analog | analogRead() |
A2 | A2 | Analog | analogRead() |
A3 | A3 | Analog | analogRead() |
A4 | A4 | Analog | analogRead(), I²C SDA |
A5 | A5 | Analog | analogRead(), I²C SCL |
Quick reference
| Capability | Pins |
|---|---|
| Digital I/O | D0–D13 (14 pins) |
| Analog input | A0–A5 (6 pins, 10-bit) |
| PWM output | D3, D5, D6, D9, D10, D11 |
| SPI | D10 (SS), D11 (MOSI), D12 (MISO), D13 (SCK) |
| I²C | A4 (SDA), A5 (SCL) |
| USART | D0 (RX), D1 (TX) |
| Operating voltage | 5 V |
| Clock speed | 16 MHz |
Usage
void setup() {
pinMode(13, OUTPUT); // configure pin as output
Serial.begin(9600); // start serial at 9600 baud (uses D0/D1)
}
void loop() {
digitalWrite(13, HIGH); // digital output
int val = analogRead(A0); // analog input (0–1023)
analogWrite(9, 128); // PWM output (0–255)
Serial.println(val);
delay(500);
}
Built-in LED
Pin 13 is connected to a small LED on the board itself. It is the fastest way to test that your sketch is running — no external components needed.
void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() {
digitalWrite(LED_BUILTIN, HIGH); delay(500);
digitalWrite(LED_BUILTIN, LOW); delay(500);
}
Serial monitor tip
D0 (RX) and D1 (TX) are shared with the USB-serial chip. When you call Serial.begin(), avoid using these pins for other GPIO — doing so will corrupt serial output and can block uploading in real hardware.
See also
- LED — connect to any digital pin via a resistor
- Resistor — always use in series with an LED
- Pushbutton — connect to a digital input pin
- Arduino Mega — same core with far more I/O
- Arduino Nano — same core in a breadboard-friendly form factor
- ESP32 DevKit V1 — WiFi/Bluetooth-capable alternative, 3.3V logic