TRAFFIC LIGHT CONTROLLER

10
Term paper On Microprocessor based traffic light control system Submitted to: Submitted by: Miss Ritu Ramjee Prasad Faculty of ECE Registration no: 10804900 Roll no : RH6802B54

description

TRAFFIC LIGHT CONTROLLER

Transcript of TRAFFIC LIGHT CONTROLLER

Page 1: TRAFFIC LIGHT CONTROLLER

Term paper

On

Microprocessor based traffic light control system

Submitted to: Submitted by:

Miss Ritu Ramjee Prasad

Faculty of ECE Registration no: 10804900

Roll no : RH6802B54

Page 2: TRAFFIC LIGHT CONTROLLER

Microprocessor:

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; see RISC processor). TTL technology is most commonly used, while CMOS is favored 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. Four-bit devices, while inexpensive, are good only for simple control applications; in general, the wider the data format, the faster and more expensive the device. CISC processors, which have 70 to several hundred instructions, are easier to program than RISC processors, but are slower and more expensive.

History:

Developed during the 1970s, the microprocessor became most visible as the central processor of the personal computer. Microprocessors also play supporting roles within larger computers as smart controllers for graphics displays, storage devices, and high-speed printers. However, the vast majority of microprocessors are used to control everything from consumer appliances to smart weapons. The microprocessor has made possible the inexpensive hand-held electronic calculator, the digital wristwatch, and the electronic game. Microprocessors are used to control consumer electronic devices, such as the programmable microwave oven and DVD player; to regulate gasoline consumption and antilock brakes in automobiles; to monitor alarm systems; and to operate automatic tracking and targeting systems in aircraft, tanks, and missiles and to control radar arrays that track and identify aircraft, among other defense applications.

Basic principle of traffic light control system

Some lights don't have any sort of detectors. For example, in a large city, the traffic lights may simply operate on timers -- no matter what time of day it is, there is going to be a lot of traffic. In the suburbs and on country roads, however, detectors are common. They may detect when a car arrives at an intersection, when too many cars are stacked up at an intersection (to control the length of the light), or when cars have entered a turn lane (in order to activate the arrow light).

There are all sorts of technologies for detecting cars -- everything from lasers to rubber hoses filled with air! By far the most common technique is the inductive loop. An inductive loop is simply a coil of wire embedded in the road's surface. To install the loop, they lay the asphalt and then come back and cut a groove in the asphalt with a saw. The wire is placed in the groove and sealed with a rubbery compound. You can often see these big rectangular loops cut in the pavement because the compound is obvious.

Page 3: TRAFFIC LIGHT CONTROLLER

Inductive loops work by detecting a change of inductance. To understand the process, let's first look at what inductance is. This figure is helpful:

We see here is a battery, a light bulb, a coil of wire around a piece of iron (yellow), and a switch. The coil of wire is an inductor. If we have read How Electromagnets Work, we will also recognize that the inductor is an electromagnet. If we were to take the inductor out of this circuit, then what we have is a normal flashlight. We close the switch and the bulb lights up. With the inductor in the circuit as shown, the behavior is completely different. The light bulb is a resistor (the resistance creates heat to make the filament in the bulb glow). The wire in the coil has much lower resistance (it's just wire), so what you would expect when you turn on the switch is for the bulb to glow very dimly. Most of the current should follow the low-resistance path through the loop. What happens instead is that when you close the switch, the bulb burns brightly and then gets dimmer. When we open the switch, the bulb burns very brightly and then quickly goes out.

Microprocessor as traffic light control system:

A traffic light control and information transmission device comprising: a microprocessor located inside the traffic control box and to control all the circuitries; a traffic light controller connected to and controlled by said microprocessor to send out the stop, go and direction signals; an electronic display board connected to and controlled by said microprocessor to display characters, patterns and graphic images; a video camera connected to and controlled by said microprocessor to monitor the traffic flow; a compression circuitry connected to said microprocessor and said video camera, said compression circuitry compresses the image data captured by said video camera and sends the data to said microprocessor; an I/O interface connected to said microprocessor to receive, transmit data and control signals; a traffic flow detector connected to said I/O interface and gathering the traffic flow information; the traffic flow information is input to said microprocessor; a DSL connected to said I/O interface 6 and receiving, transmitting data and control signals; a broadband network linking said

Page 4: TRAFFIC LIGHT CONTROLLER

DSL and a central traffic control computer together, said central traffic control computer sends out and receives the data and controls signals to said microprocessor through said broadband network.

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. A typical junction is represented on the PCB with comprehensive legend printing.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. 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.To minimize the hardware pedestrian’s indicator LED’s (both red and green are connected to same port lines (PC4 to PC7) with red inverted. Red LED’s L10 & L28 are connected to port lines PC2 & PC3 while L1 & L19 are connected to lines PC0 & PC1 after inversion. All other LED’s (amber and green) are connected to port A & B.

WORKING:-8255 is interfaced with 8086 in I/O mapped I/O and all ports are output ports. The basic operation of the interface is explained with the help of the enclosed program. The enclosed program assumes no entry of vehicles from North to West, from road East to South. At the beginning of the program all red LED’s are switch ON, and all other LED‘s are switched OFF. Amber LED is switched ON before switching over to proceed state from Halt state.The sequence of traffic followed in the program is given below.a) From road north to EastFrom road east to northFrom road south to westFrom road west to southFrom road west to northb) From road north to EastFrom road south to westFrom road south to northFrom road south to eastc) From road north to southFrom road south to northPedestrian crossing at roads west & eastd) From road east to westFrom road west to eastPedestrian crossing at roads north & south

Page 5: TRAFFIC LIGHT CONTROLLER

Programming of 8086 (for traffic light control system)

MODEL SMALL.STACK 100.DATACWR EQU 0FFC6 HPORTA EQU 0FFC0 HPORTB EQU 0FFC2 HPORTC EQU 0FFC4 H.CODESTART:MOV AX,@DATAMOV DS,AXMOV AL,80HMOV DX,CWROUT DX,AL MOV AL,F3HMOV DX,PORTCOUT DX,AL MOV AL,FFHMOV DX,PORTAOUT DX,AL MOV AL,FFHMOV DX,PORTBOUT DX,ALMOV CL,03HCALL DELAYTOP:MOV AL,EEHMOV DX,PORTAOUT DX,ALMOV AL,EEHMOV DX,PORTBOUT DX,ALMOV CL,02HCALL DELAY

MOV AL,FCHMOV DX,PORTCOUT DX,ALMOV AL,7DHMOV DX,PORTAOUT DX,ALMOV AL,57HMOV DX,PORTB

Page 6: TRAFFIC LIGHT CONTROLLER

OUT DX,ALMOV CL,15HCALL DELAY

MOV AL,E7HMOV DX,PORTBOUT DX,ALMOV AL,FDHMOV DX,PORTAOUT DX,ALMOV AL,EDHMOV DX,PORTAOUT DX,ALMOV CL,02HCALL DELAY

MOV AL,F7HMOV DX,PORTBOUT DX,ALMOV AL,F0HMOV DX,PORTCOUT DX,ALMOV AL,F1HMOV DX,PORTAOUT DX,ALMOV CL,15HCALL DELAY

MOV AL,FBHMOV DX,PORTAOUT DX,ALMOV AL,FBHMOV DX,PORTBOUT DX,ALMOV AL,50HMOV DX,PORTCOUT DX,ALMOV CL,15HCALL DELAY

MOV AL,FEHMOV DX,PORTAOUT DX,ALMOV AL,FEHMOV DX,PORTBOUT DX,ALMOV CL,03HCALL DELAY

Page 7: TRAFFIC LIGHT CONTROLLER

