Introduction
The best way to learn Arduino is by building simple projects. Each small success (like blinking an LED) gets you ready for bigger challenges (like controlling a sensor‑based device).
Here are 10 beginner‑friendly Arduino projects you can try today—all with wiring notes and ready‑to‑copy code.
- Blink an LED (Hello World of Arduino)
Wiring: LED → Pin 13, resistor to GND.
C++
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
💡 LED blinks on and off every second.
- LED Traffic Lights
Wiring: Red → pin 8, Yellow → pin 9, Green → pin 10 (all with resistors).
C++
int red = 8, yellow = 9, green = 10;
void setup() {
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}
void loop() {
digitalWrite(red, HIGH); delay(3000);
digitalWrite(red, LOW); digitalWrite(yellow, HIGH); delay(1000);
digitalWrite(yellow, LOW); digitalWrite(green, HIGH); delay(3000);
digitalWrite(green, LOW);
}
🚦 Simulates a real traffic signal.
- Button‑Controlled LED
Wiring: Button → pin 2, LED → pin 13.
C++
int buttonPin = 2, ledPin = 13;
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
if (digitalRead(buttonPin) == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
💡 Press the button → LED turns ON.
- Potentiometer → Adjust LED Brightness
Wiring: Pot → A0, LED → pin 9 (PWM).
C++
int pot = A0, led = 9, val;
void setup() { pinMode(led, OUTPUT); }
void loop() {
val = analogRead(pot); // 0–1023
val = map(val, 0, 1023, 0, 255); // scale to 0–255
analogWrite(led, val);
}
🌀 Twist pot knob → LED brightens/dims.
- Ultrasonic Distance Alarm
Wiring: HC‑SR04 sensor → Trig=9, Echo=10; buzzer → pin 3.
C++
const int trig=9, echo=10, buzzer=3;
long duration; int distance;
void setup(){
pinMode(trig, OUTPUT); pinMode(echo, INPUT); pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop(){
digitalWrite(trig, LOW); delayMicroseconds(2);
digitalWrite(trig, HIGH); delayMicroseconds(10);
digitalWrite(trig, LOW);
duration = pulseIn(echo, HIGH);
distance = duration * 0.034 / 2;
Serial.println(distance);
if(distance < 10) digitalWrite(buzzer,HIGH); else digitalWrite(buzzer,LOW);
delay(200);
}
📏 Beep if object <10 cm.