0% found this document useful (0 votes)
102 views2 pages

Week-1 Assignment PDF

The document describes a summer assignment to design a 4-way traffic light controller using an Arduino microcontroller. It includes a diagram of a 4-way intersection with 4 traffic signals. The controller must cycle through different light patterns based on the time of day, represented by a "time_slot" variable from 1-4. Time_slot 1 is light traffic with all yellow lights blinking. Time_slot 2 cycles through the signals with a green, then yellow light. Time_slot 3 alternates between the main and side roads having green lights. Time_slot 4 is the same as time_slot 1. Students must submit the circuit diagram and Arduino code on GitHub.

Uploaded by

chiku
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)
102 views2 pages

Week-1 Assignment PDF

The document describes a summer assignment to design a 4-way traffic light controller using an Arduino microcontroller. It includes a diagram of a 4-way intersection with 4 traffic signals. The controller must cycle through different light patterns based on the time of day, represented by a "time_slot" variable from 1-4. Time_slot 1 is light traffic with all yellow lights blinking. Time_slot 2 cycles through the signals with a green, then yellow light. Time_slot 3 alternates between the main and side roads having green lights. Time_slot 4 is the same as time_slot 1. Students must submit the circuit diagram and Arduino code on GitHub.

Uploaded by

chiku
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/ 2

SUMMER GUIDANCE

ARDUINO AND IOT

Week 1 Assignment
Four Way Traffic Controller
SIGNAL
1: - Red,
Yellow,
Green

SIDE ROAD
Bidirectional

MAIN ROAD MAIN ROAD


Bidirectional Bidirectional
SIGNAL ARDUINO SIGNAL
4: - Red, MICROCONTROLLER 2: - Red,
Yellow, Yellow,
Green Green

SIDE ROAD
Bidirectional

SIGNAL
3: - Red,
Yellow,
Green

Problem Statement: -
To design a basic 4-way traffic control system with LEDs using Arduino Micro controller.
A typical 24-hour day in a city X sees the following traffic patterns during various time slots:
-
1. 3 am to 6 am – Light traffic
2. 6 am to 9 am – Medium Traffic
3. 9 am to 9 pm – Heavy Traffic
4. 9 pm to 3 am – Medium Traffic
Your goal is to design the LED timing system, to operate a typical 4-way intersection in X, as
shown in the above diagram.
SUMMER GUIDANCE
ARDUINO AND IOT

Conditions: -

1. Include a variable named ‘time_slot’ in the code which can take values from 1 to 4 to
depict the time of day. Based upon the value of ‘time_slot’, the corresponding
control pattern of LEDs should execute as mentioned below.
2. At any given time, no more than one LED of the same signal should glow.
3. While defining pins, each code should include a comment showing which pin is
connected to which LED of which signal.
e.g. pinMode(9, OUTPUT); //signal 1 red led
4. time_slot==1
Under this condition, all the four yellow LEDs at signals should blink, and all the
remaining LEDs should remain OFF.
5. time_slot==2
The 4 signals should execute the following pattern in a cyclic manner going in the
order as 1, 2, 3, 4(see diagram for clarity).
Pattern of LEDs
Signal 1 GREEN ON, Signal 2 RED ON, Signal 3 RED ON, Signal 4 RED ON. (For 3 sec.)
Signal 1 GREEN OFF, YELLOW ON, Rest Signals remain RED ON, as before. (For 1 sec).
Signal 2 GREEN ON, Signal 1 RED ON, Signal 3 RED ON, Signal 4 RED ON. (For 3 sec.)
Signal 2 GREEN OFF, YELLOW ON, Rest Signals remain RED ON, as before. (For 1 sec).
…and so on.
6. time_slot==3
Pattern of LEDs
Signal 2 and Signal 4 (Main Road) must have GREENS ON, Signals 1 and 3 REDS ON.
(For 3 sec)
Signal 2 and Signal 4 GREENS OFF, YELLOWS ON. Signals 1 and 3 REDS ON (For 1 sec)
Signal 1 and Signal 3 (Side Road) must have GREENS ON, Signals 2 and 4 REDS ON.
(For 3 sec)
Signal 1 and Signal 3 GREENS OFF, YELLOWS ON. Signals 2 and 4 REDS ON (For 1 sec)
…and so on repeating again.
7. time_slot==4
Same as Condition 4.

Submission Rules: -
1. Submission should include a clear screenshot of circuit diagram, and written code in
a text file format.
2. The entire assignment must be uploaded to your GitHub accounts, as stated earlier
in Group.

You might also like