Arduino Nano LED Blink: Wiring, Code and Simulator

To build this Arduino Nano LED Blink project you need an Arduino Nano and a 220 Ω resistor and a red LED. The Nano is the Uno’s ATmega328P on a smaller board: the same sketch, the same pin numbers. Make the 3 connections in the wiring table, upload the Arduino C++ code, and compare with the Uno blink: nothing in the code changes. Try moving the LED to pin 9 and using analogWrite.

Open this circuit in the free Arduino Nano simulator

Parts list

QtyPartWhat it does
1Arduino Nanothe 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 Nano pin 13220 Ω resistor leg 1
2220 Ω resistor leg 2red LED anode (A, long leg)
3Arduino Nano 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 Nano. 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 Nano 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 Nano 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. Compare with the Uno blink: nothing in the code changes. Try moving the LED to pin 9 and using analogWrite.

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

Compare with the Uno blink: nothing in the code changes. Try moving the LED to pin 9 and using analogWrite.

Frequently asked questions

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

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

What parts do I need for this Arduino Nano project?

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

Can I simulate this Arduino Nano 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?

The Nano is the Uno’s ATmega328P on a smaller board: the same sketch, the same pin numbers.