Brushless Motor Movement Panel icon Brushless Motor Movement Panel — Control brushless motor controllers (hoverboard-style) via EZ-B: configure direction, speed and optional brake ports for DIY robot movement. Try it →
 
Arduino Due/Mega

Arduino Due/Mega by Arduino

Arduino Mega with Synthiam ARCx controls 24 servos, 13 PWM, sensors and serial modules via EZB firmware over USB.
Connection Type
USB
Number of Servos
24
Audio Support
No
Camera Support
No
UARTs
3
I2C Support
Yes
ADC Ports
8
Digital Ports
21

A large microcontroller board with a sensor shield wired to a six-servo robot arm, controlled from a browser dashboard on a tablet
Arduino Mega + Synthiam ARCx

Lots of pins for big robots

With Synthiam's EZB firmware, an Arduino Mega 2560 becomes a capability controller with 24 servo outputs, 13 PWM outputs, 21 digital ports, 8 analog inputs and three extra hardware serial ports, all driven from ARCx in a web browser over a single USB cable.

How the Mega works with Synthiam. Upload the EZB-Arduino-Mega firmware (in the Firmware section below) to the Mega once with the Arduino IDE. The Mega then speaks the EZB protocol over USB, and ARCx's Ezb Connection robot skill connects to its serial port (COM3 on Windows, /dev/ttyACM0 or /dev/ttyUSB0 on Linux). ARC connects the same way with its EZB Connection skill. You do not write Arduino sketches for each project: robot skills, Blockly and scripts do the work. We recommend ARCx, which runs on Windows, Ubuntu and Raspberry Pi and is used from any web browser.

Meet the board

What is the Arduino Mega 2560?

The Arduino Mega 2560 is a high-I/O microcontroller board for robotics and automation projects. It stands out for its large number of pins, multiple hardware UARTs and 5 V sensor compatibility.

With the EZB firmware, ARC and ARCx can operate all of these at the same time:

  • 8 ADC (analog) inputs
  • 13 PWM outputs
  • 21 digital I/O ports
  • 24 servo outputs
  • 3 hardware UARTs for GPS, RFID, motor controllers and other serial modules

That makes the Mega suitable for complex robots with many sensors, actuators, indicators and serial modules, all coordinated through the robot skills, scripts and AI in ARCx or ARC.

Arduino Mega at a glance

TypeMicrocontroller board (DIY EZB with Synthiam firmware)
MakerArduino
MicrocontrollerATmega2560
ConnectionUSB (serial)
PowerUSB or barrel jack
EZB resources24 servos, 13 PWM, 21 digital, 8 ADC, 3 UARTs
Synthiam uses it forRobots with many servos, sensors and serial devices
Websitestore.arduino.cc
Capabilities

What you can do with a Mega in Synthiam

⚙

24 servos

Animatronics, robot arms, pan/tilt systems and legged robots. Pose and animate them with Auto Position, Servo Animation and Servo Pad.

🎛

13 PWM outputs

Speed control, LED dimming, fans and ESCs. Drive motors through an H-bridge with the Hbridge Movement Panel or set duty with the Pwm Slider.

💡

21 digital ports

Relays, switches, LEDs and logic signals, with software serial transmit for simple UART modules. Watch and toggle them in Digital Monitor.

📈

8 analog inputs

Potentiometers, distance sensors, light sensors, force sensors and more, read in Adc Monitor, charted in Ez Chart, or used from scripts.

🔌

3 hardware UARTs

Talk to GPS receivers, RFID readers, motor controllers and smart servos with buffered receive. Scripts use the hardware UART commands, such as UART.hardwareUartWrite().

📡

Ultrasonic sensors

The firmware reads HC-SR04 ultrasonic distance sensors. Read one from a script with Ping.get(trigger, echo), or in ARC with the Ultrasonic Distance skill.

💻

Blockly, JavaScript, Python

Program every port in the Script robot skill without reflashing the Mega.

🎮

Joysticks and Custom UI

Drive with an on-screen Movement Joystick or a gamepad, and build touch control screens with Custom UI.

🤖

AI agents

ARCx is an MCP server, so AI agents like Claude can see, move and program a Mega robot through its robot skills.

Pin reference

EZB port to Mega pin mapping

