Controlling LED brightness and fade out

Thread Starter

mkgort

Joined Jul 4, 2011
17
Hello.

I am trying to control both the fade out, and the brightness of an LED using a couple of pots. I've managed to kind of do both using the included schematic. Of course, this really doesn't work due to the changes in R1 effecting the amount of voltage through the transistor, so I never get the full potential of the 7V if I want to increase the fade out time. I need the 7V to power a 6.3V LED, and the 5V is coming from an IC.

I've tried some variations where the emitter is tied to ground with the LED on the collector side, and also introducing another transistor to control each separately. Then my eyes crossed and I got a headache and then wisely decided to ask people who actually understand these things.

I hope the explanation is clear. I'm not the best at schematics or explaining what I'm trying to do.


Many Thanks!

LED dim and fade.jpg
 

ElectricSpidey

Joined Dec 2, 2017
3,312
I don’t see the need for either diode, the switch eliminates any discharge path for the cap other than the BE.

I would place the LED and its resistor on the collector side for maximum gain.

After that it’s really up to component values.
 

Thread Starter

mkgort

Joined Jul 4, 2011
17
Oops, I didn't mean to have the diodes in there (copy and pasted a lot of it). When I put the LED and resistor on the collector side and tie the emitter to ground, it seems to just act as a switch and the LED always just turns right off with no fade. Did I just wire it wrong?
 

wayneh

Joined Sep 9, 2010
18,089
Oops, I didn't mean to have the diodes in there (copy and pasted a lot of it). When I put the LED and resistor on the collector side and tie the emitter to ground, it seems to just act as a switch and the LED always just turns right off with no fade. Did I just wire it wrong?
No, the problem then is that all your fading occurs near the last 0.7V as the capacitor discharges. Any voltage above that turns the transistor fully on, and a voltage below 0.7V turns it off.

I think in general you're going to have a hard time getting a nice fade with just a single transistor. You could use an op-amp and get a nicer result.
 

dl324

Joined Mar 30, 2015
18,221
so I never get the full potential of the 7V if I want to increase the fade out time. I need the 7V to power a 6.3V LED, and the 5V is coming from an IC.
What fade time do you want? What is the source capability of the 5V from an IC?

You'll probably get better results if you drive the LED low side instead of high side.

What do you mean by "6.3V LED"? Most LEDs don't have built-in current limiting...
 

Thread Starter

mkgort

Joined Jul 4, 2011
17
The fade time doesn't have to be anything in particular, just longer or shorter. The 5V is coming from an HT12D decoder (I'm sorry, I'm not sure what the source capability is). I'm using an LED rated at 6.3 volts. It's a standard "pinball" SMD LED. I need something brighter than a 3 or 5MM LED.

The whole thing is part of a wireless "night light" setup. The goal is to allow the user to control the amount of light output by the LED while in use, and then how slowly the LED fades out after the switch is open. I hope this is helpful.

Thank for the replies!
 

dl324

Joined Mar 30, 2015
18,221
The fade time doesn't have to be anything in particular, just longer or shorter. The 5V is coming from an HT12D decoder (I'm sorry, I'm not sure what the source capability is).
The current to charge the capacitor comes from your 5V source. That will determine how long it takes the capacitor to charge.
I'm using an LED rated at 6.3 volts. It's a standard "pinball" SMD LED.
Standard LEDs don't have a voltage rating. They have a maximum current.
I need something brighter than a 3 or 5MM LED.
Brightness has little to do with package size.
The whole thing is part of a wireless "night light" setup. The goal is to allow the user to control the amount of light output by the LED while in use, and then how slowly the LED fades out after the switch is open.
How long of a fade out are you looking for?
 

Thread Starter

mkgort

Joined Jul 4, 2011
17
Probably around 5 to 20 seconds. These are the LEDs I just happen to have around. I'm certainly up for a better solution if I need to change them.
 
Last edited:

wayneh

Joined Sep 9, 2010
18,089
Probably around 5 to 20 seconds. These are the LEDs I just happen to have around. I'm certainly up for a better solution if I need to change them.
If controlling brightness is a goal, you really should look into a PWM control scheme and then incorporate your fade into that. It may seem daunting at first but using PWM will give a nice result and solve many problems for you. It’s how LED dimming is done. I know you may feel like it’s too much, but you’ll “see the light” in the end.
 

