0% found this document useful (0 votes)
56 views1 page

Experiment 2

The document outlines an experiment to simulate a traffic light signal using an Arduino and LEDs. It details the necessary components, hardware setup, code upload process, and testing steps to achieve a functioning traffic light system. The LEDs represent the red, yellow, and green signals, cycling through their respective states to simulate traffic light behavior.

Uploaded by

kritikashar183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views1 page

Experiment 2

The document outlines an experiment to simulate a traffic light signal using an Arduino and LEDs. It details the necessary components, hardware setup, code upload process, and testing steps to achieve a functioning traffic light system. The LEDs represent the red, yellow, and green signals, cycling through their respective states to simulate traffic light behavior.

Uploaded by

kritikashar183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Experiment 2: Traffic Light Signal

Objective: Simulate a traffic light signal using an Arduino and LEDs to represent the red, yellow,
and green lights.
Components:
• Arduino UNO R3 DIP
• Breadboard
• Jumper Wire All type
• Red, yellow and green LEDs
• Three 220Ω or 1KΩ Resistors

Steps to Perform the Experiment:


A. Set Up the Hardware
1. Place the LEDs on the Breadboard:
- Insert the red, yellow, and green LEDs into the breadboard. The longer leg (anode) is the positive terminal,
and the shorter leg (cathode) is the negative terminal.

2. Connect the Resistors:


- Place each resistor in series with each LED's anode (longer leg). Connect one end of the resistor to the LED's
anode and the other end to a jumper wire.

3. Connect the LEDs to the Arduino:


- Red LED Anode: Connect the free end of the resistor to DP 9 on the Arduino.
- Yellow LED Anode: Connect the free end of the resistor to DP 10 on the Arduino.
- Green LED Anode: Connect the free end of the resistor to DP 11 on the Arduino.
- Cathodes of all LEDs: Connect to the GND rail on the breadboard.

4. Set Up the Breadboard:


- Connect the Arduino's GND pin to the breadboard's GND rail to complete the circuit.

B. Upload the Code to the Arduino


1. Open the Arduino IDE on your computer.
2. Connect your Arduino UNO to your computer using the USB cable.
3. Write the code into the Arduino IDE.
4. Select the correct board and port in the Arduino IDE (`Tools > Board > Arduino UNO`, `Tools > Port > your
port`).
5. Click the "Upload" button to upload the code to the Arduino.

C. Testing the Setup


1. After uploading the code, the Arduino should start running the program.
2. The green LED should turn on for 5 seconds, representing the "Go" signal.
3. The yellow LED should turn on for 2 seconds, representing the "Caution" signal.
4. The red LED should turn on for 5 seconds, representing the "Stop" signal.
5. The cycle should repeat continuously, simulating a traffic light system.

Robo%cs & A.I. – Class IX | SMC Prayagraj

You might also like