Random LED panel

Thread Starter

Icanmakeit67

Joined Sep 23, 2018
137
Hello,
I build and light many different SciFi theme models. For my own entertainment and in the last couple years, others too. What I’d like to have is a circuit that would randomly light 8 to 12 LEDs as an effect for the representation of an old style computer. Sort of a representation of the computer thinking or calculating you might have seen similar in an old TV show. I’d rather not deal with programming an Arduino or microcontroller. I’m thinking this could be designed with just digital components.
Any ideas would be awesome
 

WBahn

Joined Mar 31, 2012
30,303
I would recommend looking into linear feedback shift registers, which have been the basis for many pseudorandom number generators and are particularly easily to implement in hardware using basic logic gates and flip flops.
 

Thread Starter

Icanmakeit67

Joined Sep 23, 2018
137
I'd use something like CD4017 and just arrange the LEDs so they don't light in sequence.
Yeah, I thought of that but I want more than one lighted at a time. I tried using out puts to drive transistors that in turn drive 3-5 LEDs. I also tried a driver circuit for a 7 segment display but connecting to regular LEDs randomly so different locations and quantities light up. Still playing around with it
 

Jon Chandler

Joined Jun 12, 2008
1,101
Check out this Big Clive video for the absolute simplest approach.

Tayda Electronics has self-flashing LEDs for 3 or 4 cents each depending on color.

 

dl324

Joined Mar 30, 2015
17,160
Yeah, I thought of that but I want more than one lighted at a time.
Use some multiplexing scheme.

I have a 4x4x4 LED cube where 0-4 LEDs are actually on at a time but, with a sufficiently high multiplexing rate, up to 64 can appear to be on. But I'm using an RPi Zero W with a small amount of logic.
 

Sensacell

Joined Jun 19, 2012
3,506
Setup a binary counter that runs from a fast clock. (1Mhz?)
Connect a set of latches that can latch and hold the count when triggered.

Generate another clock that runs totally asynchronously from the other, (RC oscillator) that makes latching pulses every few seconds.

The result will look very random, no programming necessary.
 

WBahn

Joined Mar 31, 2012
30,303
Yeah, I thought of that but I want more than one lighted at a time. I tried using out puts to drive transistors that in turn drive 3-5 LEDs. I also tried a driver circuit for a 7 segment display but connecting to regular LEDs randomly so different locations and quantities light up. Still playing around with it
Using a counter as suggested would result in about half the LEDs being lit at any one time, on average.

Whether it would look random enough is a different question. The number of LEDs on at a given time will definitely not be random and will follow a very definite, and possibly easily noticed, pattern. Each LED will have a constant frequency at which it turns on and off, with a 50% duty cycle for each. Humans are very good at pattern recognition, and even when we aren't looking for a pattern, or recognize the pattern, we tend to be pretty good at noticing that some kind of pattern exists. That could result in people's attention being drawn to the computer panel display, which is probably not what you want.
 

Jolly13

Joined Mar 25, 2018
27
Linear Feedback Shift Registers is fun .

A slow speed clock ( 555) you want to see it , couple of shift reg , 4 xor gates, To avoid shift look a register/latch(s) big enough to grab led bits a counter chip ( clock in ever LED-count cycles from LFS).

16 bit shift lfr = 65,535 unique combination at optimal taping (Period 2 ^n -1 )with 4 chained xor
20 bit and you get 1,048,575 period.

---or really build a fun one 242 bits. More combinations than time universe has been around, 2^24 -1 at 100ghz clock.
See Hackaday -->"YOU’LL NEVER SEE THE END OF THIS PROJECT"
 

Ian0

Joined Aug 7, 2020
10,277
I would recommend looking into linear feedback shift registers, which have been the basis for many pseudorandom number generators and are particularly easily to implement in hardware using basic logic gates and flip flops.
That's what I would recommend as well, but the only thing that is random is the first LED in the sequence.
So don't use consecutive outputs, as if you do, it is obvious that it is a chaser and that the pattern shifts along.
 

WBahn

Joined Mar 31, 2012
30,303
Linear Feedback Shift Registers is fun .

A slow speed clock ( 555) you want to see it , couple of shift reg , 4 xor gates, To avoid shift look a register/latch(s) big enough to grab led bits a counter chip ( clock in ever LED-count cycles from LFS).

16 bit shift lfr = 65,535 unique combination at optimal taping (Period 2 ^n -1 )with 4 chained xor
20 bit and you get 1,048,575 period.

