Arduino Mega 2560

The Arduino Mega 2560 Rev3 is powered by the ATmega2560 microcontroller operating at 16 MHz. It features 54 digital input/output pins, 16 analog inputs, and four hardware UARTs. The board also includes USB programming support, a DC power jack, an ICSP header and reset circuitry, making it ideal for complex embedded and automation applications.

This page provides the complete Arduino Mega 2560 pinout, including digital and analog pin mapping, power rails, multiple communication interfaces (UART, I2C, SPI), and electrical current limitations.

Official Pinout

Source: Mega Pin diagram PDF

Pinout

FeatureCount
Digital I/O pins54
PWM pins15
Analog input pins16
UART4
I2C1
SPI1
5V pins1
3.3V pins1
Ground pins5
Max current per I/O pin20 mA (recommended)

Pin Alias / Function List

UART (4 Hardware Serial Ports)

  • D0 (RX0), D1 (TX0) → UART0 (USB & sketch upload)
  • D19 (RX1), D18 (TX1) → UART1
  • D17 (RX2), D16 (TX2) → UART2
  • D15 (RX3), D14 (TX3) → UART3

Digital I/O & PWM

  • D0–D53 → 54 Digital input/output pins
  • PWM: D2–D13, D44–D46 (15 pins, 8-bit PWM)

Analog Inputs

  • A0–A15 → 16 Analog inputs (10-bit ADC)
  • Can also be used as digital I/O

I2C

  • D20 (SDA) → Data
  • D21 (SCL) → Clock

SPI

  • D50 (MISO)
  • D51 (MOSI)
  • D52 (SCK)
  • D53 (SS)

Power & Control

  • VIN → External input (7–12V recommended)
  • 5V → Regulated 5V output
  • 3.3V → 3.3V output (max 50 mA)
  • GND → Ground
  • RESET → Active LOW reset

Important usage notes

1. Avoid using D0 and D1 when uploading sketches or using the Serial Monitor

2. Each GPIO pin should source or sink no more than 20 mA

3. Do NOT power motors, relays, or high-current devices directly from GPIO pins

4. Can be powered via:

  • USB (5V)
  • DC barrel jack (7–12V recommended)
  • VIN pin (7–20V)

5. Use external drivers or power supplies for high-current loads

Compatibility

  • 5V logic level
  • Multiple hardware serial ports (ideal for GPS, GSM, Bluetooth, etc.)
  • Supports I2C, SPI & UART
  • USB-B powered
  • Large board size (not breadboard-friendly)
  • Suitable for robotics, CNC, 3D printers, and complex automation systems

Helpful Resources

Leave a Comment