Stoplight Circuit Problem Solving

Thread Starter

Chazuke

Joined Sep 22, 2014
3
So I'm attempting to create a small stoplight-type circuit using a standard breadboard, 3 LEDs, a 555 clock , a 4-bit binary counter, and some NAND/NOR gate chips. What I need to do is wire it in such a way that the green light is lit for 3 seconds, the yellow light is lit for 1 second, and the red light is lit for 4 seconds in that order. All I've been able to do so far is connect the clock to the binary counter so that I now have 4 outputs:
D1: 0 1 0 1 0 1 0 1
D2: 0 0 1 1 0 0 1 1
D3: 0 0 0 0 1 1 1 1
D4: (0 for 8 counts then 1 for 8 counts)
I also have a de-mux available, but I'm told that its possible to do it without one. However, if the easiest solution is using one then I am all for it. Your help is greatly appreciated!
 

crutschow

Joined Mar 14, 2008
34,409
Decoding the outputs from a binary counter can get complex for what you want. It's quite easy if instead, you can use an octal counter such as a CD4022 or a decade counter such as a CD4017. With a 1 second clock these chips will generate 8 or 10 separate outputs of sequential 1 second pulses. Then just use OR gates to select the combination of outputs for the desired duration of each color light.
 

Thread Starter

Chazuke

Joined Sep 22, 2014
3
Decoding the outputs from a binary counter can get complex for what you want. It's quite easy if instead, you can use an octal counter such as a CD4022 or a decade counter such as a CD4017. With a 1 second clock these chips will generate 8 or 10 separate outputs of sequential 1 second pulses. Then just use OR gates to select the combination of outputs for the desired duration of each color light.
Unfortunately, I only have the 4 bit binary counter available to me. This project is for a school assigned experiment so I am limited to only the components listed.
 

crutschow

Joined Mar 14, 2008
34,409
Then the next easiest is to use the de-mux to decode the binary output. That will give a sequence of pulses, as with the CD4017. Use the OR gates to select the desired outputs.
 

Thread Starter

Chazuke

Joined Sep 22, 2014
3
Thank you for all your help crutschow, I have just one more question. I'm a bit new to creating circuits, so could you elaborate on how you would select the desired outputs of the de-mux using an OR gate?
 

crutschow

Joined Mar 14, 2008
34,409
Thank you for all your help crutschow, I have just one more question. I'm a bit new to creating circuits, so could you elaborate on how you would select the desired outputs of the de-mux using an OR gate?
The demux output is a sequence of pulses from each of the 8 outputs, which is the decode value of the binary count. Then you just OR the outputs for the time you want for each light. For example, if the Green light is the first to be ON for 3 seconds then you would OR outputs Y0, Y1, and Y2 for Green, use Y3 for Yellow, and OR Y4, Y5, Y6, and Y7 for Red. (That's assuming you are using a 1 second clock period to the counter).

If you want that to repeat on the next clock pulse then you will have to use some logic to reset the counter back to 0 on binary count 8.
 

EinarA

Joined Sep 13, 2014
5
Chazuke has probably turned this in already, but it can be done with just two 555's ( and 3 R's, 1 C, 1D, and the LEDs). The teacher wants a counter instead. If you look at D3, you will see it is on for 4 secs, so connect red there. D1 and D2 are both high for one sec so could be ANDed for the yellow output, if we kept it off when red is on. Green could be on when red or yellow are off. So two NAND gates will do the job.
 
Top