Electronics experts: Need help/schematics for a slowly pulsating LED circuit

Pandamonium

Golden Member
Aug 19, 2001
1,628
0
76
I'm trying to find something that can simulate what newer Apples do when in sleep mode. (The power button slowly fades on and off (or at least very dim), a fading cycle from on to off to on takes about 5 seconds) Is rigging up a circuit the only way to accomplish this? I haven't been able to find any vendors that stock such an LED. If rigging a circuit is the only method, how might I do it? (I have no experience with this type of stuff)
 

tikwanleap

Senior member
Oct 9, 1999
922
0
0
Just a quick summary of what needs to be done:

Get a regular LED and you'll need to rig it up to a RC circuit with a counter ic and clock crystal.

Find the tech docs for the counter ic to set the counter time to 5 sec and have it turn a transistor on and off. The transistor will act like a switch to charge and discharge the RC circuit.

You'll need to calculate the right values of resistance and capacitance to to have it charge and discharge at an appropriate rate. (It's the RC time constant equation. It can be found in a basic EE book.)
 

rockyct

Diamond Member
Jun 23, 2001
6,656
32
91
Originally posted by: MercenaryForHire
You're not going to put this on your car, are you?

- M4H

Sounds like more of a case mod to me.
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
Originally posted by: tikwanleap
Just a quick summary of what needs to be done:

Get a regular LED and you'll need to rig it up to a RC circuit with a counter ic and clock crystal.

Find the tech docs for the counter ic to set the counter time to 5 sec and have it turn a transistor on and off. The transistor will act like a switch to charge and discharge the RC circuit.

You'll need to calculate the right values of resistance and capacitance to to have it charge and discharge at an appropriate rate. (It's the RC time constant equation. It can be found in a basic EE book.)

Nobody has commented on this approach, sounds viable. Hey xjedimasterx, it's me from the other thread. ;) I'll look into this approach, I need something to do.

EDIT: Oops, I guess syberscott did mention the 555 timer...
 

xyion

Senior member
Jan 20, 2001
706
0
0
Originally posted by: tikwanleap
Just a quick summary of what needs to be done:

Get a regular LED and you'll need to rig it up to a RC circuit with a counter ic and clock crystal.

Find the tech docs for the counter ic to set the counter time to 5 sec and have it turn a transistor on and off. The transistor will act like a switch to charge and discharge the RC circuit.

You'll need to calculate the right values of resistance and capacitance to to have it charge and discharge at an appropriate rate. (It's the RC time constant equation. It can be found in a basic EE book.)

This sounds like a good idea, however I'm not entirely sure if you will get a good fade in/out because the cap might charge/discharge too quickly. If you have access to a scope you can find the rise time and fall time of the RC circuit which would be helpful in tweaking to get the desired result.
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
Originally posted by: xyionThis sounds like a good idea, however I'm not entirely sure if you will get a good fade in/out because the cap might charge/discharge too quickly. If you have access to a scope you can find the rise time and fall time of the RC circuit which would be helpful in tweaking to get the desired result.

You don't even need to get that fancy. The rise/fall times can be determined by a formula in the tech. docs., mainly by the values of R & C and a slow fade should be able to be had by using somewhat larger values.
 

Analog

Lifer
Jan 7, 2002
12,755
3
0
Originally posted by: xjedimasterx
I'm trying to find something that can simulate what newer Apples do when in sleep mode. (The power button slowly fades on and off (or at least very dim), a fading cycle from on to off to on takes about 5 seconds) Is rigging up a circuit the only way to accomplish this? I haven't been able to find any vendors that stock such an LED. If rigging a circuit is the only method, how might I do it? (I have no experience with this type of stuff)

The real circuit probably is pulse-width modulated. You can simulate that with a single transistor capacitor/resistor feedback loop. The LED would slowly discharge the cap and simulate the fading out. Most basic electronics texts demonstrate such circuits.
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
yellowfiero Come on, ASCII art!! ;)

So after the LED discharges, would it "turn on" the transistor starting the cycle over again?
 

xyion

Senior member
Jan 20, 2001
706
0
0
Originally posted by: nebula
Originally posted by: xyionThis sounds like a good idea, however I'm not entirely sure if you will get a good fade in/out because the cap might charge/discharge too quickly. If you have access to a scope you can find the rise time and fall time of the RC circuit which would be helpful in tweaking to get the desired result.

You don't even need to get that fancy. The rise/fall times can be determined by a formula in the tech. docs., mainly by the values of R & C and a slow fade should be able to be had by using somewhat larger values.

I know that, which is why i said tweaking the circuit. And you'd probably have to have a pretty large cap. Shouldnt take more than like 15 minutes to do if you are so inclined (which i am not, mind you.) Thats just for the math though.

EDIT:
As yellowfiero said, the Apple circuit probably uses PWM supplying power for a given interval to charge the cap. As the LED drains the caps potential, it will get dimmer and dimmer giving you the fade. I didn't much like programming PWM, but I had to do it on an HC11.
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
Actually, I was looking at the formula for the on/off times for the output pin, not the rise/fall times. Silly me.
rolleye.gif
So, you're right, you'd need a big cap. on the output pin to slowly ramp up. So wouldn't Apple also have to use a big cap. to slow the fade even using PWM? Or I guess slowly increase and decrease the pulse width...

