Monday, February 28, 2011

Twinkling Lights - a 555 timer contest entry

When Jeri and Chris first came up with the idea, I was intrigued. I'd used the chip back in the early 80's when in highschool. I still had a bunch of them in a drawer. It was just a matter of what to do with them. When I worked on my masters project (in Computer Science), I used something called spectral synthesis which simply means combining simple waveforms to form a more complicated one. The idea there was that I was trying to render what looked like realistic landscapes including mountains and valleys. If you get enough waves sine waves mashed together, you end up with something that looks somewhat random.
I decided to apply that to square waves and use logic gates to combine those waves. I figured if I could have the right set of timer frequencies set up, and combine them as inputs to 4-input NAND gates, I could drive LEDs that would twinkle in a pseudo-random way. That is what this project is about.
First, some math. I had to figure out just how many timers I'd need to generate a reasonable number of combined outputs. It turns out using Combinations from set theory works here. Given 4 inputs, there is exactly 1 way to combine those in a group of 4. If I used 5 timers, I can have 5 unique combinations of 4. With 6 timers, 15 combinations, 7 timers, 35 combinations. I figured 15 LEDs was enough for the scope of this effort.
I used totally non-scientific means to create the base frequencies. I used a handy 555 timer calculator and found that using a 10 uF cap, 10K and 100K resistors let me get about .68 Hz output at near 50% duty cycle. So, I went fishing in my parts drawers and found some capacitors I had laying around (1uF -33uF). I varied the resistor values a little till I got some blink rates that looked reasonable.

Next, I had to wire up the NAND gates. Having the combinations printed helped a lot! I was also starting to run out of jumper wires.

So, there you have it. Ideally, I'd play around with the timer frequencies a bit. For a more artistic presentation, I'd like to see the LEDs either embedded into a poster of a space scene, or scattered across one of the kids room ceilings.
Oh, I ordered some parts for this from Digikey (one of the contest sponsors). Good Karma, no?

No comments: