G3-Report
G3-Report
Truth table
Since traffic management is a critical aspect of modern urban infrastructure. At the meantime,
Traffic light controllers are essential to ensure smoother vehicle and pedestrian flow at
crossroads. In our group project, our aim is to design and stimulate a traffic light controller. In
details, my job is to create a suitable and basic truth table in order to help other teammates
build a whole logic system.
At first, we designed a four-way intersection with North-South (NS) and East-West (EW)
directions. Then, we make three states about traffic light, including green(G), yellow(Y), and
red(R) signals, as well as integrating a pedestrian crossing phase. We also use timers to
manage how long each light remains in a specific state where green and red last for 30
seconds, and yellow for 5 seconds. Finally, we set that the first state Q0 is green for North and
South(NSG), which is 000, where the next state is Q1, which is 001 for yellow in North and
South(NSY). The East-West is same as the North-South process, and the pedestrian crossing
is activated when both NS and EW lights are red, which is 101, the final state.
To improve the complexity and reality of our project, we then decided to add a left turn light
for both directions. However, it seems too complicated for teammates to build a real model,
so we shortened the truth table via combining green and yellow to the same state. So, there
are only two states with 0 and 1.
In conclusion, my contribution to the project focused on building the truth table, defining the
state transitions using sequential logic, and ensuring that the timing logic. Additionally, I am
responsible for integrating the left-turn signals for both directions, which added complexity
and originality to the design.
The system handles three types of pedestrian buttons and one type of emergency vehicle input. The
pedestrian buttons are Nwe: Button between W and E on the north side; Swe: Button between W and E
on the south side; Wns: Button between N and S on the west side; Ens: Button between N and S on the
east side.
The truth table one below defines the state transitions of sidewalk options A and B.
TABLE I
TRANSITIONS OF SIDEWALK OPTIONS A AND B
The truth table below defines a partial state transition for sidewalk options c, where the input is Nwe.
TABLE II
TRANSITIONS OF SIDEWALK OPTIONS C
The following truth table defines a partial state transition for the emergency vehicle, where the input is
ew.
TABLE III
TRANSITIONS OF EMERGENCY VEHICLE
This logic ensures that the input of pedestrians and emergency vehicles is effectively managed, while
minimizing interference between different traffic flows and improving the efficiency of pedestrian and
emergency vehicles.
a. Counter section
First, I use two reversible counters with its down function to achieve the purpose of countdown.
when the down function 's output is pulse, the up function is on high level, then the counters can
achieve subtraction function.
b. 555 Timer
Then, the subtraction function counts down the second pulse generated by the multi-resonant swing
circuit composed of 555 timers. At the beginning, the two output is 00. When its load alphanumeric
port is low, outputs equal inputs. By controlling input word port, input part controls the countdown
time.
IV. Interference
The interference section checks any possible interference like mass pedestrian crossing and emergency
vehicles, then turns all traffic lights in all directions to red to make sure pedestrians and emergency
vehicles can traverse through.
a. basic circuit
The graph below shows the basic traffic light circuit simulated in Simulink, where the clock generates
time signal and is modulated by 30 to give a cycle of 30 seconds. This 30 second is divided into 3
periods representing 3 colours of the traffic light.
b. the interference
A uniform random number generator is used to generate a signal representing the emergency. The
duration of this signal is arbitrarily set to 5 seconds.