31 October 2014

The Eyes - A Last Minute Halloween Effect

Introduction
Halloween is a rather new tradition in our part of the world, but my family is very enthusiastic about it. Tombstones are built, bones are scattered in our front garden and a fog machine is kept in the basement for just this one day of the year. This time I thought that I could contribute a little LED effect. My idea was to use a couple of red LEDs to create a red-glowing eye effect, like some evil little monsters lurking in the dark.



Hardware - First Version
All I did was to take 10 LEDs (red, ultrabright, wide angle) and connect them to a battery. And the effect was quite nice. It basically looked like in the photo at the top. The schematic is more or less obvious. But here it is anyway.
The resulting current is about 60 mA from a set of four AA NiMH rechargeable batteries. So a fully charged battery should easily hold up for one night.

But in the end, I thought it was a little boring and I decided to add a microcontroller to spice it up a little.


Hardware - Second Version
The idea was to let the little monsters blink occasionally. This is a subtle, but as it turned out quite nice effect. So the little extra effort was definitely worth it.

The only component I added was a microcontroller ATTiny13A. It controls each individual pair of eyes. The schematic is again very plain. I didn't add a voltage regulator, which is not quite according to the rule book. The controller is meant to run at voltages up to 5.5 Volts. With a fully charged set of NiMH batteries you would get close to 6 Volts. But the controller should survive this. And the voltage goes down to under 5.5 Volts very quickly anyway.

Software
There is very little to it. I use a pseudo random number generator to make the eyes blink unpredictably. And they blink between one and three times. I like the resulting effect.

It is written in C using the AVR Studio 4. You can download the source and the hex file here (click on the download icon at the top).

First Use
The Eyes were used last night and everything worked as expected. I left them outdoors for the whole night. In the morning, the batteries were almost discharged. I suspect the reason is that it was very cold last night. And NiMH batteries don't work well in the cold. All in all the project was a success.

I think this could also be the base for other effects, like Christmas lights, etc. Be creative, have fun!





No comments:

Post a Comment