Site icon Circuit Ideas for You

Arduino Based Smart Traffic Light Circuit for Beginners

Traffic light is one of the best beginner Arduino projects.

It shows how to control LEDs using Arduino.

This project works like a real traffic signal like red for stop, yellow for wait and green for go.

Arduino Based Smart Traffic Light Circuit for Beginners is easy to build and fun to learn.

Coding:

int red = 8;
int yellow = 9;
int green = 10;

void setup() {
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}

void loop() {
digitalWrite(green, HIGH);
delay(5000);
digitalWrite(green, LOW);

digitalWrite(yellow, HIGH);
delay(2000);
digitalWrite(yellow, LOW);

digitalWrite(red, HIGH);
delay(5000);
digitalWrite(red, LOW);
}

Coding Explanation:

Circuit Working:

Parts List:

Component NameQuantity
Resistors
220Ω 1/4 watt3
Semiconductors
Arduino UNO1
LEDs Red, Yellow and Green1 each

When Arduino starts, green LED turns ON for few seconds.

It means vehicles can go.

After that yellow LED turns ON to show warning or wait.

Then red LED turns ON to stop vehicles.

This cycle repeats again and again.

220Ω resistors are used for safety of LEDs.

Formula with Calculations:

Below is the formula for Smart Traffic Light Circuit.

To limit current for LEDs we have used resistor.

Formula: R = (Vsource – Vled) / Iled

Example: R = (5V – 2V) / 0.015A = 200 ohms (approx)

So we have used 220Ω resistor for safety.

How to Build:

To build a Arduino Based Smart Traffic Light Circuit for Beginners below is the connection steps for connection.

Conclusion:

This simple Arduino Based Smart Traffic Light Circuit for Beginners helps understand basic LED control.

We learn how to use digital pins, timing and loops.

It is good for beginners and can be expanded with sensors later for smart traffic systems.

References:

Arduino Based Traffic Light System With Integrated LED Advertising Display

Exit mobile version