Connect with us

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

Discussion in 'LEDs and Optoelectronics' started by forrest_holleman, Dec 20, 2011.

Scroll to continue with content
  1. forrest_holleman

    forrest_holleman

    3
    0
    Dec 20, 2011
    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.
     
  2. Laplace

    Laplace

    1,252
    184
    Apr 4, 2010
    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.
     
  3. OLIVE2222

    OLIVE2222

    690
    25
    Oct 2, 2011
    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
     
  4. forrest_holleman

    forrest_holleman

    3
    0
    Dec 20, 2011
    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.
     
  5. RobSmith

    RobSmith

    56
    0
    Dec 16, 2011
    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
     
  6. forrest_holleman

    forrest_holleman

    3
    0
    Dec 20, 2011
    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: Jan 8, 2012
  7. RobSmith

    RobSmith

    56
    0
    Dec 16, 2011
    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
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-