0% found this document useful (0 votes)
23 views4 pages

Practical - 5

The document provides a guide on developing an IoT-based automated traffic signal system using an Arduino board and LEDs. It includes a sample code for controlling the traffic lights and outlines the materials needed, steps for assembly, and programming instructions. Additionally, it discusses the applications of traffic light control systems, emphasizing road safety, traffic management, pedestrian safety, emergency vehicle prioritization, and energy efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Practical - 5

The document provides a guide on developing an IoT-based automated traffic signal system using an Arduino board and LEDs. It includes a sample code for controlling the traffic lights and outlines the materials needed, steps for assembly, and programming instructions. Additionally, it discusses the applications of traffic light control systems, emphasizing road safety, traffic management, pedestrian safety, emergency vehicle prioritization, and energy efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

By Harsh Darji

1) Write a code to Develop IoT based application using Arduino board to


implement automated traffic signal system using different colour LED.
Ans :-
Input 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);
By Harsh Darji

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);

}
Output

2) How to make traffic light signal using Arduino?


By Harsh Darji

Ans :-
Materials:
 Arduino board (Uno is a good starter choice)
 Three LEDs (Red, Yellow, Green)
 Resistors (100-220 ohm, will depend on your LEDs)
 Breadboard
 Jumper wires
Steps:
1. Connect the LEDs:
 Each LED has a longer leg (positive) and a shorter leg (negative).
 Connect the shorter leg of each LED to the ground (GND) pin on the Arduino.
 Important: Use a resistor in series with the longer leg of each LED before
connecting it to an Arduino pin. This protects the LED from damage. Connect the
resistor to the longer leg, then the wire from the resistor to an Arduino pin.
2. Program the Arduino:
 You'll need software called Arduino IDE
(https://support.arduino.cc/hc/en-us/articles/360019833020-Download-and-install-
Arduino-IDE) to write the code.
 The code will tell the Arduino to turn the LEDs on and off in the specific pattern
of a traffic light.
 Many resources online provide beginner-friendly code for this project. Search for
"Arduino traffic light code" and find one that explains each step clearly.
3. Upload the code and run the program:
 Connect your Arduino to your computer using a USB cable.
 In the Arduino IDE, open the code you downloaded or wrote.
 Click the "upload" button to send the code to your Arduino.
 If everything is connected correctly, your traffic light should start working!

3) What are the applications of traffic light control system?


Ans :-
1. Road safety: Traffic light control systems help regulate vehicle movement at
intersections, reducing the risk of accidents and improving overall road safety.
2. Traffic management: These systems optimize traffic flow, reducing congestion
and travel times for drivers.
3. Pedestrian safety: Traffic lights provide designated crossing times for
pedestrians, ensuring their safety when crossing roads.
4. Emergency vehicle prioritization: Traffic light control systems can be
programmed to give priority to emergency vehicles, allowing them to navigate
through traffic more efficiently.
5. Energy efficiency: By optimizing traffic flow and reducing idling time, traffic
light control systems help conserve fuel and reduce vehicle emissions,
contributing to environmental sustainability.
By Harsh Darji

You might also like