Candle Simulator

This has got to be the simplest project of anything I've made so far.  It uses a PIC to simulate the flickering of a candle entirely in software.

The brightness of the lamp is controlled by doing PWM (pulse width modulation) of the power to the lamp.  A random number generator controls the flickering amplitude.

As seen in the schematic, only 3 pins are used on the PIC12F675.  PWM is generated on GP5 to drive a small transistor.  This gives enough current to run a 6.3 volt lamp.

Since the lamp is basically powered by an average of 2 or 3 volts, it tends to be more 'yellow' in color.  This helps in the candle flame effect.

This device is installed in a plastic water jar decorated with transparent colord graphics.  Most guests here simply assume its a real candle in the bottle.  A few get curious and look down to see the circuit inside.

For those who wish to duplicate this project, the Source and Object code is available.