Arduino MEGA 2560 Hardware Manual

The Arduino MEGA 2560 Hardware Manual is a reference and user guide for the Arduino MEGA 2560 hardware and firmware. It provides up-to-date hardware information for the Arduino MEGA 2560 revision 3 and earlier boards. The Arduino MEGA 2560 is an upgrade to the popular Arduino Uno board, providing more pins, serial ports and memory. Arduino is the easy to use open-source electronics platform used by hobbyists, makers, hackers, experimenters, educators and professionals.

This blog article provides a review of the contents of the Arduino MEGA 2560 Hardware Manual by Warwick A. Smith. Find out what the book is about and what is inside.

Arduino MEGA 2560 Hardware Manual Front Cover
Arduino MEGA 2560 Hardware Manual Front Cover

Get all the information that you need on the hardware and firmware found on Arduino MEGA 2560 boards in this handy reference and user guide. Ideal for the workbench or desktop. This manual covers the Arduino MEGA 2560 hardware and firmware, and is a companion volume to the Arduino Uno Hardware Manual, which covers the Arduino Uno hardware and firmware.

Arduino MEGA 2560 Manual vs. Arduino Uno Hardware Manual

The Arduino MEGA 2560 Hardware Manual is written for the Arduino MEGA 2560 single board computer. It is based on the layout of the Arduino Uno Hardware Manual. There are some similarities between the Arduino Uno and Arduino MEGA 2560. The Arduino MEGA 2560 Hardware Manual is extended with extra diagrams and illustrations that the Arduino Uno manual does not have. Readers who already own the Arduino Uno Hardware Manual will find the Arduino MEGA 2560 hardware manual worth owning. An extra chapter has been added to make owning both manuals value for money. The extra chapter explains compatibility of Arduino shields between different Arduino models. Find out why some shields only work with some Arduino models and not with others.

When it comes to the power supply circuit of both boards, they are nearly identical. This manual points out the subtle differences between the power supply circuits of the two boards. Similarities and differences between the MEGA 2560 and Uno are pointed out in various places, where applicable.

Also see the blog post on the Arduino Uno manual on this website.

Arduino MEGA 2560 Hardware Manual Features

The list below includes some of the features of the manual, as listed on the back cover of the book.

  • Contains all of the Arduino MEGA 2560 hardware information in one place
  • Covers Arduino / Genuino MEGA 2560 revision 3 and earlier boards
  • Easily find hardware technical specifications with explanations
  • Pin reference chapter with interfacing examples
  • Diagrams and illustrations for easy reference to pin functions and hardware connections
  • Learn to back up and restore firmware on the board, or load new firmware
  • Basic fault finding and repair procedures for Arduino MEGA 2560 boards
  • Power supply circuits simplified and explained
  • Mechanical dimensions split into five easy to reference diagrams
  • Contains circuit diagrams, parts list and board layout to easily locate components
  • A chapter on shield compatibility explains how shields work across different Arduino boards
Arduino MEGA 2560 Hardware Manual Back Cover
Arduino MEGA 2560 Hardware Manual Back Cover

Where to Buy the Arduino MEGA 2560 Hardware Manual

Find the Arduino MEGA 2560 Hardware Manual on amazon.com and amazon.co.uk. Look at other buying options for other countries.



Arduino MEGA 2560 REV3 boards are also available from amazon.com and amazon.co.uk.



Full disclosure: this website is an affiliate of amazon.com and amazon.co.uk. The above links are our affiliate links for these websites. We will earn a small commission if you purchase a product using the above links.

Arduino MEGA 2560 Hardware Manual Table of Contents

The table of contents for the manual is a complete list of all of the sections in the manual. Take a look at the table of contents to get an idea of what the book is about.

Arduino MEGA 2560 Hardware Manual Preview

A preview of the Arduino MEGA 2560 Hardware Manual includes the complete introduction chapter. The preview includes the first two pages of every chapter.

More About the Arduino MEGA 2560 Rev3

The Arduino MEGA 2560 is a single board computer that uses an ATmega2560 microcontroller as its main processor to run software loaded via the Arduino IDE or other programming environment. It extends the capabilities and number of pins of the smaller Arduino Uno. The Arduino MEGA 2560 has the following features:

  • 54 digital input/output pins
  • 15 of the digital I/O pins have PWM capabilities
  • 16 analog inputs
  • 4 hardware serial ports (UARTs)
  • 1 TWI port (I2C compatible port)
  • 1 SPI port
  • More program memory, SRAM and EEPROM than an Arduino Uno
  • USB port
  • Reset button
  • ICSP header
  • External power jack

