LED fade in/out circuit?

Hi there!

I’m looking for help in creating the simplest circuit possible that simply fades in a LED when voltage is supplied, and fade out when voltage is removed. I believe I cannot do this in software, since I only got around 100 Hz update frequency in my current design. The software “pulsing” would require a higher refresh rate, right?

Would be thankful for any response in this matter.

Thanks in advance!

I figure I could use something similar:

power → capacitor → LED → ground

But I’m not sure what kind of capacitor I should use, or if I should put in a resistor after the capacitor.

The circuit is running 5VDC and the LED’s are designed for 6VDC.

rasmadrak:
I figure I could use something similar:

power → capacitor → LED → ground

But I’m not sure what kind of capacitor I should use, or if I should put in a resistor after the capacitor.

The circuit is running 5VDC and the LED’s are designed for 6VDC.

I’m not sure what you mean by “LED’s are designed for 6VDC”. Do you have a link to a datasheet for them ?

What you could do (in it’s most general form) is more like power → resistor1 → (resistor2 → LED)//cap → gnd. Where (resistor2->LED)//cap is a resistor in series with the LED, both in parallel with a capacitor. Current through the LED is limited by the resistors and the voltage across the LED (and hence the current through R2 and it) is slowed by the cap and resistors on power up and via R2 and cap on power down. However since each LED will vary a bit in it’s characteristics you may find that whatever fade-in and fade-out times you achieve varies from LED to LED (if you have more than one) and with temperature as well. I’m also less than sure you can achieve some reasonable fade-in and fade-out times (?which would be what exactly?) with such a setup.

You mention you can “pulse” the LED at 100 Hz. This is sufficient for your intent I think. One possible method would be to set the LED to be on each pass through your loop (running at 100 times/sec) once you detect (somehow) the voltage you’ve mentioned. You’d also set a timer to trigger some fraction of 1/100’th later. When the timer goes off, an interrupt occurs which in turn triggers your software to turn the led off. You count the number of passes through you loop since the voltage was detected and vary the timer time from some low number to some high number (eventually > 1/100’th of a sec) as the loop count increases. Thus the length of time the LED is on, and hence it’s brightness, varies as a function of time since the voltage was detected. You could do similarly and reduce the timer time when the voltage goes away. So there’s a method to fade-in and fade-out and one that you can control precisely via software. I’m sure there’s other ways. All you’d need for hardware is your Arduino and the LED and a resistor and/or LED driver (all of which you’d have in any case). No “added” hardware necessary. I would persue this route rather than using R’s and C’s.

Thanks for your reply!

I’ll try to explain more.

The LED’s are not typical LED’s, but instead they are LED bulbs (building a pinball machine).

Therefor they are designed for 6VDC (at least that’s what the marking on the bulbs say).

They work fine with 9VDC and work well with 5VDC. I thought the voltage requirements/limits of the LED could be of some importance to the circuit. :slight_smile:

This is one such lamp: http://www.marcospecialties.com/product … 2D44B%2D41

I have an Arduino that controls lights and display and I can currently push an update rate of 100 Hz. Instead of just blinking LED’s on and off during the various modes, I would like them to “gently” fade in and out (maybe 1/5th of a sec).

Your post did help me a lot actually -

Since I’m able to update the LED-display at 100 Hz and creating different shades by pulsing the “pixels” without flicker, that should also be enough to keep the LED’s flickerfree and smoothly fading.

So I will attempt to do a software based PWM first.

If all else fails, I’ll try the the capacitor way you suggested.

Thanks!