traffic light with timer

Thread Starter

creaver31

Joined Feb 2, 2012
65
hi,

i need to make a traffic light with timer. I am thinking of using JK flip-flop IC
and use 7-segment as the display.

my timer is like this...
from the display - 15 to 0, the red LED is lit
then it will go back to 7 and count to 0 again, green LED is on,
then from 3 to 0, yellow is lit

then it will come back to 15 again and repeat the process.

thanks..
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
from the display - 15 to 0, the green LED is lit
then it will go back to 7 and count to 0 again, red LED is on,
then from 3 to 0, yellow is lit
Your sequence is: green red yellow which is certainly original and an aid to any police officer interested in making his/her ticket quota.

To reuse the 4 bit counter such as you do a second 2 bit counter would be needed to maintain the state of which light is on. A combination of all zero on the 4 bit counter and the state of the 2 bit could be used to advance (load) the state of all 6 bits.

It is possible, I just don't think I would do it that way. Seem doing it the long way round.
 

Thread Starter

creaver31

Joined Feb 2, 2012
65
so how am i able to do it? our prof taught something about the excitation table and gave an example about a simple 3-bit binary counter, from 0 to 7 and back to 0 again
 

ErnieM

Joined Apr 24, 2011
8,377
First, convert the 3-bit counter into a 2 bit counter (state) and a 4 bit counter (timer), those are what you need.

Then adapt those to accept an arbitrary LOAD value so you can set the 4 bit timer counter to 15, 7, or 3. State counter may just go 0-1-2-0-1-2... so a clear may be easier.

Done this way state 0=green, 2=yellow, 3=red. Those need to be decoded and sent to display LEDs.

Some other logic is needed to load the timer counter. When it detects timer = 0, it loads the next values as follows:

Rich (BB code):
state  output   next state    next timer
  0      G          1             3 
  1      Y          2             7
  2      R          0             15
 
Top