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

Abdul Iot 3

Iot worksheet for students

Uploaded by

Abdul Kalam
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)
6 views4 pages

Abdul Iot 3

Iot worksheet for students

Uploaded by

Abdul Kalam
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/ 4

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

Experiment 3

Student Name: Abdul Kalam UID:22BCS14739


Branch: CSE Section/Group: 602/A
Semester: 5 Date of Performance:01/08/2024
Subject Name: IOT Architecture and its Subject Code: 22CSP-329
Protocols Lab

1. 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 LEDslegs to ground.
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy