- All products
- Development Boards
- Arduino Mega 2560 Genuine (Original)
- Development Boards
Features
- ATmega2560 Microcontroller: 8-bit AVR microcontroller operating at 16 MHz.
- Extensive Digital I/O: 54 digital input/output pins for connecting sensors, actuators, displays, and other peripherals.
- Analog Inputs: 16 analog input channels with 10-bit ADC resolution.
- PWM Outputs: 15 digital pins support 8-bit PWM output.
- Large Program Memory: 256 KB Flash memory, including 8 KB used by the bootloader.
- Increased RAM: 8 KB SRAM for application data and variables.
- EEPROM: 4 KB of non-volatile memory for storing data between power cycles.
- Four Hardware UARTs: Four independent hardware serial interfaces for communication with multiple devices.
- SPI Communication: Hardware SPI interface for compatible displays, sensors, memory devices, and communication modules.
- I2C Communication: Supports I2C peripherals through the SDA and SCL connections.
- USB Connectivity: USB Type-B connector for programming and serial communication with a computer.
- External Power: Can be powered through USB or an external DC supply.
- Arduino Shield Compatibility: Compatible with many Arduino shields designed for the Mega form factor.
- Arduino IDE Support: Programmable using the Arduino IDE and its extensive library ecosystem.
Principle of Operation
The Arduino Mega 2560 uses the ATmega2560 microcontroller to execute the uploaded program and manage connected electronic components. It receives input signals from sensors and switches, processes the information, and controls external devices through its digital and analog interfaces.

- Power Supply: The board receives power through its USB connector or an external power source connected to the DC jack or VIN pin. Its onboard power regulation circuitry supplies the required operating voltages.
- Microcontroller Processing: The ATmega2560 executes the uploaded Arduino sketch at a clock speed of 16 MHz.
- Digital I/O: Digital pins can be configured as inputs to read switches and digital sensors or as outputs to control LEDs, relays, and other compatible devices.
- Analog Input: The 16 analog input channels use the microcontroller's 10-bit ADC to convert input voltages into digital readings.
- PWM Control: PWM-capable pins generate pulse-width-modulated signals for applications such as LED brightness control and motor speed control through a suitable driver.
- Serial Communication: Four hardware UART interfaces allow the board to communicate with multiple serial devices independently.
- SPI and I2C: These communication interfaces connect the board to compatible sensors, displays, memory devices, and other peripherals.
- Programming: Sketches are written, compiled, and uploaded through the Arduino IDE. The onboard USB-to-serial interface and bootloader allow programming without an external programmer for normal development.
Arduino sketches generally contain two main functions: setup(), which runs once when the board starts or resets, and loop(), which repeatedly executes the main application code.
Pinout

Power Connections
- VIN: External unregulated power input. The recommended external supply range is 7–12V DC.
- 5V: Regulated 5V supply rail. It can supply compatible peripherals within the board's available current budget.
- 3.3V: 3.3V output for compatible peripherals, with a maximum available current of 50mA on the genuine Mega 2560 Rev3.
- GND: Ground connections for the board and connected circuits.
- RESET: Pulling this pin LOW resets the microcontroller.
- IOREF: Indicates the board's operating logic voltage.
- AREF: External analog reference voltage input when used with the appropriate
analogReference()configuration.

