IOT-3 Zoro N - Edited

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

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

Experiment 3

Student Name:Rajeev Joshi UID:22BCS11920


Branch: CSE Section/Group:22BCS_IOT-641-B
Semester: 5 Date of Performance:29/07/2024
Subject Name: IOT LAB Subject Code: 22CSP-329

Aim:

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

Objective

1. Learn about interfacing.


2. Learn about IoT programming

Input/Equipment Used-

o 1 × Breadboard
o 1 × Arduino Uno R3
o 3 × LEDs (Red, Yellow, Green)
o 3 × 220Ω Resistor
o 3 × Jumper

Procedure-

o Gather parts: Microcontroller, LEDs (red/yellow/green), resistors, breadboard,


wires.
o Place LEDs: Insert LEDs into the breadboard.
o Attach resistors: Connect resistors to the longer leg of each LED.
o Wire to microcontroller: Connect resistors to output pins and LEDs' shorter legs to
ground.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

o Write code: Program the LED sequence (red, yellow, green).


o Upload code: Transfer the program to the microcontroller.
o Power up: Turn on the system; LEDs should light up in order.
o Test sequence: Ensure LEDs follow the correct traffic light order.
o Check connections: Verify all wires and components are securely connected.
o Expand project: Add more features, like pedestrian signals or sensors.

Connections:
This is the circuit diagram for the traffic light controller by using Arduino.
o Connect LEDs on the breadboard as Red, Yellow, Green, respectively.
o Connect the negative terminal of the LED and connect the 220 Ohm resistor in series.
o Connect these negative terminals to the ground.
o Connect the positive terminal of the LEDs to the pins 2 to 10, respectively.
o Power the breadboard by using 5V and GND on the Arduino
CODE
void setup() {
pinMode(2, OUTPUT); // Red LED
pinMode(3, OUTPUT); // Yellow LED
pinMode(4, OUTPUT); // Green LED
}
void loop() {
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
delay(5000);

// Yellow light on, others off


digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
delay(1000);
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

// Green light on, others off


digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(5000);

// Yellow light on before switching back to red


digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
delay(1000);
}
Result

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.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

Learning Outcomes:
 Learn how to integrate different hardware and software components to create a cohesive
system.
 Develop skills in working collaboratively in a team, managing tasks, and integrating
different components of the system.
 Understand how to optimize the system for energy efficiency, cost, and performance.
 Learn about the potential environmental benefits and challenges of deploying smart traffic
systems in urban areas.

You might also like