Arduino MEGA 2560 Hardware Manual Book Structure

The basic structure of the Arduino MEGA 2560 manual or book is the same as the Arduino Uno Hardware manual, but it is fully updated for the Arduino MEGA 2560. Chapters are laid out as follows.

Introduction

The introduction provides motivation on why one should buy the manual. Contains differences between the Arduino Uno Hardware Manual and Arduino MEGA 2560 Manual. Target audience, prerequisites, hardware requirements, software requirements and what is covered in the book.

Arduino MEGA 2560 Overview

This chapter, together with chapter 2, are basically the “hardware user manual” part of the book for the Arduino MEGA 2560. It covers all of the basics of the Arduino MEGA 2560: a general overview of the Arduino MEGA 2560, its main parts, and how to extend its hardware.

Basics of firmware, the software that comes factory loaded on a new Arduino MEGA 2560 board, is explained. The chapter wraps up with board handling precautions, a brief history of the Arduino MEGA 2560 and the hardware revisions that it has been through, some information on first time use, and basic testing.

Hardware Technical Information

More detailed technical information on the Arduino MEGA 2560 hardware.

Pin Reference and Interfacing

A detailed look at pins, pin functions and alternate pin functions. It includes various hardware interfacing examples. How to use and test the extra hardware serial ports on the MEGA 2560.

Power Reference

An explanation of both USB and external power sources. Power supply circuits are simplified. This is done by breaking them up into six simplified sections. Different voltage regulators are discussed. There is a comparison between MEGA 2560 and Uno power circuits.

MEGA 2560 Firmware and Bootloader

Information on all of the firmware on Arduino MEGA 2560 boards. How to update firmware, back up firmware and reload firmware.

Circuit Diagram and Components

Enhanced circuit diagrams broken into three parts. Arduino MEGA 2560 parts list and part location on the board.

Fault Finding and Measurement

A chapter dedicated to fault finding on the Arduino MEGA 2560. It covers basic fault finding techniques. An explanation of removing a faulty microcontroller from an Arduino MEGA 2560, and replacing it with a new one. This is for advanced users who have the necessary soldering skills.

Mechanical Dimensions and Templates

Length width and mass of an Arduino MEGA 2560. Mounting hole spacing and size. Header positions on the board. Various other dimensions in easy to read diagrams.

Arduino Shield Compatibility

A new chapter on shield compatibility not found in the Arduino Uno Hardware Manual. It looks at what makes Arduino shields either compatible or incompatible with different Arduino models.

Four different Arduino models show shield compatibility problems and solutions. These are the MEGA 2560, Uno, Due and Zero. Practical examples of commercial shields are used.

Specifications Quick Reference

A table in this appendix contains a summary of the Arduino MEGA 2560 technical specifications. This table has references to the appropriate sections in this book that have more information on each parameter.

GY-BMP280-3.3 Pressure Sensor Module Arduino Tutorial and Pinout

GY-BMP280-3.3 high precision atmospheric pressure sensor module for Arduino – tutorial on first use and testing of the module as well as GY-BMP280-3.3 pressure sensor module pinout. The same module is sold under different names such as BMP280-3.3 or just BMP280, although BMP280 is the actual pressure sensor chip that can be seen just below the capacitor at the top of the module, as shown in the image below.

GY-BMP280-3.3 Pressure Sensor Module

GY-BMP280-3.3 Pressure Sensor Module

GY-BMP280-3.3 Pressure Sensor Module Basic Information

The least you need to know before using this module is presented below.

What the GY-BMP280-3.3 Pressure Sensor Module Can Measure

It can measure both atmospheric pressure and temperature. Because it can measure atmospheric pressure, it can be used to calculate altitude.

BMP280 Datasheet

The module uses a BMP280 barometric pressure sensor from Bosch. A datasheet on the BMP280 can be found on the BMP280 page on the Bosch website. This datasheet and web page is for the actual BMP280 device found on the GY-BMP280-3.3 module.

Operating Voltage

The GY-BMP280-3.3 operates from 3.3V, so requires 3.3V power and must be driven with 3.3V logic levels. Some modules that use the BMP280 device have a voltage regulator and level shifters so that it can be operated from a 5V controller such as an Arduino Uno. This module does not have any regulator or level shifters.

From the BMP280 datasheet:
Minimum power supply voltage – 1.71V
Maximum power supply voltage – 3.6V
Absolute maximum power supply voltage – 4.25V

