Arduino Leonardo: everything you need to know about the development board

Arduino has various plates, various flavors with which to satisfy different needs. One of the best known development plates, together with the Arduino UNO, is the Arduino Leonardo. This board with programmable microcontroller hides one of the most powerful features of the board line if compared to some of its sisters.

Of course, this official board of the Arduino Foundation is compatible with all electronic components that we are going to show in other posts. This way you will have the freedom to combine the Leonardo board with many components to create the most varied projects you can imagine.

What is Arduino Leonardo?

This Arduino Leonardo plate bears great similarities to the One, even in appearance. But don’t confuse them, as there are notable differences between the two…

Technical_characteristics, schema and pinout

Arduino Leonardo Pinout

One of the main features you should know about Arduino Leonardo is his pinout, that is, the pins or connections he has. As you see in the image above, it is not the same as the UNO Rev3 board. There are some differences between quantity, limits, and buses.

On the other hand, you must also know their technical characteristics, which are summarized in:

  • Microcontroller: Atmel ATmega32u4 at 16 Mhz.
  • SRAM memory: 2.5 KB
  • EEPROM: 1 KB
  • Flash: 32 KB, but you have to subtract 4 KB used for the bootloader.
  • Operating voltage: 5v
  • Input voltage (recommended): 7-12v
  • Input voltage (maximum limit): 6-20v
  • Digital I/O pins: 20, of which 7 are PWM.
  • Analog input pins: 12 channels.
  • Current intensity per I/O pin: 40mA
  • Current intensity for pin 3.3v: 50mA
  • Weight and dimensions: 68.6×53.3mm and 20 grams
  • Price: Arduino Leonardo with Headers [A000057]

 

Datasheets

As it usually happens with the official Arduino boards, there are a lot of schemes, data and documentation about it, even to be able to create a derivative board from it because it is open-source. From the official website of the project, you will be able to find a lot of information to download about Arduino Leonardo and thus learn more about how it works. For example:

Differences with other Arduino plates

Arduino plates

Ideally, compare it to the most similar board, and that’s Arduino UNO Rev3. If you compare Arduino Leonardo to UNO, you can see many similarities, but also differences that are vital if you are in doubt about buying one or the other.

Physically it seems to have the same dimensions and number of pins. Also, they are arranged in the same way. The power supply is also the same, and even the frequency provided by the frequency generator. Also the A0-A5 could be configured as digital with the function pinMode(nºpin, mode). Where is the difference then?

Well, one of the main differences between the two development boards is in the microcontroller. While UNO is based on ATmega328, Arduino Leonardo is based on ATmega32u4 in his most recent revisions. In the case of the ATmega328, it does not have integrated USB communication, so a converter is needed for that serial port. Function that makes the ATmega16u2 integrated circuit.

In the case of the ATmega32u4, it does have that USB communication already implemented, so that second chip is not necessary. That, at a practical level of user generates a difference. When you connect the Arduino UNO board, a virtual COM port is assigned for the communication. While in Leonardo the board is recognized by the computer as if it were a USB device like a mouse or keyboard. This gives the possibility to use mouse and keyboard functions.

Of course, by having another MCU, some memory data varies as well. From the 32KB flash of Arduino UNO with 0.5KB reserved for the bootloader we go to the 32KB and 4KB used by the bootleader in Leonardo. For the SRAM it goes from 2KB to 2.5KB and for the EPROM it stays the same in both.

Another difference lies in the channels of the analog inputs. While Arduino UNO has only 6 channels, the Arduino Leonardo has 12 channels. That’s for A0-A5, and for pins 4, 6, 8, 9, 10 and 12 which would correspond to channels A6-A11.

More differences can be found in the I2C communication. Both can use TWI, but the difference is where the pins for the serial data line or SDA are placed and the clock line or SCL. On ONE they are on pins A4 and A5. But in Leonardo you have them in 2 and 3 respectively. Slight difference, but enough to make the UNO hats or shields not fully compatible with Leonardo.

As for the SPI communication, on the Arduino UNO you have pins 10, 11, 12, and 13, for the SS, MOSI, MISO and SCK signals respectively. This is not the case in the Leonardo, since it has a specific ICSP connector, a male connector with 6 pins near one of the ends of the card. Another reason that could make UNO shields not work for you…

For the external interruptions there are also some changes. On ONE it has two pins for this, pin 2 (interrupt 0) and pin 3 (interrupt 1). In the case of Arduino Leoanrdo they extend to 5 pins. They are pins 3, 2, 0, 1, and 7 for interruption 0, 1, 2, 3, and 4 respectively.

There is also another change between the two boards that many people tend to forget, and that is the type of USB cable needed to connect both boards to the PC. While in UNO an A-B cable is used, in Leonardo an A-microB is needed.

In short, in the following “Strong” table of differences, you can see more details:

SUMMARY OF THE DIFFERENCES ARDUINO UNO vs.

UNO

<Leonardo
MCU

ATmega328

ATmega32u4

Analog inputs A0, A1, A2, A3, A4, A5

A0, A1, A2, A3, A4, A5, 4, 6, 8, 9, 10, 12

PWM outputs

3, 5, 6, 9, 10, 11

3, 5, 6, 9, 10, 11, 13

I2C communication A4, A5

2, 3

SPI communication

10, 11, 12, 13

ICSP connector

External interruptions

2, 3

3, 2, 0, 1, 7
Flash memory

32 KB

(0.5 KB for the bootloader)

32 KB

(4 KB for the bootloader)

SRAM

2 KB

2.5 KB

EEPROM

1 KB

1 KB

Arduino IDE and programming for Leonardo

Screenshot of Arduino IDE

To program Arduino Leonardo, like the rest of the Arduino boards, you can do it from different platforms like macOS, Windows and Linux. That’s because their Arduino IDE development environment is available for those platforms.

For more information about programming to start with this board, I advise you to download our free PDF course for Arduino IDE. The truth is that Leonardo has no more mystery to start creating sketches. You just have to take into account the differences for the connections and select in the menu of Arduino IDE the right board to load the program.

That is, open Arduino IDE, go to Tools , Plates , and start enjoying the projects you create on your own or the ones we have been publishing on Hwlibre.com. I repeat, the language and codes will be the same, the only thing you have to pay attention is those variations that I have mentioned in the I/O pins and their functions…

Leave a Comment

*

*