Arduino UNO interfacing with traffic lights in proteus
In this article we will learn how to interfacing arduino UNO with traffic light in proteus.
In the last post we will learn how to interfacing arduino UNO with intensity meter in proteus. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.
Diagram of this project is below:
Components which we use in this project are listed below:
- Arduino UNO
- LCD display
- LED’s (red,yellow,green)
- Jumper wire’s
Construction of arduino UNO interfacing with traffic lights in proteus:
- Connect the point 0 of arduino UNO to the point of green LED
- Connect the point 1 of arduino UNO to the point of yellow LED
- Connect the point 2 of arduino UNO to the point D7 of LCD
- Connect the point 3 of arduino UNO to the point D6 of LCD
- Connect the point 4 of arduino UNO to the point D5 of LCD
- Connect the point 5 of arduino UNO to the point D4 of LCD
- Connect the point 6 of arduino UNO to the point E of LCD
- Connect the point 7 of arduino UNO to the point RS of LCD
- Connect the point 8 of arduino UNO to the point of red LED
- Connect the point VDD of LCD to +ve
- Connect VSS & RW both points of LCD to GND
Working of Arduino UNO interfacing with traffic lights in proteus
Interfacing an arduino UNO with traffic lights involves using the arduino board to control the timing and sequence of the traffic light signals
Applications of Arduino UNO interfacing with traffic lights in proteus are listed below:
- Educational demonstrations
- Prototyping and testing
- Smart traffic systems
- Pedestrian crossings
- Low-cost solutions for small projects
Advantages of Arduino UNO interfacing with traffic lights in proteus
- Ease of use
- Affordability
- Open-source platform
- Real-world simulation
- Learning opportunities
Program code of this project is listed below:
#include <LiquidCrystal.h>
int GREEN = 0; // Initialize Pin0 for Green Light
int YELLOW = 1;// Initialize Pin1 for Yellow Light
int RED = 8; // Initialize Pin2 for Red Light
int DELAY_GREEN = 1000; //Delay for Green Light
int DELAY_YELLOW = 1000;//Delay for Yellow Light
int DELAY_RED = 1000;//Delay for Red Light
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;// Initialize pins for interfacing LCD
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup()
{
// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD
lcd.print(“”);
pinMode(GREEN, OUTPUT);//Define Green LED in as output
pinMode(YELLOW, OUTPUT);//Define Yellow LED in as output
pinMode(RED, OUTPUT);//Define RED LED in as output
}
void loop()
{
no_light(); //Call no light function turn off lights initially
delay(1000); // 1sec delay
lcd.display(); //initialize LCD display
lcd.clear();//Clear the LCD
red_light(); // Call red light function
delay(DELAY_RED); // Delay for RED traffic light
lcd.print(“STOP”); // Print STOP for RED signal
delay(1000);// Wait for 1sec delay
lcd.clear();// Clear LCD
yellow_light();// Call Yellow light function
delay(DELAY_YELLOW);// Delay for Yellow traffic light
lcd.print(“WAIT”); // Print wait on LCD with yellow singal
delay(1000);// Wait for 1 sec
lcd.clear();// Clear LCD
green_light();//call for green traffic light
delay(DELAY_GREEN);//Delay for Green signal
lcd.clear();//clear LCD display
lcd.print(“GO”);//Print Go for Green singal
delay(1000);//1 sec delay
lcd.clear();//clear LCD
}
// Function to make all singal light low
void no_light() {
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, LOW);
}
//Function to control light for RED singnal
void red_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, HIGH);
}
//Function to control light for Yellow singnal
void yellow_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, HIGH);
digitalWrite(RED, LOW);
}
//Function to control light for Green singnal
void green_light()
{
digitalWrite(GREEN, HIGH);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, LOW);
}