Looking for a way to get 16 LEDs to flicker at "random" in a circuit

forrest_holleman

Dec 20, 2011
3
Joined
Dec 20, 2011
Messages
3
Hi all,

I'm completely new to this forum, so I hope I am asking in the right area. Having read the "Timers - notes for the less experienced" sticky, there certainly seems to be a degree of the kind of expertise I might need here...

I'm working on building a toy for my 3 year old boy. What I am trying to do is to get 16 LEDs in a circuit to all flash independent of one another at seemingly random rates (probably in the 50-250 ms range) - to give a flickering/shimmering effect. In addition, I want to use a radial potentiometer to vary the brightness of the LEDs (as a collective) as well (i.e. as he turns the dial, the set of flickering LEDs all get brighter / dimmer together).

And to complicate matters - I want four sets of these (each with 16 LEDs and its own pot).

I'm assuming I'll need to use something like 555 timer circuit in conjunction with something.... but maybe not.

Does anyone out there have any bright ideas as to how I might accomplish such a thing?

Thanks for any useful suggestions you might have.

This is just for a toy - it has no commercial use.
 

Laplace

Apr 4, 2010
1,252
Joined
Apr 4, 2010
Messages
1,252
Driving 64 LED's each in a random fashion is certainly doable but could require a lot of circuitry (64x1 LED circuit). However it could be possible to generate just a few random streams, and with time shifting and spatial diversity make it seem that all 64 LED's are driven randomly. What I would do is make 4 pseudo-random sequence generators each from an 8-bit shift register (CD4015) but create the random sequence from only 5 or 6 stage feedback. That way the ON time for each LED will vary from one clock pulse to 5 or 6 clock pulses. Then tap off 4 of the shift register stages (for instance: 1, 3, 6, 8) to drive 4 LED's in a time shifted fashion. Arrange those 4 LED's in a scattered pattern. Do the same with each of the four shift registers to drive 16 LED's. For each of the 16 LED drivers, have them drive a total of 4 LED's in parallel for a total of 64 but arrange the LED's in each of the 4 groups of 16 using a different spatial pattern. Finally, use a 555 timer to generate an independent clock for each shift register -- each clock frequency should be close to the same value but not in sync. That will improve the perception of randomness.

The internet will provide plenty of information on how to construct pseudo-random sequence generators. I have read suggestions to employ XNOR feedback rather than XOR in order to deal with the problem of all-zero initial condition in the shift register. Anyway, that is a design concept for the digital portion; analog control for the LED brightness would be another interesting problem.
 

OLIVE2222

Oct 2, 2011
690
Joined
Oct 2, 2011
Messages
690
Hi,

For the analog control of the leds, a PWM circuit can be implemented. The PWM controlled transistor must be located between the common led supply (or GND) pins and the power supply (or GND).

Olivier
 

forrest_holleman

Dec 20, 2011
3
Joined
Dec 20, 2011
Messages
3
Challenge solved

@Laplace & @OLIVE2222 - Thanks guys for your input and suggestions.

I found a simple solution - although it doesn't give me a different pseudo-random for each of the 16 LEDs as I had originally desired, it certainly provides enough variation to give the desired effect (but with 18 LEDs).

I used this circuit - http://www.kpsec.freeuk.com/projects/xmastree.htm - but used all blue LEDs. The application is a toy stove for my little one who loves to "cook".... so I wanted to simulate four gas burners with flickering blue LEDs. This circuit uses a 4060B CMOS binary counter driving 3 sets of 6 LEDs - each set running at a different flash rate and at any given time, half of each set is in the on state, the other half in the off state. I put a pot on each to vary the intensity and voila - the wee one now has a pretty realistic 4-burner stove.

Next time I'll be a bit more specific regarding the application when posting for advice/ideas.

Anyway, thanks again for taking the time to reply.
 

RobSmith

Dec 16, 2011
56
Joined
Dec 16, 2011
Messages
56
@Laplace & @OLIVE2222 - Thanks guys for your input and suggestions.

I found a simple solution - although it doesn't give me a different pseudo-random for each of the 16 LEDs as I had originally desired, it certainly provides enough variation to give the desired effect (but with 18 LEDs).

I used this circuit - http://www.kpsec.freeuk.com/projects/xmastree.htm - but used all blue LEDs. The application is a toy stove for my little one who loves to "cook".... so I wanted to simulate four gas burners with flickering blue LEDs. This circuit uses a 4060B CMOS binary counter driving 3 sets of 6 LEDs - each set running at a different flash rate and at any given time, half of each set is in the on state, the other half in the off state. I put a pot on each to vary the intensity and voila - the wee one now has a pretty realistic 4-burner stove.

Next time I'll be a bit more specific regarding the application when posting for advice/ideas.

Anyway, thanks again for taking the time to reply.

I will have a look at that circuit too and might have a go myself as I have two little ones.
My small son and I put together a velleman 'delux christmas tree' kit yesterday. This has LEDs flickering on at differing rates. There are about 150 LEDs and about 20 of these flicker. There are 6 capacitors and transistors on the back so, without investigating, guess the LED's are just driven as 6 groups to give a flickering effect.
Unfortunately that kit did not have a circuit diagram like some of them do.

Rob
 

forrest_holleman

Dec 20, 2011
3
Joined
Dec 20, 2011
Messages
3
I will have a look at that circuit too and might have a go myself as I have two little ones.
My small son and I put together a velleman 'delux christmas tree' kit yesterday. This has LEDs flickering on at differing rates. There are about 150 LEDs and about 20 of these flicker. There are 6 capacitors and transistors on the back so, without investigating, guess the LED's are just driven as 6 groups to give a flickering effect.
Unfortunately that kit did not have a circuit diagram like some of them do.

Rob

HI Rob - It was a fun project - pretty time consuming, but worth it, as my little chef loves it. I'll take a video and send some pics if you are interested....
Cheers,

Forrest
 
Last edited:

RobSmith

Dec 16, 2011
56
Joined
Dec 16, 2011
Messages
56
Hi Forrest,

Thanks for the reply. I have emailed you.
If I were you I would take the email address off the thread as I am not sure if there is automated software that can spot the 'at' and 'dot' within text and then start sending you spam emails........ I seem to get an aweful lot of spam rubbish emails.

Rob
 
Top