Good Old Fading LEDs

millwood

Joined Dec 31, 1969
0
if the two LEDs in my idea are of different colors, it would do fading as well as color changes.

and it saves parts too.
 

Wendy

Joined Mar 24, 2008
23,421
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%.

True enough. I was trying for simple, but missed. How would you go about making a simple XOR gate that can also drive a transistor? XOR chippie and a transistor driver?
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,248
I made some red, green and blue nightlights that fade and brighten each colour slowly at slightly different rates since each has its own fading circuit.

I used a circuit similar to Bill Bowden's Fading Red Eyes circuit. Here is the circuit for one colour:
 

Attachments

millwood

Joined Dec 31, 1969
0
what causes the color to change is the relative intensity of those two LEDs.

so the only way to change color is to fade the LEDs, :).

here it is.

you obviously will have to play with the numbers to get the right combination of LED current as well as beat frequency differential: as is, it is about 80ms, or 12x per second - too fast for human eyes. you may want to slow that to like .1second, or even longer to get a soothing effect.

as you can see, the pwm output's duty cycle changes, from 0% to about 50%, and the relative intensity of the two LED strings goes against each other: when one LED string gets the brightest, the other is the dimmest - exactly the effect you want to maximize the range of colors.

if you get another 555 here, you can get a total of 6 LED strings here and you are talking about lots of colors, :).
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
True enough. I was trying for simple, but missed. How would you go about making a simple XOR gate that can also drive a transistor? XOR chippie and a transistor driver?
Well, the easy way would be to use a 4070 quad XOR gate, perhaps driving a ULN2004/ULN2804 Darlington array. That would keep parts count low; you wouldn't even need resistors between the XOR gate and the inputs to the Darlington array, as they're built in.

Building an XOR gate from discrete components would be rather messy. :p
 

Wendy

Joined Mar 24, 2008
23,421
Actually Millwood's design is a XOR gate from the point of LED being lite or not lite.

Different states - lite
Same states - dark.

Leaving one LED off would mean it was only halfway bright, but a simple diode bridge would fix that if it mattered.
 

SgtWookie

Joined Jul 17, 2007
22,230
Actually Millwood's design is a XOR gate from the point of LED being lite or not lite.

Different states - lite
Same states - dark.
If the LEDs were the same color, then yes. However, since the LEDs are being directly driven by the 555's outputs, the timing will vary wildly depending on what combinations of 555 outputs are sourcing/sinking current at what time; you can see plain evidence of that in his output. The "fading" would be very abrupt.

The idea is to keep the frequency of each timer about the same, with a light output load. A CMOS XOR gate input would be a very light load, indeed.

I used a 0.1uF cap and a 42k resistor with 20k from pin 5 to ground to get around 192Hz with Vcc=10v. That wouldn't change much at all with a 4070B XOR gate load on the output.

Leaving one LED off would mean it was only halfway bright, but a simple diode bridge would fix that if it mattered.
Now you're adding parts count.
 

millwood

Joined Dec 31, 1969
0
If the LEDs were the same color, then yes. However, since the LEDs are being directly driven by the 555's outputs, the timing will vary wildly depending on what combinations of 555 outputs are sourcing/sinking current at what time; you can see plain evidence of that in his output. The "fading" would be very abrupt.
the timing will always be the same: it is when the two 555s output different (high vs. low or low vs. high).

the forward voltage drop of different diodes will affect the intensity of the diodes WHEN THE DIODES ARE CONDUCTING.

that smoothness of the transition depends on the beat differnetials: the smaller, the smoother.

the change in intensity for each diode depends on the frequency at which the 555s run: the higher the frequency, the smoother the intensity change. but anything more than 50-60hz wouldn't be noticeable by human eyes.
 

millwood

Joined Dec 31, 1969
0
as the beat frequencies get closer, the cycle gets longer and longer and it is harder to see on the waveform as the waveform gets cluttered.

here is the case of 1% matching: R1=10k, and R2=10.1k.

I am only showing a section of the waveform and you can barely see it through the gradual thinning in the middle of the chart.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
the timing will always be the same: it is when the two 555s output different (high vs. low or low vs. high).
Sorry, due to the way you've wired the LEDs on the outputs of the 555s, the timing will change due to the changing load. If the LEDs are not conducting, the 555 output will be higher or lower than it would be if sourcing/sinking current to the LEDs, which will change the rate that the timing capacitor charges/discharges through the resistor. If you don't believe me, then I invite you to experiment with real components, which will confirm my assertion.

the forward voltage drop of different diodes will affect the intensity of the diodes WHEN THE DIODES ARE CONDUCTING.
You're using two different LEDs; one green, one blue. Green LEDs usually have a Vf somewhere between 2.3-3.3v. Blue LEDs are usually somewhere between 3.3v-3.8v.

that smoothness of the transition depends on the beat differnetials: the smaller, the smoother.
I'll agree with you on that.
 

millwood

