Horizontal Servo icon Horizontal Servo — Mouse-drag horizontal servo control with configurable min/max limits, center/release functions, multi-servo mirroring and direction invert. Try it →
 
Arduino Leonardo

Arduino Leonardo by Arduino

Arduino Leonardo with Synthiam ARCx controls servos, PWM, digital I/O, analog inputs, UART and ultrasonic sensors over USB.
Connection Type
USB
Number of Servos
12
Audio Support
No
Camera Support
No
UARTs
Varies
I2C Support
Yes
ADC Ports
Varies
Digital Ports
Varies
A small two-wheeled robot with a pan and tilt sensor head, its microcontroller board connected by USB to a laptop showing a browser joystick dashboard
Arduino Leonardo + Synthiam ARCx

An Arduino Leonardo, driven from your browser

Program the Leonardo with Synthiam's EZB firmware once, then connect it to ARCx or ARC over USB and control its digital, PWM, servo, analog and serial pins directly, with robot skills instead of sketches.

How the Leonardo works with Synthiam. The Leonardo runs Synthiam's EZB firmware, uploaded once with the Arduino IDE. It then connects to ARCx through the Ezb Connection robot skill (or to ARC through EZB Connection) on its USB serial port, and you control its GPIO directly. One setting matters: the Leonardo needs DTR enabled on the connection. 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 Leonardo?

The Arduino Leonardo is an Uno-sized microcontroller board built around the ATmega32u4, a chip with USB built in. Because the USB connection comes from the main chip itself, the Leonardo's pins 0 and 1 are free to use as a real hardware serial port, which the EZB firmware exposes as a UART.

With the EZB firmware, ARCx and ARC can use the Leonardo for:

  • Digital on/off output and input on D0–D13
  • PWM duty on the PWM pins, for LED brightness and motor speed
  • Hobby servos on the digital pins
  • Six analog inputs, ADC0–ADC5
  • A buffered hardware UART on pins 0 (RX) and 1 (TX)
  • Serial transmit on the digital ports, and HC-SR04 ultrasonic distance sensors

Arduino Leonardo at a glance

TypeMicrocontroller board (DIY EZB with Synthiam firmware)
MakerArduino
MicrocontrollerATmega32u4 (native USB)
ConnectionUSB (serial), DTR enabled
EZB portsD0–D13, ADC0–ADC5, UART 0
FirmwareEZ-Genuino_Leonardo, last updated 2022/08/24
Synthiam uses it forLow-cost servo, sensor and serial I/O over USB
Websitestore.arduino.cc
Capabilities

What you can do with a Leonardo in Synthiam

⚙

Servos

Hobby servos on the digital ports, with release. Use the Servo, Servo Pad, Auto Position and Servo Animation skills.

🎛

PWM and motors

Dim LEDs and set motor speed through an H-bridge with the Hbridge Movement Panel or Pwm Slider.

💡

Digital I/O

LEDs, relays, buttons and switches, shown and toggled live in Digital Monitor.

📈

Analog sensors

Read ADC0–ADC5 in Adc Monitor, chart them in Ez Chart, or use ADC.get(adc0) in a script.

🔌

Hardware UART

Talk to a GPS, RFID reader or motor controller on pins 0 and 1, with a receive buffer in the firmware. In a script: UART.initHardwareUart(0, 9600), then the UART.hardwareUart... read and write commands.

📡

Ultrasonic distance

HC-SR04 sensors on any two digital ports, read with Ping.get(trigger, echo), or in ARC with the Ultrasonic Distance skill.

Pin reference

Leonardo pins and EZB ports

EZB port numbers match the Leonardo's pin numbers: D9 in ARCx is pin 9, and ADC0 is A0. The digital pins can be used for PWM, servos and digital on/off. The ADC ports are 0–5 for analog input. Digital pin 0 is UART #0 RX, and digital pin 1 is UART #0 TX.

EZB portLeonardo pinPWM dutyAlso used for
D00NoUART #0 RX. Use it for digital only if you do not use the UART.
D11NoUART #0 TX. Use it for digital only if you do not use the UART.
D22NoServo, digital, serial TX, ping
D33Yes (980 Hz)Servo, digital, serial TX, ping
D44NoServo, digital, serial TX, ping
D55Yes (490 Hz)Servo, digital, serial TX, ping
D66Yes (490 Hz)Servo, digital, serial TX, ping
D77NoServo, digital, serial TX, ping
D88NoServo, digital, serial TX, ping
D99Yes (490 Hz)Servo, digital, serial TX, ping
D1010Yes (490 Hz)Servo, digital, serial TX, ping
D1111Yes (980 Hz)Servo, digital, serial TX, ping
D1212NoServo, digital, serial TX, ping
D1313Yes (490 Hz)Servo, digital, serial TX, ping; the on-board LED
ADC0–ADC5A0–A5Analog input, 10-bit

PWM pins vary by board

On the Leonardo, PWM works on pins 3, 5, 6, 9, 10, 11 and 13. PWM pins may vary based on the board type, so check the table below if you use a Leonardo-compatible board such as a Micro.

