You are on page 1of 20

Arduino Leonardo:

Arduino Leonardo circuit board is based on the microcontroller ATmega32u4. It has a 16


MHz crystal oscillator, 20 digital I/O pins of which 7 can be used as PWM outputs and
12 as analog inputs, a micro USB connection, an ICSP header, a reset button and a power
jack. The board has a 5V voltage regulator and USB burner.
In Leonardo board circuit, ATmega32u4 has built-in USB communication, eliminating
the need for a secondary processor, needed for communication between board and other
devices. As most of the components are already present on the board, it reduces projects
manufacturing process. The program is loaded from computer to the main board via using
USB burner.

Arduino Leonardo front including headers

Arduino Leonardo back side

Specifications:
In Arduino Leonardo:
Microcontroller used is ATmega32u4.
Operating Voltage is 5V.
Recommended Input Voltage 7-12V.
Input Voltage is limited to 6-20V.
Number of Digital input/output pins are 20.
Number of PWM Channels are 7.
Number of Analog Input Channels are 12.
DC Current per I/O Pin is 40 m-A.
DC Current for 3.3V Pin is 50 m-A.
Flash Memory of ATmega32u4 is 32 KB of which 4 KB memory is used by
bootloader.
SRAM of ATmega32u4 is 2.5 KB.
EEPROM (Electrically Erasable Programmable ROM) of ATmega32u4 is 1 KB.
Clock Speed is16 M-Hz.
Schematic Diagram:

Power:
The power to the board is provided by using the micro USB connection or with an
external power source. An AC-to-DC adapter or a battery can be used as an external
power source. The adapter is connected to arduino by plugging a 2.1mm center-positive
plug into the board's power-jack. And if we are using a battery then we connect the
positive and negative terminals of the battery to the Gnd and Vin pin headers of the
POWER connector indicated on the board.
The board can also function on an external power supply of 6 to 20 volts. If the source
8

supply is less than 7V, the 5V pin may supply less than 5V and the board may not work
properly. If the source is providing more than 12V, the voltage regulator may overheat
and the board may be damaged. So, the recommended supply voltage range is 7 to 12
volts.
The power pins and their functions are briefly mentioned below:

Memory:
ATmega32u4 has 32 KB memory and 4KB of that memory are reserved for the
bootloader. It also has 2.5 KB of SRAM and 1 KB of EEPROM.
Input and Output:
Each of the 20 digital i/o pins on the Leonardo can be used as an input or output, using
functions like pinMode(), digitalWrite(), and digitalRead(). These pins operate at 5 volts.
Each pin can provide or receive a maximum of 40 m-A and has an internal pull up
resistor of 20-50 k-.

In addition, some pins have specialized functions:

There are also some other pins present on the Leonardo board:

Communication:
The Leonardo has a number of ways to communicate with another Arduino, another
microcontroller or a computer. The ATmega32U4 provides UART TTL serial
communication which is available on digital pins 0 (receiver) and pin 1 (transmitter). The
ATmega32U4 also allows for serial communication by using USB connection and
appears as a virtual com port to the software installed on the computer. The chip also
performs like a full speed USB 2.0 device, using standard USB COM drivers. On

10

Windows, a file with domain .INF is required. The Arduino software also includes a
serial monitor which permits simple textual data to be sent to and from the Arduino board.
The RX(receiver) and TX(transmitter) LEDs on the board will flash when data is being
transmitted via the USB connection to the computer but not for serial communication on
pins 0 and 1.
A Software Serial library allows serial communication by using any of the Leonardo's
digital pins. The ATmega32U4 also supports I2C (TWI) and SPI communication. The
Arduino software includes a Wire library to simplify use of the I2C bus. For SPI
communication we use the SPI library.
The Leonardo emerges as a standard keyboard and mouse, and can be programmed to
control these input devices using the Keyboard and Mouse classes.

Programming:
The Leonardo can be programmed with the Arduino software available on arduino site
(i.e. www.arduino.cc). Install this free software; in menu bar, open Tools drop down
menu and then select Arduino Leonardo.
The ATmega32U4 on the Arduino Leonardo comes pre-burned with a bootloader that
allows you to upload new code to it without the using an external hardware programmer.
It uses the AVR109 protocol.
You can also program the microcontroller via the ICSP (In-Circuit Serial Programming)
header using Arduino ISP.

Automatic Reset and Bootloader Initiation:


