Blog  /  Arduino Leonardo Pinout: Connection Points for the ATmega32u4-Based Microcontroller

Arduino Leonardo Pinout: Connection Points for the ATmega32u4-Based Microcontroller

There are several Arduino boards on the market, and one of the most notable ones is the Arduino Leonardo Pinout. It features a built-in USB port that increases the microcontroller's functionality and connectivity. The Leonardo pinout is also slightly different from some of its siblings in the Arduino family. We have covered its pin layout in detail below, so read through it before using the board in your project.

What is Arduino Leonardo?

Arduino Leonardo is a board microcontroller based on the low-power, high-performance ATmega32u4 chip. It features 20 digital I/O pins (12 double up as analog inputs and seven as PWM outputs), a micro USB port, a 16 MHz crystal oscillator, a reset button, and an ICSP header.
The Arduino Leonardo
The Arduino Leonardo Source: Wikimedia Commons

Arduino Leonardo Pinout

The Arduino Leonardo's pinout broadly falls into the following nine categories.
Arduino Leonardo Pinout
There's also a built-in LED connected to pin 13. If set to one (high), this LED turns on. If low (0), it turns off.

Arduino Leonardo Specifications

Arduino Leonardo Specifications

The Arduino Leonardo Schematic

Arduino Leonardo is open-source hardware, so you can build the board using this schematic and pinout file. It is vital to note the following points.

Power

You can power the Leonardo using the micro USB connection or an external (non-USB) power supply. The external power source can either be a battery or an AC-DC adapter, and the board will select the power source automatically.

USB Overcurrent Protection

This microcontroller features a resettable polyfuse. Its function is to protect the built-in USB ports from shorts and overcurrent. The fuse provides an extra protection layer to the computer's internal protection mechanism, safeguarding the system from currents above 500mA.

Memory

The ATmega32u4 controller contains 1KB EEPROM that you can read/write using the EEPROM library. There's also 2.5KB SRAM and 32KB flash memory.

Input/Output

Leonardo has 20 digital pins for I/O. Each operates at 5V and can provide or handle 40mA max. Additionally, every pin has a 20-50 kΩ internal pull-up resistor (disconnected by default).
The Arduino Leonardo with the power jack and ICSP header attached. Note the pin numbers/labels
The Arduino Leonardo with the power jack and ICSP header attached. Note the pin numbers/labels. Source: Wikimedia Commons

Physical Characteristics

The max dimensions of the Leonardo are 68.6 x 53.3mm (2.7 x 2.1 inches). However, the power jack and USB connector extend beyond these dimensions. The space between pins 7 and 8 is 160 mil, and the board should have four screw holes for attaching to a case or surface.

Communication

This board has multiple communication facilities for interacting with other Arduino boards, computers, or microcontrollers. For instance, it provides UART, digital pin, and USB serial communication, a serial monitor in the Arduino software, I2C, and SPI communication. The microcontroller appears as a generic keyboard and mouse, and you can program it using the mouse and keyboard classes to control these input devices.
A modified Arduino Leonardo schematic for a USB keylogger
A modified Arduino Leonardo schematic for a USB keylogger Source: Wikimedia Commons

Programming

You can program this board using the Arduino software, but you must select Arduino Leonardo in the Tools > Board menu. However, you can bypass the built-in bootloader by using Leonardo's 6-pin ICSP header to program the board directly using the Arduino ISP.

Auto Reset (Software) and Bootloader Initiation

Instead of requiring a physical reset button address before uploading, Leonardo allows resetting by software running on a connected computer. Opening the CDC (virtual) serial/COM port at 1200 baud rate, then closing it triggers the reset. But you can also initiate the bootloader by pressing the onboard reset button.

Connection and Firmware of the Arduino Leonardo

Use the following steps to install the Leonardo driver.
  • Connect the device to the PC
  • Wait for the software installation wizard to launch (select Arduino Leonardo line and press update under the hardware section if it fails to launch)
  • Search for drivers on the PC and click next
  • Select the required driver in the software folder
  • Accept installation
If you want to flash the controller, press the upload button to load the software to the device's memory automatically. This step initiates the reset process, which leads to bootloader startup. After the reset, the platform will wait for a new serial port, then send the sketch to the new virtual COM port. However, the auto-reset might not activate, and you should do the following if it fails.
  • Press and hold the reset button until uploading begins
  • Control the bootloader startup (should see a new port)
