The Fading RGB LED

bigcape

Joined Sep 18, 2009
158
I do not mean this rude AT ALL! I am genuine when I ask what the facination is with fading LED's?

Are they not supposed to be used that way so it is a challenge I am not aware of?

Maybe because they do not make noise and it is just plain fun?

Or is it as simple as if the LED responds then the circuit is correct, like a validator of sorts?

I see tonnes of debate on this site, thats why I ask..
 

SgtWookie

Joined Jul 17, 2007
22,230
You asked earlier about the current limit of the 2N3904. The datasheets say 200mA maximum, but 100mA is the realistic limit.

2N2222 (NPN) and 2N2907 (PNP) transistors are commonly available, and can carry a good bit more current.

I will try the 5 pin way since I have yet to mess with this feature of the 555.
Do the threshold and trigger go down while keeping the same ratio? or do they go down linearly?
In a bjt 555, the trigger and threshold are set by three 5k resistors (CMOS versions use three 100k resistors) wired in series across Vcc and ground, making a voltage divider. This gives the 1/3 Vcc and 2/3 Vcc levels.

Pin 5 is connected to the 2/3 Vcc point. If you sank enough current via a resistor to ground from pin 5 to get that voltage down to 1/2 Vcc, the lower threshold would then be 1/4 Vcc.

So, how much resistance would you need to get pin 5 down to 1/2 Vcc?

Well, since the three resistors in the voltage divider are all 5k Ohms, the upper 1/3 of the divider is 5k and the lower 2/3 of the divider is 10k. If you place a 10k resistor from pin 5 to ground, that will be in parallel with the lower 10k of the divider, for a total resistance of 5k on the lower side of the divider.
 

Wendy

Joined Mar 24, 2008
23,429
For years I have used a linear circuit to slowly fade and brighten LEDs.
It is similar to Bill Bowden's Fading Red Eyes circuit where two opamps form a triangle-wave generator. I used three of the generators driving a red, a green and a blue LED at slightly different frequencies. The colours add and make slowly changing millions of colours on a white ceiling.
Facinating, both millions of colors and boring. :D

I do not mean this rude AT ALL! I am genuine when I ask what the facination is with fading LED's?

Are they not supposed to be used that way so it is a challenge I am not aware of?

Maybe because they do not make noise and it is just plain fun?

Or is it as simple as if the LED responds then the circuit is correct, like a validator of sorts?

I see tonnes of debate on this site, thats why I ask..
It's part of the fun with electronics, making circuits do a special effect with LEDs. There is usually more than one way to do a job, indeed many ways. I enjoy coming up with new ways using simple parts. It's called designing. I don't really see much in the way of debating though.

Ultimately these special effects will get used somewhere. They may be used in something like Fenris's Dalek circuit in this thread, or simple Halloween props. The point is we help where we can, I am pretty good designing what I call do nothing circuits, and have a library of them besides, thing like flashers, sirens, whatnot.

Ultimately, if you want to learn, you have to build your share of what you're interested in.
 

Audioguru

Joined Dec 20, 2007
11,248
My solar garden lights are boring because the RGB fading LED shows only one colour at a time. There are not millions of colours, just 3 colours.

My night lights have all 3 colours fading at slightly different frequencies so the colours are many and are facinating.
 

bigcape

Joined Sep 18, 2009
158
Facinating, both millions of colors and boring. :D


I don't really see much in the way of debating though.


Ultimately, if you want to learn, you have to build your share of what you're interested in.
Like I said, genuine curiosity! I meant lots of threads "Tweeking" not realy Debateing- bad chioce of a word.

I totally get it. Just curious
 

Thread Starter

campeck

Joined Sep 5, 2009
194
Hey Bill

That last circuit you posted.
I have it built And I can't seem to get the duty cycle low enough (cause the PNP's) to give the led time to brighten. It's like no matter what I try The led always cuts off at a certain brightness. Maybe a different LED? I tried the parallel diodes and resistors and different caps.

anyhow. I am moving on to the op-amp circuit. And Then I will decide which one suits my project best!
thanks
 

Thread Starter

campeck

Joined Sep 5, 2009
194
Hey audio guru,
I have your circuit built and was wondering what values you would change for frequency, low voltage point, and high voltage point? You also mentioned voltage supply making a difference in another thread.
I'm using 2 741 op amps right now.
But for the final circuit I would use a LM324N
Thanks!
 

Wendy

Joined Mar 24, 2008
23,429
OK, I built the circuit using this layout...





I used a 100µF capacitor because that was what was handy, and a CMOS 555 (a regular 555 would have worked). I can go as low as 12 seconds duration using 1000 count (predicted is 14 seconds). The capacitor shown will be about ¼ that duration, or 3 seconds. The red LED never went completely out, pulsing as expected.

Other color LEDs, because of their higher drop, will go to zero intensity, but we think we can compensate with another variable pot on pin 5 to adjust the circuits high voltage point. This resistor (not shown) would adversly affect duty cycle a little, but I suspect it can be lived with. R2 adjusts brightness, and is calculated on this circuit by the formula (Vcc - 1/3 trip point - 1.2V (Darlington pair BE voltage drop) - Vf (LED voltage drop))/LED current. Plugging the numbers in it looks something like:
(9V-3V-1.2V-2.5V)/0.02A = 115Ω

If you look at the theory of operation for this circuit there is no lag. It reliably goes between 1/3 Vcc and 2/3 Vcc, unless that extra resistor is added it can't do anything else. Are you lighting up any other LEDs on the output?

