Arduino Leonardo/Micro vs UNO R4 for USB HID: Which Is Better for Keyboard and Mouse Projects?

Arduino Leonardo and Micro vs UNO R4 for USB HID: compare ATmega32U4 native USB with the 48 MHz RA4M1, Keyboard/Mouse support, USB recovery, memory, 5 V logic, UNO R4 Minima vs WiFi and practical HID project choices.

The Arduino Leonardo, Arduino Micro, UNO R4 Minima and UNO R4 WiFi can all act as USB Human Interface Devices.

That means they can appear to a computer as:

  • USB keyboard;
  • USB mouse;
  • macro pad;
  • button box;
  • custom controller;
  • assistive input device.

But their USB architectures are very different.

The classic Leonardo and Micro use:

The UNO R4 family uses a much newer:

with far more CPU, memory and peripherals.

The simplest way to frame the choice is:

Quick Comparison

Feature Leonardo / Micro UNO R4 Minima UNO R4 WiFi
Main MCU ATmega32U4 Renesas RA4M1 Renesas RA4M1
CPU 8-bit AVR 32-bit Cortex-M4 32-bit Cortex-M4
Clock 16 MHz 48 MHz 48 MHz
Flash 32 KB 256 KB 256 KB
SRAM 2.5 KB 32 KB 32 KB
Data memory / EEPROM 1 KB EEPROM 8 KB data memory 8 KB data memory
Logic voltage 5 V 5 V 5 V
USB connector Micro-USB USB-C USB-C
Keyboard HID Yes Yes Yes
Mouse HID Yes Yes Yes
Physical UART separate from USB Yes, Serial1 Yes Yes
Wi-Fi/BLE No No Yes, ESP32-S3
12-bit DAC No Yes Yes
CAN controller No Yes Yes
RTC No dedicated RTC Yes Yes
USB path complexity Very simple Simple/direct More complex due ESP32-S3 bridge/routing

All Four Boards Support Keyboard and Mouse HID

Arduino’s current Mouse documentation lists:

as supported HID boards.

So the question is not:

It can.

The real question is:

Leonardo and Micro: Native USB on the Main MCU

The ATmega32U4 directly handles:

There is no separate USB-to-serial bridge between the MCU and the computer.

That architecture is extremely straightforward for HID.

Why ATmega32U4 Became Popular for HID

For many years, Leonardo and Micro were the obvious Arduino choices for:

  • DIY keyboards;
  • macro pads;
  • sim racing button boxes;
  • joystick projects;
  • custom control panels.

The sketch can simply use libraries such as:

and the same chip presents the USB device directly to the PC.

UNO R4 Minima: Modern Native USB

The UNO R4 Minima uses the:

which includes USB hardware connected directly to the board’s:

connector.

So Minima preserves the clean conceptual architecture:

but provides much more processing power and memory than the ATmega32U4.

UNO R4 WiFi Has a More Complex USB Path

The UNO R4 WiFi contains:

The ESP32-S3 normally provides Wi-Fi/Bluetooth and also participates in the board’s USB/serial bridge system.

Arduino’s current user manual explains that the USB data path is routed through switches and, by default, communication passes through the ESP32-S3 bridge.

UNO R4 WiFi Can Still Do Native HID

Despite the more complex routing, Arduino explicitly supports:

on the UNO R4 WiFi.

When the HID stack is enabled, the board can present the RA4M1 HID interface through USB.

UNO R4 WiFi Can Re-Enumerate Differently in HID Mode

Arduino warns that when HID is enabled on UNO R4 WiFi, the board may appear as a:

on the computer.

If that happens, Arduino recommends:

This is an important practical difference from a simple serial-only sketch.

Serial Remapping on UNO R4 WiFi

Arduino’s current UNO R4 WiFi implementation states that including:

remaps:

so the HID-capable USB path can expose additional USB serial-control features.

This is another reason a HID sketch on UNO R4 WiFi can behave differently from an ordinary sketch.

Leonardo/Micro USB Behaviour Is Also Special

The older boards are not completely immune to USB surprises.

Because the ATmega32U4 runs both:

resetting the MCU temporarily disconnects the USB device.

During upload, the bootloader can appear as a different serial port.