The Leonardo board. Note the reset button on the upper left corner
The Leonardo board. Note the reset button on the upper left corner Source: Wikimedia Commons

Comparison with Arduino UNO, NANO, MEGA

Compared to its predecessors (Arduino NANO, UNO, and MEGA), Leonardo runs on a single chip, the ATmega32u4 microchip. This chip gives Leonardo more functionality than the other three.
The Arduino UNO rev 2
The Arduino UNO rev 2 Source: Wikimedia Commons Additionally, using a single chip makes the serial ports virtual. Real serial ports require a dedicated chip for serial communication.
The Arduino NANO
The Arduino NANO Source: Wikimedia Commons

Other Differences

  • A computer can detect the microcontroller as a keyboard, mouse, HID device, or serial port.
  • Opening a serial port on the PC does not trigger automatic restarting
  • More PWM inputs and RAM
  • Increased connectivity and functionality from the micro USB connection
There are several Arduino boards on the market, and one of the most notable ones is the Arduino Leonardo Pinout. It features a built-in USB port that increases the microcontroller's functionality and connectivity. The Leonardo pinout is also slightly different from some of its siblings in the Arduino family. We have covered its pin layout in detail below, so read through it before using the board in your project. What is Arduino Leonardo? Arduino Leonardo is a board microcontroller based on the low-power, high-performance ATmega32u4 chip. It features 20 digital I/O pins (12 double up as analog inputs and seven as PWM outputs), a micro USB port, a 16 MHz crystal oscillator, a reset button, and an ICSP header. https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Arduino_Leonardo.jpg/1599px-Arduino_Leonardo.jpg?20110929073301 The Arduino Leonardo Source: Wikimedia Commons Arduino Leonardo Pinout The Arduino Leonardo's pinout broadly falls into the following nine categories. Pin Category Representation Description Power Pins 3.3V, 5V, GND (three ground pins), IOREF, AREF, Vin, RESET Supply power to the connected device Digital Pins 0-13 Provide Arduino digital inputs and outputs PWM Pins 3, 5, 6, 9, 10, 11, 13 Used to generate the pulsating signal Analog Pins Pins A0-A5 Provide analog inputs and outputs Header Pins (6) ICSP Used to program the controller UART Rx (0), Tx (1) Used for serial communication I2C/ TWI interface SCL, SDA SCL (Serial Clock) transmits clock data for synchronization, while SDA (Serial Data) sends and receives data External Interrupts 0 (interrupt 2) 1 (interrupt 3) 2 (interrupt 1) 3 (interrupt 0) 7 (interrupt 4) Configurable to trigger interrupts on a rising/falling edge, level/value change, or low value SPI (Serial Peripheral Interface) Pins ICSP Used for efficient communication with one or more peripheral devices There's also a built-in LED connected to pin 13. If set to one (high), this LED turns on. If low (0), it turns off. Arduino Leonardo Specifications Microcontroller ATmega32u4 Operating Voltage 5V Recommended Input Voltage 7 to 12V Input Voltage Limit 6 to 20V Digital Input/Output Pins 20 PWM Channels 7 Input Channels (Analog) 12 DC for 3.3V Pin 50 mA DC per Input/Output Pin 40 mA Flash Memory 32 KB (4KB reserved for the bootloader) SRAM 2.5 KB (ATmega32u4) EEPROM 1 KB (ATmega32u4) Clock Speed 16 MHz Dimensions 68.6 x 53.3mm Weight 20g Arduino Leonardo Schematic Arduino Leonardo is open-source hardware, so you can build the board using this schematic and pinout file. It is vital to note the following points. Power You can power the Leonardo using the micro USB connection or an external (non-USB) power supply. The external power source can either be a battery or an AC-DC adapter, and the board will select the power source automatically. USB Overcurrent Protection This microcontroller features a resettable polyfuse. Its function is to protect the built-in USB ports from shorts and overcurrent. The fuse provides an extra protection layer to the computer's internal protection mechanism, safeguarding the system from currents above 500mA. Memory The ATmega32u4 controller contains 1KB EEPROM that you can read/write using the EEPROM library. There's also 2.5KB SRAM and 32KB flash memory. Input/Output Leonardo has 20 digital pins for I/O. Each operates at 5V and can provide or handle 40mA max. Additionally, every pin has a 20-50 kΩ internal pull-up resistor (disconnected by default). https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Arduino_Leonardo_board_%28cropped%29.JPG/1540px-Arduino_Leonardo_board_%28cropped%29.JPG?20150803170232 The Arduino Leonardo with the power jack and ICSP header attached. Note the pin numbers/labels Source: Wikimedia Commons Physical Characteristics The max dimensions of the Leonardo are 68.6 x 53.3mm (2.7 x 2.1 inches). However, the power jack and USB connector extend beyond these dimensions. The space between pins 7 and 8 is 160 mil, and the board should have four screw holes for attaching to a case or surface. Communication This board has multiple communication facilities for interacting with other Arduino boards, computers, or microcontrollers. For instance, it provides UART, digital pin, and USB serial communication, a serial monitor in the Arduino software, I2C, and SPI communication. The microcontroller appears as a generic keyboard and mouse, and you can program it using the mouse and keyboard classes to control these input devices. https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/CleLeornado.png/1600px-CleLeornado.png?20140707143316 A modified Arduino Leonardo schematic for a USB keylogger Source: Wikimedia Commons Programming You can program this board using the Arduino software, but you must select Arduino Leonardo in the Tools > Board menu. However, you can bypass the built-in bootloader by using Leonardo's 6-pin ICSP header to program the board directly using the Arduino ISP. Auto Reset (Software) and Bootloader Initiation Instead of requiring a physical reset button address before uploading, Leonardo allows resetting by software running on a connected computer. Opening the CDC (virtual) serial/COM port at 1200 baud rate, then closing it triggers the reset. But you can also initiate the bootloader by pressing the onboard reset button. Connection and Firmware of the Arduino Leonardo Use the following steps to install the Leonardo driver. Connect the device to the PC Wait for the software installation wizard to launch (select Arduino Leonardo line and press update under the hardware section if it fails to launch) Search for drivers on the PC and click next Select the required driver in the software folder Accept installation If you want to flash the controller, press the upload button to load the software to the device's memory automatically. This step initiates the reset process, which leads to bootloader startup. After the reset, the platform will wait for a new serial port, then send the sketch to the new virtual COM port. However, the auto-reset might not activate, and you should do the following if it fails. Press and hold the reset button until uploading begins Control the bootloader startup (should see a new port) https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Arduino_Leonardo_PCB.jpg/1600px-Arduino_Leonardo_PCB.jpg?20111004100110 The Leonardo board. Note the reset button on the upper left corner Source: Wikimedia Commons Comparison with Arduino UNO, NANO, MEGA Compared to its predecessors (Arduino NANO, UNO, and MEGA), Leonardo runs on a single chip, the ATmega32u4 microchip. This chip gives Leonardo more functionality than the other three. https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Arduino_UNO_unpacked.jpg/1599px-Arduino_UNO_unpacked.jpg?20120109151834 The Arduino UNO rev 2 Source: Wikimedia Commons Additionally, using a single chip makes the serial ports virtual. Real serial ports require a dedicated chip for serial communication. https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Arduino_Nano_on_table.jpg/1052px-Arduino_Nano_on_table.jpg?20210411085003 The Arduino NANO Source: Wikimedia Commons Other Differences A computer can detect the microcontroller as a keyboard, mouse, HID device, or serial port Opening a serial port on the PC does not trigger automatic restarting More PWM inputs and RAM Increased connectivity and functionality from the micro USB connection https://upload.wikimedia.org/wikipedia/commons/0/01/Arduino_Mega.jpg?20110709214008 The Arduino MEGA Source: Wikimedia Commons Arduino Leonardo Applications Industrial automation Wireless keyboards USB trackpad Embedded systems Security and health systems Automatic pill dispenser Summary In conclusion, the Arduino Leonardo's built-in USB communication is its most unique feature compared to its predecessors. Since the USB port is somehow part of the pinout, it is vital to consider it and the other pins altogether. We hope this article has been insightful and if you have any questions or need the Leonardo, contact us for more details.
The Arduino MEGA Source: Wikimedia Commons

Arduino Leonardo Applications

  • Industrial automation
  • Wireless keyboards
  • USB trackpad
  • Embedded systems
  • Security and health systems
  • Automatic pill dispenser

Summary

In conclusion, the Arduino Leonardo's built-in USB communication is its most unique feature compared to its predecessors. Since the USB port is somehow part of the pinout, it is vital to consider it and the other pins altogether. We hope this article has been insightful and if you have any questions or need the Leonardo, contact us for more details.