Digital I/O Pins
- 54 digital input/output pins, numbered D0 to D53.
- Configure pins using
pinMode(). - Use
digitalRead()to read digital input states. - Use
digitalWrite()to control digital outputs. - Digital logic operates at 5V.
Analog Input Pins
- 16 analog input channels, A0 to A15.
- 10-bit ADC resolution, providing readings from 0 to 1023.
- With the default analog reference, the measurable input range is approximately 0–5V.
- Analog pins can also be used as digital I/O pins when configured accordingly.
- Use
analogRead()to obtain analog measurements.
PWM Outputs
- 15 PWM-capable pins: D2 to D13 and D44 to D46.
- 8-bit PWM output using
analogWrite(), with values from 0 to 255. - Useful for controlling LED brightness and motor speed through an appropriate driver.
USART Serial Communication
- Serial0: RX0 (D0) and TX0 (D1).
- Serial1: RX1 (D19) and TX1 (D18).
- Serial2: RX2 (D17) and TX2 (D16).
- Serial3: RX3 (D15) and TX3 (D14).
- Use
Serial.begin(),Serial1.begin(),Serial2.begin(), orSerial3.begin()to configure the respective serial interfaces. - Serial0 is also connected to the onboard USB-to-serial interface for communication with the computer.
SPI Interface
- MISO: D50
- MOSI: D51
- SCK: D52
- SS: D53
- The SPI signals are also available through the ICSP header.
- Use the Arduino
SPIlibrary to communicate with compatible SPI devices.
I2C / TWI Interface
- SDA: D20
- SCL: D21
- Use the Arduino
Wirelibrary for I2C communication. - Suitable for connecting compatible sensors, displays, and other I2C peripherals.
Hardware Interrupt Pins
- External interrupt pins: D2, D3, D18, D19, D20, and D21.
- These pins can be used for interrupt-driven applications such as encoder inputs, event detection, and pulse counting.
- Use
attachInterrupt()to configure external interrupt handling.
Applications
- Robotics: Control multiple motors, sensors, actuators, encoders, and robotic mechanisms.
- Home Automation: Manage lighting, appliances, security systems, and environmental monitoring devices.
- Data Acquisition: Read multiple analog sensors and collect measurements for logging or further processing.
- Instrumentation: Build measurement systems, control panels, and monitoring equipment.
- Industrial Prototyping: Develop control systems and interface with compatible sensors and equipment through suitable signal-conditioning hardware.
- Educational Projects: Teach electronics, programming, embedded systems, and robotics.
- Display Systems: Connect LCD, OLED, TFT, and other display modules.
- Automation Projects: Coordinate multiple inputs and outputs in automated systems.
- Communication Gateways: Interface with several serial devices, wireless modules, and communication peripherals.
Getting Started
- Install Arduino IDE: Download and install the Arduino IDE.
- Connect the Board: Connect the Arduino Mega 2560 to your computer using a USB Type-B data cable.
- Select the Board: Open Tools > Board and select Arduino Mega or Mega 2560.
- Select the Processor: Select ATmega2560 if the processor option is available.
- Select the Port: Open Tools > Port and choose the serial port assigned to the board.
- Open an Example: Select File > Examples > 01. Basics > Blink to load the built-in LED test program.
- Upload the Sketch: Click Verify to compile the program, then click Upload to transfer it to the board.
- Monitor Communication: Open the Serial Monitor when using sketches that send serial messages.
If the board does not appear in the port menu, check the USB cable, computer connection, and driver requirements for the USB-to-serial interface fitted to your particular board.
Code
This example blinks the onboard LED connected to digital pin 13 and displays its status in the Arduino IDE Serial Monitor.
// Arduino Mega 2560 - Blink with Serial Monitor
const int LED_PIN = 13;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("Arduino Mega 2560 Blink Test");
}
void loop() {
digitalWrite(LED_PIN, HIGH);
Serial.println("LED ON");
delay(1000);
digitalWrite(LED_PIN, LOW);
Serial.println("LED OFF");
delay(1000);
}
After uploading the sketch, the onboard LED will turn on and off at one-second intervals. Open the Serial Monitor and select 9600 baud to view the corresponding status messages.
Specifications
- Board: Arduino Mega 2560 Rev3
- Microcontroller: ATmega2560
- USB-to-Serial Interface: ATmega16U2 on the genuine Mega 2560 Rev3
- Microcontroller Architecture: 8-bit AVR
- Clock Speed: 16 MHz
- Operating Voltage: 5V
- Recommended Input Voltage: 7–12V DC
- Digital I/O Pins: 54
- PWM Outputs: 15
- Analog Inputs: 16
- ADC Resolution: 10-bit
- Flash Memory: 256 KB (8 KB used by the bootloader)
- SRAM: 8 KB
- EEPROM: 4 KB
- UART Interfaces: 4 hardware serial ports
- SPI: Hardware SPI interface
- I2C: Hardware I2C/TWI interface
- DC Current per I/O Pin: 20mA recommended operating current
- 3.3V Output Current: 50mA maximum
- USB Connector: USB Type-B
- Board Dimensions: Approximately 101.52 × 53.3 mm
Note: The ATmega2560 has a 40mA absolute maximum current rating per I/O pin, but this is not a recommended operating current. Design outputs around the recommended 20mA limit and observe the overall microcontroller and board current limits. The board does not provide true analog voltage outputs; PWM pins generate digital pulses that can be filtered to produce an approximate analog voltage.
Comparison: Arduino Mega 2560 vs. Arduino Uno Rev3
The Arduino Mega 2560 and Arduino Uno Rev3 are both 5V Arduino development boards operating at 16 MHz. The Mega 2560 provides more I/O connections, memory, and serial interfaces, making it suitable for larger projects.

