Arduino LED Blink: Wiring, Code and Simulator

To build this Arduino LED Blink project you need an Arduino Uno and a 220 Ω resistor and a red LED. Pin 13 through a 220 Ω resistor to a red LED. The board’s own L LED blinks with it. Make the 3 connections in the wiring table, upload the Arduino C++ code, and watch the red LED and the tiny L LED on the board blink together, once a second.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
1220 Ω resistorLimits current. 220 Ω in series with an LED; 10 kΩ as a pull-up or pull-down.
1red LEDLights when A (anode, the bent leg) is high and C (cathode) is low. Use a resistor.

Wiring

#FromTo
1Arduino Uno pin 13220 Ω resistor leg 1
2220 Ω resistor leg 2red LED anode (A, long leg)
3Arduino Uno GNDred LED cathode (C, short leg)

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add a 220 Ω resistor and a red LED from the parts palette.
  3. Wire 1. Connect Arduino Uno pin 13 to 220 Ω resistor leg 1.
  4. Wire 2. Connect 220 Ω resistor leg 2 to red LED anode (A, long leg).
  5. Wire 3. Connect Arduino Uno GND to red LED cathode (C, short leg).
  6. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  7. Run it. Press Run. Watch the red LED and the tiny L LED on the board blink together, once a second.

Arduino C++ code

// Blink: the "hello world" of hardware.
// Pin 13 drives both the board's built-in L LED and the red LED on the breadboard.
void setup() {
  pinMode(13, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);  // LED on
  delay(500);
  digitalWrite(13, LOW);   // LED off
  delay(500);
}

What to try

Watch the red LED and the tiny L LED on the board blink together, once a second.

Frequently asked questions

How do I wire the LED Blink project on an Arduino Uno?

Make 3 connections: Arduino Uno pin 13 to 220 Ω resistor leg 1; 220 Ω resistor leg 2 to red LED anode (A, long leg); Arduino Uno GND to red LED cathode (C, short leg).

What parts do I need for this Arduino project?

An Arduino Uno and a 220 Ω resistor and a red LED.

Can I simulate this Arduino project online for free?

Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.

What does the code do?

Pin 13 through a 220 Ω resistor to a red LED. The board’s own L LED blinks with it.

More Arduino Uno projects