0% found this document useful (0 votes)
180 views9 pages

Communication Stream (Traffic Light) PDF

The document describes a traffic light controller system using a microprocessor. It includes a block diagram showing main components like sensors, lights, and a surveillance camera connected to a microcontroller. The microcontroller runs a control program to interpret sensor input and output signals to the lights. Pseudocode is provided showing the algorithm to sequence the lights through red, yellow, and green states over time to regulate traffic flow. Source code in assembly language further explains how the microprocessor is programmed to activate the different light combinations using input/output ports and time delays.

Uploaded by

Zelalem Birhanu
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)
180 views9 pages

Communication Stream (Traffic Light) PDF

The document describes a traffic light controller system using a microprocessor. It includes a block diagram showing main components like sensors, lights, and a surveillance camera connected to a microcontroller. The microcontroller runs a control program to interpret sensor input and output signals to the lights. Pseudocode is provided showing the algorithm to sequence the lights through red, yellow, and green states over time to regulate traffic flow. Source code in assembly language further explains how the microprocessor is programmed to activate the different light combinations using input/output ports and time delays.

Uploaded by

Zelalem Birhanu
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/ 9

DEBRE BIRHAN

UNIVERSITY
School of Engineering
Department of Electrical and Computer
Engineering
Communication stream
Microcomputer & Interfacing (ECEg4161)
Assignment on Traffic Light

Done By: Group 3 students

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.

TRAFFIC LIGHT CONTROLLER


• The control system is realized by a microcontroller-base control program, which interprets the
input and qualifies it to produce a desired output,

• 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 2: Look at the traffic light.

Step 3: Is your light green?

Step 4: If the light is red, go to step 2.(otherwise go to step 5)

Step 5: Look to the left.

Step 6: Are there cars still passing by?

Step 7: if yes, go to step 5.(otherwise go to step 8)

Step 8: Look to the right.

Step 9: Are there cars still passing by?(there should not be any now, but you never know!)

Step 10: if yes, go to step 8(otherwise go to step 11)

Step 11: proceed across the street carefully!

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.

➢ 36 LED’s are arranged in the form of an intersection.

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

; wait 5 seconds (5 million microseconds)

8. mov cx, 4Ch ; 004C4B40h = 5,000,000


9. mov dx, 4B40h
10. mov ah, 86h
11. int 15h
12. add si, 2 ; next situation
13. cmp si, sit_end
14. jb next
15. mov si, offset situation
16. jmp next

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

WORKING PRINCIPLE OF PROGRAM


• At line 1, is used to label the code.
• At line 2, we used a mov instruction to move the value of all_red to Ax register.
• At line 3, the out 4, ax instruction activates all ports to the value inserted in Ax i.e.
all_red.
• At line 4, moves the offset (address) of situation to source index register (SI).
• At line 5 and 6, the next loop starts and the content of SI will be moved to Ax.
• At line 7, the instruction will activate the output port i.e. situation.
• At line 8 and 9, are used to insert a delay with the value of 5,000,000 microseconds
using register Cx and Dx.
• At line 10 and 11, mov ah,86h/ int 15h are BIOS delay functions are used to
interrupt the program to support the Assembler and add a 1 sec delay.
• At line 12, it adds 2d to Si register to move to the next situation.
• At line 13, compares the contents of Si with sit_end(the total value of the array
elements).
• At line 14, if Si is below sit_end, the Jb instruction will loop up to next label. Else it
will jump to the next instruction.
• At line 15, used to reset the value of SI by putting the address of situation.
• At line 16, loop up to next label.
• At line 17, is used to assign the ports (12 ports) by using a hexadecimal guide line.
• From line 18 to 22, are used to represent the state of the ports i.e. 1 for ON and 0
for OFF accordingly to the hexadecimal guide line.

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).

You might also like