LED Candles with PIC 12F683
* Update v2.01 of 28/12/2010 *
other projects on this web site,
please can send me
of his accomplishments?
I would like to
put it here
so that they are visible and
can serve as a
starting point for new
different realizations or
in this way
of this site which
is in favor of
knowledge of electronics
free of charge.
Also, if you, while sending photos of your prototypes, authorize me to put on-line together with the photos at least your name and your email, you will be contacted or you can contact another user who made the same project in order to do together of constructive confrontation.
Thank you in advance, Tony
After designing various LED electronic candles, I decided to present this project, simple and interesting, which simulates the light of a candle, but without the danger of fire, etc. ...
The micro works through the internal oscillator set to 1MHz so that its flow is around the 220/260 microA, the LED is controlled via PWM output pin 5 with the operating frequency set to 10KHz.
If you insert the jumper 1, when the LED candle is in a bright room, it turns off automatically, and when the brightness drops below the preset threshold, automatically turns on. 1 If the jumper is removed. the led candle always works until the batteries run out.
To change the threshold of light / dark, adjust the resistance R3, currently 220K. is possible to put a resistor R3 as for example from 33K in series with a trimmer by 180K/220K in order to adjust so end the intervention threshold.
In the micro, there are several functions that manage the PWM with different thresholds of delay and more precisely in steps of 2ms to 10ms, to make the increases and decreases in the brightness as real as possible.
By observing the flame of a burning candle, a flame looks almost regular, with slight increases and decreases in brightness, never fade, and periodically, the flame is tottering sometimes faster sometimes slower. All these effects were included in the software.
V2.01 update of 28/12/2010: Improvement of the effect of a single candle and elongation cycle at about 13minuti of continuous effects and not repeated damage to the flame realism better understood the flame that random wobbles like when someone passes close to the flame a lit candle ...
As LED was chosen leds and more exactly the Agilent HLMP-EL31-SV000, you can find it from large distributors such Farnell - RS Componentes etc ... true is that you can use any other LEDs with similar characteristics.
To get the effect of scattered light, the light was "encapsulated" in a piece of heat shrink tubing transparent 5mm.
Prototype single candle
Led with heat shrink tubing
Version with 2 or 3 LEDs. This version is useful when more light is needed by the LEDs, and the LEDs being in parallel simultaneously illuminate all
Wiring Diagram version 2
or 3 leds
Prototype version with 2 or 3 led in parallel
Detail of the prototype
Detail of the LEDs
Detail of the LEDs
Version with 2 or 3 independent LEDs, as if they were separate candles, because each LED is controlled by a PIC12F683. The software inside the PIC is different in the sense that, looking at the electric, the first PIC Master said, manages the photocell and J1 pin 2 and generates a signal to enable the micro Slave U2/U3. The routine generation of flame within the three micro are all different, so as to make the effect of autonomous candles. And 'possible modfiy this circuit diagram, and cross it with the previous one with the end to mount the BC337 and manage multiple LEDs for each micro. with this project, the maximum number of micro cascadable is 10.
Prototype with three micro
Data sheet BC337 BC337.pdf (125k)
Files Update. HEX 28/12/2010 ver 1.2
The file contains the CandelaA HEX for PIC12F683 in single or planning the first micro project with three micro ie the master. CandelaB and CandelaC NOT work in master mode but in slave mode. (See diagram above project with three micro)
CandelaA v2.01.rar file contains the. HEX file to load into the micro CandelaA v2.01.rar (1k)
CandelaB v2.01.rar file contains the. HEX file to load into the micro CandelaB v2.01.rar (1k)
contains the. HEX file
to load into the micro CandelaC v2.01.rar (1k)
© Copyright email@example.com