Like the bearing size code, resistor values for LEDs is something that I keep needing to work out, or just go back to my nominal somewhere between 200 Ω and 1 kΩ rule of thumb. The Vf on the chart below is also fairly rule of thumb, but in general, without looking at the datasheet for a specific LED, these values are a good place to start.
While I could work it out every time I need it, using the equation:
Resistor = (Supply Voltage – LED voltage(Vf)) / desired LED current(If)
And then chose the nearest common resister value. I have just assembled the following table:
| If 20 mA | If 10 mA | If 5 mA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Colour | Vf | 3V3 | 5V | 12V | 3V3 | 5V | 12V | 3V3 | 5V | 12V |
| Red | 1.7V | 82Ω | 180Ω | 560Ω | 180Ω | 330Ω | 1k2Ω | 330Ω | 680Ω | 2k2Ω |
| Orange | 2V | 68Ω | 150Ω | 560Ω | 150Ω | 330Ω | 1kΩ | 270Ω | 680Ω | 2k2Ω |
| Yellow | 2.1V | 68Ω | 150Ω | 560Ω | 120Ω | 330Ω | 1kΩ | 270Ω | 680Ω | 2k2Ω |
| Green | 2.2V | 56Ω | 150Ω | 560Ω | 120Ω | 330Ω | 1kΩ | 220Ω | 560Ω | 2k2Ω |
| Blue | 3.2V | 5.6Ω | 100Ω | 470Ω | 10Ω | 180Ω | 1kΩ | 22Ω | 390Ω | 1k8Ω |
| White | 3.2V | 5.6Ω | 100Ω | 470Ω | 10Ω | 180Ω | 1kΩ | 22Ω | 390Ω | 1k8Ω |
All of the above resistors can be 1/4 W resistors; most values will work on 1/8 W resistors, however, I only stock 1/4 W.
The values for series resistors for Blue and While LEDs when running off a 3.3V supply need to be checked, since the Vf of these LEDs is typically around 3.2V, which leaves only 100 mV across the resistor. As the Vf can vary quite a bit from device to device, as well as by temperature, there will be a LOT of variation in diode current…
If you are doing anything more than prototyping, I would recommend getting the data sheet for the LEDs you are using and testing it out on a breadboard before you commit to PCB layout, and take that time to work out the best value of a resistor for your needs.
I made these Breadboard LEDs previously with all the same 560 Ω value resistors, which, as you can see from the above chart, is set for 20 mA forward current at 12V and between 5 and 10 mA at 5 V, so that one value can be used on a very wide band without causing long-term damage to the LED.
If I wanted to make the LED appear dimmer, I could have used a higher value resistor.