You are on page 1of 15

Course code OENG1207

Course name Digital Fundamentals

Location & Campus RMIT University Vietnam - Saigon South


campus

Title of project Group Project Report

Lecturer Dr. Alexandru C Fechete

Group number 5

Student name/ID Huy Le - S3915144


Hoang Nguyen Bui Huy - S3914538

Group Tuesday 10:30-12:30

Assignment due date September 21, 2022

Page numbers 15

"I declare that in submitting all work for this assessment I have read, understood and
agreed to the content and expectations of the Assessment declaration."

OENG1205 – Digital Fundamentals

Semester 2 – 2022

1
Table of Contents

Introduction/Background ...................................................... 3
Design and methodology ...................................................... 3
Design Explanation ............................................................... 6
Automatic system .................................................................. 6
Manual System ..................................................................... 8
Output and Testing.............................................................. 10
Automatic system ................................................................ 10
Manual System ................................................................... 11
Conclusion........................................................................... 13
Picture for testing ................................................................ 14

2
I. Introduction/Background

The project is programmed on the Simulink system with a basic traffic light
signal system that interacts between traffic lights and pedestrian lights. The car
light system is displayed with three light patterns including green, yellow and
red; And the lights for pedestrians will be displayed in two colours green and
red. The programmers will use the 'Counter Limited' block for about 15 seconds
to align the time to balance between the crosses of the beacons. The automatic
light system requires the design time for the vehicle to run (green light) with
about 7 seconds equivalent to 7 counts in the programming system, and the
yellow light 3 seconds equivalent to 3 counts to warn traffic vehicles. slow down
and prepare to stop at a red light with 6 seconds equals 6 counts. Therefore, a
red light for pedestrians to wait for about 10 seconds is equivalent to 10 counts,
and a green for pedestrians to cross the street before the system stops at 15
counts. In fact, the signal light system will be similar and repeated in a cycle to
ensure the safety of passers-by and ensure circulation between vehicles.

In addition, the project also requires programmers to design a light system with
a switch (manual operation system). And same with the automatic system, the
manual system also has a programming system with a counting system from 0
to 15 counts, and after pressing the 'Push Button' the light system also works
with the same principle as the system. Automatic system when the traffic lights
are green, the pedestrian lights will be red and vice versa; Only when the yellow
light signals that the vehicle needs to slow down before the red light comes on,
pedestrians will recognize the signal about to cross the road.

II. Design and methodology

Name Picture Description

3
Counter-limit It lets the users select the
block maximum value. The block
counts up until reaching the
maximum value. The number
then resets to zero and resumes
counting up. The counter is
always reset to zero.

Scope Block It displays a figure which has a


y-axis for time and an x-axis for
signals generated.

Constant The Constant block creates a


block signal that has a constant real or
complex value. The automatic
traffic light system requires six
constant blocks to build up.

Relational The Relational Operator block


operators applies the relational operator
supplied to the input. The
relational operator parameter
controls whether the block takes
one or two input signals.

Logical On its inputs, the Logical


operator Operator block executes the
given logical operation. If an
input value is nonzero, it is true
(1), and if it is zero, it is false (0).

Output block There are three output blocks in


each system. While counting, if
the number is in the right range,
the blocks will have a value of

4
one (1). Otherwise, the blocks
will receive a value of zero (0).

Signals Every system has five lights.


(Traffic Three lights in the left are for
Lights ) cars and two others in the right
are for pedestrians. These lights
are connected to the logical
operators. The light will be in the
state of On or Off mode
depending on the condition.

State-Flow This block serves as the primary


Chart Block component of the Interoperable
System, outlining the three
lighting system states and which
lights should be activated for
each.

Momentary The users may alter the value of


Push Button a tuneable parameter or
variable by depressing the
button. When the users release
the button, the value of the
associated parameter or
variable is reset to its initial
value.

III. Design Explanation


Automatic System:

The counter limit block was used to define a time interval of 0-15 counts (sec),
and this represents the range of beacons required by the project. The counter

5
limit block is linked with relational operators to check for each associated
signal condition.
There are three distinctly defined timelines:

● 0 ≤ time (Counter-limit block) ≤ 6

● 6 < time (Counter-limit block) ≤ 9

● 9 < time (Counter-limit block) ≤ 15

Algorithm 1: Automatic Traffic System

6
Picture 1: Automatic System

The signals are designed and linked to the output blocks under certain conditions, if
the value of the signal is zero, the output block is equal to zero, then the signal
condition at that time will be off. If the value of the output block is equal to 1 the value
of the signal is also equal to 1 and the light is on.

Picture 2: Signal alignment with output blocks

7
Picture 3: Graph of test lights

Manual System:

In manual programming, we used Stateflow as a phase 'Counter' that will


produce corresponding results programmed in Stateflow. In each different
state, the beacon will be switched on and off to match a basic traffic signal,
and we use the 'sec' equivalent to the second-count in the project. When
starting, the program will display like the image below:

Picture 4: Pedestrian crossing button/switch

8
Algorithm 2: Pedestrian crossing button/switch