The PNPs are not your problem (unless they're bad transistors). This circuit works.
 

Attachments

Last edited:

Thread Starter

campeck

Joined Sep 5, 2009
194
Well Then I was doing some things wrong!

First of all I was running it on 5v with a 3.5v drop LED
So I will move to 9v.
I didn't calculate the voltage drop of the transistors or the 1/3 trip point.
I am also using a 2v 15ma LED on the output of the 555 as an indicator. How will that effect the circuit?
Basically when you explain everything out to me I get it. (like you just did)
But I am not at the point yet where I can just look at it and figure EVERYTHING out.
But hopefully soon...

Thanks Bill.
building now.
 

Wendy

Joined Mar 24, 2008
23,429
No problem, this circuit peaked my interest, I'll be using this later for one of my articles, several of them as a matter of fact. I suspect the power supply was the issue, 9V seems to be a magic number for this circuit, as all the math works out by itself. The one AG showed is simple enough too, with a few more parts. I try for minimum parts count myself, that and new ways of doing things. Wookie and I came up with it more or less the same time, I haven't seen it out on the web before.

I notice AG's circuit also uses 9V. 5V is kinda tight, there isn't much range to play with, expecially with other color LEDs.

I think I could do it with two 555s and a LM339 (or another comparitor/op amp) using a PWM scheme.
 
Last edited:

Thread Starter

campeck

Joined Sep 5, 2009
194
I have both of those things!
would what you are thinking of fade red, green, and blue LED's with just those IC's and minimal parts?

I have a quad op-amp which is why I think I may end up with AG's circuit.
Are there quad 555's?

I also have a chip called ULN2802A
8 Darlington array.
I don't know much about this chip, But could It replace the three darlington arrays you have? That could save space with a quad 555!

I also have an LED driver chip I need to play with
STP08DP05B1
 

Wendy

Joined Mar 24, 2008
23,429
Don't know if it would work, but there is a chip called the 558, and it is a quad timer. Never used it.

AGs circuit still takes 2 op amps per oscillator, so you would need 2 chips.
 

Thread Starter

campeck

Joined Sep 5, 2009
194
Hell yeah Bill!
I applied what you said and now it is working great.
The Blue & Green 3.5v 20mA LED I have turns all the way off for a bit before turning back on.
And when I use My Red 2.6v 70mA LED (which I seem to have misplaced at this moment...*checks floor) with the same circuit, It barely goes off and seems brighter. Is there a way to calculate for the Blue and Green Led to not go ALL the way out?
Or Make the Red Led less bright and go off more?
 

Wendy

Joined Mar 24, 2008
23,429
First, you have to measure the Vf of each device, this is critical. You use the forumla I showed in post #29 to calculate the resistor.

To move the bottom (low) intensity around connect a pot to pin5. When I get a chance I'll draw the revised schematic. This pot will move the low voltage point around to where you want it to be.
 

Wendy

Joined Mar 24, 2008
23,429
Here is the concept circuit I was talking about...



I need to clear up a couple of points before it is finished.

1. I don't know what the maximum drive of the LM339 is, which is the quad comparitor I was thinking of using. It is an open collector type of device. You mentioned something about 50~70ma per LED? I'm pretty sure a transistor per LED would be needed.

2. I don't think there would be any interaction, but I'm not sure of it either. The low frequency oscillators would need to be deliberately set for different frequencies, and even then now and then they would switch together. An occasional sync is no big deal, a pattern is what is to be avoided.

3. The advantage of this design is it is digital as far as the LED is concerned. When the PWM is high the LED will be fully on, when it is low the LED will be off. It can go very low as power supply voltages go, especially with CMOS 555s.

4. Even though I drew 555s I'm thinking of a 556, or perhaps a 558. I need to look into a 558 to see if that oscillator is even possible. At the moment, with 556s, I'm thinking 3 chips.
 

Attachments

Wendy

Joined Mar 24, 2008
23,429
You know, it just occured to me, there are a lot of CMOS gates out there that are inverting schmitt triggers. We might be able to get the chip count down to 2 with them.

************************

I've just bought a couple of CD40106 (aka 74C14), a hex Schmitt Trigger (as in 6 in the package). The 556 design will work well, but with this CMOS version it should go down to 3V minimum.

I still owe you a schematic for the single throbber with the low intensity adjust. I get side tracked easily, but I make pretty drawings. :D
 
Last edited:

Thread Starter

campeck

Joined Sep 5, 2009
194
Yes you do.
And I enjoy looking at them and building them and figuring out how they work. It really helps me learn.

So what I am seeing is that the top 555 is set at a frequency and the other 555's feed into the comparator so that the different frequencies cause the beat pattern that I have read about in other threads?

I can't wait to go build this!
thanks yet again.
 

Wendy

Joined Mar 24, 2008
23,429


OK, the pot R3 needs to be detachable from pin 5. You should start off by adjusting the same voltage on R3 wiper as on pin 5. I don't know, they may change when connected to pin 5 (probably not). Whatever you adjust the value too will be the minimum cutoff voltage to the LED, so you can increase or decrease the low light level of the LED.

R1 - Flash Rate
R2 - Max Intensity
R3 - Min Intensity
 

SgtWookie

Joined Jul 17, 2007
22,230
Bill,
Got your message; just got back in town.

Yes, the LM339 has a typical sink current to 16mA, but I don't like to push them that hard. Vce starts going up with a corresponding increase in power dissipation. Sinking 16mA, the output will typically be around 1.5v, but it can be that high with as little as 6mA current sink.

If you want to be pretty certain you'll get a good difference between the high and low voltages, stick with around 4mA sink max.
 
Top