| Specification | Arduino Mega 2560 Rev3 | Arduino Uno Rev3 |
|---|---|---|
| Main Microcontroller | ATmega2560 | ATmega328P |
| Clock Speed | 16 MHz | 16 MHz |
| Digital I/O Pins | 54 | 14 |
| PWM Outputs | 15 | 6 |
| Analog Inputs | 16 | 6 |
| Flash Memory | 256 KB | 32 KB |
| SRAM | 8 KB | 2 KB |
| EEPROM | 4 KB | 1 KB |
| Hardware UART Interfaces | 4 | 1 |
| Operating Voltage | 5V | 5V |
| USB Connector | USB Type-B | USB Type-B |
The Mega 2560 is the better option when a project requires many sensors, motors, displays, or serial communication connections. The Uno Rev3 is a more compact choice for projects with fewer I/O requirements and lower memory demands.
Resources
- Arduino IDE Download
- Arduino Mega 2560 Hardware Documentation
- Arduino Language Reference
- Arduino Upload Troubleshooting
- Arduino Mega Pinout and Schematics
Features
- ATmega2560 Microcontroller: 8-bit AVR microcontroller operating at 16 MHz.
- Extensive Digital I/O: 54 digital input/output pins for connecting sensors, actuators, displays, and other peripherals.
- Analog Inputs: 16 analog input channels with 10-bit ADC resolution.
- PWM Outputs: 15 digital pins support 8-bit PWM output.
- Large Program Memory: 256 KB Flash memory, including 8 KB used by the bootloader.
- Increased RAM: 8 KB SRAM for application data and variables.
- EEPROM: 4 KB of non-volatile memory for storing data between power cycles.
- Four Hardware UARTs: Four independent hardware serial interfaces for communication with multiple devices.
- SPI Communication: Hardware SPI interface for compatible displays, sensors, memory devices, and communication modules.
- I2C Communication: Supports I2C peripherals through the SDA and SCL connections.
- USB Connectivity: USB Type-B connector for programming and serial communication with a computer.
- External Power: Can be powered through USB or an external DC supply.
- Arduino Shield Compatibility: Compatible with many Arduino shields designed for the Mega form factor.
- Arduino IDE Support: Programmable using the Arduino IDE and its extensive library ecosystem.
Principle of Operation
The Arduino Mega 2560 uses the ATmega2560 microcontroller to execute the uploaded program and manage connected electronic components. It receives input signals from sensors and switches, processes the information, and controls external devices through its digital and analog interfaces.

