LED Calculations | General Electronics

This article was written with contributions from Jon Chandler, Graham Mitchell and Davide Andrea. Please review author's comment here.
LEDs require a resistor to limit current through the LED. Calculating the required resistor can seem like a mystery but it's very simple, even with LEDs of unknown types.
A basic LED circuit is shown below. It might be powered by a battery or a microcontroller port pin. The resistor controls the current flow through the LED; the current flow is the same through the entire circuit, as indicated by the red line.
LEDs serve a variety of roles from panel indicators to powerful arrays that light up the night. This article covers small LEDs that might be used as indicators in a microcontroller circuit or flashing elements in fantastic art project. Generally, LEDs in this range typically draw up to 25 mA. For high-power LEDs specialized driver circuits are usually used. LEDs come in a wonderous range of shapes and sizes - some common packages are shown here.
LEDs of this type are typically rated to draw 10 mA - 20 mA. The required series resistance will depend on the supply voltage, the voltage drop across the LED and the desired current. The voltage drop (Vforward) across the LED depends on the LED chemistry, the current through the LED and the temperature. For standard red, yellow and green LEDs, Vf is usually around 2 volts which serves as a good starting point for these calculations. To calculate the required resistance, basic circuit analysis results in the following relationship:
The source voltage is the voltage supplied by the battery or microcontroller port.
Using Ohm's Law, VR can be calculated:
Combining equations 1 and 2:
Rearranging equation 3 yields:
Suppose a standard red LED is to be operated from a microcontroller port pin operating at 5 volts and the rated LED current is 10 mA. For a typical red LED, assuming Vf = 2 volts will be close enough. From equation 4:
The closest standard resistance value can be selected from a resistor table.
See LED Calculations - The Lab Section for real-world tests of the following techniques.
The above calculations are based on knowing Vf . For standard brightness red, yellow and green LEDs, a Vf of 2 volts is a safe assumption. For high-brightness LEDs and other colors of LEDs, Vf can range from 1.8 volts to 3.5 volts or higher as shown in the table below.
| Color | Material | Wavelength (nm) | V-forward |
| Super Red | GaAIAs | 660 | 1.8 |
| Green | GaP | 565 | 2 |
| Red | GaAsP | 635 | 2 |
| Red | AlInGaP | 636 | 2 |
| Orange | AlInGaP | 610 | 2 |
| Yellow | AlInGaP | 590 | 2 |
| Amber | GaAsP | 605 | 2.1 |
| Red | GaP | 700 | 2.1 |
| Green | GaP | 555 | 2.1 |
| Green | AlInGaP | 574 | 2.2 |
| Blue | SiC | 430 | 3.5 |
| Green | InGaN | 505 | 3.5 |
| Blue | InGaN | 470 | 3.5 |
| White | InGaN | 3.5 | |
| Green | InGaN | 525 | 3.7 |
| Green | InGaN | 525 | 4 |
| Blue | SiC | 430 | 4.5 |
If the LED is a known type, Vf can be determined from the data sheet for the desired operaing current and the needed series resistor calculated using the above equations. Below is a typical I-V curve for a family of LED colors.
If we want to operate the LED on 10 mA to get moderate brightness, the Vf for the various colors of this LED family can be read from the graph.
| Color | Red | High Eff. Red | Yellow | Green | Blue |
| Vf | 1.8 | 1.9 | 2 | 2.25 | 3.6 |
When the LED specifics aren't known, such as when the LED comes from a grab bag, the situation is a bit more tricky. As seen from the table above, color isn't a reliable indicator of Vf. Since Vf is a function of current as shown in the graph above, calculating the needed series resistance to achieve a desired operating current can be tricky. Three options for determining the LED characteristics are presented below, ranging from "close enough" to highly accurate.
Click on the following tabs to view each topc.
With the absence of a datasheet, how can you safely drive LEDs from an assortment grab bag? As shown in the chart, color isn't a very reliable indication. Using the basic circuit (a 470 ohm resistor is a safe start point), the current can be easily measured with a DVM in series with the LED. Reduce the resistor value until 10mA is generally a safe level to drive LEDs, a potentiometerwould be handy for this.

At the beginning of the article we looked at transposing Ohms law for calculating the required resistor in an LED circuit. This works fine for LEDs operating at their rated specifications. If you were to bias the LED at half forward current (to save power), Ohms law can be used to create a near accurate result.
Equation 4 allows us to calculate a resistor based on lower currents.
Given the desired current, what should the resistor value be?
As discussed by DavideAndrea, here's the method for calculating the resistor based on the desired current (you will need some additional information usually found the datasheet):

Given the resistor value, what’s the current?
DavideAndrea also described how to proceed if the resistor value is already defined and you want to know the resulting current:

The current-limiting resistor for an LED must be rated to handle the power dissipation across it, which depends on the voltage across the resistor and the current through the resistor.
Power is equal to volts x Amps:
Using Ohm's Law and substituting for the voltage across the resistor:
Considering the first example from above:
For the example, even a 1/16 watt resistor will handle the power dissipation.{/slides}
Nine tines out of ten, the following diagram will be accurate for determining LED polarity. There is the odd chance that a manufacturer does not comply.

Please feel free to leave comments and ask questions below.
No comments.
Please login first.