Arduino · Dev board
Arduino Uno R3
The ATmega328P reference board. 5 V logic throughout, which is exactly why it still gets used for anything driving relays, LED strips or older 5 V peripherals.
- Logic level
- 5 V
- Package
- Uno shield form factor, 68.6 x 53.4 mm
1.Pinout diagram
Highlight a signalhover to preview, click to keep
Digital header
Power + Analog headers
Pin detail
Hover a pin for its mappings and gotchas. Click to keep it here.
- Logic level
- 5 V
- Package
- Uno shield form factor, 68.6 x 53.4 mm
Fig. 1. Arduino Uno R3, Uno shield form factor, 68.6 x 53.4 mm. Hover or tap a signal to light up every pin that carries it.
2.Watch out
- 20 mA per I/O pin is the design figure; 40 mA is the absolute maximum and 200 mA is the limit across the whole chip. Drive motors and strips through a transistor or driver.
- D13 is wired to the on-board LED through a resistor, so it already has a load. It is a poor choice for an input.
- A4/A5 are the only I2C pins. A0-A5 all work as ordinary digital pins (14-19) when you do not need the ADC.
- D0/D1 are shared with the USB-serial bridge. Anything attached there fights the serial monitor and the bootloader.
- VIN accepts 7-12 V through the barrel jack regulator. Feeding 5 V into the 5V pin bypasses the regulator and its protection.
- The R3 and R4 have the same header layout, but the R4 is a 5 V RA4M1 (Minima) or RA4M1 + ESP32-S3 (WiFi) and its peripheral mapping differs.
3.Register configuration
Turning a pin on the diagram into a configured pin.
Drive a pin, and read one with a pull-up
avr-libc
#include <avr/io.h> /* Three registers per port. DDR picks direction, PORT writes the output latch, PIN reads the physical pin. */ DDRB |= (1 << PB5); /* PB5 = Arduino D13 = output */ PORTB |= (1 << PB5); /* high */ PORTB &= ~(1 << PB5); /* low */ PINB |= (1 << PB5); /* writing PIN toggles the output */ DDRD &= ~(1 << PD2); /* PD2 = D2 = input */ PORTD |= (1 << PD2); /* PORT on an input enables the pull-up */ if (!(PIND & (1 << PD2))) { /* switch to ground reads 0 when pressed */ }On an input pin, PORT is the pull-up enable, not an output value. Forget it and a floating pin reads whatever the nearest mains cable is doing.
4.Full pin reference
Every pin, alias and mapping. This is the table that prints.
Table 1. Pin assignments.
| Pin | Name | Also called | Functions | Notes |
|---|---|---|---|---|
| - | SCLI²C | D19, A5 | I2C SCL | Same silicon pin as A5, duplicated on the header for shields. |
| - | SDAI²C | D18, A4 | I2C SDA | Same silicon pin as A4. |
| - | AREF | - | ADC reference in | Only drive this after calling analogReference(EXTERNAL), or you short the internal reference. |
| - | GND | - | Ground | |
| - | D13SPIClock | SCK, PB5 | SPI SCK, On-board LED | Driven by the LED circuit. |
| - | D12SPI | MISO, PB4 | SPI MISO | |
| - | D11SPIPWM | MOSI, PB3, ~D11 | SPI MOSI, Timer2 OC2A | |
| - | D10SPIPWM | SS, PB2, ~D10 | SPI SS, Timer1 OC1B | |
| - | D9PWM | PB1, ~D9 | Timer1 OC1A | |
| - | D8 | PB0, ICP1 | Timer1 input capture | |
| - | D7 | PD7 | - | |
| - | D6PWM | PD6, ~D6 | Timer0 OC0A | |
| - | D5PWM | PD5, ~D5 | Timer0 OC0B | Timer0 also runs millis(); changing its prescaler breaks timing functions. |
| - | D4 | PD4 | - | |
| - | D3PWM | PD3, INT1, ~D3 | Timer2 OC2B, External interrupt 1 | |
| - | D2 | PD2, INT0 | External interrupt 0 | |
| - | D1UART | TX, PD1 | UART TXD | Shared with the USB-serial bridge. |
| - | D0UART | RX, PD0 | UART RXD | Shared with the USB-serial bridge. |
| - | NC | - | Not connected | |
| - | IOREF5 V | - | I/O reference voltage | Tells a shield what logic level the board runs at. 5 V here, 3.3 V on a Due or Zero. |
| - | RESET | - | Active-low reset | Pull low to reset. The USB bridge toggles it through a 100 nF cap to start the bootloader. |
| - | 3V33.3 V | - | 3.3 V supply out | From the USB bridge regulator, 50 mA only. Not enough for a WiFi module. |
| - | 5V5 V | - | 5 V supply out | ~500 mA on USB power, ~800 mA from the barrel jack before the regulator overheats. |
| - | GND | - | Ground | |
| - | GND | - | Ground | |
| - | VIN7-12 V | - | Unregulated supply in | Same net as the barrel jack center pin. Above 12 V the linear regulator cooks. |
| - | A0ADC | D14, PC0 | ADC0 | |
| - | A1ADC | D15, PC1 | ADC1 | |
| - | A2ADC | D16, PC2 | ADC2 | |
| - | A3ADC | D17, PC3 | ADC3 | |
| - | A4ADCI²C | D18, SDA, PC4 | ADC4, I2C SDA | |
| - | A5ADCI²C | D19, SCL, PC5 | ADC5, I2C SCL |
Primary sources
Found a wrong pin? The whole board is one file, data/boards/arduino-uno-r3.json.