📘 Project 1 – LED Blinking (Hello World of Arduino)
🎯 Learning Objectives
After completing this project, students will be able to:
✅ Connect an LED with Arduino
✅ Understand digital output
✅ Use pinMode()
✅ Use digitalWrite()
✅ Use delay()
✅ Upload Arduino programs
1. Introduction
The LED Blinking project is the first project for almost every Arduino programmer.
Just like printing:
Hello World
is the first program in many programming languages,
blinking an LED is the first Arduino project.
This project teaches the basic workflow of Arduino programming.
2. What is an LED?
LED stands for:
Light Emitting Diode
An LED emits light when electric current flows through it.
LED Legs
LED has two terminals:
Anode (+)
Long Leg
Cathode (-)
Short Leg
3. Components Required
| Component | Quantity |
|---|---|
| Arduino UNO | 1 |
| USB Cable | 1 |
| LED | 1 |
| 220Ω Resistor | 1 |
| Breadboard | 1 |
| Jumper Wires | 2 |
4. Circuit Connection
| Arduino Pin | Component |
|---|---|
| Pin 13 | LED Anode (+) through 220Ω resistor |
| GND | LED Cathode (-) |
Connection Diagram
Arduino Pin 13
|
220Ω
|
LED
|
GND
5. Working Principle
Arduino sends:
HIGH
↓
LED ON
Arduino sends:
LOW
↓
LED OFF
By repeating ON and OFF with delays, the LED appears to blink.
6. Algorithm
Step 1
Set Pin 13 as OUTPUT
↓
Step 2
Turn LED ON
↓
Step 3
Wait 1 Second
↓
Step 4
Turn LED OFF
↓
Step 5
Wait 1 Second
↓
Step 6
Repeat Forever
7. Arduino Program
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
8. Code Explanation
Configure Pin
pinMode(13, OUTPUT);
Makes Pin 13 an output pin.
LED ON
digitalWrite(13, HIGH);
Outputs 5V.
LED glows.
Delay
delay(1000);
Waits:
1000 ms = 1 Second
LED OFF
digitalWrite(13, LOW);
Outputs 0V.
LED turns OFF.
Repeat
The loop() function repeats forever.
9. Expected Output
LED Pattern:
ON
↓
1 Second
↓
OFF
↓
1 Second
↓
Repeat
10. Real World Applications
LED blinking concepts are used in:
- Status Indicators
- Alarm Systems
- Traffic Signals
- Machine Status Lights
- Industrial Control Panels
11. Common Errors
LED Not Glowing
Check:
- LED polarity
- Pin number
- Wiring
LED Always ON
Check:
digitalWrite()
logic.
Upload Failed
Check:
- COM Port
- USB Cable
- Board Selection
12. Experiment Variations
Fast Blink
delay(200);
Slow Blink
delay(2000);
SOS Pattern
Create custom blinking sequences.
📊 Project Summary
In this project, we learned:
✅ LED connection
✅ Digital Output
✅ pinMode()
✅ digitalWrite()
✅ delay()
✅ Arduino program upload
This project serves as the foundation for all future Arduino projects.
🏠 Assignment
Task 1
Change blink speed to 500 ms.
Task 2
Change blink speed to 200 ms.
Task 3
Create a pattern:
ON
ON
OFF
ON
OFF
OFF
Task 4
Connect two LEDs and blink them alternately.
Task 5
Explain the role of pinMode(), digitalWrite(), and delay() in your own words.