

The Arduino Leonardo R3 is a microcontroller board developed by Arduino, based on the ATmega32u4 microcontroller. Unlike other Arduino boards, the Leonardo features built-in USB communication, enabling it to emulate a keyboard, mouse, or other USB devices directly. This unique capability makes it ideal for projects requiring direct interaction with a computer or other USB host devices.








The Arduino Leonardo R3 is equipped with a range of features that make it versatile and powerful for various applications.
| Specification | Value |
|---|---|
| Microcontroller | ATmega32u4 |
| Operating Voltage | 5V |
| Input Voltage (recommended) | 7-12V |
| Input Voltage (limit) | 6-20V |
| Digital I/O Pins | 20 (7 PWM outputs) |
| Analog Input Pins | 12 |
| DC Current per I/O Pin | 40 mA |
| Flash Memory | 32 KB (4 KB used by bootloader) |
| SRAM | 2.5 KB |
| EEPROM | 1 KB |
| Clock Speed | 16 MHz |
| USB Communication | Native USB (no external chip) |
The Arduino Leonardo R3 has 20 digital I/O pins, 12 of which can also be used as analog inputs. Below is a detailed description of the pin layout:
| Pin Number | Functionality | Description |
|---|---|---|
| 0-1 | RX/TX | Serial communication (UART) |
| 2-13 | Digital I/O | General-purpose digital input/output |
| 3, 5, 6, 9, 10, 11 | PWM Output | Pulse-width modulation (PWM) capability |
| 13 | Built-in LED | Onboard LED connected to pin 13 |
| Pin Number | Functionality | Description |
|---|---|---|
| A0-A11 | Analog Input | Read analog signals (0-5V) |
| Pin Name | Functionality | Description |
|---|---|---|
| VIN | Input Voltage | External power input (7-12V recommended) |
| 5V | Regulated 5V Output | Powers external components |
| 3.3V | Regulated 3.3V Output | Powers low-voltage components |
| GND | Ground | Common ground for the circuit |
| IOREF | I/O Reference Voltage | Voltage reference for I/O pins |
The Arduino Leonardo R3 is easy to use and program via the Arduino IDE. Below are the steps and best practices for using the board effectively.
Powering the Board:
Programming the Board:
Connecting Components:
The following example demonstrates how to use the Arduino Leonardo R3 to emulate a keyboard and send a keystroke to a connected computer.
#include <Keyboard.h> // Include the Keyboard library
void setup() {
// Start the Keyboard library
Keyboard.begin();
delay(1000); // Wait for the computer to recognize the device
}
void loop() {
// Send the letter 'A' to the computer
Keyboard.print('A');
delay(1000); // Wait 1 second before sending the next keystroke
}
Note: Ensure the sketch does not continuously send keystrokes, as it may make the computer unresponsive.
The board is not recognized by the computer:
Sketch upload fails:
USB functionality is not working:
Keyboard.h or Mouse.h library is included in your sketch. The board overheats:
Q: Can the Leonardo R3 be powered via USB only?
A: Yes, the board can be powered and programmed via USB without the need for an external power supply.
Q: How is the Leonardo different from the Arduino Uno?
A: The Leonardo uses the ATmega32u4 microcontroller, which has built-in USB communication, allowing it to act as a USB device. The Uno requires an external USB-to-serial chip for communication.
Q: Can I use the Leonardo for wireless communication?
A: Yes, you can connect wireless modules (e.g., Bluetooth, Wi-Fi) to the Leonardo via its digital or analog pins.
Q: What is the maximum current the board can supply?
A: The 5V pin can supply up to 500 mA when powered via USB, or up to 1A when powered via an external power supply.
By following this documentation, users can effectively utilize the Arduino Leonardo R3 for a wide range of projects and applications.