I’m working my way through some beginner content around the internet and found my way here. How do I figure out what I should be using for a resistor value for an LED? Can I just use any value?
The math (or maths, depending on your continent) is pretty short and simple, but as long as your voltage is 5V or less I usually start with a value around 300 ohms as a guess. However, I’m somewhat lazy and have found an iPhone app that takes all the bother out of this - it’s Adafruit’s Circuit Playground. Specify the color of your LED, your voltage, what current you want (usually less than 20 mA), and it will tell you the exact resistor value and the closest “standard”, easy-to-find resistor size.
As for the math, it’s
R = (Vsupply - Vled) / I
where Vsupply is your project’s supply voltage (frequently 3.3V or 5V),
Vled is the voltage drop across the led (somewhere around 2.1V depending on the color),
and I is the current you want (0.020 A is really bright, 0.002 A is pretty dim)
If you are using a voltage higher than 5V you probably need a larger resistor.
This is a great explanation, thanks Alan. I normally assume a slightly lower drop, but it can be viewed on most datasheets for LEDs. Here’s an example from this page:
2V is a good rule of thumb though, if the drop is lower, the LED will just end up a bit brighter. Also note that the LED forward drop is at a particular current. This is a tricky concept for most beginners, but you should use it instead as the “optimal” brightness that the part can do. So if you want to get the most out of this LED, plan for 20 mA.
What is the relationship to brightness? Can I tell how bright the LED will be with this calculation?
@Getoctords I think this is an age old question. The datasheets mostly indicate a forward current of around 20mA. I have found this to be much brighter than I ever really need, especially since my LEDs are more for indicators or to help with troubleshooting. Recently I have taken a different view and ask the question “How much do I want my project to draw?”. In my last board, I tried limiting this to 5mA per LED. The brightness is still very acceptable - with exception the the green which could be a little brighter.
Steve brings up a good point. Different LEDs have different brightness, simply because of the physics involved and how the human eye perceives output. The first line of defense is the datasheet…the ultimate test is seeing it on a board though.
I probably don’t do this the best way. I start with 220 or 330 ohm resistors. If too bright, I increase resistance until it suits my needs. I am generally working in 3.3v or 5v systems today.
Boy, that gets me thinking I should have used 220 instead of 200 for the “Shine on you crazy Kicad” board, espcially after the discussion about R3,6,9,12, etc. Ah well.
The brightness is determined by the Luminous Intensity which is usually stated on the datasheet as it is on the above example. This gives the brightness at a specific current, which represents the efficiency of the LED, in this case typically 12.6 mcd at 10 ma. To determine what the brightness will be at different currents there is usually a chart that shows how the luminous intensity changes relative to the current. On the full datasheet for this LED this chart is provided at the bottom of page 4. The values for luminous intensity are normalized for 10 ma. You can see that a current of 20 ma will cause the brightness to be 2.5 times what it is at 10 ma, and a current of 30 ma gives a brightness four times what it is at 10 ma. This luminous intensity is usually adjusted to compensate for the human eye response. So even if the absolute brightness of 12.6 mcd does not mean much to you it can still be used to make relative comparisons to other LEDs regardless of color. You can then use this information to calculate the necessary currents to get all of your LEDs the same brightness. Of course, as always, there is a tolerance for the brightness and this too will be specified on the datasheet.
Edit: I should also mention that the viewing angle also plays a role. If two LEDs have the same luminous intensity but one has a larger viewing angle, the one with the larger viewing angle will be brighter. It is not a linear relationship but calculators are available online.
Also, don’t confuse luminous intensity with luminous flux.
I have a variable resistor with lead soldered onto it. I usually just measure current and look for a suitable intensity.
That can be a good idea…as long as the low end of the resistance spectrum doesn’t allow the LED to get overloaded
I’ve though about building a couple of pots, serial connection, into a box and having terminals to quickly add a fixed value ‘safety’ resistor for just such cases. Haven’t done it yet though.
Its very general question for a beginner to find the resistor value to glow an LED. Thumb rule says that you can use 220 or 330 ohm value resistor for normal LED like this one:
Generally a LED consumes 20mA (0.02A) current and has a voltage drop of 2.5 volt so as we know R = V/I ; so resistor value will be like
(9 - 2.5) / 0.02 = 325 ohm ~ 330ohm
You can try few more values for your LED, you can check Datasheet of your LED to find the current and voltage ratings. There are lot of Ohms law calculator available online if you dont want to that calculation manually: