Arduino AVR
Arduino Mega 2560 Pinout
The Arduino Mega 2560 uses an ATmega2560 to give you 54 digital I/O pins (15 PWM), 16 analog inputs, 4 hardware serial ports, and 8 KB of SRAM — the go-to board when an Uno runs out of pins or memory. Shield-compatible with the Uno footprint.
Specifications
- MCU
- ATmega2560, 16 MHz
- Flash
- 256 KB (8 KB used by bootloader)
- SRAM
- 8 KB
- EEPROM
- 4 KB
- Digital I/O
- 54 (15 PWM)
- Analog inputs
- 16 (10-bit ADC)
- Operating voltage
- 5V (7–12V on VIN)
Pin reference
| Pin | Name | Type / functions | Notes |
|---|---|---|---|
| D0–D1 | Serial0 RX/TX | USB serial | Used by Serial — avoid for I/O. |
| D2–D13 | Digital I/O | Digital, PWM on D2–D13 | — |
| D14–D15 | Serial3 TX/RX | UART3 | — |
| D16–D17 | Serial2 TX/RX | UART2 | — |
| D18–D19 | Serial1 TX/RX | UART1, INT5/INT4 | — |
| D20 | SDA | I2C SDA | — |
| D21 | SCL | I2C SCL | — |
| D22–D53 | Digital I/O | General digital | — |
| D50 | MISO | SPI MISO | — |
| D51 | MOSI | SPI MOSI | — |
| D52 | SCK | SPI SCK | — |
| D53 | SS | SPI SS (must be OUTPUT for master mode) | — |
| A0–A15 | Analog 0–15 | Analog input / Digital I/O | — |
| AREF | Analog reference | ADC reference | — |
| VIN | VIN | Power input, 7–12V | — |
| 5V | 5V output | Regulated 5V, ~800 mA | — |
| 3V3 | 3.3V output | Regulated 3.3V, ~50 mA | — |
| GND | Ground | Power | — |
| RESET | Reset | Pull LOW to reset | — |
Gotchas
- 01SPI pins are on D50–D53 — NOT on D11–D13 like the Uno. Most shields that hardcode D11–D13 for SPI will not work on the Mega.
- 02I2C is on D20 (SDA) and D21 (SCL), not A4/A5.
- 03Six hardware interrupts on D2, D3, D18, D19, D20, D21 (attachInterrupt).
- 043.3V rail is weak (~50 mA) — power 3.3V modules from an external regulator.
Generate a wiring diagram
Describe your circuit and get a Mermaid diagram you can share.
Open diagram generator