Animated gif of the Boo!Blink in action.
As the Halloween season draws closer, I realized I wanted, nay NEEDED, multiple weird flickering lights to spread around the house for our yearly Halloween bash. After trying a few other "flickering LED" schematics that I found on the web, I decided that I wanted a weirder, more configurable flicker. And thus I had to build my own.
First Requirement: Instead of just ON/OFF control, I wanted several levels of LED brightness that hopped around in an unpredictable manner, including fully OFF at times.
Second Requirement: I wanted to have several colors of LED, so their tones would mingle as the brightness hopped around. For a generic "candle" effect, I chose high-intensity Red (12000mcd) and high-intensity Yellow (10000mcd) and got away with using only 2 LED's. But with a few tweaks, this circuit could drive more or less LED's, or even a relay to drive incandescent lights.
Third Requirement: I wanted the circuit to be stable and reliable, but convincingly random. No fiddling with super-high-gain "junction noise" amplifiers that are easily swamped with signal, but I certainly did not want every copy of the Boo!Blink to look and act exactly the same.
Fourth Requirement: I wanted the circuit to have some "tweakability", so different copies of the same circuit could easily be set up to look drastically different with just a few cap or resistor changes. Or in the best case, all the same components with different connections.
Fifth Requirement: CHEAP and SIMPLE! First of all, I'm lazy and don't want to assemble lots of components. Second, I wanted a high chance of success for others (who may not be circuit-savvy) to be able to produce and tweak their own Halloween lighting.
After a few different tries on the breadboard, I came to the conclusion that the best circuit topology would be a super-simple oscillator clocking a 2-chip digital pseudorandom number generator. By tying the various bits of the PRNG to the LED's through resistors, it would offer 8-level (well actually many more than 8 level) brightness control with semi-unpredictable flickering effect. I say semi-unpredictable because the simple and classical 8-bit PRNG only has 255 states before it repeats. So if I am clocking at about 10-20Hz, it will take 12-25 seconds for the pattern to repeat. That may sound too short, but unless you're zoned out and watching the flicker intently, you won't even notice. You can certainly upgrade to a 16-bit PRNG to give you 65536 states before repeating, but that seems like overkill to me.
HOWEVER, these PRNG's need to be "seeded" in order to get them started. By using a simple R-C delay to seed the PRNG, the seed for each Boo!Blink can be made different just by changing the cap. Long story short: Although Boo!Blink #1 using a 2.2uF delay cap may have a sequence like dark, bright, medium, bright... then 252 more states... , by changing that cap to a 3.3uF the seed will be different so Boo!Blink #2 may have a sequence like bright, dark, dim, dark, bright, medium ... and so on. The only combination that won't work is if the RC POR (power-on-reset) circuit is missing, or if it's so fast that no seed gets clocked in. In that case, the sequence is always 0, 0, 0, 0. So you must use some delay to seed the PRNG.
Additionally, you can tie the LED's resistors to different bits to get different effects. I use 3 bits, with binary weighted resistors such as 1k, 2k, 4k. As the various bits go high and low, it changes the current drawn through the LED and therefore changes the brightness. You can use 4 LED's and 2 bits each, 1 LED and 8 bits, etc etc. You can tie LED 1's resistors to bits Q0, Q1, Q2 or Q7, Q3, Q1, or any combination. Each one looks and acts different so feel free to experiment.
On to the circuit!
I run my Boo!Blinks using a 4xAA battery holder that I got from Fry's for $1.79 each. It fit's easily within the base of a $5.41 "globe" light fixture and supplies enough power to run one for a week or more. The 74HC164 shift register won't tolerate more than 7v so you can't use a 9v battery, but you could build a similar circuit using a CD4015 shift register (NOT PIN COMPATIBLE) that would tolerate a 9v battery. I have so many rechargable AA's that I decided 74xx series was fine. You could replace the 74HC164 with a 74LS164 or a 74164 or anything - they all act the same.
The CD4070 is a quad 2-input-XOR gate. You need 3 2-input XOR's to make an 8-bit maximal-length PRNG, and we use the other XOR to add in a few 1's upon power-up that act as the seed. There is also a 74xx series XOR gate, but my local junk store was out of them so I used the CD4070. C1 and R5 create the POR delay that seeds the PRNG. When power is connected, C1 pulls one of the XOR gates high for a few clock cycles. This acts as an inversion of the incoming data, and begins seeding the PRNG with 1,1,1,1 - if the delay is really long, it continues to invert the pseudorandom data that the PRNG churns out. But we usually set it to just clock in 3 to 5 1's to get the PRNG started. Eventually the resistor R5 pulls this gate low, and that XOR quits inverting and just passes the data through - at that point, the PRNG acts normally. So tweak R5 and C1 to change the "seed" and get a different PRNG sequence.
The NPN's used in the oscillator can be anything, really. 2n2222 or 2n3904, or any other small-signal npn you may have lying around. I usually use C2 to set the timing, and I leave C1 as 100nF to get a nice clock pulse. Personally, I prefer a slow and lethargic flicker so I can appreciate the many digital brightness settings my circuit is creating. You may want a smaller value of C2 such as 330nF or 220nF to get a faster flicker - play around and see!
For you advanced users: It is also possible to use some of the PRNG bits to affect the current in Q2, which will randomly vary the clock speed as well. I usually tie a few bits back to Q2's collector with big resistors such as 20k, 40k. Don't go lower than 10k or you can choke out the oscillator and "lock up" the circuit.
Last but not least - driving the LED's. Originally, my circuit used a few more npn's to drive the LED currents. It worked well, but increased the component count and didn't really offer too much extra performance. The 74HC's pins can sink at least 8mA each, so as long as you choose your resistors to keep the currents below 8mA, you should have no trouble. You can watch the pins with a scope to see if they are being pulled up away from ground if you're really interested, but if you stay away from using resistors lower than about 800 Ohms, you should be fine. Essentially, each bit that is low pulls current through the LED, increasing brightness. Each bit that is high steals current from the other (low) bits, decreasing brightness. In this manner, you get varying levels of brightness as the pseudorandom data shifts past.

