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

Exp 3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

Experiment 3
Student Name: Armaan UID: 22BCS10504
Branch: BE-CSE Section/Group: 607(B)
Semester: 5th Date of Performance: 02-08-24
Subject Name: IoT Architecture and Subject Code: 22CSP-329
its Protocols Lab

1. Aim:
To Develop a smart traffic light management system with the help of IoT.

2. Objectives:
• Learn about interfacing.
• Learn about IoT programming.

3. Equipment Used:
• 1 × Breadboard
• 1 × Arduino Uno R3
• 3 × LEDs (Red, Yellow, Green)
• 3 × 220Ω Resistor
• 3 × Jumper

4. Procedure:
• Gather parts: Microcontroller, LEDs (red/yellow/green), resistors,
breadboard, wires.
• Place LEDs: Insert LEDs into the breadboard.
• Attach resistors: Connect resistors to the longer leg of each LED.
• Wire to microcontroller: Connect resistors to output pins and LEDs' shorter
legs to ground.
• Write code: Program the LED sequence (red, yellow, green).
• Upload code: Transfer the program to the microcontroller.
• Power up: Turn on the system; LEDs should light up in order.
• Test sequence: Ensure LEDs follow the correct traffic light order.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

• Check connections: Verify all wires and components are securely connected.
• Expand project: Add more features, like pedestrian signals or sensors.

5. Code:
void setup()
{
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
}
void loop()
{
digitalWrite(2, HIGH);
delay(2000);
digitalWrite(2, LOW);
digitalWrite(1, HIGH);
delay(2000);
digitalWrite(1, LOW);
digitalWrite(0, HIGH);
delay(2000);
digitalWrite(0, LOW);
}

6. Connections:

This is the circuit diagram for the traffic light controller by using Arduino.
• Connect LEDs on the breadboard as Red, Yellow, Green, respectively.
• Connect the negative terminal of the LED and connect the 220 Ohm resistor
in series.
• Connect these negative terminals to the ground.
• Connect the positive terminal of the LEDs to the pins 2 to 10, respectively.
• Power the breadboard by using 5V and GND on the Arduino.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

7. Result:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

8. Learning Outcomes:
• Learn how to connect and interface LEDs with an Arduino microcontroller.
• Develop programming skills specific to IoT and Arduino environments.
• Gain practical experience in designing and assembling basic electronic
circuits.
• Understand the logic and sequence behind traffic light management systems.
• Learn how to expand basic projects with additional features, like sensors or
pedestrian signals.

9. Conclusion:
You should see your LED turn on and off. If the required output is not seen, make
sure you have assembled the circuit correctly, and verified and uploaded the code
to your board. This traffic light controller includes a crosswalk signaling system.
The traffic light controller in this system can be implemented practically, and it
could be expanded.

You might also like