There is probably a million LED candle projects already, so I had to give it a try too :). I used bare Funky PCB and an ATTiny84 – no need for anything else indeed.The Attiny is set to run on 1Mhz with BOD disabled, so it will keep going down to 1.8V. I soldered a yellow LED with a 220 ohm resistor on its leg to Funky’s PWM pin and a scavenged shock sensor from an old toy. The shock sensor is a very fine spring coiled around a copper rod, any move makes it vibrate and close the circuit. Ideal to start the LED candle by throwing in a pin-change interrupt. I hooked the sensor to digital pin 9 on the Funky, brought the internal pull-up to HIGH state and the shock sensor will briefly bring that pin to LOW when movement is detected. The pin-change interrupt wakes the ATTiny from sleep and I have the LED candle run for 10 minutes before it falls in another deep sleep until movement is detected. Basically gently picking or moving the LED candle makes it run for 10 minutes. I use a CR2032 battery here, although I could fit two AAA batteries as well. The 220mAh of the CR 2032 will last for 24hrs of actual run time because I do PWM i.e. the LED isn’t fully lighted, but imitates flicker. I got 500 bytes of real recorded candle flicker from Pete’s similar project.
Here is how the project came along:
That particular LED isn’t very bright. I have red ones that are by a factor of 5 brighter..but red LED candle is ugly.. will need to find a better LED. Other than that, it is very realistic.
Finally, my code is available for those wanting to test it out.
Page views: 2797