This article mainly introduces how the Arduino development board works from a hardware perspective.
Most articles cover Arduino software. However, a deeper understanding of its hardware design will help you take a solid step in your Arduino journey. Mastering the electronic design of Arduino hardware will help you learn how to embed Arduino into the design of the final product, including what parts should be kept and omitted from the original design.
Component Overview
The PCB design of the Arduino UNO development board uses all SMD (Surface Mount Device) components. I started to learn about SMD components when I was learning Arduino PCB design a few years ago, and I was re-designing a DIY clone of the Arduino UNO .
Integrated circuits use standardized packages and come in a variety of packaging styles.
The dimensions of many SMD resistors, capacitors and LEDs are indicated by the following package codes:
SMD package codes for discrete components such as resistors, capacitors and inductors.
Most packages are generic and can be used for different parts with different functions. For example, a SOT-223 package can be a transistor or a voltage regulator.
The following table lists some of the components used by Arduino UNO and their corresponding packages:
Arduino UNO System Overview
Before we learn about the UNO’s hardware, we must first get a general overview of the system.
After compiling the code using the Arduino IDE, it should be uploaded to the main microcontroller of the Arduino UNO through the USB connection. Since the main microcontroller does not have a USB transceiver, a bridge is required to convert the signals between the serial interface ( UART) of the microcontroller and the host USB signals.
The bridge in the latest version is an ATmega16U2, which has a USB transceiver and a serial interface (UART).
To power your Arduino board, you can use USB power. Another way is to use the DC jack. You may ask, “If I have both a DC adapter and USB connected, which one will be the power source?” The answer is discussed in the “Power Supply” section of this article.
To reset your board you should use the button on the board. Another reset source should be generated every time you open the serial monitor from the Arduino IDE.
I have re-purposed the original Arduino UNO schematic to make it more readable, as shown below.
A redistributed version of the original Arduino schematic
Microcontroller
It is important to note that the Arduino board contains a microcontroller, and the microcontroller is what executes the instructions in the program. If you know this, you will never say something like “Arduino is a microcontroller” again.
The ATmega328 microcontroller is used as the main controller in the Arduino UNO R3. The ATmega328 is an MCU from the AVR series; it is an 8-bit device, which means that its data bus architecture and internal registers are designed to handle 8 parallel data signals.
The ATmega328 has three types of memory:
● Flash memory: 32KB of non-volatile memory. This is used to store the application, which explains why you don’t need to upload the application every time you unplug the arduino from the power source.
● SRAM memory: 2KB volatile memory. This is used to store variables used by the application at runtime.
● EEPROM memory: 1KB of non-volatile memory. This can be used to store data that must be available even after the board is powered off and then back on again.
Let’s briefly review the specifications of this MCU:
Encapsulation
The MCU is packaged in a DIP-28, which means it has 28 pins in a dual in-line package. These pins include power and I/O pins. Most of the pins are multi-function, which means that the same pins can be used in different modes depending on how you configure them in software. This reduces the number of necessary pins because the microcontroller does not need a separate pin for each function. It also makes your design more flexible because one I/O connection can provide multiple types of functions.
ATmega328 is also available in other packages such as TQFP-32 SMD package (Surface Mount Device).
Atmega328 has two different packages
power supply
The MCU supports a supply voltage of 1.8 to 5.5 V. However, there are restrictions on the operating frequency; for example, if you want to use the maximum clock frequency (20 MHz), a supply voltage of at least 4.5 V is required.
Digital I/O
This MCU has three ports: PORTB, PORTC, and PORTD. All pins of these ports can be used for general digital I/O or for alternate functions as indicated in the pinout below. For example, PORTC pins 0 to 5 can be ADC inputs instead of digital I/O.
There are also some pins that can be configured as PWM outputs. These pins are marked with a “~” on the Arduino board.
NOTE: The ATmega168 is almost identical to the ATmega328, and they are pin compatible. The difference is that the ATmega328 has more memory (32KB Flash, 1KB EEPROM, and 2KB RAM) compared to the ATmega168’s 16KB Flash, 512 Bytes EEPROM, and 1KB RAM.
Tmega168 pinout with Arduino labels; the ATmega168 and ATmega328 are pin-compatible.
Arduino UNO R3 Pinout.
ADC Input
This MCU has 6 channels – PORTC0 to PORTC5 – of A/D converter with 10-bit resolution. These pins are connected to the analog headers on the Arduino board.
A common mistake is to think of the analog inputs as inputs dedicated to A/D functionality because the headers in the board say “Analog.” The truth is, you can use them as either digital I/O or A/D.
ATmega328 block diagram.
As shown in the diagram above (via the red traces), the pins associated with the A/D unit are:
AVCC: Power supply pin for A/D unit.
AREF: An optional input pin if you want to use an external reference voltage for the ADC instead of the internal Vref. You can configure this using the internal registers.
Internal register setting to select Vref source.
UART Peripheral
UART (Universal Asynchronous Receiver/Transmitter) is a serial interface. ATmega328 has only one UART module.
The pins (RX, TX) of the UART are connected to the USB to UART converter circuit and to pin 0 and pin 1 in the digital header. If you are already using UART to send/receive data over USB, you must avoid using UART .
SPI peripherals
SPI (Serial Peripheral Interface) is another serial interface. The ATmega328 has only one SPI module.
In addition to using it as a serial interface, you can also program the MCU using a standalone programmer. You can access the SPI’s pins from the header next to the MCU in the Arduino UNO development board or from the digital header as shown below:
11 <-> MOSI
12 <-> MISO
13 <-> SCK
TWI
The I2C or TWI interface consists of two lines, serial data SDA and serial clock SCL.
You can access these pins through the last two pins of the digital header, or through pins 4 and 5 of the analog header.
Other Features
There are other features included in the MCU, such as those provided by the Timer/Counter module. You may not be aware of features that you are not using in your code. You can refer to the datasheet for more information.
Arduino UNO R3 MCU part.
Coming back to the electronics design, the microcontroller part has the following:
● ATmega328-PU : The MCU we just talked about.
● IOL and IOH (digital) headers : In addition to GND, AREF, SDA, and SCL, these are the digital headers for pins 0 to 13. Note that RX and TX from the USB bridge are connected to pins 0 and 1.
● AD plug : plug for analog pins.
● 16 MHz ceramic resonator (CSTCE16M0V53-R0) : Connected to XTAL2 and XTAL1 of the MCU.
● Reset pin : Pulled up by a 10K resistor, helps prevent false resets in noisy environments; this pin has an internal pull-up resistor, but according to the AVR Hardware Design Considerations application guide ( AVR042 ), “If the environment is too noisy, it may cause unwanted resets and resets may occur occasionally.” A reset occurs if the user presses the reset button or if the USB bridge sends a reset signal. You can also see a D2 diode. The purpose of this diode is described in the same application note: “If high-voltage programming is not used, it is recommended to add an ESD protection diode from RESET to Vcc, as this diode is not provided internally due to high-voltage programming.”
● C4 and C6 capacitors (100nF) : These devices are added to filter power supply noise. The impedance of the capacitor decreases with frequency:
XC=12πfC
The capacitor provides a low impedance path to ground for high frequency noise signals. 100nF is the most common value.
● PIN13 : Connected to the SCK pin of the MCU and also connected to the LED. The Arduino development board uses a buffer (LMV358) to drive the LED.
● ICSP header (In-Circuit Serial Programming): used to program the ATmega328 using an external programmer. It connects to the In-System Programming (ISP) interface (using the SPI pins). Normally, you do not need to use this programming method because the bootloader handles the programming of the MCU through the UART interface connected to the USB using a bridge. This header is only used when programming a bootloader to the MCU for the first time in production.
|