On the Mega, EZB port numbers are not the same as the Arduino pin numbers, and the mapping depends on what the port is used for. Wire each device to the pin listed for its job.

Use the map for the job. The servo, PWM and digital tables are separate maps. For example, a servo on D0 plugs into pin 22, a PWM output on D0 uses pin 2, and a digital output on D9 is pin 11 while a PWM output on D9 is pin 13.

Digital I/O and PWM outputs

ARC supports up to 24 digital I/O ports; the Mega exposes 21, mapped as D0–D20. These drive relays, switches, LEDs and logic signals, and also support software serial transmit for simple UART modules. The 13 hardware PWM channels (speed control, dimming LEDs, fans, ESCs) are mapped as D0–D12.

EZB portDigital I/O pinPWM pin
D022
D133
D244
D355
D466
D577
D688
D799
D81010
D91113
D101244
D111345
D124446
D1345—
D1446—
D1562 (A8)—
D1663 (A9)—
D1764 (A10)—
D1865 (A11)—
D1966 (A12)—
D2067 (A13)—

Servo outputs

Up to 24 servo outputs are exposed using the Mega's Servo library.

EZB servo portMega pin
D022
D123
D224
D325
D426
D527
D628
D729
D830
D931
D1032
D1133
D1234
D1335
D1436
D1537
D1638
D1739
D1840
D1941
D2042
D2143
D2268 (A14)
D2369 (A15)

Analog inputs (ADC)

ARC and ARCx read up to 8 analog inputs on the Mega, mapped as ADC0–ADC7.

EZB portMega pinEZB portMega pin
ADC0A0ADC4A4
ADC1A1ADC5A5
ADC2A2ADC6A6
ADC3A3ADC7A7

Hardware serial ports

The firmware's three hardware UARTs are the Mega's extra serial ports. Its first serial port (pins 0 and 1) is the USB link to the computer, so leave it alone.

Mega serial portTX pinRX pin
Serial11819
Serial21617
Serial31415

The (A8)–(A15) labels in the tables are the Mega's analog header names for pins 62–69. Those pins are used here as digital and servo pins.

Wiring tip
A Mega sensor shield with rows of three-pin signal, voltage and ground headers for every digital and analog pin

The Mega exposes raw pin headers. A sensor or servo shield adds a signal, voltage and ground pin beside every I/O pin, which makes wiring servos and sensors much easier and reduces cable strain.

A commonly used option is the KEYESTUDIO Mega Sensor Shield V1 for Arduino Mega 2560.

Servos can draw more current than the Mega's regulator or USB can supply. Power them from a separate supply sized for your servos, and connect its ground to the Mega's GND.

Get started