MOV AL,FFHMOV DX,PORTAOUT DX,ALMOV AL,AFHMOV DX,PORTCOUT DX,ALMOV AL,EEHMOV DX,PORTAOUT DX,ALMOV AL,EEHMOV DX,PORTBOUT DX,ALMOV CL,02HCALL DELAY

MOV AL,BFHMOV DX,PORTAOUT DX,ALMOV AL,BFHMOV DX,PORTBOUT DX,ALMOV CL,15HCALL DELAYJMP TOP

DELAY:MOV BX,10HD1:MOV CX,0FFFFHD2:LOOP D2DEC BXJNZ D1INT 03HEND START

TRAFFIC LIGHT CONTROLLER”USING 8085 MICROPROCESSOR

The 8085 Microprocessor is a popular Microprocessor used in Industries for various applications. Such as traffic light control, temperature control, stepper motor control, etc. In this project, the traffic lights are interfaced to Microprocessor system through buffer and ports of programmable peripheral Interface 8255. So the traffic lights can be automatically switched ON/OFF in desired sequence. The Interface board has been designed to work with parallel port of Microprocessor system.

The hardware of the system consists of two parts. The first part is Microprocessor based system with 8085. Microprocessor as CPU and the peripheral devices like EPROM, RAM, Keyboard & Display

Page 8: TRAFFIC LIGHT CONTROLLER

Controller 8279, Programmable as Peripheral Interface 8255, 26 pin parallel port connector, 21 keys Hexa key pad and six number of seven segment LED’s.

The second part is the traffic light controller interface board, which consist of 36 LED’s in which 20 LED’s are used for vehicle traffic and they are connected to 20 port lines of 8255 through Buffer. Remaining LED’s are used for pedestrian traffic. The traffic light interface board is connected to Main board using 26 core flat cables to 26-pin Port connector. The LED’s can be switched ON/OFF in the specified sequence by the Microprocessor. in fig.1.

.

BLOCK DIAGRAM

LAY OUT

Traffic light interface board

8085

CPU

Latch 8255

PPI

26 p

in p

ort

co

nn

ect

or

26 p

in p

ort

co

nnect

or

Buffer

AD0-AD

7A

0-A

7

26 pin

FRC cable

D0-D

7

System Bus

EPROM RAM

8279

keyboard

Display

Controller

Anode driver

DecoderKeyboard Cathode driver

Display

Sto

p P

WSto

p P

W

Stop PN Stop PN

Sto

p

PE

Sto

p

PE

Go P

W

Stop PS

Go PS

Stop PS

Go PS

Go P

E

Go P

W

Go PN Go PN

Go P

E

NORTH

SOUTH

EA

ST

WES

T

Sto

p W

Warn

ing

WG

o W

FR W

FL W

ST W

Stop NWarning N

Go NFR N FL NST N

Stop S

Warning S Go S

FR SST SFL S

Sto

p E

Warn

ing

E

FR E

FL E

ST E

Page 9: TRAFFIC LIGHT CONTROLLER

PROGRAM FOR 8085 (TRAFFIC LIGHT SYSTEM)

LXI SP,FFFFH

MVI A,80H

OUT 63H

CALL 1: MVI A,21H

OUT 60H

MVI ,0CH

OUT 61H

CALL DELAY1

MVI A,12H

OUT 60H

MVI A,0CH

OUT 61H

CALL DELAY2

MVI A,0CH

OUT 60H

MVI A,21H

OUT 61H

CALL DELAY1

Page 10: TRAFFIC LIGHT CONTROLLER

MVI A,0CH

OUT 60H

MVI A,12H

OUT 61H

CALL DELAY2

JMP CALL1

References:

1. www.emu8086.com/vb/index_asm.html

2. www.rbainnovations.com/...%20Embedded%20microprocessor/.../H%20Traffic%20light%20controller-n.doc

3. jntuimplab.blogspot.com/.../traffic-light-control-system-using-8086.html

4. http://www.8085projects.info/post/Overview-or-Features-of-8086.aspx