Candle Simulation Pic Program

Best Circuit Simulator software??? And inside the program itself, you can 'program' the PIC and it will simulate everything. The don't hold a candle to Proteus.

  1. Mar 03, 2009 Mondo Technology - Pic Projects has a candle simulator. 5th: If you do not know how to program in any language this is over your head.
  2. Posts about PIC proteus simulation. This simulation will provide another platform to test and debug your PIC program in. PIC proteus simulation, PIC.

Description The aim of this project is to create a credible simulation of the light of a candle. Candle light is usually warm and waves slowly with random oscillations caused by the air flowing in the surrounding environment. Using a random number generator to modulate a light emiter like a LED or a light bulb it is possible to create a very credible effect.

Design I tested both LEDs and small incandescent light bulbs and although LEDs require less current to produce the same amount of light, light bulbs tend to create a softer effect. In this circuit I'll use LEDs but nothing stops you from using light bulbs.

The brightness of the LED is digitally controlled using Pulse Width Modulation , generated by the micro-controller. The amount of brightness and its oscillations are governed by a random number generator based on a Linear Feedback Shift Register. PWM or Pulse-width modulation of a signal or power source involves the modulation of its duty cycle, to control the amount of power sent to a load.

This is because the average power delivered is proportional to the modulation duty cycle. With a sufficiently high modulation rate, passive electronic filters can be used to smooth the pulse train and recover an average analog waveform. A linear feedback shift register (LFSR) is a shift register whose input bit is a linear function of its previous state. Applications of LFSRs include generating pseudo-random numbers, pseudo-noise sequences, fast digital counters, and whitening sequences. Both hardware and software implementations of LFSRs are common. Circuit Implementation I'll use both Microchip PICs 12F629 and 12F675 micro-controllers to develop the candle simulator. Each output pin of the micro-controler is limited to source or sink 25mA.

This is enough to power a small 5mm LED but not a light bulb or even a more powerful 1W LED. To power small light bulbs or more LEDs it is required to use a transistor like a bs170 n-channel mosfet, connected to the micro-controller.

It will then provide the remaining power to the light bulbs or LEDs. There are common components in both schematics:. the 78L05 voltage regulator;.

Pic

the 100nF capacitor to decouple the micro-controller voltage;. the PIC to generate the effect;. the 4k7 MCLR pull-up resistor to keep the micro-controller out of reset.

Process simulation pic art

Simulation Pic

The output stage depends on whether just a simple LED is enough or several small light bulbs are required. There's no external crystal or oscillator because we are using the micro-controller's internal 4MHz oscillator instead. The power supply should be able to provide 7Vdc/60mA or more in order to make the simple circuit work properly or for example 12V if you want the powerful one with 12V light bulbs.

Replacements. It is possible to replace the 78L05 with any other 5V/100mA voltage regulator. It is also possible to replace the FET with another one capable of driving more current, as long as its threshold voltage is below 5V. The PIC may also be replaced by another one. Just use the correct hex file or recompile the code for your own PIC! PCB The prototype was assembled in a pre-drilled, easy to cut, prototyping board for testing but there are two example PCBs for anyone wishing to build the project. The eagle files are available.

Downloads Here are all the files from this project available for download. I made two versions, one with the regular candle effect and another with a smoother/slower effect more apropriated for simulating fire with red/orange LEDs. Candle software with regular speed effect (replicates wind gust effect). Candle software with soft brightness variations like embers glowing. (updated in 2011/10).

Pic

Datasheets:. Eagle schematics and PCBs:. References. Published on Saturday 2007/06/09, last modified on Wednesday 2014/06/04.