Saturday, June 14, 2025

Traffic Light using Arduino - A Beginner Project

 

  • Traffic Light using Arduino - A Beginner Project


  • Introduction

    In this project I will Demonstrate you how to make a very simple and very cool traffic light Using Arduino.

    This project will involve using a little a bit of code and a very simple circuit that’s great for beginners.

    The video further down this page will go through all the steps to completing this cool traffic light project.

    This simple little project uses an Arduino and some LEDs to replicate a traffic light. It uses code as an internal timer and continues to run until you cut the Arduino's power supply.

Working on Basics

The LED have been powered by Arduino UNO (Board). It contains a code which uploaded to the board. And once it simulated LED Start's blinking like a traffic light. In this 15 Second will for Red Light 6 Second for Yellow Light (In my Project Blue) and 20 Second for Green Light.

Usage

There is multiple usage of the project:-

  1. If you are beginner so it is a intro to arduino
  1. You can Make a real but small Traffic Light using it
  1. You can also add more LED and Can change as per your usgae






code 

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

void setup(){
  
  pinMode(red, OUTPUT);
  pinMode(yellow, OUTPUT);
  pinMode(green,  OUTPUT);
  
}
void loop(){
digitalWrite(red, HIGH);
 delay(15000);
digitalWrite(red,  LOW);
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow,  LOW);
delay(500);

  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow,  LOW);
delay(500);

  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow,  LOW);
delay(500);
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  
digitalWrite(green, HIGH);
delay(20000);
digitalWrite(green,  LOW);
//  
digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow,  LOW);
delay(500);

  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow,  LOW);
delay(500);

  digitalWrite(yellow, HIGH);
delay(1000);  
  digitalWrite(yellow, LOW);
delay(500);
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  
  digitalWrite(yellow, HIGH);
delay(1000);
  digitalWrite(yellow, LOW);
delay(500);
  
  
}


  • "This Content Sponsored by Buymote Shopping app

    BuyMote E-Shopping Application is One of the Online Shopping App

    Now Available on Play Store & App Store (Buymote E-Shopping)

    Click Below Link and Install Application: https://buymote.shop/links/0f5993744a9213079a6b53e8

    Sponsor Content: #buymote #buymoteeshopping #buymoteonline #buymoteshopping #buymoteapplication" 

No comments:

Post a Comment

Traffic Light using Arduino - A Beginner Project

  Traffic Light using Arduino - A Beginner Project Introduction In this project I will Demonstrate you how to make a very simple and very co...