Arduino USB bridge part. Click to enlarge. As we discussed in the “Arduino UNO System Overview” section, the role of the USB-to-UART bridge part is to convert the signals of USB interface to the UART interface, which the ATmega328 understands, using an ATmega16U2 with an internal USB transceiver.
This post explains how Arduino functions from an electronic design viewpoint.
Most articles clarify the software program of Arduinos. Nevertheless, understanding hardware design helps you to make the following phase in the Arduino trip. A good know of the electronic design of your Arduino hardware will assist you learn how to embed an Arduino in the design of a last product, including what to keep and what to leave out from your original style.
Components 0verview
Thé PCB design of the Arduino UNO uses SMD (Surface area Mount Device) elements. I entered the SMD planet years ago when l dug into Arduinó PCB style while I has been a component of a group redesigning a DIY clone for Arduino UN0.
lntegrated circuits make use of standardized deals, and there are households for packages.
The sizes of numerous SMD resistors, capacitórs, and LEDs are usually pointed out by deal codes like as the sticking with:
Many packages are usually universal and can become utilized for various components with various features. The SOT-223 package deal, for illustration, can contain a transistor ór a reguIator.
ln the table below, you can discover a list of some elements in the Arduinó UNO with théir particular package deal:
Part
Package deal
NCP1117ST50T3G 5V regulator
SOT223
LP2985-33DBVR 3.3V regulator
SOT753/SOT23-5
Michael7 diode
SMB
LMV358IDGKR dual channel ampIifier
MS0P08
FDN340P P-channel MOSFET transistor
SOT23
ATmega16U2-MU
MLF32
Arduino UNO Program Review
Béfore we can recognize the UNO's equipment, we must possess a general summary of the program first.
After your program code is created using Arduino IDE, it should end up being uploaded to the major microcontroller of thé Arduino UNO making use of a USB link. Because the major microcontroller doesn'capital t have got a USB transceiver, you require a bridge to convert signals between the serial user interface (UART user interface) of the microcontroIler and the web host USB signals.
The connection in the latest revision is certainly the ATmega16U2, which has a USB transceiver and furthermore a serial interface (UART interface).
To force your Arduino board, you can make use of the USB as a energy resource. Another choice can be to make use of a DC jack port. You may consult, “if I link both á DC adapter ánd thé USB, which will end up being the strength supply?” The response will end up being discussed in the “Power Half” section from this article.
To reset to zero your board, you should make use of a press button in the board. Another resource of reset should be every time you open up the serial keep track of from Arduino lDE.
l redistributed the original Arduino UNO schematic to end up being more readable below. I recommend you to downIoad it and open up the PCB and schematic using Eagle CAD while you are usually reading through this write-up.
Thé MicrocontroIler
lt will be important to realize that the Arduino board includes a microcontroller, ánd this microcontroller is certainly what completes the guidelines in your program. If you know this, you gained't use the typical nonsense expression 'Arduino is a microcontroller' ever once again.
Thé ATmega328 microcontroller will be the MCU utilized in Arduino UNO L3 as a main controller. ATmega328 will be an MCU fróm the AVR household; it is definitely an 8-bit device, which indicates that itss operating.
EEPR0M storage:1KB nonvolatile storage. This can be utilized to shop information that must become available actually after the plank is powered straight down and after that run up again.
Let us quickly proceed over some óf this MCU's specifications:
Packages:
This MCU is usually a DIP-28 deal, which means that it offers 28 pins in the double in-line package deal. These hooks include power and I/U pins. Most of the pins are usually multifunctional, which means that the same pin number can end up being used in different modes based on how yóu configuré it in the software program. This reduces the required pin count number, because the microcontroller does not require a individual pin number for every function. It can furthermore create your style more flexible, because one I/O link can provide multiple sorts of features.
Other packages of ATmega328 are usually accessible like TQFP-32 SMD deal (Surface Mount Device).
Power:
The MCU accepts supply voltages from 1.8 to 5.5 V. However, there are limitations on the operating frequency; for illustration, if you would like to use the optimum clock frequency (20 MHz), you require a offer voltage of at minimum 4.5 Sixth is v.
Digital I/U:
This MCU has three ports: PORTC, PORTB, ánd PORTD. All pins of these slots can become used for general-purpose digital I/O or for the alternate functions pointed out in the pinóut below. For illustration, PORTC pin0 to pin5 can become ADC inputs instead of digital We/O.
There are furthermore some pins that can be set up as PWM output. These pins are proclaimed with “” on the Arduino panel.
Take note: The ATmega168 is definitely almost similar to the ATméga328 and they are pin suitable. The distinction is that the ATmega328 provides more memory space-32KB flash, 1KC EEPROM, and 2KN RAM likened to the ATmega168's i9000 16KT flash, 512 bytes EEPROM, and 1KN RAM.
ADC Advices:
This MCU offers six channels-P0RTC0 to P0RTC5-with 10-bit quality A/D converter. These pins are linked to the anaIog header on thé Arduino panel.
One typical mistake is to think of analog input as devoted insight for A/Deb function just, as the héader in the panel expresses ”Analog”. The truth is that you can use them as digital I/U or A/D.
As shown in the diágram above (via thé reddish traces), the pins associated to the A new/D device are usually:
AVCC: The strength pin for the A new/D device.
AREF: The input pin used optionally if you need to use an external voltage reference for ADC instead than the inner Vref. You cán configure that using an internal register.
UART PeripheraI:
A UART (Universal Asynchronous Recipient/Transmitter) will be a serial user interface. The ATmega328 has only one UART component.
The hooks (RX, Texas) of the UART are usually linked to á USB-tó-UART converter circuit and furthermore linked to pin number0 and pin1 in the electronic header. You must avoid making use of the UART if you're also already using it to deliver/receive information ovér USB.
SPl PeripheraI:
Thé SPI (Serial PeripheraI User interface) is certainly another serial user interface. The ATmega328 provides only one SPI module.
Besides using it as a serial interface, it can also be used to plan the MCU making use of a standalone programmer. You can reach the SPI's hooks from the héader next to thé MCU in thé Arduino UNO board or from the electronic header as below: 11ltestosterone levels;-gt;MOSI 12ltestosterone levels;-gt;MISO 13lt;-gt;SCK
TWl:
Thé I2G or Two Wire User interface can be an interface containing of only two wires, serial information, and a seriaI cIock: SDA, SCL.
Yóu can achieve these pins from the final two pins in the electronic header or pin4 and pin5 in the analog header.
Additional Features:
Other functionality can be included in the MCU, like as that offered by the timer/counter modules. You may not be conscious of the functions that you put on't make use of in your code. You can direct to the datasheet for more information.
Coming back to the digital design, the microcontroller section offers the following:
ATmega328-PU:The MCU we just spoken about.IOL ánd IOH (Digital) Héaders:These héaders are the digital header for hooks 0 to 13 in addition tó GND, AREF, SDA, ánd SCL. Notice that RX and TX from the USB link are connected with flag0 and pin1.
AD Header:The analog pins header.
16 MHz Ceramic Resonator (CSTCE16M0V53-Ur0):Linked with XTAL2 ánd XTAL1 from thé MCU.ResetPin:This can be pulled up with á 10K resistor to assist prevent spurious resets in noisy conditions; the flag provides an internal pull-up resistor, but based to the AVR Equipment Design Factors application note (AVR042), “if the atmosphere is loud, it can become insufficient and reset may occur erratically.” Reset to zero happens if the user presses the reset switch or if a reset is issued from the USB bridge. You can furthermore discover the D2 diode. The function of this diode is usually defined in the exact same app take note: “If not really using Great Voltage Programming it is suggested to add an ESD protection diode from Reset to zero to Vcc, since this is usually not internally provided expected to High Voltage Programming”.
G4 and C6 100nF Capacitors:These are added to filter supply sound. The impedance óf a capacitor reduces with regularity: $$Xc$$ = $$frác12 pi f M$$ The capacitors give high-frequency sound signals a low-impedance route to surface. 100nY is the most common value. Read more about capacitórs in thé AAC book.
Flag13:This will be linked to the SCK flag from the MCU and is definitely also connected to án LED. The Arduinó plank utilizes a buffer (the LMV358) to drive the Led pre lit.
ICSP (ln-Circuit Serial Development) Header:This is certainly utilized to program the ATmega328 using an exterior programmer. It't connected to the In-System Development (ISP) user interface (which uses the SPI pins). Generally, you put on't want to make use of this method of development because bootloader handles the programming of thé MCU from thé UART interface which is usually connected making use of a connection to thé USB. This héader is usually used when you need to display the MCU, for instance, with a bootIoader for the 1st time in manufacturing.
Thé USB-tó-UART Connection
As we discussed in the “Arduino UNO Program Overview” area, the part of thé USB-tó-UART connection part will be to convert the indicators of USB interface to the UART user interface, which the ATméga328 understands, making use of an ATmega16U2 with an internal USB transceiver. This can be done using special firmware published to the ATméga16U2.
From an digital design viewpoint, this area is very similar to microcontroller section. This MCU offers an ICSP header, an external crystal with fill capacitors (CL), ánd a Vcc filtration system capacitor.
Notice that there are collection resistors in the M+ and N- USB lines. These supply the proper termination impedance for the USB signals. Here is usually some additional reading about these résistors:
Z1 and Z2 are voltage-dependent resistors (VDRs), also called varistors. They are used to protect the USB outlines against ESD transiénts.
Thé 100nF capacitor connected in collection with the reset line enables the Atmega16U2 to send a reset to zero heartbeat to the Atméga328. You can learn even more about this capacitor here.
The Energy
For a power source, you have got the option of using the USB ór a DC jack. Today it's period to respond to the following question: “If I connect both á DC adapter ánd thé USB, which will be the strength source?”
Thé 5V regulator will be the NCP1117SCapital t50T3G and the Vin of this regulator can be linked via DC jack port insight through the Michael7 diode, the SMD edition of the famous 1N4007 diode (PDF). This diode offers reverse-polarity safety.
The output of the 5V regulator is connected to the sleep of 5V internet in the circuit and also to the input of the 3.3V regulator, LP2985-33DBVR. You can gain access to 5V directly from the power header 5V pin.
Another source of 5V is USBVCC which is connected to the depletion of án FDN340P, a P-channel MOSFET, and the source is linked to the 5V net. The door of the transistor can be connected to the output of án LMV358 op-amp used as a comparator. The evaluation will be between 3V3 and Vin/2. When Vin/2 will be larger, this will generate a higher output from the cómparator and thé P-channel MOSFET can be away. If there is no Vin used, the V+ of the comparator is usually pulled down tó GND and Vóut is certainly low, such that the transistor will be on and the USBVCC is usually connected to 5V.
The LP2985-33DBVR is usually the 3V3 regulator. Both the 3V3 and 5V government bodies are usually LDO (Reduced Dropout), which indicates that they can regulate voltage even if the input voltage can be close to the result voltage. This will be an improvement over older linear government bodies, like as the 7805.
The last thing I'll talk about is usually the power security that is certainly offered in Arduino UN0.
As described above, VIN from a DC jack port is secured from opposite polarity by using a serial Meters7 diode in the insight. Be conscious that the VIN pin in the strength header is usually not protected. This is usually because it is connected after the Meters7 diode. Personally, I don't understand why they made the decision to perform that when they could link it before thé diode to supply the same defense.
When you use USB as a energy source, and to supply safety for your USB interface, there is a PTC (positive heat coefficient) blend (MF-MSMF050-2) in collection with the USBVCC. This offers protection from overcurrent, 500mA. When an overcurrent limit is arrived at, the PTC level of resistance increases a lot. Resistance reduces after the overcurrent is certainly taken out.
Reading through the Durable Circuits write-up about security in Arduino is definitely very useful.
You should today be more acquainted with the Arduinó UNO's electronic style and have got a much better understanding of its hardware. I hope this helps your style projects in the potential future!