A tour of the board
Thirteen things on the top face, from the USB-C socket to the ICSP header: what each one does, and what it looks like when it is the reason something does not work.
Where everything is
The board is 68.6 by 53.3 mm, the Uno's size. Every part below is drawn where the pick-and-place file puts it, USB-C on the left as in the first picture.
Pick a part and the verdict says what goes wrong with it. Most of what a beginner meets is in three places: the USB-C socket and its cable, the CH340C and its driver, and the lamps, which are how the board tells you what it is doing.
The USB side
The USB-C socket has two 5.1 kΩ resistors on its CC pins. A USB-C port only switches its 5 V on when it sees them, so they are what lets a C-to-C cable power the board as well as an A-to-C one.
Power from the socket goes through F2, a resettable fuse that holds 0.5 A, and then Q2, an FDN340P MOSFET, onto the 5 V rail. Short 5V to GND and the fuse heats up and cuts the supply; take the short away and it recovers once it cools. Data goes to the CH340C, which turns USB into the ATmega328P's serial line on pins 0 and 1, and also drives RESET through C6, a 100 nF capacitor, at the start of every upload.
The power side
The barrel jack takes 7 to 12 V. An SS14 diode behind it blocks a supply plugged in backwards, and the AMS1117-5.0 makes the 5 V rail from what is left. It is a linear regulator: the extra volts become heat.
When the jack brings more than 6.6 V, half of the LM358 turns Q2 off, so the jack powers the board and USB only carries data. The other half of the same chip copies D13 to the L lamp. An XC6206 makes the 3V3 pin's 3.3 V from the 5 V rail, and it is rated for 200 mA.
The chip and its clock
The ATmega328P sits right of centre, with the 16 MHz crystal at its upper right. Every header hole that is not power or ground is a pin of this chip. It is soldered down, so a pin damaged by too much current stays damaged; how much a pin can give has the numbers.
The reset button and the lamps
The reset button in the top-left corner pulls RESET to ground. The chip
stops while it is held and starts again when it is let go: first the
bootloader, which flashes L a few times and listens for about a second, then
your sketch from the top of setup(). Nothing in flash or EEPROM is erased.
The four lamps sit in a column left of centre, each behind its own 1 kΩ:
- ON, green, lit while the 5 V rail is up.
- TX and RX, red, lit while pin 1 or pin 0 is LOW, which is while bytes are moving on the serial line.
- L, red, following pin 13 through the LM358, so it takes no current from the pin.
The sketch on this page uses two of these parts at once: the reset button restarts the chip, and EEPROM remembers how many times.
The ICSP header
Six pins on the right edge carry MISO, SCK and MOSI (the same wires as 12, 13 and 11), 5 V, GND and RESET. They are for a programmer that writes the chip without going through the bootloader, and for shields that take SPI from there. You will not need them for anything in this book.
The code
Counts how many times the chip has started, keeps the count in EEPROM, and prints it. Upload it, open the Serial Monitor at 9600 baud, then press the reset button a few times and watch L.
// Reset_Count.ino — counts its own starts in EEPROM
// Tools > Board: Arduino Uno (Arduino AVR Boards)
// Tools > Port: the CH340 port
// Serial Monitor: 9600 baud
// Wiring: none. Press the reset button by the USB-C socket.
#include <EEPROM.h>
const int ADDR = 0; // EEPROM bytes 0 to 3 hold the count
void setup() {
Serial.begin(9600);
unsigned long starts;
EEPROM.get(ADDR, starts);
if (starts == 0xFFFFFFFF) { // a never-written EEPROM reads all 1s
starts = 0;
}
starts++;
EEPROM.put(ADDR, starts); // one write per start, never in loop()
Serial.print("Start number ");
Serial.println(starts);
}
void loop() {
}Each press prints the next number, and L flashes quickly just before: that is the bootloader, which runs after every reset. Opening the Serial Monitor usually counts as a start too: opening the port pulses RESET, the same way an upload begins.
When it does not work
No 5 V is reaching the rail. Try another cable and another USB socket. If ON went dark while something was wired to 5V or 3V3, unplug, remove the wire, and wait a minute: the resettable fuse cuts USB on a short and recovers once it cools.
That is the auto-reset doing its job. Opening the port pulses the CH340C's DTR line, which reaches RESET through a 100 nF capacitor. It is the same pulse that starts every upload, so the board cannot tell the two apart.
The AMS1117 is linear: it turns everything above 5 V into heat, so 12 V in wastes seven volts times the current. Use a supply near 7 to 9 V, or power the board from USB, when it is feeding anything more than the chip and a few lamps.
Those quick flashes are the bootloader, which runs for about a second after the reset pin is pulled and flashes L while it listens for an upload. After that, whatever L does is your sketch.
Thirty-two holes along two edges, which job each one can do, and the two that are the same holes twice.
The four header strips →Edit this page — content/books/uno/a-tour-of-the-board.mdx
Questions about this product
See what other owners have asked, and read their solutions.
UNO R3 USB-C (ATmega328P)
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.