Communication Stream (Traffic Light) PDF
Communication Stream (Traffic Light) PDF
UNIVERSITY
School of Engineering
Department of Electrical and Computer
Engineering
Communication stream
Microcomputer & Interfacing (ECEg4161)
Assignment on Traffic Light
Submitted to Tesfaye
1
Introduction
• A microprocessor is a multipurpose programmable, clock driven, register based electronic
device that reads binary instruction from storage device called memory, accepts binary data as
input and processes data according to those instruction, and provides result as output.
• It has integrated circuit containing the arithmetic, logic, and control circuitry required to
interpret and execute instructions from a computer program.
• When combined with other integrated circuits that provide storage for data and programs,
often on a single semiconductor base to form a chip, the microprocessor becomes the heart of a
small computer, or microcomputer.
• Microprocessors are classified by the semiconductor technology of their design (TTL, transistor-
transistor logic; CMOS, complementary-metal-oxide semiconductor; or ECL, emitter-coupled
logic), by the width of the data format (4-bit, 8-bit, 16-bit, 32-bit, or 64-bit) they process; and by
their instruction set (CISC, complex-instruction-set computer, or RISC, reduced-instruction-set
computer; )
• TTL technology is most commonly used, while CMOS is favoured for portable computers and
other battery-powered devices because of its low power consumption.
• ECL is used where the need for its greater speed offsets the fact that it consumes the most
power.
• CISC processors, which have 70 to several hundred instructions, are easier to program than RISC
processors, but are slower and more expensive.
• microprocessor located inside the traffic control box and to control all the circuitries
• Block diagram of the Density Based Traffic Light Control System consists e include:
✓ Mains Supply
✓ DC Power Supply
✓ Sensors Arrays Controller
✓ Traffic Light
✓ Surveillance Camera
2
• The block diagram was drawn so as to give a vivid explanation of how the system works at a
glance, thus;
• the main supply provides 230VAC power which is converted to 5VDC (VDD) by the DC power
supply used to power the sensor arrays, the controller, the surveillance camera and traffic lights.
• The sensor provide input to the controller which then perform some logical operations to power
the traffic lights as output used for controlling traffic at road intersections.
• Additionally, for the proposed surveillance system, the camera is interfaced with the controller
to capture license number plates of traffic defaulters for storage and law enforcement purposes.
❖ In choosing the sensors, the following features were taken into consideration: accuracy, range,
calibration, resolution and affordability. Although the infrared (IR) sensors are usually
disturbed by noise in the surrounding such as radiations, ambient light etc., they were used for
this design because they are chip and readily available in the market and are easy to interface
❖ In Choice of Traffic Light Indicators three light emitting diodes, ‘GREEN’, ‘YELLOW’ and ‘RED’,
each having their usual meaning of ‘GO’, ‘READY’ and ‘STOP’ respectively.
3
Algorithm of traffic light
Step 1: walk up to the traffic lights and stop.
Step 9: Are there cars still passing by?(there should not be any now, but you never know!)
4
Traffic light control system using 8086
Microprocessor:
➢ Traffic light controller interface module is designed to simulate the function of four way traffic
light controller.
➢ Combinations of red, amber and green LED’s are provided to indicate Halt, Wait and Go
signals for vehicles.
➢ Combination of red and green LED’s are provided for pedestrian crossing.
Working Principle
• At the left corner of each road, a group of five LED’s (red, amber and 3 green) are arranged in
the form of a T-section to control the traffic of that road.
• Each road is named North (N), South(S), East (E) and West (W).
• LED’s L1, L10, L19 & L28 (Red) are for the stop signal for the vehicles on the road N, S, W, & E
respectively.
• L2, L11, L20 & L29 (Amber) indicates wait state for vehicles on the road N, S, W, & E
respectively.
• L3, L4 & L5 (Green) are for left, strait and right turn for the vehicles on road S.
5
• similarly L12-L13-L14, L23-L22-L21 & L32-L31-L30 simulates same function for the roads E, N,
W respectively.
• A total of 16 LED’s (2 Red & 2 Green at each road) are provided for pedestrian crossing.
• L7-L9.L16-L18, L25-L27 & L34-L36 (Green) when on allows pedestrians to cross and L6-L8, L15-
L17, L24-L26 & L33-L35 (Red) when on alarms the pedestrians to wait.
6
SOURCE CODE
#start=Traffic_Lights.exe#
1. name "traffic”
2. mov ax, all_red
3. out 4, ax
4. mov si, offset situation
5. next:
6. mov ax, [si]
7. out 4, ax
17. ; FEDC_BA98_7654_3210
18. situation dw 0000_0011_0000_1100b
19. s1 dw 0000_0110_1001_1010b
20. s2 dw 0000_1000_0110_0001b
21. s3 dw 0000_1000_0110_0001b
22. s4 dw 0000_0100_1101_0011b
23. sit_end = $
7
24. all_red equ 0000_0010_0100_1001b
N.B: 0 – RED
1 – YELLOW
2 – GREEN
8
3 – RED
4 – YELLOW
5 – GREEN
6– RED
7 – YELLOW
8 – GREEN
9 – RED
A – YELLOW
B – GREEN
Hexadecimal Guideline: FEDC_BA98_7654_3210
Situation: 0000_0011_0000_1100b
S1 : 0000_0110_1001_1010b
S2 : 0000_1000_0110_0001b
S3 : 0000_1000_0110_0001b
S4 : 0000_0100_1101_0011b
In Situation: port 9, 8, 3 and 2 are ON (1) and the remaining ports are OFF (0).
In S1: port A, 9, 7, 4, 3 and 1 are ON (1) and the remaining ports are OFF (0).
In S2: port B, 6, 5 and 0 are ON (1) and the remaining ports are OFF (0).
In S3: port B, 6, 5 and 0 are ON (1) and the remaining ports are OFF (0).
In S4: port A, 7, 6, 4, 1 and 0 are ON (1) and the remaining ports are OFF (0).
• At line 23, sit_end=$ instruction holds the total value of the array elements.
• At line 24, all_red is used to set all red ports i.e. 0, 3, 6 and 9 to ON (1).