- Power Supply: The board receives power through its USB connector or an external power source connected to the DC jack or VIN pin. Its onboard power regulation circuitry supplies the required operating voltages.
- Microcontroller Processing: The ATmega2560 executes the uploaded Arduino sketch at a clock speed of 16 MHz.
- Digital I/O: Digital pins can be configured as inputs to read switches and digital sensors or as outputs to control LEDs, relays, and other compatible devices.
- Analog Input: The 16 analog input channels use the microcontroller's 10-bit ADC to convert input voltages into digital readings.
- PWM Control: PWM-capable pins generate pulse-width-modulated signals for applications such as LED brightness control and motor speed control through a suitable driver.
- Serial Communication: Four hardware UART interfaces allow the board to communicate with multiple serial devices independently.
- SPI and I2C: These communication interfaces connect the board to compatible sensors, displays, memory devices, and other peripherals.
- Programming: Sketches are written, compiled, and uploaded through the Arduino IDE. The onboard USB-to-serial interface and bootloader allow programming without an external programmer for normal development.
Arduino sketches generally contain two main functions: setup(), which runs once when the board starts or resets, and loop(), which repeatedly executes the main application code.
Pinout

Power Connections
- VIN: External unregulated power input. The recommended external supply range is 7–12V DC.
- 5V: Regulated 5V supply rail. It can supply compatible peripherals within the board's available current budget.
- 3.3V: 3.3V output for compatible peripherals, with a maximum available current of 50mA on the genuine Mega 2560 Rev3.
- GND: Ground connections for the board and connected circuits.
- RESET: Pulling this pin LOW resets the microcontroller.
- IOREF: Indicates the board's operating logic voltage.
- AREF: External analog reference voltage input when used with the appropriate
analogReference()configuration.

