Discussion in 'General Electronics Chat' started by ineedhelp, Mar 3, 2006.

1. ### ineedhelp Thread Starter New Member

Mar 3, 2006
1
0
i want to make a led fade in and out how would i do this ?

2. ### jatulm New Member

Feb 13, 2006
7
0
There are many ways of doing that. But basically you would need an oscilator connected as the source of you led... of course, you would need a resistor beteween the source and the led in order to NOT burn the LED....

I mean:

SOURCE ----> /\/\/\/\/\ - -D|------ GND

where /\/\/\ is the resistor and -D| is the LED (long life to ASCII drawing heh)

What is a LED?

Light Emiting Diode ... this means that when a current 'I' passes through the LED from "left to right" in my drawing, the the LED is essencially a short circuit (very low resistance) and emmits light. When the LED is polarized "backwards", a current 'I' would try to pass through the LED but it would be essencially an open circuit (very high resistance) and no current will exist (actually there is a very very low current).
Thats why you need the resistor.. otherway you would have almost a shortcircuit between source and gnd, and you would probably see light due to the fire, heh..

The oscilator, acting as the Source, would give a voltage between +V and -V as a sinusoide. so, when the source has a voltage greater than 0V (GND) then current will pass trhough the LED and it will emmit light, the smaller the voltage of the source, the smaller the current and the weaker the ligh will be.
When the source has a voltage under 0V (GND) then no current will pass through the circuit as I explained before.

Therefore, you have a led that emmits light fading in and out, and have a half period of completly OFF.
If you want to avoid the fact that it is OFF for a while, then you would need at the output of the source a FULL-WAVE rectificator bridge. (google for it)

greetings

3. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
The SOURCE in the above drawing, by the previous poster, could also be a pulse width modulated (PWM)signal. With a very narrow positve going pulse, the LED would be off most of the time. As you increase the duty cycle(ratio of on time to off time) the average voltage of the on and off periods will approach the threshold of the LED and it will begin to glow dimly. As the duty cycle continues to increase the LED gets brighter until the duty cycle is 100% and the LED is on all the time. The basic frequency of the PWM should be in the 500Hz to 3kHz range, but the rate at which you increase and decrese the duty cycle will be much slower in the 0.25 to 10 Hz range.

4. ### Mazaag Senior Member

Oct 23, 2004
255
0
Bout the PWM, if you want it to happen automatically, then you need something ( like a microcontroller probably) that will change the duty cycle of the pulses automatically.

5. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
Quite correct. The original question was an open ended, "how would I do this" sort of question with no criteria for evaluating solutions. In the interest of completeness I advanced an alternative. It is up to the original questioner to evaluate the alternatives for his particular situation about which we know very little, or refine his requirements.

6. ### pebe AAC Fanatic!

Oct 11, 2004
628
3
If you just want to make a LED dim at the twiddle of a knob. then here's a simple variable mark/space ratio generator built with a 555 timer.

The cap C! has different charge and discharge paths via D1 and D2 so by varying the position of P1 you can go from full brightness to darkness.

7. ### hgmjr Moderator

Jan 28, 2005
9,030
214
I agree with those responders that have recommended a Pulse Width Modulation (PWM) scheme as the solution of choice.

hgmjr

8. ### windoze killa AAC Fanatic!

Feb 23, 2006
605
24
Microcontroller????? What ever happened to the humble 555?

9. ### thingmaker3 Retired Moderator

May 16, 2005
5,072
6
In Pebe's drawing, one could substitute an oscillator for P1. Sawtooth or sine-wave would make for fade-in & fade-out.

Jan 10, 2006
613
0
Or, if you wanna stay linear, then just drive it with a slow buffered sawtooth.
(PWM would be my choice though).

11. ### pebe AAC Fanatic!

Oct 11, 2004
628
3
But the circuit IS an oscillator. The output is a square wave with a variable mark/space ratio - PWM if you like.

12. ### thingmaker3 Retired Moderator

May 16, 2005
5,072
6
Indeed. I should have said "second oscillator."

13. ### Mazaag Senior Member

Oct 23, 2004
255
0

Haha. Humble 555 all the way