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!





6 February 2014

The Morse Thermometer - Part 3

Putting it all together
In part 1 and part 2 of this posts I investigated and designed the components for a solar-powered Morse thermometer. In part 3 everything gets connected.

In order to get the most out of the collected sunlight it is important to use as little power as possible. A red LED is a good choice here, because it only has a forward voltage of 1.7 Volts. So it will consume only about half the power of a white LED with a forward voltage of about 3.3 Volts.

Perhaps you remember that I had found out that even when the LED is not lit, the boost circuit from the solar lamp draws about 7mA. So it was important to switch it off during the time the thermometer is in stand-by.

Let's have a look at the original lamp circuit again.

24 May 2013

How to Do ISP Programming – Part 4: Fuses and Troubleshooting


Setting Fuses
 
As mentioned before, fuses are used to set a couple of things that might need to be set before the actual software starts to run. As a beginner you should not tinker with most of those settings, because it is possible to lock yourself out of in-system programming.