You are on page 1of 21

Traffic Lights Controller

Page 1

Objectives
To design and to produce a simple circuit of the traffic light controller. To learn how to use other program to check the result of the karnaugh map. To design a fully functional traffic light for the cross junction To learn how to design and simulate the traffic light circuit schematic and download the design into LP-2900 using Altera Quartus-II program to make sure that our design is functioning theoretically and practically

Page 2

Introduction

The traffic light 1 will turn green and the rest of the traffic light will be turn to red light. It will take two seconds for the light to turn to yellow light. Then traffic light 1 will turn to yellow while the rest of the traffic light will still be red light. This will take one second before it turn to red light. After the traffic light 1 turn to red light, the traffic light 2 will turn green and the rest of the traffic light still in red light. This process will continue for traffic light 3 and 4 and the whole steps will keep on going in this order.

Page 3

The truth table of traffic light

Boolean Equation
Based on the truth table and the Karnaugh map just now we can find the equation below:
Y1 G1 R2 Y2 G2 R3 Y3 G3 R4 Y4 G4 = ABCD = ABC = A + CD + BC + BC = BCD = BCD + ABCD = AC + AB + AC + CD = ACD = BC = A + CD = ACD = ACD + ACD

Logic schematic circuit Traffic 1

Logic schematic circuit Traffic 2

Logic schematic circuit Traffic 3

Logic schematic circuit Traffic 4

General Circuit

Counter

Timer

Logic Block Diagram

1 Hz timer using divider 10

Page 11

Output waveform of traffic light

Page 12

Discussion
timer - controlled on lights changing time. green light lighting longer than yellow. 2:1 = green lights will be two times longer than the yellow light. 1Hz representing the ratio time output for 2:1 0.1Hz is for ratio time output 20:10. Counter 74163 count from 0000-1011 (0-11)
Page 13

Page 14

Using counter 74163

1 0 1 1

1 1 1 1 1

0 Active CLRN reset QA-QD (0000)

Waveform of counter 74163 tested

Problem Encountered
Selection of counter Try and error method types of counters had been tested; - 74160 synchronous decade counter (standard reset) - 74161 synchronous 4-bit counter (standard reset) - 74162 synchronous decade counter (synchronous reset) - 74163 synchronous 4-bit counter (synchronous reset)

Page 17

Problem Encountered
Synchronous counters -outputs change together on each clock pulse
Decade counters -count 0 to 9 (0000 to 1001 in binary). 4-bit counters -count from 0 to 15 (0000 to 1111 in binary). Standard reset -when low it resets the count to zero (0000, QA-QD low

Synchronous reset -reset occurs on the rising-edge of the clock input


Page 18

Conclusion and Recommendation


successfully run the traffic lights as desired The weakness - the traffic light has to be lighting in sequence - drivers need to wait although they are no car in other junction

Page 19

Recommendation
sensor to detect the appearance of car enhance the circuit with the additional sensor or monitoring system time of green light and yellow light also not practical in real world -increase the time ratio for green light to yellow light -set the timer to approaches the real traffic time.

Page 20

Demo

You might also like