Counting Program: Divided into three phases


● The first stage: the driving light (green light) is on, the yellow and red
signal lights (for vehicle) will not light up, and the algorithm value will be
1 for green and 0 for both yellow and red.
● Stage two: after using 'Push Button' the initial button value will change
to 1 and the system will switch from green light (for vehicle) to yellow
signal light. Therefore, the value of the yellow signal light will be 1, the
green light and the red light (for vehicles) will remain in the off state
with a value of 0. This state will be activated within 3 seconds
corresponding to the unit. taste 3 'sec'. The fact that the program has
the value 'Button == 1' means that when the button system gives
'Constant = 1' and the comparison of the value of 'Button' matches, the
second state-flow will actually work.
● Stage three: After 3 'sec', the value of the red light is 1, the yellow and
green lights will turn off at the same time with a value of 0. That means
at this time the vehicle driver will stop the vehicle and at the same time.
Pedestrians will move for 6 'sec' before the program system ends.
When the red light for traffic is on, it will also light up a green signal to
let pedestrians know when to cross the road.

9
Picture 3: The state-flow
A ‘Constant’ block that is attached to the ‘Push Button’ serves as the state
line's input. Because the node cannot be directly connected to the state
stream as its input in this case, we are using constant blocks instead. The
output and signal connection technique is the same as for an automated
system. Additionally, since the input will be utilised in the state stream, it must
have a value. The constant block's value initially is zero, but when the button
is pressed, it becomes one. The state stream will cycle in order and produce
each corresponding light system. When the conditions are right, the order will
be output as required by the programmer starting from green to yellow and
red, and in the pedestrian light system will be red to green. Therefore, when
the indicator light value is equal to 1 will be when the light is on and 0 will be
when the light is off.

IV. Output and testing:


Automatic system:
Screenshots of testing on the appendix.

Time (Second) Picture

10
First phase: seven (7) counts (0s to 6s)

Vehicles: Green
Pedestrian: Red

Picture 4.1.1

Second phase: three (3) counts (7s to 10s)

Vehicles: Yellow
Pedestrian: Red

Picture 4.1.2

Third phase: six (6) counts (0s to 6s)

Vehicles: Red
Pedestrian: Green

Picture 4.1.3

Table 2: Testing of Automatic Systems.

Interoperable button/switch for pedestrians System:

11
Process Picture

Before pushing the button, the constant


block has the value of zero and the traffic
light displays colours below.

Vehicles: Green
Pedestrian: Red

Picture 4.2.1

When the pedestrians push the button, the


constant block transfers into value of one
(1) and the traffic light displays the colours
below.

Vehicles: Yellow
Pedestrian: Red

Picture 4.2.2

Despite the fact that the constant block


returns into the value of zero (0), the value
of one has already been input and the time
passes three (3) seconds. Therefore, the
traffic light displays the colour below.

Vehicles: Red
Pedestrian: Green

Picture 4.2.3

12
V. Conclusion
The project is a basic program that exposes students to the actual traffic light
project, and the goal is to regulate safety and traffic between vehicles and
pedestrians. Simulink supports students to increase the arrangement of
running algorithm graphs and review reasonable conditions. The project gives
an overview of real-life projects such as traffic lights or conversion algorithms.
Our team's automatic and manual traffic light programming systems met the
set criteria, and the status flow and counting operations performed the
required checks. The program automatically responds to common signals and
the button program makes it easy for pedestrians to use in the state of
needing to cross. Pedestrian signals are still connected to traffic lights, with
the goal that when the green light for vehicles is running, it will be a red light
for pedestrians to wait before crossing the street. A yellow light signals the
driver of a vehicle to slow down for 3 'sec' before coming to a complete stop at
a red light. At this point, the pedestrian will walk with a green light before the
program is repeated as at the beginning.
● Automatic traffic light system: The operating program starts with a
counter-limited block and progresses to the relational operator to check
the condition. And after the system is tested, the successful conditions
will bring to the output blocks and light up the lights. In addition, the
'Logical operators' will connect the conditions and associations so that
the lights are on at the same time.
● Manual system (Pedestrian crossing button/switch): The program
system uses 'Push Button' instead of 'Counter-limited block' because it
is a manual system that requires direct action from the person who
wants to move across the street. In the manual program we don't use
the operator system, but we choose 'State-flow Chart Block' to output
each result in order when the users press 'Push Button'. In the end, the
results will remain the same as automatic; however, the program will
change status to yellow after pressing 'Push Button', and stay for 3
'sec' before changing to green pedestrian light.

13
VI. Picture for testing:

Picture 4.1.1 - First phase (0 to 6) of Automatic System

Picture 4.1.2 - First phase (6 to 9) of Automatic System

Picture 4.1.3 - First phase (9 to 15) of Automatic System

14
Picture 4.2.1 - Before pushing button of Interoperable button/switch for
pedestrians System

Picture 4.2.2 - After pushing button of Interoperable button/switch for


pedestrians System

Picture 4.2.3 - After 3 second from pushing button of Interoperable


button/switch for pedestrians System

15

You might also like