Breadboard Traffic Light

Discussion in 'The Projects Forum' started by toeykq, Apr 25, 2014.

  1. toeykq

    Thread Starter New Member

    Apr 17, 2014
    10
    0
    Hi all,

    I could use some tips for building this.
    The gist of the project is that the system receives some sort of stimulus. Upon receiving this, a green-LED lights up and remains on for the duration of the countdown of a 7-segment from 9 to 0.

    At 0, the 7-segment blanks and the green light turns off, and a yellow-LED turns on. After a duration, the yellow-LED turns off and a red-LED turns on. After another duration, the red-LED turns off and a stimulus is sent to another unit.

    Thus far, I have my 7-segment set up counting down from 9 to 0 continuously.

    I have no idea what to use for the initial stimulus.

    At first I thought to use a flip flop, but then I realized that the green-LED would be flashing on and off as the 7-segment counts, since they would be using the same clock.
    Then I thought to use a push-button to send a 1 to the flip-flop, but then realized I would still have the same problem. The flip-flop would turn the LED off again as soon as I stopped pressing the button.


    I've looked for help online but most solutions seem to involve something called a 555 chip and capacitors, neither of which are available to me.


    Does anyone have any tips or ideas for this?
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I think you need to offer a bit more detail as to what you are doing.

    What hardware are you using? A lot of microcontroller classes are using this project as a way to check a student's understanding. Or, is this supposed to be done with logic gates and defined that way?

    As far as your initial stimulus, would not a switch work? You'll need to debounce it, but that's all over the internet, so you should be fine there.
     
  3. toeykq

    Thread Starter New Member

    Apr 17, 2014
    10
    0
    We are just using logic gates.

    I don't know anything about debouncing a switch. This is the first I've heard of the term. I've never actually used a switch before.

    If I used a switch for the stimulus, how would that work?

    The only way I can see a switch working is if I use a flip flop to catch the 1 from the switch and relay it to the LED.

    But the part I don't get is, as soon as I take my finger off the switch, the flip flop is gonna catch zero and the LED is gonna turn off regardless of what the count on the 7 segment is.

    I don't know how to relate the count to the flip flop and make the switch independent of the clock.
     
    Last edited: Apr 25, 2014
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    All switches exhibit what is called 'switch bounce' - essentially, electrical instability while the mechanical parts make contact (it "switches" many times before settling at the final value).

    This is bad when using digital circuits which are fast enough to detect each and every one of the times the switch makes and breaks electrical contact.

    The digital section of the eBook has some more information on the matter.
     
  5. toeykq

    Thread Starter New Member

    Apr 17, 2014
    10
    0
    But I'm saying how can I make a switch that I only press for a moment give an impulse that triggers an entire countdown?
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Okay, you need to be explicit - what do you want the input to be?

    What is it you hope this signal to do and how is your system to respond?
     
Loading...