How do I design a traffic light controller using a counter and clock?

In summary, you are designing a state machine. There is a step-by-step process to define the states, figure out how many FFs the state machine will require, and then write the truth/transition table and implement the logic.
  • #1
brad sue
281
0
Hi,
I have some problem to design a traffic controller.
the traffic lights are placed at an intersection of two streets, one street running north-south (called NS) and another street running east-west (called EW).
there is 5 clock cycles for Red light, 1 clock cycle for Yellow light , and 4 clock cycles for Green light. EW light is Red when NS light is Yellow or Green. Similarly, NS light is Red when EW light is Yellow or Green.
I need to design the controller that is essentially a counter driven with a clock (without any other external input). I will need 10 states to design the circuit. The six outputs are R-EW, Y-EW, G-EW, R-NS, Y-NS, and G-NS

What I did is that I tried to design a modulo 10 counter (see attached file ). I form the truth table of the system.
A B C D | NS | EW |
0 0 0 0 | R | G |
0 0 0 1 | R | G |
0 0 1 0 | R | G |
0 0 1 1 | R | G |
0 1 0 0 | R | Y |
0 1 0 1 | G | R |
0 1 1 0 | G | R |
0 1 1 1 | G | R |
1 0 0 0 | G | R |
1 0 0 1 | Y | R |

Then I tried the output tables, but I does resemble to anything I don't have the relationship of the table.
please can you help me ?
thank you
B.
 

Attachments

  • Traffic controller.doc
    42 KB · Views: 420
Engineering news on Phys.org
  • #2
Normal solution would be to use a memory (ROM)
Treat each possible setup as a location in memory, set the value of the memory so that the output lines are the correct state for each switch.
Then clock through the memory in sequence outputing these values.

You can always think of a memory as mapping a particlular set of inputs (the address lines) onto a particular set of outputs (the data lines)
 
  • #3
Hi mgb_phys,

we cannot use memory, only any kind of flip-flop and basic gates.
B
 
  • #4
brad sue said:
Hi mgb_phys,

we cannot use memory, only any kind of flip-flop and basic gates.
B

You are designing a state machine. Have you learned how to do that yet? There is a step-by-step process to define the states, figure out how many FFs the state machine will require, and then write the truth/transition table and implement the logic.

http://en.wikipedia.org/wiki/State_machine


.
 
  • #5
Also worth googling "Karnaugh map"
 
  • #6
Thank you berkeman and mgb_phys,

I have looked at what you suggested me and I got some good things to work with!

B.
 
  • #7
  • #8
mgb_phys said:
Also worth googling "Karnaugh map"

Karnaugh Maps by member Kenneth Mann
https://www.physicsforums.com/showthread.php?t=100628

or search "Science Education" forum for threads containing Karnaugh
https://www.physicsforums.com/forumdisplay.php?f=35
 
Last edited by a moderator:

FAQ: How do I design a traffic light controller using a counter and clock?

What is a traffic light controller?

A traffic light controller is a device that is used to control the operation of traffic lights at intersections. It is responsible for determining the timing and sequencing of the traffic signals to ensure the safe and efficient movement of vehicles and pedestrians.

How does a traffic light controller work?

A traffic light controller uses sensors, timers, and a computerized control system to manage the flow of traffic. The sensors detect the presence of vehicles and pedestrians, and the timers determine the length of time each traffic signal will stay on. The computerized control system uses this information to adjust the timing and sequencing of the traffic signals in real-time.

What are the benefits of using a traffic light controller?

Using a traffic light controller can help improve traffic flow, reduce congestion, and increase safety at intersections. It also allows for the coordination of traffic signals on multiple intersections, preventing gridlock and reducing travel time for drivers.

What are the different types of traffic light controllers?

There are several types of traffic light controllers, including fixed time controllers, actuated controllers, and adaptive controllers. Fixed time controllers use a predetermined timing sequence, while actuated controllers use sensors to adjust the timing of the signals based on traffic demand. Adaptive controllers use real-time data to adjust the timing of signals to optimize traffic flow.

How is a traffic light controller programmed?

A traffic light controller is programmed using specialized software that allows for the customization of timing sequences and coordination with other controllers. The programming process involves inputting data such as intersection geometry, traffic data, and signal timing plans. The controller can then be adjusted and reprogrammed as needed to adapt to changing traffic patterns.

Similar threads

3
Replies
97
Views
3K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
3
Views
2K
Replies
21
Views
1K
Back
Top