traffic light with timer

Discussion in 'General Electronics Chat' started by creaver31, Mar 1, 2012.

  1. creaver31

    Thread Starter Member

    Feb 2, 2012
    65
    0
    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: Mar 1, 2012
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    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.
     
  3. creaver31

    Thread Starter Member

    Feb 2, 2012
    65
    0
    haha my bad! :D

    15-0, Red is lit and 7-0 green is lit..
     
  4. creaver31

    Thread Starter Member

    Feb 2, 2012
    65
    0
    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
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    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:

    Code ( (Unknown Language)):
    1.  
    2. state  output   next state    next timer
    3.   0      G          1             3
    4.   1      Y          2             7
    5.   2      R          0             15        
    6.  
     
Loading...