Arduino LED Blink Project – First Step Into Arduino Programming

by ElectronicsBD in Circuits > Arduino

62 Views, 0 Favorites, 0 Comments

Arduino LED Blink Project – First Step Into Arduino Programming

Arduino LED Blink Project – First Step into Arduino Programming Thumbnail.png

Arduino LED Blink Project - The Perfect First Arduino Project



If you're new to Arduino, the LED Blink project is the best place to start. Although it's simple, this project teaches the basic concepts of Arduino programming, digital outputs, circuit wiring, and uploading code.



In this tutorial, you'll learn how to connect an LED to an Arduino Uno, write a simple program, and make the LED blink every second.



After completing this project, you'll have the knowledge needed to move on to more advanced Arduino projects involving sensors, displays, motors, and IoT devices.

Supplies

Arduino Project Supplies.png
Arduino Project Supplies 02.png

How It Works

How-LED-Diode-Works.png

Step 1: Understanding the Project


An LED (Light Emitting Diode) lights up whenever electrical current flows through it.

The Arduino controls the LED by changing the voltage of one of its digital output pins.

  1. HIGH = 5V Output = LED ON
  2. LOW = 0V Output = LED OFF

By repeatedly switching between HIGH and LOW with a delay, the LED continuously blinks.

Circuit Connection

Opera Snapshot_2026-08-02_195958_app.cirkitdesigner.com.png

Step 2: Circuit Connection


  1. Arduino D13 → 220Ω Resistor
  2. 220Ω Resistor → LED Positive (Anode)
  3. LED Negative (Cathode) → Arduino GND


Tip: The longer leg of the LED is the positive terminal (Anode).

Install Arduino IDE

Step 3: Install Arduino IDE



  1. Download the Arduino IDE from the official Arduino website.
  2. Install the software.
  3. Connect the Arduino using a USB cable.
  4. Select the correct Board from the Tools → Board menu.
  5. Select the correct COM Port from the Tools → Port menu.

Arduino Code

Arduino-Code.png

Step 4: Upload the Code


Copy the following code into the Arduino IDE.


const int ledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);

digitalWrite(ledPin, LOW);
delay(1000);
}


Click the Upload button. After uploading, the LED should begin blinking every second.

Code Explanation

Step 5: Understanding the Code


Define the LED Pin


const int ledPin = 13;

This line tells the Arduino which digital pin is connected to the LED.


Setup Function


void setup()
{
pinMode(ledPin, OUTPUT);
}

The setup() function runs only once after the Arduino powers on. Here, pin 13 is configured as an output.


Loop Function


void loop()
{
}

The loop() function repeats forever while the Arduino is powered.



Turn LED ON


digitalWrite(ledPin, HIGH);

This supplies 5V to the LED, turning it on.



Delay


delay(1000);

The Arduino waits for 1000 milliseconds (1 second).



Turn LED OFF


digitalWrite(ledPin, LOW);

This removes the voltage from the LED, turning it off.

Experiment

Step 6: Try Different Blink Speeds



You can change the blinking speed by modifying the delay values.



Fast Blink




delay(200);


Slow Blink




delay(2000);


Custom Blink Pattern




digitalWrite(ledPin, HIGH);
delay(100);

digitalWrite(ledPin, LOW);
delay(900);


Experiment with different values to create your own blinking patterns.