Sensacell

Joined Jun 19, 2012
3,769
It's surprisingly difficult to achieve really nice fading of LED's using analog methods.
It's totally do-able, but you end up needing lots of tricky stuff to get it 'just right'

Going for MCU and digital PWM lets you tweak away and get just what you want- with far less parts.
 

Thread Starter

mkgort

Joined Jul 4, 2011
17
Thank you for the suggestions. I'm OK with not having the best fade out. This project is really a proof of concept prototype. If at all possible, I'd like to stick to simple components. Will it be possible to control the fade and brightness without the voltage drop, or does it seem I may be out of luck?
 

dl324

Joined Mar 30, 2015
18,221
I'm OK with not having the best fade out. This project is really a proof of concept prototype. If at all possible, I'd like to stick to simple components. Will it be possible to control the fade and brightness without the voltage drop, or does it seem I may be out of luck?
Keep re-reading post #6 until you understand what it says.

Then do the same for posts #11 and #12.
 

wayneh

Joined Sep 9, 2010
18,089
Thank you for the suggestions. I'm OK with not having the best fade out. This project is really a proof of concept prototype. If at all possible, I'd like to stick to simple components. Will it be possible to control the fade and brightness without the voltage drop, or does it seem I may be out of luck?
I can't recommend much but here's a "what if". Instead of putting the capacitor negative pole to ground, tie it to the emitter of the transistor, or the junction of the LED and its resistor. Connect ground of the 5V supply to the same point. This will give you 5V on the capacitor moved up, relative to the 7V supply, by the voltage drop of those components.

I have no idea how that will work. Note that if you leave the two supply grounds connected, then charging the capacitor would allow a brief but high and potentially damaging current through the LED. This won't happen if the 5V supply ground is 'above' the LED.
 

WBahn

Joined Mar 31, 2012
32,707
No, the problem then is that all your fading occurs near the last 0.7V as the capacitor discharges. Any voltage above that turns the transistor fully on, and a voltage below 0.7V turns it off.

I think in general you're going to have a hard time getting a nice fade with just a single transistor. You could use an op-amp and get a nicer result.
Because the diode and, more importantly, the current limiting resistor are in the emitter path, the basic topology is as an emitter-follower so the current through the diode will drop more-or-less steadily as the capacitor voltage discharges until the capacitor voltage is Vf_led + Vbe.

Putting the LED in the collector path will allow for a wider fade range. The base resistor isn't doing too much since the RC time constant will be dominated by the beta times the emitter resistor, so the base resistor would need to be considerable larger than this, but then you are dropping quite a bit of voltage across the base resistor when it is the LED is on full, reducing the range of the fade voltage.
 

ElectricSpidey

Joined Dec 2, 2017
3,312
Fade_Led.jpg

Yea, sorry about having to bug out like that and sorry for the confusion, my eyes saw “fade” but my brain said “delay” so yea the follower config. will give a better fade.

I really can’t see how that circuit works at all with a 6.3 volt LED, and only 5 volts at the base.

Anyway, I put together this basic circuit as something you can start with, the circuit is untested, but I’m pretty sure it is a good starting point.

NOTES:

You should choose an LED with a lower forward voltage, such as a multi-chip, where the chip has multiple chips already installed in parallel as to give a lower forward voltage but more output. Your LED probably has the chips in series, hence the 6.3 volts. A lower voltage LED will give you a longer/better fade time.

VR1 and C1 values are chosen to give the required fade time.

R1 is chosen to give minimum fade time but large enough to still protect the supply.

Pot1 sets the brightness and should be a high value such as 500k or more.

R2 should be chosen to give maximum brightness to the LED, because it’s not going to be lit continually, so the brighter the better for the fade time. (but don’t overdrive it)

A transistor can be added to the output of the Op Amp if you want but the opa551 should handle the wattage. Also a transistor placed there will allow you to use just about any Op Amp.

You should also use the same supply for the cap charge as the LED driver.

You can install a master switch if the device is battery powered.

All in all the circuit is still pretty simple, and has a low component count.
 

Thread Starter

mkgort

Joined Jul 4, 2011
17
Thanks again for everyone's input. I'm still pretty new to making circuits, but it looks like it's time to give an op amp a try. The schematic looks nice and straightforward, so I'll probably only screw it up 3 or 4 times :)

Very much appreciated!
 
Top