The Leonardo is designed in a way that allows it to be reset by software running on a
connected computer rather than needing to physically push the reset button before an
upload. The reset is triggered when the Leonardo's virtual (CDC) serial / COM port is
opened at 1200 baud and then closed. When this happens, the processor will reset thus
breaking the USB connection to the computer; meaning that the virtual serial / COM port
will disappear. After the processor resets, the bootloader starts and remains active for
about 8 seconds. The bootloader can also be initiated by pushing the reset button on the
Leonardo. Observe that when the board first powers up, it will jump straight to the user
sketch, if present, rather than initiating the bootloader.
Because of the way the Leonardo handles reset; it's best to let the Arduino software try to
initiate the reset before uploading the program, especially if you have the routine to press
the reset button on other boards before uploading. If the software can't reset the board
you can always start the bootloader by pushing the reset button on the board.

USB Over-current Protection:


The Leonardo has a resettable poly-fuse that sets off if it faces shorts and protects our
computer's USB ports. Most computers have their own internal protections but fuse

11

provides an extra layer of protection. If more than 500 m-A current is applied to the USB
port then the fuse automatically break the connection till the short circuit or overload is
managed.

Physical Characteristics:
The max area of the Leonardo PCB is 2.72.1 inches with USB connector and powerjack extending beyond the former measurements. Four holes are present on the board that
allows the board to be fixed to any surface or on another board. The distance between
digital pin number 7 and 8 is 0.16 inch, not an even multiple of the 0.1 inch spacing of
the other pins.

12

Arduino Uno R3:

The Arduino Uno R3 (revision 3) is ATmega328 based board. It has 6 analog inputs, 14
digital input/output pins, a USB connection, a 16 MHz ceramic resonator, a power jack, a
reset button and an ICSP header. It has everything needed to maintain the
microcontroller; just connect it to a computer via a USB cable, or power it with a AC-toDC adapter or battery.
The Uno R3 differs from all preceding boards in that it does not use the FTDI USB-toserial driver chip instead it has the Atmega16U2 programmed as a USB-to-serial
converter.
13

Uno R3 of the board has the following new features:


1.0 pinout:

added SDA and SCL pins that are near to the AREF pin and two other
new pins placed near to the RESET pin, the IOREF that allow the shields
to adapt to the voltage provided from the board. In future, shields will be
compatible with both the board that uses the AVR, which operates with
5V and with the Arduino Due that operates with 3.3V. The second one is a
not connected pin that is reserved for future purposes.
Reset:
Stronger RESET circuit.
Atmega 16U2: Atmega 16U2 replace the 8U2.
"Uno", is an Italian word, means one. The Uno is the latest model in the series of USB
Arduino boards, and is considered as the reference model for the Arduino platform.
Specifications:
In Arduino Uno R3:
Microcontroller used is ATmega328.
Operating Voltage is 5V.
Recommended Input Voltage 7-12V.
Input Voltage is limited to 6-20V.
Number of Digital input/output pins are 14, and 6 of which can generate PWM
output.
Number of Analog Input Channels are 6.
DC Current per I/O Pin is 40 m-A.
DC Current for 3.3V Pin is 50 m-A.
Flash Memory of ATmega328 is 32 KB of which 0.5 KB memory is used by
bootloader.
SRAM of ATmega328 is 2 KB.
EEPROM of ATmega328 is 1 KB.
Clock Speed is16 M-Hz.
Schematic & Reference Design:

14

arduino-uno-Rev3-schematic

The pin configuration is identical on all three processors i.e. Atmega8, 168, or 328.
15

Power:
The power to Arduino Uno R3 is provided by the USB connection or with an external
power supply. The power source is selected automatically.
An AC-to-DC adapter or a battery can be used as an external power source. The adapter
is connected to arduino by plugging a 2.1mm center-positive plug into the board's powerjack. And if we are using a battery then we connect the positive and negative terminals of
the battery to the Gnd and Vin pin headers of the POWER connector indicated on the
board.
The board can also function on an external power supply of 6 to 20 volts. If the source
supply is less than 7V, the 5V pin may supply less than 5V and the board may not work
properly. If the source is providing more than 12V, the voltage regulator may overheat
and the board may be damaged. So, the recommended supply voltage range is 7 to 12
volts.
The power pins and their functions are briefly mentioned below:

16

Memory:
The ATmega328 has 32 KB of which 0.5 KB memory is used for the bootloader. It also
has 2 KB of SRAM and 1 KB of EEPROM which can be read and written by using
the EEPROM library.
Input and Output:
Each of the 14 digital pins on the Uno can be used as an input or output,
using pinMode(), digitalWrite(), anddigitalRead() functions. They operate at 5 volts.
Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 k. In addition, some pins have specialized functions:
Pin name

Pin Function

Serial

Pin 0 and 1 are used to receive (RX) and transmit (TX) TTL serial data
respectively. These pins are connected to the corresponding pins of
the ATmega8U2 USB-to-TTL Serial chip.

