Thursday, January 14, 2010

LEDs and power

(Warning: longish, dry, kinda techie post)

Since I posted my LED spot light how to I've received quite a few questions, mostly about how to power them. The simple answer is there's no simple answer. LEDs don't behave like light bulbs, and powering them without damaging them requires you to take a few things into account. I'm by no means an expert on the matter, but I'll do my best to explain what I know about the way they work.

LED stands for Light Emitting Diode. A diode is a semiconductor that acts like a traffic cop on a one way street - It lets current flow in one direction, but not the other. An LED has the same electrical characteristics as a regular diode with the added benefit of - you guessed it - emitting light.

There are 2 specifications of an LED that we need to pay attention to - the current rating and the forward voltage. These represent safe values and are different for every LED. There's no specification for the resistance of an LED, because the resistance isn't constant. The amount of current that passes through an LED increases exponentially in relation to the voltage. So for example if an LED passes 1 mA (milliamp) of current at 1 volt, it would pass 2 mA at 2 volts and 4 mA at 3 volts. The manufacturer's specs are for a safe current level. The brightness of an LED isn't proportional to either the voltage or current, and the manufacturers specs will usually give you pretty much the max brightness you will get. You might be able to squeeze a little more brightness out of one by increasing the voltage or current, but you'll likely dramatically shorten the LED's life span.

So, OK, that last paragraph was a great cure for insomnia. But how do we calculate what resistor we need? Ohm's law, baby! R = V/I. The needed resistance (R) is equal to the power supply voltage minus the forward voltage (V) divided by the desired current (I). To use the spotlights I built as an example, I have a 12 volt power supply and an LED with a forward voltage of 3.4 volts. The voltage across the resistor (V) would be (12 - 3.4) = 8.6 volts. The desired current (I) is 20 mA or .02 amps. So, we have 8.6 (V) divided by .02 (I) = 430 (R). Since there's no standard 430 ohm resistor, we'll go up to the next standard size of 470 ohms. Easy as falling out of bed, right? Of course, that's just for 1 LED...

There are 2 ways you can wire LED's - series and parallel. Parallel circuits have all the positive leads connected to the positive lead of the power source and all the negative leads connected to the negative.




Series circuits have the power supply connected to the positive lead of one LED, and the negative lead of that LED connected to the positive lead of the next LED and so on, with the negative lead of the last LED in the circuit connected to the negative lead of the power source.





I chose to wire mine in parallel because for my setup it offers the most flexibility. I can add as many lights as I want as long as I don't exceed the amperage rating of my power supply. In a parallel circuit amps are king. The supply voltage requirement remains constant, but you need to add up the amperage draw of all the lights on the circuit & make sure you don't exceed the output capability of your power source. (I wouldn't recommend loading your power supply to the max - try to stay below 80% of the rated current.) In a series circuit, the current draw remains constant but the cumulative forward voltage can't exceed the supply voltage. For example, 3 LEDs each with forward voltages of 3.4 volts could be run in series on a 12 volt supply (3.4 * 3 = 10.2) but 4 couldn't (3.4 * 4 = 13.6). Current limiting resistors are still necessary in both series and parallel circuits. The calculations are the same, but you have to use the cumulative values. 3 of the example LEDs in series would need a 90 ohm resistor. A 12 volt supply voltage minus the cumulative forward voltage of the LEDs of 10.2 volts divided by 20 mA (12 - 10.2)/.02 = 90. The same 3 LEDs in parallel could use a 150 ohm resistor. 12 volt supply minus 3.4 volts forward voltage divided by the cumulative current of 60 mA (12 - 3.4)/.06 = 143.33333. The beauty of the parallel circuit is that you can use one resistor per light and not have to worry about recalculating your resistor values every time you want to add or remove a light.

Of course you could save yourself a bunch of trouble and just use one of the many online calculators... :)