Getting Started with Arduino Uno

Draft. This tutorial has not been checked against the physical product yet. Confirm wiring, pin assignments and voltage limits against the product documentation before building it.
DifficultyBeginner
CategoryBoards and setup
Supported boardsArduino Uno R3 and compatible ATmega328P boards
Time needed30 minutes
PrerequisitesNone
Tested boardNot yet verified
Tested onNot yet verified
Arduino IDE versionNot yet verified
LibraryNot yet verified

What it does

The Arduino Uno is a small board built around an ATmega328P microcontroller. It runs one program at a time, from the moment it receives power until it loses it, and it gives you pins that can switch things on and off, read sensors, and talk to a computer over USB.

It solves two practical problems. It removes the specialist hardware normally needed to get a program onto a microcontroller, because the board arrives with a bootloader and needs only a USB cable. And it fixes a known pin layout, so a module built for an Uno plugs into any Uno.

This guide takes you from an unopened board to a running program and readable serial output. Every other tutorial in this library assumes you have finished it.

Before you begin

Required parts and tools

  • An Arduino Uno R3 or compatible board.
  • A USB cable that matches the board’s connector and carries data, not only power.
  • A computer running Windows, macOS or Linux.
  • The Arduino IDE, version 2.x, from the official Arduino website.

Power and voltage

  • The Uno runs at 5 V logic. A 3.3 V sensor connected directly to a 5 V output can be damaged. Check a module’s rated voltage before wiring it.
  • USB supplies enough power for the board and a handful of LEDs or small sensors.
  • The barrel jack accepts roughly 7-12 V DC, centre positive. Below that the board browns out; above it the regulator overheats.
  • The 5V and 3.3V pins are outputs, not inputs. Feeding voltage into them bypasses the regulator and can destroy the board.

Safety notes

  • Each I/O pin is rated for about 20 mA. An LED without a series resistor, a motor, or a relay coil driven straight from a pin will exceed that.
  • The 3.3V pin can supply only about 50 mA in total.
  • Wire and rewire with the USB cable unplugged. A stray wire across 5V and GND is a short.
  • This board is for low-voltage work. Mains electricity is out of scope and needs separate equipment and training.

Pin reference

This is the board layout you will need for the rest of the library. It is not the full pinout.

Arduino Uno pin map showing the digital pins along the top edge, the power and analog pins along the bottom edge, and the USB socket and barrel jack on the left
The pins you will meet in this library. The tilde marks the ones that can do PWM.
Pin or label Connect to Purpose Notes
USB Computer Power, uploading, serial communication Must be a data cable
BARREL JACK 7-12 V DC supply Power without a computer Centre positive
5V Module VCC 5 V output to modules Output only
3.3V 3.3 V module VCC 3.3 V output About 50 mA total
GND Module GND Common ground Three pins, all equivalent
VIN External supply Unregulated input ahead of the regulator Rarely needed at this stage
D0–D13 Digital inputs and outputs On/off signals D0 and D1 are shared with USB serial
D3 D5 D6 D9 D10 D11 PWM-capable outputs Dimming and tone generation Marked with a tilde on the board
A0–A5 Analog inputs Read a varying voltage as 0-1023 Usable as digital pins too
D13 / L Onboard LED Built-in test output Already wired, nothing to connect
RESET Reset button Restart the running program The program restarts, it is not erased

Avoid D0 and D1 for your own wiring while you are using the Serial Monitor. They carry the USB serial traffic, and a module on those pins will interfere with uploading.

Wiring steps

Nothing needs to be wired for this tutorial. The LED you will control is already fitted to the board and connected to digital pin 13.

  1. Take the board out of its packaging and place it on a non-conductive surface. Bare metal underneath the board can short the pins on the underside.
  2. Check that nothing is plugged into the headers.
  3. Connect the USB cable to the board, then to the computer.
  4. Confirm that the green ON LED is lit. If it is not, the cable is not supplying power. Try a different cable or port before going further.

Software and libraries

No library is required for this tutorial. The functions used are part of the Arduino core.

