LEDs (and, to be honest, most other diodes) exhibit a peculiarity called "negative temperature coefficient of resistance." In English? An ordinary conductor (like a piece of wire) shows an increasing resistance to current as its temperature increases. Pass a current through it, and the temperature increases, the resistance increases, the current decreases
, and the conductor stops getting hotter.
Pass a current through a diode junction, and the junction heats up, the resistance decreases
, the current increases
, the temperature
increases, the resistance decreases, the current increases, the temperature increases, and then the diode releases its magic smoke and the current drops to zero, never to rise again.
Put a resistor in series with the diode, and the current through the diode will be exactly equal to the current through the resistor, and that current will never
be greater than
I = V / R
where V is the voltage across the diode-resistor pair. That's why that resistor is sometimes referred to as a "current-limiting" resistor.
The data sheet for a LED will have two numbers of particular interest to us: the forward voltage VF
, and the maximum averge forward current IFmax
is the maximum continuous current the diode can carry without risk of damage, and is typically around 20mA. VF
is the maximum voltage that will appear across the leads of the LED (until you roach it), and is typically in the range of 1 to 3 volts. Even if the diode is connected by itself, directly to the voltage supply, the voltage across the leads (and the voltage across the supply's terminals) will not exceed VF
. Connect a diode with VF
= 2V to a 12V battery, and the voltage across the battery's terminals will drop to 2 volts. (Just for a moment; then you get smoke, and then the voltage jumps back to 12 volts.)
To choose a resistor, you need to know Vin
(the voltage that will be powering the circuit,) VF
, and IFmax
(in Amperes; if it's given in milliAmperes, divide
by 1000.) Then plug everything into the formula
R = (Vin – VF) / IFmax
to get the required resistance in Ohms. Add 5% or so, just to be safe, then buy the smallest resistor larger
than your calculated value.
happens to be a large value, you'll also need to watch the power rating on the resistor. Make sure that the power (Watts) rating on the resistor is larger than Vin
; otherwise you risk having the resistor
release its magic smoke and stop working. Most of the time, though, a typical quarter-Watt resistor should suffice.
I do hope that was at least moderately understandable, and that someone finds it to be of use.
Prof. Darwin Prætorius von Corax, Executive Director & Lead Researcher
The Leverkusen Institute of PaleocyberneticsEDIT 4 Feb 2009: reformatted formulæ for readability