Since I was going with the concept of a mystical, crystal-ball like device, I headed over to my local Home Depot to see what they had for me. Probably the circuit could be adapted to many types of fixtures, but I found these simple Hampton Bay "globe" fixtures for about five bucks each - good enough!

A suitable light fixture for assembling the Boo!Blink
Gutting the fixture is trivial - the actual light socket is only clipped inside and pops out easily. I also removed the insulation from inside the base of the fixture as it was pretty much unnecessary. The glossy white base is not very scary though, so you can disassemble the globes and give the bases a quick shot of spray paint. I used matte brown spray paint and it looked pretty good.

Three fixtures with their newly-painted brown bases
Mount the PCB inside the globe - hot glue works like a charm here. For the prototype unit shown below, I was originally trying to keep the LED's on the top of the board so they could be very near the top of the globe when mounted at an angle like this.
A prototype, showing mounting in the globe fixture
However, the high intensity LED's tend to cast a spotlight effect on the inside surface of the globe. Not very spooky. A diffuser is needed! After experimenting with hot glue on the LED body and other diffuser tricks, I decided to go with a very simple solution - Plastic wrap! By scrunching up some plastic wrap in the globe, or even wrapping the PCB in a scrunched bundle of garden-variety plastic wrap, a nice diffuse glow emanates from the center of the globe with very little spotlighting effect. An additional advantage is that you can place the LED's lower in the globe, to really make it look like there is some mystery energy source trapped inside and radiating outwared. Here's a couple of examples of plastic-wrap based diffusers for you.
Plastic wrap LED diffuser inside globe body Plastic wrap LED diffuser simply wrapped around PCB
Now the nice thing about these globes is that they have a little space in the body that we can use to mount the battery pack. So if you've gone through the trouble of making a beautifully scrunched diffuser, or have inserted some transparent overlay of a spooky face to project, you won't need to go opening and removing the glass part of the globe just to replace the batteries. Oh, and for heaven's sake use rechargeable batteries! Here are a few pictures of the battery pack mounting - remember, hot glue is our friend and it is our duty to keep the hot glue manufacturers in business. So use a lot!

Bottom up view of the base of the globe. Finished view of the mounted and soldered battery pack
Here are some front and back pics of the completed and mounted PCB. You will see that some components (the two transistors) are mounted on the back of the PCB. This was due to a mistake I made while assembling - I used the wrong transistors and couldn't get the broken leads out of the PCB holes so I just soldered the new transistors to the bottom. You won't need to do anything like that, hopefully. You can also see that while the PCB has enough mounting pads to run resistors from every shift register output, we really only drill and use two or three. In this device, two resistors are used on each side.

Front view of the completed LED Flicker PCB Back view of the completed LED flicker PCB.
So there you go. I suggest you build up your board and test it before mounting - it will be a lot easier to measure those backside traces if it is not yet hot glued into the globe base. Plus, this gives you the chance to play around with the resistor and capacitor settings before committing to them forever. And for you indecisive people, I suggest that instead of mounting the resistors directly, you take some DIP header sockets (or cut an 8-pin DIP socket in half) and solder the sockets into the PCB. Now it will be much easier to plug in different resistor values in different locations and see the effect on the flicker.
Enjoy this little Halloween electronics project, and good luck! If you start now, you can have tons of these built and lying around your haunt in time for the next Halloween season!
(c) 2008, Openschemes Halloween
![]() |