ntroduction
Arduino Uno R3 is one of the most popular microcontroller boards used for learning electronics and embedded systems. In this beginner project, we will learn how to control an LED using Arduino. This is usually the first project every Arduino learner builds.
This tutorial will show how to connect an LED and control it using simple Arduino code.
Components Required
- Arduino Uno R3
- LED
- 220Ω Resistor
- Breadboard
- Jumper wires
- USB cable
Circuit Diagram
Connections:
- LED positive → Arduino Pin 13
- LED negative → 220Ω resistor
- Resistor → GND
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
How It Works
pinMode()sets pin 13 as outputdigitalWrite(HIGH)turns the LED ONdigitalWrite(LOW)turns the LED OFFdelay(1000)creates a 1-second delay
The LED will continuously blink every second.
Conclusion
This simple project helps beginners understand:
- Digital output
- Basic Arduino programming
- LED control
You can expand this project by controlling multiple LEDs or creating patterns.