ATmega32U4 Uses the 1200 bps Touch Technique

The normal Leonardo/Micro upload process uses a:

to trigger the bootloader.

This means the application USB port can disappear and the bootloader port can appear temporarily.

UNO R4 Has a Better Recovery Mechanism

The UNO R4 family supports entering the bootloader through:

which is particularly useful if a bad HID sketch:

  • spams keystrokes;
  • locks USB;
  • crashes the application;
  • prevents normal enumeration.

Bad HID Code Can Make Any Board Annoying to Reprogram

For example, this is dangerous:

because it continuously types into the host computer.

A safer design uses a physical enable input.

Safe Keyboard Example

The same basic HID logic can be used on:

  • Leonardo;
  • Micro;
  • UNO R4 Minima;
  • UNO R4 WiFi.

Keyboard API

Typical Keyboard functions include:

Mouse API

Typical Mouse functions include:

Raw HID Capability Is Not the Main Performance Limit

A keyboard report is tiny.

So even the 16 MHz ATmega32U4 is easily fast enough for ordinary keyboard and mouse projects.

You do not need a 48 MHz Cortex-M4 simply to send:

to a PC.

UNO R4 Becomes Valuable When HID Is Only One Part of the Project

Suppose a controller also needs:

  • many state machines;
  • sensor filtering;
  • CAN communication;
  • large lookup tables;
  • display handling;
  • networking;
  • complex menu logic.

That is where the UNO R4 becomes much more attractive.

CPU Difference

Leonardo/Micro:

UNO R4:

The R4 is not simply three times faster because architecture matters as well.

The Cortex-M4 is a much more capable processor for:

  • 32-bit arithmetic;
  • interrupt-heavy applications;
  • DSP-style work;
  • larger libraries;
  • complex firmware.

Memory Difference Is Huge

Leonardo/Micro:

UNO R4:

That gives R4 approximately:

at the headline level.

Why RAM Matters for HID Controllers

A basic button box does not need much RAM.

But a more advanced controller may store:

  • keymaps;
  • profiles;
  • macro sequences;
  • menu text;
  • USB descriptors;
  • sensor calibration data;
  • network buffers.

On an ATmega32U4, 2.5 KB SRAM becomes restrictive very quickly.

UNO R4 Has Better ADC Capability

Leonardo/Micro use a:

UNO R4 supports analogue reads up to:

through the RA4M1.

That is useful for:

  • joysticks;
  • pedal sensors;
  • analogue controls;
  • instrumentation.

UNO R4 Includes a True DAC

UNO R4 also provides a:

on A0.

Leonardo and Micro have:

and use PWM for analogWrite().

UNO R4 Includes CAN

The RA4M1 includes a CAN controller.

That means a USB HID controller can also communicate with:

  • automotive networks;
  • industrial equipment;
  • machine controllers;

with an external CAN transceiver.

Leonardo/Micro need an external CAN controller such as an MCP2515-class device.

UNO R4 Includes an RTC

The UNO R4 RA4M1 includes a real-time clock.

This can be useful for:

  • timestamped macros;
  • scheduled actions;
  • standalone controllers;
  • logging.

UNO R4 WiFi Adds Wireless

The WiFi version adds:

plus the:

This enables a USB controller that can also:

  • receive commands over Wi-Fi;
  • publish state to a network;
  • communicate over BLE;
  • display local status.

That Extra Hardware Comes with More Complexity

For a basic six-button keyboard emulator, the UNO R4 WiFi architecture is arguably more complicated than needed.

You now have:

instead of:

UNO R4 Minima Is the Cleaner Modern HID Upgrade

If you want:

  • 48 MHz Cortex-M4;
  • 32 KB SRAM;
  • 256 KB Flash;
  • native HID;
  • USB-C;
  • 5 V logic;
  • CAN;
  • DAC;

without the ESP32-S3 bridge/radio layer, UNO R4 Minima is the simpler modern option.

Micro Is Still the Better Compact Board

UNO R4 uses the full UNO footprint.

The Arduino Micro is:

and breadboard-friendly.

For a compact embedded USB controller, physical size may matter more than CPU performance.

Leonardo Is Still Convenient for Shields

Leonardo retains the classic Arduino shield layout.