I'm not an electronics expert, but I know enough to be dangerous! Maybe I need to do some reading on PWM...
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
The op-amp circuit given by dighn works well. I used it to good effect for a lighting system.

In my case I actually converted the triangle wave into PWM waveform in order to improve efficiency in the drive transistors.

The problem, is that you need a very big, non-polarised capacitor in order to get very long fade times.

In the end I ditched the analogue idea and used a microprocessor. 1/2 the price, and about 1/5 the size of the original circuit and far more flexible.

My original circuit needed 5 op-amps, a potentiometer, and a barrage of resistors and capacitors. The revised version used a $3 CPU and a couple of push-buttons. The drive transistor was unchanged in both circuits.
 

Pandamonium

Golden Member
Aug 19, 2001
1,628
0
76
Wow. I understand little more than what an rc circuit and time costant are... I'm not very electrically inclined... Are there any parts I could pick up at say Radio Shack and solder together to arhieve the end result or am I going to be tweaking with number of combinations of resistor/capacitor arrangements?
 

Analog

Lifer
Jan 7, 2002
12,755
3
0
Originally posted by: nebula
yellowfiero Come on, ASCII art!! ;)

So after the LED discharges, would it "turn on" the transistor starting the cycle over again?

ACII art? Heh. Yes - the LED discharge cycle would turn the transistor back on etc.
 

Special K

Diamond Member
Jun 18, 2000
7,098
0
76
Dumb question - instead of a large cap., why couldn't he just use a large resistor? A 10M resistor with a 1uF capacitor would give a time constant of 10s (theoretically anyway).
 

Analog

Lifer
Jan 7, 2002
12,755
3
0
Originally posted by: SpecialK
Dumb question - instead of a large cap., why couldn't he just use a large resistor? A 10M resistor with a 1uF capacitor would give a time constant of 10s (theoretically anyway).

it depends on how the circuit is actually wired. If the LED is fed off the capacitor directly, then you would need a large capacitor to feed the hungry LED. If you are using the RC as only a timing delay on the base of the transistor, then you would need to rig it so that the LED is fed off a secondary current switching transistor. Both methods would work, but it is hard to conjure images without all of us staring at the same schematic diagram.
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
Originally posted by: SpecialK
Dumb question - instead of a large cap., why couldn't he just use a large resistor? A 10M resistor with a 1uF capacitor would give a time constant of 10s (theoretically anyway).

With a large resistor, the current to the LED is very small, i.e. it won't light up.
 

AgaBoogaBoo

Lifer
Feb 16, 2003
26,108
5
81
Actually, I would take a dual suspension brake module and add a spring nylon cotton based substance around it using a couple P4 3.2C chips for decoration to go along with the revolving flourescent power circuitry.

Seriously, I have no clue whatsoever what you guys are talking about. Electrical stuff and me don't go very well...
 

nebula

Golden Member
Apr 4, 2001
1,315
3
0
OK, I found a circuit that looks like it will do the job.

Fading Red Eyes
and an updated version for more LEDs, LED Fader

I also found a newsgroup thread about this curcuit and someone made this comment:
One MAJOR change you should make to Bill's circuit is to use the
transistor as a current source, which is ideal for LEDs. You're
both driving the LED-resistor stack with a voltage source.

Add a 5-volt 3-terminal regulator, change to a 1-4V triangle, to
be well suited for higher supply voltages like 35V (could happen
with an unloaded bell transformers) and lower voltages, like
Melissa's specified 24V. Because you'll always get the same LED
current. For example, what happens with your circuit if you
reduce the supply all the way down to say 23.5V? Hmm, not good.

I understand what he's saying but I don't get the "change to 1-4v triangle" part. Can maybe yellowfiero explain this? (I tried to put in the schematic for this addition but it doesn't want to look right in the preview. Basically it was feeding the op-amp with 5v regulator and moving the LEDs to the collector instead of on the emitter. Here's the Google thread with the schematic for this part.

I'm going to throw this together, sounds fun! But I want to know if I should add the 5v reg.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
understand what he's saying but I don't get the "change to 1-4v triangle" part.

Very simple. With the op-amp circuits described the output is a triangle wave, which operates between voltages set by the resistor values (but centred around the middle of the supply - 0 volts in a +/- supply circuit, 1/2 Vcc in a single supply circuit).

Typically opamps want to run on at least 12V, but modern[*] ones can operate right down to 3V. Therefore what Dr Hill is saying is to use the same circuit but run it from 5V instead of 12V (or higher). Then you should set the output waveform to oscillate between 1 and 4 V.

[*] You will need a 'low-voltage rail-to-rail' op amp.

The output stage is a classical voltage controlled current source. In the circuit showed it stops conducting completely at about 0.7V input, and at 4V input sinks 16 mA. The current is controlled by the emitter resistor.