Direct connection to a 3.3V Arduino such as an Arduino Due, Arduino Zero, Arduino M0 or Arduino M0 Pro is fine, so long as the pressure sensor is powered from the Arduino 3.3V pin. For 5V Arduinos such as the Arduino Uno or Arduino MEGA, it must be powered from the Arduino 3.3V pin, and must be interface to the Arduino using a level shifter for the data and clock pins.

I have seen videos on YouTube where this module is connected directly to a 5V Arduino and powered from 5V. This is extremely bad engineering practice and could result in severely damaging or destroying the BMP280 device. It is sheer luck if the device actually works and does not blow up.

Interfacing

I2C or SPI can be used to interface or connect the module to an Arduino or other microcontroller. Pin 6 of the module controls the I2C address of the module which can be set to either 0x76 when pin 6 is left unconnected or 0x77 when pin 6 is pulled to Vcc (3.3V).

Wrong Information

The Internet is full of wrong information regarding this sensor module. Tutorials on powering this device from 5V and not using level shifters on the data pins are out there. Or if the advice is to power the module from 3.3V, then the data pins are directly connected to 5V Arduino pins without level shifters.

Another mistake that I have seen is that people do not know that the I2C address can be changed by using pin 6 of the module, as can be seen in the pinout for the module (link in the section below). What they then do is modify the Arduino driver to change its I2C address so that it matches the default I2C address of the module, instead of just pulling pin 6 high so that the module address matches the driver address.

GY-BMP280-3.3 Pressure Sensor Module Pinout

Refer to the GY-BMP280-3.3 pressure sensor module pinout page for the module’s pinout and circuit diagram.

GY-BMP280-3.3 Pressure Sensor Module Tutorial

A tutorial on basic use and testing of the GY-BMP280-3.3 pressure sensor module on the Starting Electronics website shows how to connect the module to both 3.3V and 5V Arduino boards. An Arduino Due is used to demonstrate how to wire the module to a 3.3V Arduino. For 5V Arduino boards, an Arduino Uno is used to demonstrate how to use a transistor level shifter to wire the module for 5V use.

The tutorial also shows how to install drivers for the pressure sensor module and then test the module to make sure that it can read pressure and temperature.

Go to the tutorial now →

Choosing an Arduino for Beginners

In this blog post we look at how beginners wanting to start with Arduino can choose an Arduino board. Help is provided for beginners choosing an Arduino. The difference between an Arduino and AVR ATmega microcontroller is also covered.

Choosing an Arduino for Beginners

The recommended Arduino for beginners is usually the Arduino Uno. On the Starting Electronics website, the article on choosing an Arduino for beginners provides more information on which Arduino to choose when starting to learn about Arduino and writing sketches.

Difference Between Arduino and AVR

Many Arduino beginners are confused about the difference between Arduino and AVR, or Arduino and ATmega. Difference between Arduino and ATmega328 explains what the ATmega328 microcontroller is and how it relates to the Arduino Uno. The article also explains more about the AVR microcontroller found on most Arduino boards.

How to Use Arduino Serial Ports

Arduino boards such as the Uno, MEGA2560 and Due all have a serial port that connects to the USB device port on the board. This port allows sketches to be loaded to the board using a USB cable. Code in a sketch can use the same USB / serial port to communicate with the PC by using the Arduino IDE Serial Monitor window, or a Processing application for example. The USB port appears as a virtual COM port on the PC.

This article shows how to use Arduino serial ports when additional serial ports are needed for a project.

Arduino Serial Ports Available

The serial port for programming the Arduino mentioned above is a hardware serial port. The microcontroller on the Arduino board has a hardware serial port built-in, so that after the port has been initialized by software, a byte sent to the port will be sent out serially by the hardware.

The Arduino Uno has only one hardware serial port because the microcontroller used on the Uno has only one built-in serial port. The Arduino MEGA 2560 and Arduino Due both have 3 extra hardware serial ports.

Serial Port Technical Details

The hardware serial ports referred to here are UART (Universal Asynchronous Receiver Transmitter) ports. They may be referred to as USART (Universal Synchronous Asynchronous Receiver Transmitter) ports in the microcontroller documentation if they are configurable in both synchronous and asynchronous modes.

Arduino Uno Serial Port

This image shows the only serial port available on the Arduino Uno highlighted in red. The port connects through a USB chip to the USB device port.

Arduino Uno Serial Port

Arduino Uno Serial Port

Arduino MEGA 2560 and Due

