0% found this document useful (0 votes)
8 views3 pages

Lab 1 Ie

The document outlines a laboratory manual for simulating a basic traffic light system using an Arduino and three LEDs (Red, Yellow, and Blue). It includes a list of required components, circuit connections, and Arduino code to mimic real-world traffic light behavior with specified time delays. The simulation demonstrates the operation of each LED to represent stop, caution, and go signals.

Uploaded by

acccountsample23
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)
8 views3 pages

Lab 1 Ie

The document outlines a laboratory manual for simulating a basic traffic light system using an Arduino and three LEDs (Red, Yellow, and Blue). It includes a list of required components, circuit connections, and Arduino code to mimic real-world traffic light behavior with specified time delays. The simulation demonstrates the operation of each LED to represent stop, caution, and go signals.

Uploaded by

acccountsample23
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/ 3

Laboratory Manual: Arduino Traffic Light Simulation

Objective:

To simulate a basic traffic light system using an Arduino and three LEDs (Red, Yellow, and Blue) with
specified time delays to mimic real-world traffic light behavior.

Components Required:

 Arduino UNO board

 Breadboard

 1 x Red LED

 1 x Yellow LED

 1 x Blue LED (or Green for more realistic traffic light)

 3 x 220-ohm resistors

 Jumper wires

 USB cable to connect Arduino to a computer

Circuit Diagram:

Refer to the provided diagram.

1. Red LED:

o Connect the positive leg (longer) of the Red LED to Digital Pin 9 of the Arduino.

o Connect a 220-ohm resistor between the negative leg (shorter) of the Red LED and the
ground rail on the breadboard.

2. Yellow LED:

o Connect the positive leg of the Yellow LED to Digital Pin 8.

o Connect a 220-ohm resistor between the negative leg of the Yellow LED and the ground
rail.

3. Blue LED (acts as a Green Traffic Light):

o Connect the positive leg of the Blue LED to Digital Pin 7.

o Connect a 220-ohm resistor between the negative leg of the Blue LED and the ground
rail.

4. Connections to Arduino:
o Connect the ground (GND) of the Arduino to the ground rail of the breadboard.

o Ensure the circuit has a common ground for proper operation.

Code
int red = 9;
int yellow = 8;
int blue = 7;
Observation: void setup(){
pinMode(red, OUTPUT);
 Red LED: Lights up for 15 seconds, indicating a
pinMode(yellow, OUTPUT);
stop.
pinMode(blue, OUTPUT);
 Yellow LED: Blinks } for a short period, warning
that the signal is void loop(){ about to change.
digitalWrite(red, HIGH);
delay(15000);
digitalWrite(red, LOW);
digitalWrite(yellow, HIGH);
delay(500);
digitalWrite(yellow, LOW);
delay(500);
 Blue LED (Green in real-life traffic lights): Stays on for 20 seconds, indicating it's safe to go.

 Yellow LED: Blinks again to signal the transition back to red.

You might also like