---or really build a fun one 242 bits. More combinations than time universe has been around, 2^24 -1 at 100ghz clock.
See Hackaday -->"YOU’LL NEVER SEE THE END OF THIS PROJECT"
For what he is doing, he doesn't need that many bits. While humans are good at pattern recognition, recognizing that a given overall visual sequence is repeating is not something we are particular adept at. As long as the repetition period is many seconds, people are unlikely to notice unless there is an outlier (like just a couple bits lit or almost all the bits lit), in which case they likely will notice what is essentially a strobing effect.
 

WBahn

Joined Mar 31, 2012
30,303
That's what I would recommend as well, but the only thing that is random is the first LED in the sequence.
So don't use consecutive outputs, as if you do, it is obvious that it is a chaser and that the pattern shifts along.
Agreed, though using a Galois-configuration mitigates this effect to a significant degree, particularly if several taps are used.

One way to increase the apparent randomness (though, in actuality, it actually decreases it), is to have each LED driving by the XOR of a couple of bits in the LFSR, so that each LED is depending on content from different portions of the LFSR. You could carry this out further and have each LED be the XOR of n-bits of the LFSR state (and n doesn't have to be the same for each LED).

One of the nice things about this is that
(1) It's very simple and easy to implement with SSI logic components.
(2) It's very easy to change configurations until you get something you like.
(3) It's easy to write a console program that simulates what you would see from the LEDs and tweak things there before you build.
 

Jolly13

Joined Mar 25, 2018
27
For what he is doing, he doesn't need that many bits. While humans are good at pattern recognition, recognizing that a given overall visual sequence is repeating is not something we are particular adept at. As long as the repetition period is many seconds, people are unlikely to notice unless there is an outlier (like just a couple bits lit or almost all the bits lit), in which case they likely will notice what is essentially a strobing effect.
Ya the rolling effect in a single clock shift sequence does not look good. but may look good with LED wired out of sequence hmm.

I guess i nerded out .. All about what you call fun :) Bread board a couple and see what you eye think.
 

Ya’akov

Joined Jan 27, 2019
9,272
You could make a matrix arrangement with three independent clocks. Two would be used as X and Y select (one on the anodes and the other on the cathodes), running at some multiple of the third that holds the X/Y clocks and connects the cathode side of whatever is selected to 0V (to use low side switching).

The if the X and Y clocks were very fast compared to the enabling clock, and slightly different to each other. The result would be pretty chaotic if not random and certainly unpredictable.
 

Ian0

Joined Aug 7, 2020
10,277
You could make a matrix arrangement with three independent clocks. Two would be used as X and Y select (one on the anodes and the other on the cathodes), running at some multiple of the third that holds the X/Y clocks and connects the cathode side of whatever is selected to 0V (to use low side switching).

The if the X and Y clocks were very fast compared to the enabling clock, and slightly different to each other. The result would be pretty chaotic if not random and certainly unpredictable.
Where I used to work we had an apprentice whose ultimate goal seemed to be making a random light flasher. He tried separate oscillators, but his power supply was badly decoupled and his oscillators always synchronised.
 

Thread Starter

Icanmakeit67

Joined Sep 23, 2018
137
I would recommend looking into linear feedback shift registers, which have been the basis for many pseudorandom number generators and are particularly easily to implement in hardware using basic logic gates and flip flops.
Would you have time to illustrate with a schematic?
 

Thread Starter

Icanmakeit67

Joined Sep 23, 2018
137
Where I used to work we had an apprentice whose ultimate goal seemed to be making a random light flasher. He tried separate oscillators, but his power supply was badly decoupled and his oscillators always synchronised.
Would you have an example schematic?
 

Jon Chandler

Joined Jun 12, 2008
1,101
I seem to remember that it was based on LEDs with a built-in flasher circuit.
See my post #5 and watch the video. "But all the LEDs flash at the same rate" you may think. They do not. They are all slightly different – they start off in sync, but quickly drift off. Quick, easy, cheap and virtually foolproof. Watch the video.
 

MisterBill2

Joined Jan 23, 2018
19,476
To create a fairly random display with any number of LEDs, two binary counters driven by two non-harmonicly related oscillators with and gates inputs fed by outputs from each of the two counters. the and gates can feed CD4049s as low-side drivers for the LEDs. No expensive complicated shift registers and the blink rates will be different for most of the LEDs. You van use CD4060 counters that include the oscillators, if you can get their oscillators to work.
 
Top