# Random Blinking LEDs, Control Speed

Discussion in 'The Projects Forum' started by paintlax, Jan 10, 2013.

1. ### paintlax Thread Starter New Member

Jan 10, 2013
13
0
My school play needs a prop made, I have basic circuitry skills, can solder, understand most schematics, etc. There is a part in the play where the actor will open a box and LEDs will begin to blink randomly to make a magic effect. I think I am looking for more of a fade in/out effect than blinking. I also want to have a knob that will control how fast the LEDs will fade. Can someone please help me out with how I would go about doing this. I have a PIC programmer if I need to use a PIC, also willing to purchase an arduino UNO if needed.

Thanks for all help in advance.

2. ### wayneh Expert

Sep 9, 2010
16,102
6,219
It's a little hard to help until we can specify what needs to happen. Do you want multiple colors? How many total LEDs are you thinking of? Do you want all of the LEDs doing the same thing, or do you imagine that there will be 2, 3 or more sequences going at the same time?

I took one of those LED tealight simulators and used its output to drive a MOSFET and thereby a string of LEDs. My point is that a programmed dimming sequence like the tealight uses can be scaled up and you can get any program you want at any scale you want. You just need to know what you want.

3. ### paintlax Thread Starter New Member

Jan 10, 2013
13
0
I am thinking of having 8 LEDs total. Each one should be fading in and out but not at the same time, so sort of random. This way you created a random glowing effect.

4. ### Wendy Moderator

Mar 24, 2008
21,838
3,047
There are many ways to do this. You could have 8 555 chips, or 4 555 chips, all running as independent faders. (LEDs, 555s, Flashers, and Light Chasers, chapter 12). I remember seeing a pseudo random digital number generator somewhere around here, you can always convert a square wave into a fade effect (the same link has examples).

Or you can go with a microcontroller, wiring is much simpler but programming isn't.

5. ### thatoneguy Expert

Feb 19, 2009
6,349
732
Do you have any PIC Microcontroller ICs to program, or just the programmer? Do you have a compiler for PIC (other than the assembler in MPLAB)?

For a single project of the type you are looking for could be accomplished with a low cost PICAXE which is programmed in basic from only a PC serial port (no programmer required). The other option would be an Arduino if you do not have a BASIC or C Compiler for PIC. I would not recommend taking this task on in PIC assembly if you are not very familiar with it.

You could control 8 LED outputs with a PICAXE or Arduino. All controllers mentioned can easily read an analog signal from one or more potentiometers to adjust fade and/or speed rates. The fading would be controlled by software PWM (Pulse Width Modulation), so a search for that should help you get an idea of what is involved. I will say the Arduino libraries and large existing code base around would be a quick start in that regard, though a good bit more money to start.

The solution will depend on how comfortable you are with software versus hardware, as Bill mentioned above. If you are more comfortable soldering known ICs together to combine functions, that would be the route you should take. If you are more of a programming type person, you do get a lot more flexibility, and a little less soldering with a microcontroller solution.

At the other end of the spectrum, if cleverly laid out, an on sale Christmas LED string with effects may be a complete solution for what you'd like to build, just pick and choose the colors you like and mount them.

Last edited: Jan 11, 2013