LED Calculations

LED Calculations | General Electronics LED_image

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.

typical_LEDs

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:

circuit_2

V_s = V_f +V_R; ; where; ; ; ; (Eqn; 1)

 

V_S = source; voltage
V_f = LED; forward; voltage
V_R = voltage; drop; across; resistor

The source voltage is the voltage supplied by the battery or microcontroller port.

Using Ohm's Law, VR can be calculated:

V = IR ; ; where; ; ; ; (Eqn ; 2)

I = current; in ; Amps
R = resistance ; in; Omega

Combining equations 1 and 2:

V_s = V_f +IR; ; ; ; (Eqn; 3)


Rearranging equation 3 yields:

R = frac{ V_s-V_f}{I}; ; ; ; (Eqn ; 4)



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:

R = frac{V_s - V_f}{I} = frac{5 - 2}{0.010}= 300Omega


The closest standard resistance value can be selected from a resistor table.

Calculations for Undocumented LEDs

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.

Typical I-V curve(click to enlarge)

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.

Practical Method

Practical Discovery

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.

potentiometer-led

OHMs Law + LEDs

OHMs Law + LEDs

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.

R = frac{ V_s-V_f}{I}; ; ; ; (Eqn ; 4)

Earlier the equation was used to calculate the resistor at 10mA. If you are willing to trade off brightness for low current (say 5mA), then plug in the values and recalculate for R.

The 'Right Way'


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):

  • On the LED’s V-I curve, see the LED voltage at that current.
  • Subtract that voltage from the supply voltage
  • Divide that difference by the desired current: that’s the resistor value

calculate-resistor

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:

  • Divide the supply voltage by the resistor value, to get the max current
  • On the LED’s VI graph, extend the X-axis to the left to 0 V, and to the right to the supply voltage
  • On the Y-axis of the LED’s V-I graph, , mark the max current
  • On the X-axis of the LED’s V-I graph, , mark the supply voltage
  • Draw a line between those 2 points
  • Mark the intersection between this line, and the LED’s V-I curve: that’s the operating point
  • The current of that intersection, is the LED current

Resistor Power Dissipation

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:

P = (V_R)I; ; ; ; (Eqn ; 6)

Using Ohm's Law and substituting for the voltage across the resistor:

P = (IR)I = I^{2}R; ; ; ; (Eqn ; 7)

Considering the first example from above:

P = I^{2}R = (0.01)^{2}(300)= 0.03: watt; ; ; ; (Eqn ; 8)

For the example, even a 1/16 watt resistor will handle the power dissipation.{/slides}

LED Polarity

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.

LED_Polarity


Please feel free to leave comments and ask questions below.

Share this article

Tags: General Electronics, LED