Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to [email protected]or drop us a line on Twitter. We can’t wait to tackle your conundrums!

Bjorn writes in:

I’m wondering if you could help me out with resistors. I’m a computer science guy and am very new to electronics. Most of my resistor usage in my experimentation has been because I read about situations when I should use them online and just used a specific resistor because it was recommended. Obviously this only gets me so far. How do you go about determining what level of resistance you need and when you should or need to use resistors? I didn’t know I was supposed to be hooking up LEDs to my Arduinos with resistors until I started burning out LEDs and read somewhere what type of resistor someone recommended. I know it has to do with the Arduino running at 5V and most LEDs being lower voltage, but how do you know what voltage an LED is if it’s not labeled? And more importantly (like my question above), even if you know what voltage and LED is how are you supposed to figure out what kind of resistor to use?

Sure thing! This question actually comes up quite a bit, and it’s a good thing to understand.

Putting a resistor in series with an LED limits the amount of current that can flow through it, preventing it from blowing up. It’s nice to be able to figure out an exact resistance to use, but if you aren’t too worried about your light being a bit dim, you can always just stick in a largish resistor, and you will get some light. For instance, if I am making a prototype circuit and just want an indicator light that I can control from an Arduino, I’ll grab a 220 ohm resistor and put it in series with the first LED I can find. It’s probably fine for a quickie circuit, but if you are soldering up a project that you intend to keep around, it’s probably a better idea to actually calculate the correct amount of resistance to use.

Unfortunately, this only helps if you know the forward voltage and current rating of your diode. So, how can one figure those out? You can make an estimate abut the forward voltage of the diode based on it’s color, because the wavelength of the color and the forward voltage are roughly inversely proportional to one another. Some typical forward voltages are: Red:1.8V, Green: 2V, Blue: 3.4V. Once you have an estimate, you can measure the forward voltage of your LED by hooking it up with the suggested resistor value, and measuring the voltage across it. Then, if you were way off, you can re-calculate the resistance with the actual voltage to get a better result.

Once you know the forward voltage drop, you can choose a current value based on how bright you want the LED to be, as long as it is lower than the current rating of the device. Unfortunately, it’s a little bit harder to figure out the current rating, because most LEDs will continue to operate at higher than the recommended amount. If they are, though, their lifetime will be much shorter, and they won’t be as efficient at producing light. If you don’t have the specifications for your LED, 20ma is probably a safe maximum.

If you don’t feel like solving all of that by hand, or have a more complicated design involving multiple LEDs, you could also use an online LED calculator. This one looks nice, because it will also tell you how to hook up multilple LEDs.

Ok, enough calculations. This is what can happen if you don’t connect the LED up properly:

When you don’t use the dropping resistor, at least some times you can hear them. :-)

John Park

Great post Matt. Erick, that made me laugh out loud.

Anonymous

We always called it ‘letting out the magic smoke’ – which obviously applied to more than just LED’s… I did see part of a PIC18F go flying through the air when one of my friends mistakenly assumed that the 5 volt output from a USB port was equivalent to a 5 volt output from a power supply… oops.

Before LED’s were common small neon bulbs were often used for indicators. I bought a ten pack at the Shack for a buck, went home, and plugged the bare wires of one into a 120 volt outlet. After all, it was rated for 120 volts. I didn’t know about the need for a current limiting resistor. I can still see, hear, and feel the explosion.

jammit

A close approximation of the resistor needed for an LED is to use 100 ohms per volt. For 5 volts, use a resistor close to 500 ohms. If the LED has a 1.7 volt drop, that leaves 3.3v for the 500 ohm resistor. Ohm’s law then tells us the circuit is drawing V/R=I, or 3.3/500=6.6mA. This is fine enough for an indicator. Higher voltages are more accurate. 100V, 10Kohm with a LED drop of 1v is 9.9mA, with an LED with a 5v drop the current is 9.5mA. 12V, 1.2Kohm gives about 10mA for almost any LED. The only problem with this resistor shortcut is that the supply voltage has to be greater than the LED drop.

http://pulse.yahoo.com/_4HDTB5U4HKVEIAE2EHR5GVWNAU KentW

So “voltage drop” is “forward voltage” is “voltage across it”? Thanks!