Candle Simulator using PIC12F675 microcontroller




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.

Candle Simulator

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 [1], 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 [2].

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 [1].

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 [2].

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.

Schematic candle power

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.

 

For more detail: Candle Simulator using PIC12F675 microcontroller




Current Project / Post can also be found using:

  • pic12f675 project led
  • role of 12 f 675 with microprosser 89c51
  • candle simulator using pic microcontroller
  • paper of candle simmulator using pic microcontroller

Leave a Comment

*
= 4 + 6

Read previous post:
7-Segment ASCII character Set A 127-character ASCII table for 7-segment LED or LCD displays using PIC16C84

I started to develop what I call my "next generation of microcontroller projects" (I have to find a name for...

Close
Scroll to top