External Pin number 2 and 3 can be programmed to set off an interrupt on a low
Interrupts
value, a rising or falling edge, or a change in value by using function
attachInterrupt().
PWM

SPI

LED

Pin number 3, 5, 6, 9, 10, and 11, provide 8-bit PWM output by using
function analogWrite().
Pin number 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK) support SPI
communication using the SPI library.

There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which
provide 10 bits of resolution (i.e. 1024 different values). By default they
measure from ground to 5 volts, though is it possible to change the upper
end of their range using the AREF pin and the analogReference() function.

Additionally, some pins have specialized functionality:


Pin name
TWI

Pin name
A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.

There are a couple of other pins on the board:

17

Pin name
AREF

Pin function
It provides the reference voltage for the analog inputs and is used with
function analogReference().
By bringing this pin to LOW, we can reset the settings of our
microcontroller. It is typically used to add a reset button to shields,
which blocks the reset button present on the board.

Reset

The mapping between Arduino pins and ATmega328 ports


The mapping for the Atmega8, 168, and 328 is identical.
Communication:
The Arduino Uno has many facilities to communicate with other Arduino, computer, or
other microcontrollers. Here we have 2 digital pins named as 0 which is receiver pin and
another is pin 1 that is transmitter pin, used for serial communication which is done by
ATmega328.serial communication on the board of ATmega16U2 over USB and appears
to software on the computer as a virtual com port. There is no need of external drivers
because of the uses of standard USB COM drivers by'16U2. However, a.inf file is
required on windows. The Arduino software has a serial monitor which allows simple
textual data to be sent to the Arduino board and from the Arduino board. When data is
transmitted by USB to Serial chip, receiver LEDs and transmitting LEDs on the board
will flash but make sure this whole procedure is not for serial communication on
transmuting and receiver pins i.e. 0 & 1.

18

On any UNOs digital pins, software serial library allows serial communication
The ATmega328 also supports the I2C (TWI) and SPI communication. To simplify the
use of l2C bus Wire library of the Arduino software is use. For SPI communication SPI
library is use.
Programming:
The Arduino Uno R3 can be programmed with the help of Arduino software which can
be downloaded from site (i.e. www.arduino.cc).
Install this free software; in menu bar, open Tools drop down menu and then select
Arduino Uno R3 from the Tools > Board menu.
The ATmega328 on the Arduino Uno R3, comes pre-burned with a bootloader that
permits you to upload new code to the microcontroller without the use of an external
hardware programmer. It communicates by using the original STK500 protocol. You can
also program the microcontroller through the ICSP header by using Arduino ISP.
The ATmega16U2 is loaded with a DFU bootloader, which can be activated by, pulling
the 16U2 HWB line to ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external
programmer (overwriting the DFU bootloader).

Automatic (Software) Reset:


One thing best in Arduino Uno is that it has a improved feature the we dont have to reset
it before an upload, because it automatically reset when it is connected to the computer
by its software. Reset line of the ATmega328 is connected to the hardware flow control
lines (DTR) of theATmega8U2/16U2 through a 100 nF capacitor.
When first line is taken down, rest line has enough time to reset the chip. This capability
is used by Arduino software to allow you to upload code in Arduino environment just by
pushing button. As lowering of DTR can be good co-ordinate with starting of upload, it
indicates that boot-loader could have shorter timeout. Above setup have many other
effects. A computer running Mac OS X or Linux when connected to Uno, it resets when a
connection is made to it from software. for the next time, the boot loader is running on
the Uno. When a connection is opened it will intercept the first few bytes of data which is
send to the board, while it is programmed to ignore malformed data.
If a sketch running on board receives one time configuration or a data that starts then we
should make sure that the data from which they are all communicate waits a second after
operating the connection and similarly before sending this data. To disable auto reset Uno
trace can be cut down. The trace can be activated again by joining the pads present on
both sides. It is labeled "RESET-EN". Auto reset can also be disabled by connecting a
110 ohm resistor from 5V to the reset line.
19

USB Over current Protection:


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from
shorts and over-current. Most computers have their own internal protections but this
polyfuse provides an extra layer of protection. If more than 500 m-A is applied to the
USB port then the fuse automatically break the connection till the short circuit or
overload is managed.

Physical Characteristics:
The max area of the UNO PCB is 2.72.1 inches with USB connector and power-jack
extending beyond measured area. Four holes are present on the board that allows the
board to be fixed to any surface or on another board. The distance between digital pin
number 7 and 8 is 0.16 inch, not an even multiple of the 0.1 inch spacing of the other pins.

20

You might also like