Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Boards & Microcontrollers
  4. ›Arduino Mega 2560

Component guide · Beginner · 4 min read

Arduino Mega 2560

Pinout, Specs and When You Need More Pins

By Geekobot Learning Team · Updated 24 Oct 2026

On this page
Short answerArduino Mega pinout: the pins that matterWhen to choose a Mega instead of an UnoUsing Uno shields on a MegaPower and current limitsUsing the extra serial portsTry itCommon mistakesFAQsParts and next steps
Short answer

The Arduino Mega 2560 is a bigger Uno: the same 5 V, 16 MHz programming model, but with 54 digital pins (15 with PWM), 16 analog inputs, four hardware serial ports and eight times the flash memory. Choose it when a project needs lots of inputs and outputs or several serial devices, such as a 3D printer controller, a big LED or relay panel, or a robot with GPS, Bluetooth and a display at once.

Key specs at a glance

Microcontroller
ATmega2560, 16 MHz, 5 V logic
Flash / SRAM / EEPROM
256 KB (8 KB bootloader) / 8 KB / 4 KB
Digital I/O
54, of which 15 PWM (2 to 13, 44 to 46)
Analog inputs
16 (A0 to A15), 10-bit
Serial ports
4: Serial (0/1), Serial1 (19/18), Serial2 (17/16), Serial3 (15/14)
Input voltage
7 to 12 V recommended on the barrel jack
Pin current
20 mA recommended, 40 mA absolute maximum
01

Arduino Mega pinout: the pins that matter

FunctionMega 2560 pinsUno equivalent
I2C20 (SDA), 21 (SCL), also the SDA/SCL headerA4, A5
SPI50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS), plus ICSP header12, 11, 13, 10
Serial0/1 (USB), 19/18, 17/16, 15/14 (RX/TX)0/1 only
External interrupts2, 3, 18, 19, 20, 212, 3
PWM2 to 13, 44, 45, 463, 5, 6, 9, 10, 11
Analog inA0 to A15A0 to A5
Built-in LED1313
I2C
Mega 2560 pins:
20 (SDA), 21 (SCL), also the SDA/SCL header
Uno equivalent:
A4, A5
SPI
Mega 2560 pins:
50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS), plus ICSP header
Uno equivalent:
12, 11, 13, 10
Serial
Mega 2560 pins:
0/1 (USB), 19/18, 17/16, 15/14 (RX/TX)
Uno equivalent:
0/1 only
External interrupts
Mega 2560 pins:
2, 3, 18, 19, 20, 21
Uno equivalent:
2, 3
PWM
Mega 2560 pins:
2 to 13, 44, 45, 46
Uno equivalent:
3, 5, 6, 9, 10, 11
Analog in
Mega 2560 pins:
A0 to A15
Uno equivalent:
A0 to A5
Built-in LED
Mega 2560 pins:
13
Uno equivalent:
13
02

When to choose a Mega instead of an Uno

Many pins

keypads, several displays, relay banks, LED panels, or a big model railway.

Several serial devices

GPS, Bluetooth, a GSM module and a sensor at the same time without SoftwareSerial.

Bigger programs

256 KB of flash fits sketches and libraries that overflow an Uno.

3D printers and CNC

the classic RAMPS 1.4 board plugs onto a Mega.

If you need speed, Wi-Fi or lots of RAM rather than pins, an ESP32 is usually a better and cheaper choice; port expanders such as the PCF8574 or MCP23017 can also add pins to a smaller board. See how to choose a microcontroller.

03

Using Uno shields on a Mega

Most Uno shields fit the Mega's header, but check two things. SPI: on the Mega, SPI is on pins 50 to 53 and the ICSP header, not on 11 to 13, so older shields that use pins 11 to 13 for SPI (some Ethernet and SD shields) need jumpers or a library change. I2C: shields that use A4 and A5 for I2C will not work unless they also connect to the SDA/SCL header near AREF, which all R3 shields do. Pin 10 stays as the usual chip-select for SD and Ethernet shields, but pin 53 must be left as an output for SPI to work.

04

Power and current limits

The barrel jack takes 7 to 12 V. At 12 V the on-board 5 V regulator gets hot if you draw more than a few hundred milliamps from the 5V pin, so power servos, motors and LED strips from their own supply and share only ground. Each I/O pin should source or sink 20 mA or less; the total for the chip is 200 mA. Many clone Megas use a CH340 USB chip instead of the ATmega16U2: they work the same but may need the CH340 driver on older Windows. See USB to TTL adapters and powering an Arduino.

05

Using the extra serial ports

Each port has its own object, so there is no need for SoftwareSerial.

