Good Old Fading LEDs

Discussion in 'The Projects Forum' started by PDubya, Apr 5, 2006.

  1. PDubya

    Thread Starter Member

    Mar 16, 2006
    28
    0
    Well, I've searched the forum and found various hints at how to fade LED's such as using a quad op amp, an oscilator, pulse-width modulation/dac/analog ramp. But none of the threads have actual examples of how to use any of these techniques. PWM seems like the one recommended the most, but I could not find any specifics on PWM or pulse-width, and the closest on the main site was this chapter on PWM power controllers.

    My project is to make a nightlight for my daughter's room from an old toy that recently broke. It's one of those fiber-optic toys with the bundled epoxied cap on one end, and the loose fillaments on the other that spread out in a big dome-shaped cascade of the fillaments.

    I've already modded a project box that it can slide into just fine, and works with some blinking LED circuits I've made, but would like to fade the LED's slowly in and out at different intervals for each color. Currently I have 6 leds (red, yellow, orange, blue, green, pink).

    What would be the easiest route for my particular project?
     
  2. PDubya

    Thread Starter Member

    Mar 16, 2006
    28
    0
    Uh, anyone? Did I say something wrong?
     
  3. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    You could always do it the old fashioned way and mount the LEDS on a board very close together and attach the board to a motor which rotates the LEDS and instead of a fading in and out you would have various colours moving through out the fibres.
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    A possible solution would be to use two 555 timers each set to produce a 50% squarewave of around 200 Hz. Setup one of the 555 timers so that its frequency could be adjusted to be very slightly off frequency by a fraction of a Hz. So 555 timer "A" is oscillating at 200 Hz and 555 timer "B" is oscillating at 200.02 Hz. Then take the output of each of the 555 timers and feed them into an "XOR" gate. Take the output of the XOR gate and use it to drive your LED through a transistor and voila you have a fading LED.

    The principle is based on the beat frequency phenomenon. The fade rate results from the difference between the two squarewaves as the phase between them drifts with time. The XOR gate is use to combine the two squarewaves so that when they are in phase the LED is OFF and when they are 180 degrees out of phase the LED is full "ON". In between these two extremes, the output of the XOR gate will be a squarewave of twice the frequency of the 555 timers and whose duty cycle will vary continuously.

    Note that the rate at which the LED will fade will not be constant over time but that can be feature.

    hgmjr
     
  5. PDubya

    Thread Starter Member

    Mar 16, 2006
    28
    0
    Thanks for the info!!!

    The 555 idea is great! I've got like 4 dozen of those boogers laying around. I'll have to give that a try. Ironically, it's similar in concept to the router blinking project I was working on a few weeks ago.

    Thanks again!!!
    - PDubya
     
  6. windoze killa

    AAC Fanatic!

    Feb 23, 2006
    605
    24
    You could stick your fibre optics in your router. hehehe just kidding guys.
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I look forward to hearing how the dual 555 approach works out for you.

    Make sure you set the boogers up to generate 50% duty cycle pulses.

    hgmjr
     
  8. PDubya

    Thread Starter Member

    Mar 16, 2006
    28
    0

    Could you explain what you mean?
     
  9. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    This is a cheap and cheerful astable using just one resistor and one capacitor as the timing components:

    [attachmentid=1367]

    Here is an example of the circuit hook up I had in mind.

    This technique needs only two components (a resistor and a capacitor) to set the frequency of the square-wave out and the duty cycle is close enough to 50% to do the job.

    hgmjr
     
  10. PDubya

    Thread Starter Member

    Mar 16, 2006
    28
    0
    Ah, I just didn't understand what you meant by duty cycle. Sorry about that.
     
  11. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    No problem. Sometimes the jargon can get in the way. Sounds like you have everything clear now.

    If you hit a snag during prototyping just post it here so we can work through it.

    Good Luck,
    hgmjr
     
  12. Rshetley

    New Member

    Jul 11, 2009
    2
    0
    I would love to see the circuit if you can send the SCHEM. to me or post again.

    Thanks
    Rich
     
  13. Rshetley

    New Member

    Jul 11, 2009
    2
    0
    Does anyone have a Schem of Attachment=1376?
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    This isn't exactly the same as what was originally posted, but it's a similar idea.

    The value of R2 depends upon the supply voltage and the load. You'll have to adjust it to get close to 50%. Without R2, the output will spend more time high than low, as bjt 555's have a Darlington follower in the output. It can get down to 0v, but depending on load can only rise to within 1.7v-1.3v of Vcc.

    R2 compensates for the lower high voltage by pulling down the upper trip point.
     
  15. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,122
    389
    This might be what you were looking for. Note that pin 7 , dump, is not used. As the output does not swing completely to the +&- rails uniformilly, the output duty cycle willnot be exactly 50%, ie half up & half down. If needed it can be corrected, or use one stage of divide by two for exact 50%.
     
  16. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Greetings Rshetley,

    Sgtwookie and Bernard have both served up the basic circuit for the 50% duty cycle 555 timer circuit that I originally posted and that has now evaporated.

    hgmjr
     
  17. Wendy

    Moderator

    Mar 24, 2008
    20,732
    2,498
    Something like this perhaps? Just build two identical oscillators, component variation will take care of the rest.

    [​IMG]
     
  18. millwood

    Guest

    how about putting two leds, reversed against each other, + a resistor, between the 3 pins of the 555s?

    you will see smooth changing of intensity in each of those LEDs.

    the components actually should be as close as possible to get a slow change.
     
  19. Wendy

    Moderator

    Mar 24, 2008
    20,732
    2,498
    He said fading, he got fading.
     
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    hgmjr had mentioned XORing the outputs. If the outputs of the two 555s were close to 50% duty cycle and slightly off frequency, his idea would result in nearly 0% to nearly 100% duty cycle.

    Using a simple wired OR gate with the two diodes would result in a variation of only about 50% to nearly 100%.
     
Loading...