Arduino Uno R3 vs Arduino Mega 2560 R3
Same shield header layout, but on the Mega I2C and SPI sit on different pins.
The Arduino Uno R3 uses the ATmega328P, the Mega 2560 the ATmega2560. Both run at 16 MHz with 5 V logic, but the Mega has much more of everything: 256 KB instead of 32 KB of flash, 8 KB instead of 2 KB of SRAM, 54 instead of 14 digital pins (15 instead of 6 with PWM), 16 instead of 6 analog inputs and four hardware UARTs instead of one. The front part of its headers matches the Uno, so many shields fit both boards mechanically.
Electrically there are two classic pitfalls. On the Uno I2C is on A4 (SDA) and A5 (SCL), on the Mega on D20 (SDA) and D21 (SCL). Shields that take I2C from A4/A5 only work on the Mega if they use the separate SDA/SCL pins next to AREF. SPI is on D10 to D13 on the Uno and on D50 (MISO), D51 (MOSI), D52 (SCK) and D53 (SS) on the Mega. Shields that take SPI from the 6-pin ICSP header work on both boards. External interrupts are on D2 and D3 on the Uno, the Mega adds D18 to D21.
The tables below match the pins of both boards by signal and show where each interface is broken out.
The pinouts differ. Use the tables below to rewire the signals.
Overview from the pinout data
| Property | Arduino Uno R3 | Arduino Mega 2560 R3 |
|---|---|---|
| Manufacturer | Arduino | Arduino |
| Type | Board | Board |
| Compared pinout | Arduino Uno R3 Board Pinout (Digital, Analog & Power) | x1 Stiftleisten Links & Rechts (Power, Analog & Digital) |
| Pins | 32 | 50 |
| Supply pins | IOREF, 3V3, 5V, VIN | IOREF, 3V3, 5V, VIN |
| Ground pins | 3 | 3 |
| Interfaces | ADC, I2C, PWM, SPI, UART | ADC, I2C, JTAG, PWM, SPI, UART |
Interface pins
| I2C | Arduino Uno R3 | Arduino Mega 2560 R3 |
|---|---|---|
| SDA | 13 · A431 · SDA | 26 · D20 / SDA49 · D20 / SDA |
| SCL | 14 · A532 · SCL | 25 · D21 / SCL50 · D21 / SCL |
| SPI | Arduino Uno R3 | Arduino Mega 2560 R3 |
|---|---|---|
| MOSI / COPI | 26 · D11~4 · COPI | 32 · D514 · COPI |
| MISO / CIPO | 27 · D121 · CIPO | 31 · D501 · CIPO |
| SCK | 28 · D133 · SCK | 33 · D523 · SCK |
| CS / SS | 25 · D10~ | 34 · D53 |
| UART | Arduino Uno R3 | Arduino Mega 2560 R3 |
|---|---|---|
| TX | 16 · D1 | 41 · ~D1 / TX043 · D14 / TX345 · D16 / TX2+1 |
| RX | 15 · D0 | 42 · ~D0 / RX044 · D15 / RX346 · D17 / RX2+1 |
| RTS | – | – |
| CTS | – | – |
Pin number · pin name. "+n" = further pins with the same function.
Pin by pin
The pins are numbered differently, so they are matched by signal: 31 signals exist on both.
| Signal | Arduino Uno R3 | Arduino Mega 2560 R3 |
|---|---|---|
| IOREF | 2 · IOREF | 2 · IOREF |
| RESET | 3 · RESET | 3 · RESET |
| 3V3 | 4 · 3V3 | 4 · 3V3 |
| 5V | 5 · 5V | 5 · 5V |
| GND | 6 · GND | 6 · GND |
| GND | 7 · GND | 7 · GND |
| VIN | 8 · VIN | 8 · VIN |
| A0 | 9 · A0 | 9 · A0 |
| A1 | 10 · A1 | 10 · A1 |
| A2 | 11 · A2 | 11 · A2 |
| A3 | 12 · A3 | 12 · A3 |
| A4 | 13 · A4 | 13 · A4 |
| A5 | 14 · A5 | 14 · A5 |
| D0 | 15 · D0 | 42 · ~D0 / RX0 |
| D1 | 16 · D1 | 41 · ~D1 / TX0 |
| D2 | 17 · D2 | 40 · ~D2 |
| D3~ | 18 · D3~ | 39 · ~D3 |
| D4 | 19 · D4 | 38 · ~D4 |
| D5~ | 20 · D5~ | 37 · ~D5 |
| D6~ | 21 · D6~ | 36 · ~D6 |
| D7 | 22 · D7 | 35 · ~D7 |
| D8 | 23 · D8 | 34 · ~D8 |
| D9~ | 24 · D9~ | 33 · ~D9 |
| D10~ | 25 · D10~ | 32 · ~D10 |
| D11~ | 26 · D11~ | 31 · ~D11 |
| D12 | 27 · D12 | 30 · ~D12 |
| D13 | 28 · D13 | 29 · ~D13 |
| GND | 29 · GND | 28 · GND |
| AREF | 30 · AREF | 27 · AREF |
| SDA | 31 · SDA | 26 · D20 / SDA |
| SCL | 32 · SCL | 25 · D21 / SCL |
Only on Arduino Mega 2560 R3
15 · A616 · A717 · A818 · A919 · A1020 · A1121 · A1222 · A1323 · A1424 · A1543 · D14 / TX344 · D15 / RX345 · D16 / TX246 · D17 / RX247 · D18 / TX148 · D19 / RX149 · D20 / SDA50 · D21 / SCLFurther connectors
Arduino Uno R3
- ATmega328P ICSP Programming Header (2x3 Header)
- ATmega16U2 USB-Bridge ICSP Header (2x3 Header)
Arduino Mega 2560 R3
- x2 Stiftleiste Unten (D22 - D53, 5V, GND)
- ICSP1 Header (ATmega16U2 USB Controller)
- ICSP Header (ATmega2560 Main MCU)
Verdict
The Uno is enough for most projects. The Mega pays off with many inputs and outputs, several serial devices such as GPS and a radio module at the same time, or large sketches, for example in 3D printers and displays.