Thursday, 31 October 2013

Jack-O'-Lantern Time

With Halloween now upon us and with the kids a bit older I decided this year I would make some Jack-O'-Lanterns. Never made any before so wasn't sure how these would turn out. However for a first attempt I don't think they turned out that bad.


To light them up I decided I was going to use a flickering LED candle. Seen loads of these all over the internet and figured it wouldn't be very hard to make. After rummaging through my parts bin I decided I would go with a trusty old ATtiny13. Using one of the PWM outputs and a single N channel FET to drive a few of LEDs.


Built it up on a small piece of strip board held onto the back of single 2 x AA battery socket.


The firmware is almost a simple as the circuit. The PWM level ramps up from its low value right up to its full brightness level holds it there for a short period before ramping down to its low value. A variable delay period is then generated using a linear feedback shift register. This gives a reasonable flickering effect. The cycle is then repeated indefinitely.