17
\$\begingroup\$

My question is this: Can I use a variable resistor to control the brightness of an LED?

I was originally planning on using a potentiometer and an MCU to control the brightness with PWM, but that'd be a bit more difficult :). So, could I just connect the LED straight to my batteries through a variable resistor to control the brightness?

\$\endgroup\$
1
  • \$\begingroup\$ What current range do you want to vary the LED? \$\endgroup\$
    – jippie
    Commented Jan 19, 2013 at 14:54

3 Answers 3

20
\$\begingroup\$

Theoretically, yes you could use a pot to control the brightness of an LED. In practice, not so much.

To start with, let's assume that the LED has a \$V_F\$ of 2.0v, an \$I_F\$ of 20 mA, and our power supply has 5v. If we wanted a standard current limiting resistor it would have to be 150 ohms to limit the current to 20 mA.

With a pot, we also want a 150 ohm fixed resistor in series. The reason for this is that the pot will go down to 0 ohms, and we don't want to blow anything up in that case. So by putting the 150 ohm resistor in there there will be a maximum current of 20 mA through the LED.

Let's also say that we want the LED current to go down to 1 mA. Unless the pot has a super high resistance, it won't go down to 0 mA, and 1 mA seems like a reasonable lower limit. To make that work, our pot needs to be about 2K Ohms.

Going through the math, the maximum power dissipation on the pot is when it is at about 8%, and the resistance is 160 ohms. In this case the dissipation in the pot is about 0.016 watts -- which is fine for almost every pot. Even so, it is an important step to make sure you won't be burning up your pot.

But here is the important thing: The human eye has a logarithmic response to brightness. Let's say that we have 100% power going through the LED and we want to turn it down. It needs to go down to about 50% before we sense that as being reasonable. The next step down would be at 25%, etc.

Put a different way, if our knob was marked 1 to 10, then 10 would be 100%, 9 would be 50%, 8=25%, 7=12%, 6=6%, 5=3%, etc.

The problem is that a standard pot doesn't quite do that. It will work, and the LED will be dimmed. But a large part of the pots range (maybe 50%) will essentially be useless, producing very little change in brightness.

You might be able to use an audio pot, which has a logarithmic taper, but I'm guessing that the log part is in the wrong direction. (Sorry, even though I work in audio I don't use log taper pots.)

So yes, you can use a pot. It just might not give you the effect you seek.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ Wow incredible! I only got one line answer and you wrote a book in the same time. you are not human! +1 \$\endgroup\$
    – RTOSkit
    Commented Jan 19, 2013 at 15:04
  • \$\begingroup\$ Wow, thanks. You are clearly an electrical master. \$\endgroup\$
    – Rees
    Commented Jan 19, 2013 at 15:58
  • 1
    \$\begingroup\$ The POT will also, for some LED's, change the colour of emission. Often it isn't noticeable, but it can matter for some applications. \$\endgroup\$
    – Lucas
    Commented Jan 20, 2013 at 2:21
14
\$\begingroup\$

Yes, you can. David isn't wrong that if you just had one variable resistance in series with the resistor, adjusting it wouldn't seem very linear in relation to perceived brightness. But if you introduce some resistors in parallel, the picture changes:

schematic

I tested these values with a red LED and it works pretty great. You could do all the math, but really it's just easiest to stick it on a breadboard and play with the values until you get the response you want. This works because as the current through the parallel combination of R2 and D1 increase, the dynamic resistance (that is, the resistance you would figure based on ohm's law at the voltage and current observed an one point) of D1 decreases, and it steals more current away from R2. Think of them like parallel resistors. The relationship isn't exactly logarithmic, but it's close enough no one can tell with unaided eyes.

You can also do pretty well just connecting the diode between the wiper of R1 and ground, and putting R1 across the power rails. Effectively, half of R1 becomes R2. The problem here is that at the low range of the pot's travel, the voltage at the wiper isn't high enough to turn the LED on at all.

I didn't worry about R1 going all the way to zero because most pots don't do that. Test your pot and add another \$180\Omega\$ or so in series with R1 if it's a problem.

\$\endgroup\$
1
  • \$\begingroup\$ I just simulated this TINA TI free and find it really interesting how this works. I plan to use this method to tweak LED current using a potentiometer. I added a dropping resistor in series with the LED to absolutely limit the current and I like how I can now safely control the current without the power exceeding safe limits for the pot. Thanks for this. \$\endgroup\$
    – BartmanEH
    Commented Feb 14, 2016 at 19:37
10
\$\begingroup\$

I just happened to have drawn an adjustable brightness LED driver that does use PWM. Maybe overkill, but it does work nicely:

enter image description here

3V is below spec for the NE555, but it does work anyway. Pick a CMOS 555 variant to get around this, or use more than 3V.

The interesting thing about this circuit is that, at least in theory, it is more efficient than driving an LED through a resistor. A resistor converts excess voltage into heat, but by using an inductor you can store energy at one voltage then release it at a different voltage with (in theory) no loss.

Of course this is just a proof of concept, not so carefully engineered, and almost surely far more complicated than necessary, but I thought it would be interesting to share, if only for educational purposes.

\$\endgroup\$
6
  • \$\begingroup\$ You don't need the transistor circuitry when it's a normal LED. \$\endgroup\$
    – user17592
    Commented Jan 19, 2013 at 16:10
  • 3
    \$\begingroup\$ @CamilStaps He is actually showing how to make a higher efficiency buck for controlling and has a dimmer control. It seems applicable, but not for the user who asked, maybe for many others. \$\endgroup\$
    – Kortuk
    Commented Jan 19, 2013 at 16:34
  • \$\begingroup\$ I know, and it's a good solution. But you can also use the 555 without the transistor, by connecting the LED directly to OUT. Does this, with transistor circuitry on pin 3, use fewer current than when connecting the LED directly to pin 3 of the IC? \$\endgroup\$
    – user17592
    Commented Jan 19, 2013 at 16:46
  • \$\begingroup\$ @CamilStaps: the transistor is necessary in this application because the 555 output will both sink and source current. If the 555 were connected directly to L1 and D1, then its output would be fighting to drive the inductive load. You could get rid of L1 and instead put a resistor in series with D1, then drive it directly with the 555, but that wasn't the point of this circuit. Or, if the 555 had an open collector output, it could be made to work without an external transistor. \$\endgroup\$
    – Phil Frost
    Commented Jan 19, 2013 at 18:20
  • 1
    \$\begingroup\$ @CamilStaps you are right, and it is easier, but that's not the point. A resistor works by converting excess power to heat. An inductor stores it, then releases it into the LED. In theory, this circuit is more efficient. I haven't measured the efficiency of this circuit, so I don't know if it actually is, but the concept is sound, and with proper design, efficiencies can be in excess of 90%. \$\endgroup\$
    – Phil Frost
    Commented Jan 19, 2013 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.