Good Old Fading LEDs

Thread Starter

PDubya

Joined Mar 16, 2006
28
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?
 

windoze killa

Joined Feb 23, 2006
605
Originally posted by PDubya@Apr 7 2006, 02:28 PM
Uh, anyone? Did I say something wrong?
[post=15923]Quoted post[/post]​
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.
 

hgmjr

Joined Jan 28, 2005
9,027
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
 

Thread Starter

PDubya

Joined Mar 16, 2006
28
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
 

windoze killa

Joined Feb 23, 2006
605
Originally posted by PDubya@Apr 8 2006, 04:46 PM
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
[post=15965]Quoted post[/post]​
You could stick your fibre optics in your router. hehehe just kidding guys.
 

hgmjr

Joined Jan 28, 2005
9,027
Originally posted by PDubya@Apr 8 2006, 12:46 AM
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
[post=15965]Quoted post[/post]​
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
 

Thread Starter

PDubya

Joined Mar 16, 2006
28
Originally posted by hgmjr@Apr 8 2006, 08:09 AM
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

Could you explain what you mean?
 

hgmjr

Joined Jan 28, 2005
9,027
Originally posted by PDubya@Apr 8 2006, 12:24 PM
Could you explain what you mean?
[post=15987]Quoted post[/post]​
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
 

Thread Starter

PDubya

Joined Mar 16, 2006
28
Originally posted by hgmjr@Apr 8 2006, 02:04 PM
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
Ah, I just didn't understand what you meant by duty cycle. Sorry about that.
 

hgmjr

Joined Jan 28, 2005
9,027
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
 

Rshetley

Joined Jul 11, 2009
2
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
I would love to see the circuit if you can send the SCHEM. to me or post again.

Thanks
Rich
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Attachments

Bernard

Joined Aug 7, 2008
5,784
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%.
 

Attachments

hgmjr

Joined Jan 28, 2005
9,027
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
 

millwood

Joined Dec 31, 1969
0
Something like this perhaps? Just build two identical oscillators, component variation will take care of the rest.

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.
 

SgtWookie

Joined Jul 17, 2007
22,230
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%.
 
Top