Read a GPS on Serial1 and print to USB · Arduino C++Verify & upload in Electrolark
void setup() {
  Serial.begin(115200);    // USB to computer
  Serial1.begin(9600);     // GPS: module TX -> pin 19 (RX1)
}

void loop() {
  while (Serial1.available()) {
    Serial.write(Serial1.read());   // pass NMEA sentences through
  }
}
06

Try it: ADC resolution calculator

Change the values and the diagram and results update as you type.

07

Common mistakes to avoid

  • !Using pins 11 to 13 for SPI as on an Uno.
  • !Feeding 12 V and drawing servo current from the 5V pin until the regulator overheats.
  • !Using Serial (pins 0/1) for a module and then wondering why uploads fail.
  • !Forgetting that analog pins A0 to A15 are 5 V maximum.
  • !Choosing a Mega for speed; it runs at the same 16 MHz as an Uno.
08

Frequently asked questions

How many pins does an Arduino Mega have?

54 digital I/O pins, 15 of which support PWM, and 16 analog inputs. It also has four hardware serial ports.

What are the I2C pins on the Arduino Mega?

Pin 20 is SDA and pin 21 is SCL. They are also on the SDA and SCL header next to AREF.

Is Arduino Mega code the same as Uno code?

Yes, the language and most libraries are the same. Select 'Arduino Mega or Mega 2560' as the board, and change pin numbers for SPI, I2C and serial if needed.

Can an Arduino Mega use Uno shields?

Most fit and work. Older shields that use pins 11 to 13 for SPI or A4/A5 for I2C may need jumper wires or a code change.

Is the Arduino Mega faster than the Uno?

No. Both run at 16 MHz. The Mega has more pins and memory, not more speed. For speed, use an ESP32 or a Raspberry Pi Pico.

Parts for this guide

  • L293D Motor Driver Shield for Arduino Uno / Mega
    ₹189View
  • DC Power Adapter (5.5x2.1mm)
    ₹188View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Arduino Boards

Calculators

ADC resolution calculatorPWM duty cycle calculator

Terms in this guide

MicrocontrollerA single chip with a processor, memory and input/output pins that runs one program, such as the ATmega328P or ESP32.GPIOGeneral-purpose input/output: a microcontroller pin that your code can read or drive.UARTUniversal asynchronous receiver-transmitter: two-wire serial (TX and RX) used by GPS, Bluetooth modules and debug output.I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.SPISerial Peripheral Interface: a fast bus with clock, data in, data out and a chip-select line per device.PWMPulse-width modulation: switching a signal on and off quickly so its average sets brightness, speed or position.InterruptA hardware signal that makes the microcontroller pause its program and run a short function immediately, for example when a button pin changes.BootloaderA small program stored on a microcontroller that lets you upload new code over USB or serial without a dedicated programmer.

Projects that use it

Put this into practice: 19 step-by-step builds in our project library use parts from this guide.

Intermediate · 2–3 hoursWhole-home sensor panel on an Arduino MegaView projectIntermediate · 2–3 hoursFull weather station on an Arduino MegaView projectIntermediate · 2–3 hoursThree-zone security alarm on an Arduino MegaView project
Browse all 19 projects

Keep learning

Component guideBeginnerArduino UnoThe Arduino Uno is a beginner-friendly microcontroller board that reads sensors and controls LEDs, motors and relays using simple C++ programs called sketches.5 min read · Boards & MicrocontrollersComponent guideBeginnerArduino NanoThe Arduino Nano is a breadboard-friendly version of the Uno: the same ATmega328P, 5 V logic and 14 digital pins, in a 45 x 18 mm board with a mini USB port.4 min read · Boards & MicrocontrollersBuying guideBeginnerHow to Choose a Microcontroller BoardFor learning electronics, start with an Arduino Uno: 5 V logic, sturdy, and every tutorial works on it.4 min read · Boards & MicrocontrollersConcept explainerBeginnerUART and Serial CommunicationA UART sends data one bit at a time over one wire with no shared clock, so both ends must agree on the speed, called the baud rate (9600 and 115200 are common).4 min read · Electronics Fundamentals

Sources

  • Arduino Mega 2560 Rev3 datasheet and schematic
  • Microchip ATmega640/1280/2560 datasheet

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerArduino Mega pinout: the pins that matterWhen to choose a Mega instead of an UnoUsing Uno shields on a MegaPower and current limitsUsing the extra serial portsTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide1 item · ₹980

Arduino Mega 2560 Rev3

Run itChange the inputs and watch the output
Serial monitor115200 baud
$GPGGA,061500.00,1258.2959,N,07735.6740,E,1,08,0.98,920.4,M,-86.1,M,,*4F

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question