Servos and PWM share timers

The hardware spec lists up to 12 servos. Arduino's Servo library notes that, on boards other than the Mega, using servos disables PWM on pins 9 and 10. The Leonardo firmware does not include I2C.

BoardPWM pinsPWM frequency
Uno, Nano, Mini3, 5, 6, 9, 10, 11490 Hz (pins 5 and 6: 980 Hz)
Mega2 - 13, 44 - 46490 Hz (pins 4 and 13: 980 Hz)
Leonardo, Micro, Yún3, 5, 6, 9, 10, 11, 13490 Hz (pins 3 and 11: 980 Hz)
Uno WiFi Rev2, Nano Every3, 5, 6, 9, 10976 Hz
MKR boards *0 - 8, 10, A3, A4732 Hz
MKR1000 WiFi *0 - 8, 10, 11, A3, A4732 Hz
Zero *3 - 13, A0, A1732 Hz
Nano 33 IoT *2, 3, 5, 6, 9 - 12, A2, A3, A5732 Hz
Nano 33 BLE/BLE Sense1 - 13, A0 - A7500 Hz
Due **2-131000 Hz
1013, 5, 6, 9pins 3 and 9: 490 Hz, pins 5 and 6: 980 Hz

Source: Arduino's analogWrite() reference. * These boards also have a true analog output (DAC) on pin A0. ** The Due also has true analog outputs on pins DAC0 and DAC1. The EZB firmware on this page is built for the Leonardo.

Get started

Connect a Leonardo to ARCx

  1. Download the firmware. EZ-Genuino_Leonardo.zip (last updated 2022/08/24). Extract it to a folder.
  2. Upload it with the Arduino IDE. Open EZ-Genuino_Leonardo.ino in the Arduino IDE, choose Tools → Board → Arduino Leonardo and its port, and press Upload. The firmware upload tutorial shows each step.
  3. Install ARCx on the computer the Leonardo plugs into: Windows, Ubuntu or a Raspberry Pi with Ubuntu 24.04. Download ARCx.
  4. Enable DTR. Add the Ezb Connection robot skill (Communication category), open its configuration, select EZB 0, open the Connection tab and tick Enable DTR (Data Terminal Ready). Set Baud rate to 115200 to match the sketch. Save.
  5. Connect. Pick the Leonardo's serial port and press the green connect button.
    Windows:  COM3   (check Device Manager for the number)
    Linux:    /dev/ttyACM0
  6. Test. Toggle D13 in Digital Monitor to blink the on-board LED, then add a Servo skill on a digital port.

Why DTR?

Due to an undocumented feature of the Leonardo's USB serial driver, the board only receives data events when DTR is enabled. Without it, the connection opens but the Leonardo never answers.

Using ARC instead?

The firmware works with ARC versions greater than or equal to 2019.06.25.00. Open ARC's connection control Config screen (the same place you set the baud rate), tick DTR Enabled, save, pick the Leonardo's COM port and press Connect.

ARC or 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 Connection, with Enable DTREZB Connection, with DTR Enabled
AI agentsBuilt-in MCP server: agents like Claude can see, drive and program the robotThrough ARC robot skills
Troubleshooting

If something does not work

DTR is off. Tick Enable DTR on the Ezb Connection's Connection tab (in ARC, DTR Enabled on the connection Config screen), save, then disconnect and reconnect.

Because the USB comes from the Leonardo's main chip, the board re-enumerates when it resets into its bootloader, and Windows can give it a different COM number. Disconnect ARCx or ARC before uploading, select the port again after upload, and update the address in the Ezb Connection skill if the number changed.

Initialize UART 0 with the device's baud rate first (UART.initHardwareUart(0, 9600)), wire the device's TX to pin 0 and its RX to pin 1, and share ground. Do not use D0 or D1 as digital ports at the same time.

A servo is in use. Arduino's Servo library disables PWM on pins 9 and 10 on this board while servos are attached. Move the PWM device to pin 3, 5, 6, 11 or 13.

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

Not much. The sketch sets 115200, but the firmware's own notes say it does not matter on the Leonardo because the USB device connects at the fastest speed it can. DTR is the setting that matters.

Both give you servos, digital, PWM, six ADC inputs and ultrasonic sensors. The Leonardo adds a hardware UART on pins 0 and 1 and lets you use those pins, because its USB does not need them. The Uno has more firmware options on Synthiam, including a wheel encoder firmware. See the Arduino Uno page.

The Micro uses the same ATmega32u4 chip and shares the Leonardo's PWM pins in Arduino's table, but this firmware is published for the Leonardo. If you try it on a Micro, check its pinout against the table above before wiring.

Yes. Add it as another row in the Ezb Connection skill (EZB 1, EZB 2...) and pass that number to skills and scripts, for example Digital.set(d13, true, 1).

Make your Leonardo a robot controller

Upload the EZB firmware, install ARCx, enable DTR, and control the Leonardo from any web browser.


ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.