Random sequence of 4 LEDs

Wendy

Joined Mar 24, 2008
21,914
If you look at the topography no matter which pair you get rid of it will still be your schematic Wookie. There will be one common 555 with the other two feeding it. It may not look it, but the circuit with 6 LEDs is actually symmetrical, with each 555 feeding the other two.

You could do it with 2 555s. One of the things wrong with the design I put up is only two LEDs could be lit at a time. This idea wouldn't look as random, I suspect you could eventually spot the pattern, but it is simpler and might meet the OPs requirements, and 3 LEDs at a time could be lit.

Never mind, upon thinking about it two of the LEDs would be simple flashers. 3 555's it is.
 

SgtWookie

Joined Jul 17, 2007
22,210
If you look at the topography no matter which pair you get rid of it will still be your schematic.
Yep, I realize that.

There will be one common 555 with the other two feeding it. It may not look it, but the circuit with 6 LEDs is actually symmetrical, with each 555 feeding the other two.
I realized that as well. However, without the ability to make one of the outputs have a high impedance state, you'll wind up with more than 1 LED lit about half of the time; and the duration of the flashes will vary considerably, from a maximum duration to barely a flicker. I don't know for certain if that's what our OP wanted; they mentioned approximately 1/2 second in their first post.

You could do it with 2 555s. One of the things wrong with the design I put up is only two LEDs could be lit at a time. This idea wouldn't look as random, I suspect you could eventually spot the pattern, but it is simpler and might meet the OPs requirements, and 3 LEDs at a time could be lit.

Never mind, upon thinking about it two of the LEDs would be simple flashers. 3 555's it is.
Yep, has to be three of 'em.

The 4017 Johnson counter driven by a couple of 555's isn't ideal, either; the flashing duration is right, but it will seem to have a more regular pattern.

The LSFR idea I was working on seemed really random, but there were too many times where one would seem to be stuck on, or all off. In reality, that's what a truly random system would do, but our OP wanted something that would flash randomly every 1/2 second - so it doesn't fill the bill either.
 

Wendy

Joined Mar 24, 2008
21,914
What was that schematic with the D shift register and XOR gates? That might be good.

If we were to take 8 LEDs using that schematic and some how merge two LEDs into one it might look better.

Another way is to make the common 555 really slow. it would increase the one time of the LED.
 

SgtWookie

Joined Jul 17, 2007
22,210
Here's one version of it - see the attached. The LEDs would be driven by points A, B, C, and D.

As you can see, the outputs are pretty random. I didn't bother setting the clock to get 1/2 second interval outputs; it was just something I was fiddling with.

U2b is the only F/F that gets set to 1 on start-up; if they were ALL cleared, the output would only have 1 LED lit constantly.

Might be hard to tell, but one and only one output is high at a time. Most of the time, a given output is only high for 1 clock pulse, but every few clocks one will stay on for two or more clocks.

Yes, I know I mixed TTL with CMOS. I simply didn't have the functions I needed all in one logic group; the library selection is rather limited as of yet.
 

Attachments

Last edited:

colinb

Joined Jun 15, 2011
351
Yes, I know I mixed TTL with CMOS. I simply didn't have the functions I needed all in one logic group; the library selection is rather limited as of yet.
So is there any problem with the circuit as shown your simulation schematic? The 74HCxxx are CMOS, not really TTL, they just inherit their pinouts from the 74xxx TTL family, right? Though I seem to recall that the 4000-series CMOS can run at higher supply voltage levels and has some other different characteristics. Just curious since I've never used the 4000-series CMOS ICs before.
 

Wendy

Joined Mar 24, 2008
21,914
CMOS has wonderful characteristics, but the one thing they do not have is drive. They can light an LED, but to do it right they need a driver of some sort, transistor or otherwise.
 

THE_RB

Joined Feb 11, 2008
5,438
...
The 4017 Johnson counter driven by a couple of 555's isn't ideal, either; the flashing duration is right, but it will seem to have a more regular pattern.

The LSFR idea I was working on seemed really random,
...
The 555 driving 4017 can approach true randomness if the high speed clocking sufficiently fast that there are many clock cycles in the short period of time where the 555 gate signal is known to be unreliable, ie within the noise threshold. So if the fast flashing was (say) 100kHz it would give a pure random result on a 0.5Hz gated system.

As a nice looking "random to the eye" you could eliminate the last lit LED, and randomly pick on of the other 3 LEDs.

That would guarantee a different LED lights up every cycle, which humans interpret as "random flashing". I've done that in software which is very easy, but I'm not sure of the best way to do it with simple logic hardware...

If it is of any help in software I did it like this;
1. generate newrandom 1-4
2. if newrandom = oldrandom goto 1, and do it again.
3. else display newrandom on LEDs
 

k7elp60

Joined Nov 4, 2008
555
Here is my 2cents worth. My circuit does not need drivers for the LED'S as the 74AC138 will sink 24mA. The three oscillators full times are .78sec,1.36sec and .44sec's, so the average on time is .43sec's.
I have extra 74AC138's and 74AC14's if someone needs them. Just send me a PM and we will arrange shipment.
 

Wendy

Joined Mar 24, 2008
21,914
I had forgotten the Hex Schmitt Triggers out there, they make dandy Hysteretic Oscillators also. The Hex Schmitt Trigger is a 40106 (or the 74C14, or 4584) and a quad XOR gate would be a 4070 CMOS chip.



Figure 4 oscillators can feed 6 XOR gate. The flash patterns will be more random, the LEDs will be on 50% unlike the original idea. Here i show the patter from 4 oscillators would work...

12
13
14
23
24
34
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,210
Gee, Bill - I'm afraid it won't quite work like that.

You'll wind up with sort of a very slow version of your 555-driven fading red eyes.

Have a look at the attached. I used 4093 quad Nand Schmitt triggers instead of 40106's, but for this simulation & the way I wired them, they'd function identically.

Looks to me as if the output signals were put through a low-pass filter, you'd see almost sine wave outputs.
 

Attachments

Wendy

Joined Mar 24, 2008
21,914
The time frame is the thing, each flash should be about a second.

If you look at the pair of LEDs in the original concept you would find the pair (which are considered common) to be an XOR function.

Fact is true random is a lot harder than it looks. I've seen circuits that use a ROM with a table of random numbers.
 

Ron H

Joined Apr 14, 2005
7,014
Better late than never, I guess. I've been chewing on this for several days.
I took a cue from SgtWookie in using a LFSR to generate pseudorandom sequences.

One goal of the circuit is to avoid having any LED be on for more than one successive clock cycle. To do this, we need to avoid having the HC139 inputs be the same for two successive clock cycles. This is done by looking at them over two successive clock cycles using the circuit in the red box. If they try to be the same over two successive cycles, this is detected by U15, U16, and U17, causing U12 to toggle the lower incoming bit before it reaches A1 of the HC139.

EDIT: HC139 outputs are active LOW.
 

Attachments

Last edited:
Top