May 6

Calculating an LED resistor: a technical test

Setting up this website, I have certain requirements.  Superscript, subscript, equation display, logical picture display, charts, formatting that I like and presents information in a manner I think works1.  This is the useful test post to evaluate all of these capabilities.  The subject below is covered in several other places on the wide wide webz.

Calculating current-limiting resistor for an LED

LED circuit
Basic LED circuit

An LED is a great thing.  It makes a great deal of light with relatively little heat and over a long life.  However, LEDs are also a bit more sensitive to power requirements and more easily damaged than other indicators and/or illuminators6.  LEDs require a minimum amount of voltage before they will turn on, producing any illumination, and have a maximum amount of current they can tolerate before their lifespan is degraded (or they fry; I consider this a notable degradation of the expected life of the product).

Refer to the diagram to the right.  An LED is a diode; as such there is a voltage threshold below which no current will flow and above which current will.  This forward voltage drop of the diode, defined as Vf, varies depending on the type of LED used2.  Once voltage exceeding the forward voltage is applied across the LED, current will flow.  The LED has a maximum  forward current (and/or typical, and minimum, too) given by If, where the LED will emit light of the specified intensity and frequency for the given lifetime.  If the datasheet or part spec does not indicate if this is a typical or maximum value, assume it is maximum.

Note: exceeding the maximum current level of an LED will not necessarily fry it immediately.  Too, it will be brighter.  However, exceeding it will decrease the lifespan and luminous efficiency3.

A current limiting device must be used to protect the LED.  The simplest way to limit current is to add a resistor, R, in series with the LED.

Continue reading

January 12

Toy LED Lantern

The culprit, functional now
The subject of this discussion

Lights are an impulse buy I constantly struggle against. Soooo many lovely varied options.  My young son gives me new excuses to give in to that impulse.  On the Fourth of July, I was shopping at Michael’s when I found an LED lantern in the discount bin.  It seemed sturdy enough, with good fittings and a solid-feeling switch.  So I gave in to the impulse. After all, my son will be out after dark tonight, right?  He will need the lantern.

I loaded it up with 4xAA (NiMH, but the lower voltage shouldn’t cause any performance issues) and we took it to the evening fireworks show.  The lamp was bright through the evening, and my son turned it on and off at his whim. On the way back from fireworks, however, the new little plastic lantern started flickering.  I cracked it open, expecting a loose wire, or cold solder joint – both common problems in cheap consumer goods, especially with ROHS directives and lead-free solder.  The litany of problems went far deeper than that. The three white LEDs were wired in parallel, a fair design choice.  It could have used one fewer batteries at that point, but we will let that pass.  They were current-limited by a 22Ω, 1/8W, 5% resistor, which I noticed was hot to the touch.  Very hot.

Running the calculations*, each branch of the LEDs were running at ~37mA, which is 120% of their MAXIMUM rating.  Further, the resistor was dissipating ~260mW, about 200% of its maximum rating.  As a side note, the resistor had externally visible voids and a poor paint job, indicating possibly a rejected part (aka cheaper); it did measure within tolerance, though. As it turns out, one of the LEDs was partially burned out – occasionally working, occasionally shorting, causing the whole unit to flicker.  This particular LED configuration is not fault-friendly – if one shorts, the entire set goes out; if one opens, the other two LEDs each experience half of the burned-out LED’s current in addition to their own.

Oh, also the wiring was flimsy with cold soldering and no strain relief and part of the diffuser latch was cracked.

Many parts of this product were shodding (opposite of shining) examples of the shoddy engineering and poor foresight that plagues many consumer goods, many of which could be rectified inexpensively and easily.   Using a 33Ω instead of a 22Ω resistor (1/4W) would dramatically decrease the failure rate of these products, cutting down on returned product.  The human eye is not very sensitive to differences in high light levels, and LED life sharply decreases with higher currents / overcurrent.  I would venture that the consumer of a toy lantern is not looking for a room-lighting device so much as a rugged, long-lasting device.

This has turned into something of a rant.  In the end, I repaired the lantern with some white LEDs I had on-hand and a correct 33ohm resistor. Take-away lessons:

  1. A 1/4 cent oversight/savings can be rectified with $1.51 in parts and $100 in equipment – on a $5 plastic lantern
  2. Don’t be afraid to open up a product, and do question everything. Just because it is on the market does not mean that it is correct, and price tag does not dictate quality. There are some quite elegant solutions found in cheap toys, as well as appalling oversights.
  3. When buying cheap toys, don’t loose your receipt. You can’t take it back, and then you have to fix it.  :)

* Simple LED current-voltage calculations for single and paralleled configurations, derived from Ohm’s Law and Kirchhoff Current Laws A single LED driven by a voltage source and with a current limiting resistor is defined by the following equations:

I=\frac{V_{s}-V_{f}}{R}       OR       R=\frac{V_{s}-V_{f}}{I}

  • Vf is the forward voltage drop of the LED (a characteristic of the LED based on its color) [volts]
  • Vs is the voltage source [volts]
  • R is the value with a current limiting resistor [ohms]
  • I is the current through the branch (from the voltage source, through the resistor and the LED) [amps]

Given the forward voltage (available on the datasheet or package for the LED, or here) and the maximum continuous current (again, datasheet or package), you can determine the resistor needed, rounded to the next largest standard resistor value. With this information, LEDs wired in parallel (all anodes tied together and all cathodes tied together) being limited by a single resistor would be described by:

I_{LED}=\frac{V_{s}-V_{f}}{R \cdot N}       OR       R=\frac{V_{s}-V_{f}}{I_{LED}\cdot N}

with N being the number of (identical) LEDs wired in parallel.  ILED now only describes the current through a single LED. The calculations above were used with the assumptions of Vf=3.6V, ILED=Imax=30mA for LED characteristics, which are typical for a white “superbright” type LED.