Both the MEGA 2560 and Due have 4 serial ports in total. One that connects through a USB port chip to the USB device port on the board and three extra serial ports that connect to pins on one of the pin headers of the board.

Arduino Due Serial Ports

Arduino Due Serial Ports

 

Arduino MEGA 2560 Serial Ports

Arduino MEGA 2560 Serial Ports

Pins 0 and 1 of the Due and MEGA connect serial port 0 through to the USB device port so that these Arduino boards are compatible with the pin numbering of the Uno and therefore with Arduino shields.

The extra serial ports are ports 1 to 3 with each port having a transmit and receive pin.

It is important to be aware that the MEGA 2560 serial port pins use 5V voltage levels, but the Due uses 3.3V voltage levels.

How to Use Additional Arduino Serial Ports

An extra serial port can be used on an Arduino Uno, but must be simulated in software by using the SoftwareSerial library.

Arduino Uno

The following code is taken from the article on serial communications with the GT-511C3 fingerprint scanner which connects the fingerprint scanner to a software serial port on an Arduino Uno.

#include <SoftwareSerial.h>

SoftwareSerial gtSerial(8, 7); // Arduino RX, Arduino TX

void setup() {
  Serial.begin(9600);    // serial / USB port
  gtSerial.begin(9600);  // software serial port
}

byte rx_byte = 0;        // stores received byte

void loop() {
  // check if byte available from USB port
  if (Serial.available()) {
    rx_byte = Serial.read();
    // send a byte to the software serial port
    gtSerial.write(rx_byte);
  }

  // check if byte available on the software serial port
  if (gtSerial.available()) {
    // get the byte from the software serial port
    rx_byte = gtSerial.read();
    Serial.write(rx_byte);
  }
}

To use the software serial port, first the header file for the software serial library must be included.

#include <SoftwareSerial.h>

Next create the software serial port, selecting the Arduino pins to use for receive (RX) and transmit (TX). Here pin 8 has been set as the receive pin and pin 7 as the transmit pin.

SoftwareSerial gtSerial(8, 7);

The software serial port had been given the name gtSerial which will be used in the sketch to refer to this serial port.

The port can now be checked for incoming data.

if (gtSerial.available()) {

If data is available, it can be read from the port.

rx_byte = gtSerial.read();

Data bytes can also be sent on the port.

gtSerial.write(rx_byte);

How to Use Additional Serial Ports on the Arduino MEGA 2560 and Due

The additional hardware ports on the Arduino MEGA 2560 and Due can be used in the same way as the main USB serial port is used in sketches, only changing the name of the port. The USB serial port, or serial port 0 is referred to as Serial in sketches. To use serial port 1, the name changes to Serial1. Serial ports 2 and 3 are referred to as Serial2 and Serial3.

This sketch shows serial port 3 being used which transmits on pin 14 of the MEGA or Due and receives on pin 15.

void setup() {
  // initialize serial ports
  Serial.begin(9600);    // USB serial port 0
  Serial3.begin(9600);   // serial port 3
}

byte rx_byte = 0;        // stores received byte

void loop() {
  // check for data byte on USB serial port
  if (Serial.available()) {
    // get byte from USB serial port
    rx_byte = Serial.read();
    // send byte to serial port 3
    Serial3.write(rx_byte);
  }
  // check for data byte on serial port 3
  if (Serial3.available()) {
    // get a byte from serial port 3
    rx_byte = Serial3.read();
    // send the byte to the USB serial port
    Serial.write(rx_byte);
  }
}

The additional serial ports are immediately available in the sketch without having to include any libraries.

Serial port 3 must first be initialized to the desired baud rate.

Serial3.begin(9600);

The port can be checked for incoming data.

if (Serial3.available()) {

If a byte has arrived on the serial port, it can be read.

rx_byte = Serial3.read();

A byte can be written to the serial port.

Serial.write(rx_byte);

Arduino Serial Port Resources

Arduino Website References for Software and Hardware

Projects, Articles and Tutorials

Arduino MEGA Ethernet Web Server for Controlling 24 Outputs

In this tutorial, an Arduino MEGA 2560 and Ethernet shield are used to make a web server that hosts a web page that allows 24 outputs to be controlled using checkboxes. The tutorial on the Arduino MEGA web server contains the circuit diagram and all of the source code for the project.

This tutorial was written to answer a question on the blog about the Arduino web server tutorial.

An image of the web server with the web page used to control 24 LEDs is shown below.

24 Output Arduino MEGA Web Server using the Ethernet Shield

24 Output Arduino MEGA Web Server using the Ethernet Shield