If your HID project uses:

  • relay shield;
  • LCD shield;
  • motor shield;
  • prototype shield;

its full-size form factor can still be useful.

UNO R4 Also Uses the UNO Shield Form Factor

The R4 preserves the familiar UNO physical layout and 5 V logic.

This makes it easier to migrate many shield-based HID projects from Leonardo or UNO-era designs.

Software compatibility still needs to be checked because:

AVR-Specific Libraries Can Break on UNO R4

A library that uses:

directly is AVR-specific.

It will not simply compile on the RA4M1.

Generic Arduino libraries based on:

  • digitalRead();
  • digitalWrite();
  • analogRead();
  • Wire;
  • SPI;

are much easier to migrate.

5 V Logic on All These Boards

One major advantage is that:

all use:

This makes migration easier for many older Arduino circuits.

But GPIO Current Is Different

The classic ATmega32U4 boards commonly use:

as the current board-level guidance per GPIO.

The current UNO R4 pinout specifies:

with a board-level overall GPIO current limit.

So do not assume a circuit that directly sinks relatively high LED current on Leonardo can be copied unchanged to UNO R4.

USB Connector Upgrade

Leonardo and Micro use:

while UNO R4 uses:

For a new controller enclosure, USB-C is generally easier to source and mechanically more convenient.

Which Is Better for a Simple Macro Pad?

Leonardo or Micro.

A simple macro pad needs very little:

  • CPU;
  • RAM;
  • Flash.

The ATmega32U4 architecture is straightforward and very well established.

Which Is Better for a Compact Macro Pad?

Micro.

It provides the same HID capability as Leonardo in a much smaller:

board.

Which Is Better for a Complex Simulator Controller?

UNO R4 is the stronger platform if the project includes:

  • many analogue axes;
  • menus;
  • CAN;
  • large configuration tables;
  • complex filtering;
  • high-level state machines.

Which Is Better for HID Plus Wi-Fi?

UNO R4 WiFi.

Leonardo and Micro would require an additional Wi-Fi module.

Which Is Better for Pure USB Simplicity?

Leonardo/Micro.

The entire architecture is simply:

Which Is Better for Modern USB-C Without Wireless?

UNO R4 Minima.

It gives the newer RA4M1 platform without the WiFi version’s ESP32-S3 routing layer.

Which Is Better for Joysticks and Analogue Axes?

UNO R4 has much more capable analogue hardware and significantly more processing headroom.

But software support for a specific joystick/HID report class still needs to be verified for the library you intend to use.

Keyboard and mouse HID support is officially documented.

Recovery Strategy

For any HID development board, build a recovery mechanism into your workflow.

Useful approaches include:

  • physical HID-enable switch;
  • startup delay;
  • safe-mode pin;
  • double-tap reset on UNO R4;
  • bootloader reset timing on ATmega32U4.

Decision Table

Requirement Better fit
Simplest HID architecture Leonardo / Micro
Smallest board Micro
Classic shield footprint Leonardo / UNO R4
USB-C UNO R4
Most CPU performance UNO R4
Most SRAM UNO R4
Most Flash UNO R4
Native keyboard/mouse HID All
Wi-Fi/BLE UNO R4 WiFi
CAN controller UNO R4
True DAC UNO R4
Advanced ADC UNO R4
Simplest modern R4 USB path UNO R4 Minima
Breadboard-friendly HID Micro

Quick Reference

Final Thoughts

Leonardo and Micro are not obsolete simply because UNO R4 is faster.

For a simple USB keyboard, mouse or macro controller, the ATmega32U4 boards remain extremely effective because:

The UNO R4 becomes the more capable platform when HID is only one part of a larger embedded system.

Its:

provide much more room for complex application logic.

For the cleanest modern USB-C HID architecture, the UNO R4 Minima is especially attractive.

For HID plus wireless connectivity, the UNO R4 WiFi adds Wi-Fi and Bluetooth, but its USB architecture is more complex because of the ESP32-S3 bridge/routing system.

For the smallest proven USB HID board, the Arduino Micro remains hard to beat.

For detailed pin mapping, see our Arduino Leonardo pinout guide, Arduino Micro pinout guide and UNO R4 WiFi pinout guide.

Share your love