Joined Dec 31, 1969
0
Sorry, due to the way you've wired the LEDs on the outputs of the 555s, the timing will change due to the changing load.
the timing will always be the same. i can replace the leds with resistors and the timing will be the same.

the reason is simple: the conduction takes place when the two timers are in a different state. what state the timers are in is independent of the load.

You're using two different LEDs; one green, one blue. Green LEDs usually have a Vf somewhere between 2.3-3.3v. Blue LEDs are usually somewhere between 3.3v-3.8v.
the intensity of the leds, when they are on, depends on their current flow. you can equalize the current going through the leds by giving each of them their own current limiting resistors.
 

millwood

Joined Dec 31, 1969
0
You're using two different LEDs; one green, one blue. Green LEDs usually have a Vf somewhere between 2.3-3.3v. Blue LEDs are usually somewhere between 3.3v-3.8v.
even if you don't use individual current limiting resistors, the difference isn't that big when the supply current is high.

if you set the led current to be roughly 40ma, the current limiting resistor is about (12v-3v)/40ma=220ohm, give or take.

so when the Green LED is on, the current is at most: (12-2.3)/220=44ma, 10% higher than our goal of 40ma.

when the blue led is on, the current is at least: (12-3.8)/220=37ma, or 8% lower than our goal.

a 15% deviation, worst case scenario.

and if you use a 240ohm (where abouts) for the Green LEDs, and 200ohm for the Blue LEDs, they would have been spot on.

the point? the difference is much smaller than you think.

word of caution though: for anyone wishing to use this design with multiple LEDs, you want to put a real diode, like 1n4148, in serial with each string of the diodes to protect them from being reversed damaged. This only applies if multiple diodes are used in a string.
 

millwood

Joined Dec 31, 1969
0
word of caution though: for anyone wishing to use this design with multiple LEDs, you want to put a real diode, like 1n4148, in serial with each string of the diodes to protect them from being reversed damaged. This only applies if multiple diodes are used in a string.
here is what I meant.

1) D3/D4: they are the protection diodes so that the leds wouldn't be reverse damaged when the other string is conducting.

2) R4/R5: current limiting diodes for each led strings. in this case, one string has three blue leds and the other has just one green led so there is great disparity in the forward voltage drop. by adjusting those two resistors, the current flow through both strings is roughly the same: just shy of 40ma.
 

Attachments

Last edited by a moderator:

SgtWookie

Joined Jul 17, 2007
22,230
the timing will always be the same. i can replace the leds with resistors and the timing will be the same.

the reason is simple: the conduction takes place when the two timers are in a different state. what state the timers are in is independent of the load.
Here, try an experiment in your simulator.

Or, you could experiment with the one I did, as you seem to have LTSpice installed.

The two 555 timer circuits are identical, except that U1 has an LED load on it's output.

See how that load has affected the timing? By 80mS, they're about 90° out of phase.

Note that LTSpice's model for a 555 isn't that great; the high side of the output swing on pin 3 would be limited to around Vcc-1.3v, as internally a BJT 555 has a Darlington follower.
 

Attachments

Wendy

Joined Mar 24, 2008
23,421
Now you're adding parts count.
1 diode bridge vs. a XOR gate and drivers. This I can live with. :D

Or, you could experiment with the one I did, as you seem to have LTSpice installed.

The two 555 timer circuits are identical, except that U1 has an LED load on it's output.

See how that load has affected the timing? By 80mS, they're about 90° out of phase.

Note that LTSpice's model for a 555 isn't that great; the high side of the output swing on pin 3 would be limited to around Vcc-1.3v, as internally a BJT 555 has a Darlington follower.
In theory the load shouldn't matter, because the if the RC network sees the same voltage the curves will be identical, but the 1.2V Darlington drop is very significant in this kind of oscillator, and that same voltage drop removes some of the power supply stabilty. I don't always trust simulators. I'm slow to build, but I prefer hands on because of it.

Don't make me point to the 555 Hysteretic Oscillator.

Dang, did it anyhow.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
In theory the load shouldn't matter, because the if the RC network sees the same voltage the curves will be identical...
But they won't see the same voltage, as my simulation illustrated.
Notice that U2's output reached a higher voltage than U1's output? That's because U2 had less of a load than U1. As a result, U2 had a higher frequency than U1 did, even though the RC time components were identical. The difference was that U1 had a load for the high part of it's cycle, which increased the charge time for it's capacitor.

Really, an XOR gate is just one component (and pretty cheap, too)

... but the 1.2V Darlington drop is very significant in this kind of oscillator, and that same voltage drop removes some of the power supply stabilty. I don't always trust simulators. I'm slow to build, but I prefer hands on because of it.
The 1.2v Darlington drop causes a "real" 555 timer wired in this way to have considerably more ON-time than off-time. That's why I showed the 20k resistor from the CTL pin to GND; with Vcc being 10v it pulled the trigger points in line for just about 50% duty cycle.

As I already mentioned, I'm not too fond of the way Linear Technology modeled their 555; it's more like a CMOS version, but with the current of a BJT version.
 
Top