Install the IDE

  1. Download Arduino IDE 2.x from the official Arduino site and install it.
  2. Open it and let it finish its first-run setup.

Select the board and port

  1. Open Tools > Board > Arduino AVR Boards > Arduino Uno.
  2. Open Tools > Port and select the port that appears when the board is plugged in. Unplug the board and look again if you are unsure which one it is. The board’s port is the entry that disappears.

If no new port appears, the board’s USB-to-serial chip needs a driver. Official boards use a chip that Windows recognises without one; many compatible boards use a CH340 or CP2102 chip that needs a driver installed first. Read the marking on the small chip nearest the USB connector and install the matching driver from the manufacturer.

Install a library

You will need libraries for later tutorials, so it is worth learning the route now.

  1. Open Tools > Manage Libraries, or click the books icon in the left sidebar.
  2. Type a library name into the search box.
  3. Click Install on the entry you want.

Installed libraries appear under File > Examples, below the built-in examples.

Minimal working example

This sketch blinks the onboard LED and reports each change over the serial connection, so it tests uploading and serial output at once.

// Siratek: first Arduino Uno program.
// Blinks the onboard LED and reports each change over USB.

const int ledPin = LED_BUILTIN;  // Pin 13 on an Uno, already wired to the onboard LED.
const int interval = 1000;       // Milliseconds the LED stays in each state.

void setup() {
  pinMode(ledPin, OUTPUT);  // The pin drives the LED, so it must be an output.
  Serial.begin(9600);       // Opens the USB serial link. The Serial Monitor must match this rate.
  Serial.println("Siratek: board is running.");
}

void loop() {
  digitalWrite(ledPin, HIGH);
  Serial.println("LED on");
  delay(interval);

  digitalWrite(ledPin, LOW);
  Serial.println("LED off");
  delay(interval);
}

Change interval to make the blink faster or slower. Nothing else needs editing. LED_BUILTIN resolves to the right pin for whichever board you have selected.

Upload it

  1. Open File > New Sketch and replace its contents with the code above.
  2. Click Upload, the arrow in the toolbar.
  3. Watch the two small TX and RX LEDs flicker while the code transfers.

Expected result

The onboard LED, marked L, turns on for one second and off for one second, repeating.

Open Tools > Serial Monitor and set the rate selector to 9600 baud. You should see:

Siratek: board is running.
LED on
LED off
LED on

A new line should appear each second, in step with the LED. If the LED blinks but the Serial Monitor shows nothing or shows unreadable characters, the baud rate is wrong.

Troubleshooting

Symptom Likely cause Check or fix
No ON LED when plugged in Charge-only USB cable, or a dead port Try another cable, then another port
No port in Tools > Port Missing USB-to-serial driver Identify the chip near the USB connector and install its driver
programmer is not responding Wrong port or board selected Reselect both, then upload again
Upload fails while Serial Monitor is open The port is already in use Close the Serial Monitor and upload again
Upload succeeds, LED does nothing Sketch uploaded to the wrong board Confirm the selected port belongs to this board
Serial Monitor shows symbols Baud rate mismatch Set the Serial Monitor to 9600
Serial Monitor stays empty Something is wired to D0 or D1 Remove it and upload again
Board gets hot Short circuit, or wrong barrel-jack supply Unplug immediately, then check wiring and supply polarity

Next steps

  • Easier first: nothing. This is the starting point for the library.
  • Related product: the Siratek Arduino Starter KIT, which supplies the parts used across the other tutorials.
  • Next project: LED Traffic Light Module, which applies what you have just done to an external module on three pins.

Sources and attribution

All text, wiring guidance and code in this tutorial are original Siratek work.

  • Arduino Uno R3 product documentation and ATmega328P datasheet, for electrical limits.
  • Arduino IDE 2 documentation, for the board, port and Library Manager routes.

No third-party tutorial text, diagrams, photographs or code has been reproduced here.

Product used in this tutorial: Arduino UNO R3 Development board
Shop
Sidebar
0 Wishlist
0 Cart