Connect a Mega to ARCx

  1. Download the firmware. Get EZB-Arduino-Mega from the Firmware section below and extract the zip to a folder.
  2. Upload it with the Arduino IDE. Connect the Mega with a USB cable, open the .ino file in the Arduino IDE, choose Tools → Board → Arduino Mega or Mega 2560 and the Mega's port, and press Upload. Write down the _BAUD_RATE value near the top of the sketch: ARCx must use the same baud rate. The firmware upload tutorial walks through it with pictures (it uses the Mega as its example).
  3. Install ARCx on the computer the Mega is plugged into: Windows, Ubuntu or a Raspberry Pi running Ubuntu 24.04. Download ARCx.
  4. Set the baud rate. Add the Ezb Connection robot skill (Communication category), open its configuration, select EZB 0, open the Connection tab and set Baud rate to the firmware's _BAUD_RATE. Save.
  5. Connect. Pick the Mega's serial port in the main window and press the green connect button.
    Windows:  COM3   (check Device Manager for the number)
    Linux:    /dev/ttyACM0   (many clone boards: /dev/ttyUSB0)
  6. Test. Add a Servo skill on D0 with a servo on pin 22, or toggle digital D11 (pin 13, the Mega's on-board LED) in Digital Monitor.
Arduino Mega 2560 EZB firmware, 24 servos, sensors, serial modules
⇄
ARCx Ezb Connection One USB cable
⇄
Any web browser Robot skills, scripts, Custom UI

Using ARC instead?

Press Config on ARC's connection control, open Settings, set the baud rate for the EZB index you use for the Mega and save. Choose the Mega's COM port in the address box and press Connect. ARC lists the firmware's capabilities in its debug window.

ARC or ARCx?

The Mega firmware speaks the standard EZB protocol, so it works with both of Synthiam's platforms. Start new robots in ARCx.

ARCx Recommended ARC
Runs onWindows 10/11 x64, Ubuntu 24.04 x64 and ARM64, Raspberry Pi 4/5 with Ubuntu 24.04Windows
User interfaceAny web browser, several people at once; closing the browser leaves the robot runningWindows desktop application
Connection skillEzb ConnectionEZB Connection
On-robot computerA Raspberry Pi with Ubuntu 24.04 can carry ARCx and the Mega, controlled over Wi-Fi from a browserNeeds a Windows PC
AI agentsBuilt-in MCP serverThrough ARC robot skills
Robot skill storeBoth install robot skills from the Synthiam store
Troubleshooting

If something does not work

Check the pin against the mapping for that job. Servos use pins 22–43, 68 and 69, not the PWM pins; PWM outputs and digital I/O use their own maps. Port D0 is pin 22 for a servo but pin 2 for PWM or digital.

The Ezb Connection's Baud rate must match _BAUD_RATE in the firmware (ARCx defaults to 9600). Save, disconnect and reconnect after changing it. If the Mega resets or never answers, try toggling Enable DTR and Enable RTS on the same tab.

Disconnect ARCx or ARC from the Mega first, because only one program can use the serial port. Check the board (Mega or Mega 2560) and port in the Tools menu, and try another USB cable and port. Clone boards may need their USB driver and board package installed.

The servos are drawing more current than the supply can give. Use a separate servo supply (a sensor shield makes this easy) and join its ground to the Mega's GND.

Add the user that runs ARCx to the dialout group, then log out and back in:
sudo usermod -aG dialout $USER
Questions

Frequently asked questions

The firmware is written for the Mega 2560. The Due shares the Mega's pin layout but uses a different (ARM) processor, and a community member reported that the firmware would not compile for the Due. The likely cause is the software serial code, which is written for AVR chips like the Mega's. If you do not need serial transmit on the digital ports, that part could be removed to build for a Due.

Servos are driven by Arduino's Servo library, which generates servo pulses on ordinary digital pins, so the firmware puts the 24 servos on pins 22–43, 68 and 69, apart from the hardware PWM pins it uses for PWM duty. Just remember that a servo port number and a PWM port number lead to different pins.

Yes. Each board is a row in the Ezb Connection skill (EZB 0, EZB 1...). Skills and scripts choose the board by number, for example Servo.setPosition(d0, 90, 1) for the second board.

No. ARCx and ARC send commands over serial, so the same firmware serves every project. You only reflash to update the firmware.

Put all of the Mega's pins to work

Upload the EZB firmware, install ARCx, add the Ezb Connection skill, and build a robot with dozens of servos and sensors.


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

#1  
Author Avatar
Netherlands
#2  

No arduino mega in house and i need enought Digital pins, allready ordered one should arrive in a few days.... But i have a Arduino Due laying... It has the same pinout... Will it be compatible?

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#3   — Edited

I think it should be compatible. Give it a shot by putting the firmware on it. I think the due and mega are similar enough to work with the same firmware.

edit: quick google says they’re compatible. The duo will work with the mega firmware.

Author Avatar
Netherlands
#4  

Always that fast with a reply.. i almost think you are a bot

Thanks! I will give it a try.. Still waiting till everything is updated on the lattepanda. Making it a workstation/data library for everything ez-b related 

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#5  

Beep bleep beep beep beep 1011010011110101000110001 beep. I’m not a bot:)

Author Avatar
Netherlands
#6  

hahaha lolxD

I tried it.. but it gives me an error. Seems like this file is not compatible with the Due because it has no avr chip...? or am i wrong

User-inserted image

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#7  

The software serial library might not be compatible. Do you require transmitting serial on all digital ports?

Author Avatar
Netherlands
#8  

I want to connect. Arround 16 servos Jrk2 motorcontroller, i think that one ineeds serial... Still trying to understand the manual. The smartdrive duo is on rc mode. Then i need something to control the lights in R2's body, but that can be a seperate nano.