Maker Pro
Maker Pro

Random Traffic Light

Camille

Jul 9, 2014
2
Joined
Jul 9, 2014
Messages
2
Hello all

I'm a part of a wedding and the groom asked me to make a device. It's a traffic light that when you press the big red button it would randomly go to either red, amber, or green. It's the device instead of 'clinking' glasses to get the bride and groom to kiss. I'm not sure how to go about this. Getting a mock traffic light and a button is easy. I'm not sure how to tie them together to do what I want. Could you please lend some advice.
Thank you
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The easiest way is with a 555 and a 4017.

Have the 555 oscillate at a reasonably high frequency and the 4017 set to reset at count 4 (so the only valid outputs are 1, 2, and 3 (red, amber and green).

Connect the 555 to the clock input of the 4017, and use the switch to enable the oscillator.

All lights will appear to be on while the button is pressed, with only one remaining lit when you release it.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Steve has assumed that you want the three colours to have equal probability. If you don't, then if you can allocate probabilities so the total is in the range 3~10, you can use more of the 4017 outputs and OR some together, e.g. using diodes, to combine them. For example if you want amber to be only 1/3 as likely as red and green, you can set probabilities at red = 3/7, amber = 1/7 and green = 3/7, set the 4017 to divide by 7, and OR three outputs together for red, and another three outputs for green.
 
Top