Digital I/O Pins
- 54 digital input/output pins, numbered D0 to D53.
- Configure pins using
pinMode(). - Use
digitalRead()to read digital input states. - Use
digitalWrite()to control digital outputs. - Digital logic operates at 5V.
Analog Input Pins
- 16 analog input channels, A0 to A15.
- 10-bit ADC resolution, providing readings from 0 to 1023.
- With the default analog reference, the measurable input range is approximately 0–5V.
- Analog pins can also be used as digital I/O pins when configured accordingly.
- Use
analogRead()to obtain analog measurements.
PWM Outputs
- 15 PWM-capable pins: D2 to D13 and D44 to D46.
- 8-bit PWM output using
analogWrite(), with values from 0 to 255. - Useful for controlling LED brightness and motor speed through an appropriate driver.
USART Serial Communication
- Serial0: RX0 (D0) and TX0 (D1).
- Serial1: RX1 (D19) and TX1 (D18).
- Serial2: RX2 (D17) and TX2 (D16).
- Serial3: RX3 (D15) and TX3 (D14).
- Use
Serial.begin(),Serial1.begin(),Serial2.begin(), orSerial3.begin()to configure the respective serial interfaces. - Serial0 is also connected to the onboard USB-to-serial interface for communication with the computer.
SPI Interface
- MISO: D50
- MOSI: D51
- SCK: D52
- SS: D53
- The SPI signals are also available through the ICSP header.
- Use the Arduino
SPIlibrary to communicate with compatible SPI devices.
I2C / TWI Interface
- SDA: D20
- SCL: D21
- Use the Arduino
Wirelibrary for I2C communication. - Suitable for connecting compatible sensors, displays, and other I2C peripherals.
Hardware Interrupt Pins
- External interrupt pins: D2, D3, D18, D19, D20, and D21.
- These pins can be used for interrupt-driven applications such as encoder inputs, event detection, and pulse counting.
- Use
attachInterrupt()to configure external interrupt handling.
Applications
- Robotics: Control multiple motors, sensors, actuators, encoders, and robotic mechanisms.
- Home Automation: Manage lighting, appliances, security systems, and environmental monitoring devices.
- Data Acquisition: Read multiple analog sensors and collect measurements for logging or further processing.
- Instrumentation: Build measurement systems, control panels, and monitoring equipment.
- Industrial Prototyping: Develop control systems and interface with compatible sensors and equipment through suitable signal-conditioning hardware.
- Educational Projects: Teach electronics, programming, embedded systems, and robotics.
- Display Systems: Connect LCD, OLED, TFT, and other display modules.
- Automation Projects: Coordinate multiple inputs and outputs in automated systems.
- Communication Gateways: Interface with several serial devices, wireless modules, and communication peripherals.
Getting Started
- Install Arduino IDE: Download and install the Arduino IDE.
- Connect the Board: Connect the Arduino Mega 2560 to your computer using a USB Type-B data cable.
- Select the Board: Open Tools > Board and select Arduino Mega or Mega 2560.
- Select the Processor: Select ATmega2560 if the processor option is available.
- Select the Port: Open Tools > Port and choose the serial port assigned to the board.
- Open an Example: Select File > Examples > 01. Basics > Blink to load the built-in LED test program.
- Upload the Sketch: Click Verify to compile the program, then click Upload to transfer it to the board.
- Monitor Communication: Open the Serial Monitor when using sketches that send serial messages.
If the board does not appear in the port menu, check the USB cable, computer connection, and driver requirements for the USB-to-serial interface fitted to your particular board.
Code
This example blinks the onboard LED connected to digital pin 13 and displays its status in the Arduino IDE Serial Monitor.
// Arduino Mega 2560 - Blink with Serial Monitor
const int LED_PIN = 13;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("Arduino Mega 2560 Blink Test");
}
void loop() {
digitalWrite(LED_PIN, HIGH);
Serial.println("LED ON");
delay(1000);
digitalWrite(LED_PIN, LOW);
Serial.println("LED OFF");
delay(1000);
}After uploading the sketch, the onboard LED will turn on and off at one-second intervals. Open the Serial Monitor and select 9600 baud to view the corresponding status messages.
Specifications
- Board: Arduino Mega 2560 Rev3
- Microcontroller: ATmega2560
- USB-to-Serial Interface: ATmega16U2 on the genuine Mega 2560 Rev3
- Microcontroller Architecture: 8-bit AVR
- Clock Speed: 16 MHz
- Operating Voltage: 5V
- Recommended Input Voltage: 7–12V DC
- Digital I/O Pins: 54
- PWM Outputs: 15
- Analog Inputs: 16
- ADC Resolution: 10-bit
- Flash Memory: 256 KB (8 KB used by the bootloader)
- SRAM: 8 KB
- EEPROM: 4 KB
- UART Interfaces: 4 hardware serial ports
- SPI: Hardware SPI interface
- I2C: Hardware I2C/TWI interface
- DC Current per I/O Pin: 20mA recommended operating current
- 3.3V Output Current: 50mA maximum
- USB Connector: USB Type-B
- Board Dimensions: Approximately 101.52 × 53.3 mm
Note: The ATmega2560 has a 40mA absolute maximum current rating per I/O pin, but this is not a recommended operating current. Design outputs around the recommended 20mA limit and observe the overall microcontroller and board current limits. The board does not provide true analog voltage outputs; PWM pins generate digital pulses that can be filtered to produce an approximate analog voltage.
Comparison: Arduino Mega 2560 vs. Arduino Uno Rev3
The Arduino Mega 2560 and Arduino Uno Rev3 are both 5V Arduino development boards operating at 16 MHz. The Mega 2560 provides more I/O connections, memory, and serial interfaces, making it suitable for larger projects.

| Specification | Arduino Mega 2560 Rev3 | Arduino Uno Rev3 |
|---|---|---|
| Main Microcontroller | ATmega2560 | ATmega328P |
| Clock Speed | 16 MHz | 16 MHz |
| Digital I/O Pins | 54 | 14 |
| PWM Outputs | 15 | 6 |
| Analog Inputs | 16 | 6 |
| Flash Memory | 256 KB | 32 KB |
| SRAM | 8 KB | 2 KB |
| EEPROM | 4 KB | 1 KB |
| Hardware UART Interfaces | 4 | 1 |
| Operating Voltage | 5V | 5V |
| USB Connector | USB Type-B | USB Type-B |
The Mega 2560 is the better option when a project requires many sensors, motors, displays, or serial communication connections. The Uno Rev3 is a more compact choice for projects with fewer I/O requirements and lower memory demands.

