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
| Qty | Part | What it does |
|---|---|---|
| 1 | Arduino Uno | the microcontroller board |
| 1 | 220 Ω resistor | Limits current. 220 Ω in series with an LED; 10 kΩ as a pull-up or pull-down. |
| 1 | red LED | Lights when A (anode, the bent leg) is high and C (cathode) is low. Use a resistor. |
Wiring
| # | From | To |
|---|---|---|
| 1 | Arduino Uno pin 13 | 220 Ω resistor leg 1 |
| 2 | 220 Ω resistor leg 2 | red LED anode (A, long leg) |
| 3 | Arduino Uno GND | red LED cathode (C, short leg) |
Step by step
- Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
- Add the parts. Add a 220 Ω resistor and a red LED from the parts palette.
- Wire 1. Connect Arduino Uno pin 13 to 220 Ω resistor leg 1.
- Wire 2. Connect 220 Ω resistor leg 2 to red LED anode (A, long leg).
- Wire 3. Connect Arduino Uno GND to red LED cathode (C, short leg).
- Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
- 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
- Arduino LDR Light Sensor: Wiring, Code and Simulator
- Arduino NTC Thermistor Thermometer: Wiring, Code and Simulator
- Arduino PWM to Analog RC Filter: Wiring, Code and Simulator
- Arduino Capacitance Meter: Wiring, Code and Simulator
- Arduino DC Motor PWM Speed Control with MOSFET: Wiring, Code and Simulator
- Arduino Push Button LED: Wiring, Code and Simulator