leonardo_arduino
leonardo_arduino
net/publication/328233526
CITATIONS READS
0 2,833
1 author:
Mohamed Fezari
Badji Mokhtar - Annaba University
138 PUBLICATIONS 423 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Our research interests include Control systems and Automation, Fault Diagnosis and Isolation, Fault Tolerant Control and Supervisory systems with Advanced Quality
Control. View project
All content following this page was uploaded by Mohamed Fezari on 12 October 2018.
In this post, we will try to cover each and everything related to Arduino Leonardo, so we
don’t need to wrestle our mind browsing the whole internet and find all the information in one
place. Let’s dive right in and get down to the nitty-gritty of this tiny module.
Serial Peripheral Interface (SPI) is a third communication protocol added on the board that is
commonly used to send data between microcontrollers and small peripherals such as sensors,
shift registers, and SD cards using separate clock and data lines, layered with a select line to
pick the device for communication.
USB jack, Power Jack and Reset button are quite in line with each other and are surfaced on one
side of the board. Nonetheless, all components and pins on the board are designed in a regular
pattern, giving a compact and symmetrical interface.
Memory
The ATmega32u4 has 32 KB (with 4 KB used for the bootloader). It also has 2.5 KB of SRAM and
1 KB of EEPROM (which can be read and written with the EEPROM library).
We have got a clear idea about some of the basic functions of this Arduino Module. In this section,
we will break down pinout of the board with different images and describe them in terms of pin
description of the board. Let’s get started.
PWM output
we place the board with power jack pointing upward, these pins appear on the right side of the
board. PWM is a process for getting analog results with digital means. We can see these pins in the
figure below.
Serial Communication
Three communication protocols including SPI, UART and I2C are incorporated on the board.
We can see them on the figure below. It is important to note that SPI communication is not
available on the digital I/O pins like other boards instead, it houses in the ICSP header.
Power Source
Mainly, the board operates at 5V while 3.3V is the operating voltage of each pin. The Vin is the input
voltage that ranges between +7 to +12 V. This voltage comes from the external power source. There
are two ground pins on the board. The AREF is an Analogue reference voltage, mainly used for
analog pins.
The IOREF is useful for powering and developing a compatibility between this board and Arduino
Shields. As the shield is connected with this pin, it (shield) wears the I/O voltage provided by the
Board. The Shield using IOREF pin will be compatible with both 3V3 and 5V.
Programming
The Leonardo can be programmed with the Arduino software (download). Select "Arduino Leonardo
from the Tools > Board menu (according to the microcontroller on the board). For details, we can
see the reference and tutorials. The ATmega32U4 on the Arduino Leonardo comes preburned with
a bootloader that allows us to upload new code to it without the use of an external hardware
programmer. It communicates using the AVR109 protocol. We can also bypass the bootloader and
program the microcontroller through the ICSP (In-Circuit Serial Programming) header using Arduino
ISP or similar; see these instructions for details.
ICSP Programming
ICPS stands for In-Circuit Serial Programming – A feature used for programming Arduino with
another Arduino. ICSP header is added that helps in connecting the board with a computer for
uploading a sketch in case USB port is not available.
Arduino.cc has introduced its own official software, called Arduino IDE, for programming the
Arduino module. This software supports common operating systems like Windows, Linux or MAC.
Before we download this software, we make sure that required software version is compatible
with the system i.e. if we aim to download App version, we must have Windows 10 installed in
our system as app version is not compatible with Windows 7 or 8.1.
We are ready to use the software as we install it. Some simple LED programs are already available
on the software, giving us the flexibility to start working on the board.
Arduino IDE comes with a compilation option that allows us to see the code compilation on the
bottom of the screen as we upload the code. It generates hex file of the code which then is
transferred into the board.
No external burner is required to burn the code inside the module as it comes with a built-in
bootloader. Having said that, if we intend to insert a new controller on the module, we need to
install the bootloader again using IDE software.
The Serial Monitor is added in Arduino Software, that helps us to see the code working in real time
after we verify and upload the code.
There is a slight difference between these two boards in terms of controller used, number of digital
pins, PWM pins, and the pins reserved for SPI communication.
Arduino Uno incorporates ATmega328 while Arduino Leonardo comes with ATmega32U4.
Similarly, Uno has 20 digital I/O pins, out of them 6 are analog input pins and Leonardo has 23
digital I/O pins, out of which 12 are analog input pins.
There are 7 PWM output pins available on the Leonardo and 6 are added on the Uno board.
Uno comes with SPI protocol on the digital I/O pins while Leonardo contains SPI communication on
the ICSP header pins.
6. Arduino Leonardo Projects and Applications
We can not write off the importance of Arduino Modules if we are developing a project that comes
with a remote connection with automation. Arduino Leonardo comes with a wide range of
applications and incorporates a number of peripherals, setting us free from spending money for
buying and integrating additional components.
Applications
Following are some major applications can be developed using Arduino Leonardo:
Industrial Automation
IR Remote control
Embedded Systems
Student Projects
Smart things
The Arduino library has made it really easy to do by creating a two new classes - one for emulating
a mouse, and the other a keyboard.
There are two things we must do before using wer new Leonardo board.
First, we must upgrade wer Arudino IDE to version 1.01. It adds the support needed for this new
board, plus it has a lot of nice new features.
Second, unless we are using Linux, we will need to install USB drivers for the Leonardo.
References
1. http://forum.arduino.cc/index.php?topic=292191.0
2. https://www.arduino.cc/en/Main/Arduino_BoardLeonardo
3. https://www.instructables.com/id/Step-by-Step-Guide-to-the-Arduino-Leonardo/
4. https://www.thingbits.net/products/adafruit-motor-shield-arduino
5. http://elecrab.com/archives/800
6. Le grand livre d'Arduino, Patrick Chantereau et Erik Bartmann, éd. Eyrolles,
2014 (ISBN 978-2212137019)
7. Arduino Workshop: A Hands-On Introduction with 65 Projects, John Boxall,
2013 (ISBN 978-1593274481)
8. Programming Arduino: Getting Started With Sketches, Simon Monk, 2011 (ISBN 978-
0071784221)