Home -> Reference -> How to light an LED

How to light an LED

How to light an LEDSo you want to cast a lighting spell without having to study for a degree in electronic wizardry? If so, this article by Chris Gosling is for you.

Basic circuit

At its most basic all you need is:

  1. an LED of the size and colour you want

  2. a battery (or other power supply)

  3. a resistor

  4. some small gauge (thin) wire to connect it all together.

Note that your power supply could be two or more batteries in a holder or even a power adapter with a DC output. You will also want to be able to switch the circuit on an off but at its simplest, this can be done by disconnecting the battery/supply.

For tools you need:

  1. a low wattage soldering iron (15-25W)

  2. a pair of wire strippers/cutters.

  3. some Rosin Core Solder (NOT Acid Core!)

The following image (supplied by djconfirmed of Sci-Fi Lookout Tower fame) illustrates how it all goes together.

How to light an LED How to light an LED

Care and Feeding of LEDs

LED stands for Light Emitting Diode and while the bit we really care about is the 'light emitting' part it's important to know that a diode is a device that allows current to flow in only one direction. Thus you must have it the right way around for it to work, but we'll come back to that shortly.

You also need to be aware that LEDs do not like to get hot, which is why you must use a low wattage soldering iron and not that big ol' gun that you use for plumbing. There are many good tutorials available on the Internet to help you learn how to use it, so we won't cover it here. Just remember that keeping it in contact with the LED for longer than you need to can damage the LED.

Resistance is NOT Futile

Heat is also generated by electricity and the more current that flows through something, the more heat it generates. While this might be a good thing in a hotwire cutter it's not so good in an LED. Obviously you have to let some current flow for it to light up, but you have to make sure that it doesn't get too much. This is the purpose of the resistor in the circuit: it limits current flow, keeping it cool enough to have a long happy life.

It's worth being aware that some people will tell you that you can 'get away' with not using a resistor and it's true that sometimes you can get away without a resistor for quite a reasonable length of time before the LED is destroyed. We say: spend the extra few pennies on a resistor to ensure that the light in your terrain piece goes on working for a long, long time.

How to Identify Polarity

We said earlier that there is a right and a wrong way around for an LED and as a picture is worth a thousand words, here you go:

How to light an LED

While we're here, I've shown with a red line, the part we can file, sand and shape to our hearts content. As long as we don't get too close to the little bits inside that make the light, it'll still work.

To tell + from - we normally go by lead length, but if your LED was salvaged from some broken thing you found, and the leads are both the same length, you can use the flat edge on the LED. If you LED doesn't have a flat edge, try looking to see which one is attached the bigger piece inside. If that doesn't work just try it both ways, if you have a resistor in place you won't damage the LED by doing a quick test.

Note that the resistor does not have polarity and can go either way around. The resistor can also go on either the positive or negative side of the LED. It really doesn't matter which side just so long as it's there.

The Magic Formula

A blue LED sits at the heard of Andy Slater's Alien ArtefactWhenever we work with electronics there's always a formula that looks like something out of a wizard's spell book. Fortunately the one we need to calculate the value for our resistor is quite simple and needs just four values:

R is the perfect resister value in ohms.

VS the voltage of your batteries or transformer.

VF is the voltage drop for your LED.

IF is the current rating for the LED (in Amperes).

And here's the formula:

R = ( VS - VF ) / IF

To put it another way: we're subtracting the voltage needed by our LED from the voltage being supplied to calculate the part of the voltage that the resistor had to deal with. We then divide the resistor's share of the voltage by the current that we need to allow through to light the LED. This result is the value that we need for our resistor.

The formula would look simpler if we just used a single letter for each of those four values but we'll do them like this because you'll need to know about those things when you go shopping for the parts. So in a little more detail:

The 'Secret Ingredients'

How to light an LEDVS This stands for Supply Voltage. In other words, how many volts are you giving the circuit to work with? If you have two 'AA' batteries stacked end to end that is 3V. If you are using a wall transformer that is marked 'Out 12 vdc' then you are using 12V.

VF This stands for Forward Voltage and is the amount of voltage that your LED needs to make light. If you buy your LED in a package from a store like Radio Shack, this will probably be printed on the card they come on. If you get them from a more industrial place, you can ask the staff member. If you are salvaging them from broken things like video game controllers and such, we will cover guessing later on. The units are going to be in V (Volts). It will look something like this: VF = 2.0V on the package.

IF This stands for Forward Current. This is the amount of current that makes our LED happiest. Less and it gets dim, too much more and it burns out. Once again, it should be on the package, the staff can tell you, or we can guess. The units are going to be in mA (milliAmperes), which is important to note because the formula wants Amperes. 1 Ampere = 1000 milliAmperes, so we have to move the decimal place 3 spaces to the left. So if the package looks like this: IF = 20 mA, and we nod to ourselves and move the decimal so we get 0.020 A. They can't fool us with their tricky labelling!

R Plain old boring R, kind of a let-down really, just means Resistance. Bigger numbers resist the flow of current more (get it?). It's measured in Ohms and sometimes they stick 'kilo' in front of when you need thousands of them (1 kiloOhm = 1000 Ohms). The formula will give us the value in Ohms, and we probably only need a couple hundred in the type of circuits we are dealing with here.

Another value that's worth being aware of is IMAX because even though we don't use it in our formula, you'll see it on the packaging when you go shopping and it tells you the Maximum Current that the LED can handle. Although there are a few geeky TechnoMage applications where you might want to make an LED work that hard, we really want to stay under this number so that our LED has a long and happy life. Again the units are in mA (milliAmperes).

Educated Guesswork

If you are buying your components specially for the job then you can find out the various values at the shop. But what it you've got a whole pile of salvaged LEDs, or a special offer pack of 50 assorted colours and shapes? In those instances, we guess:

A blue LED sits at the heart of Andy Slater's Alien ArtefactIf your LED is:

Red, Yellow or Green you can guess VF is 2V and IF is 20 mA with IMAX at 23 mA

Blue or White you can guess VF is 3.5V and IF is 20 mA with IMAX at 23 mA

Note that LEDs come in a lot of different flavours, and even an electronics wizard will sometimes guess wrong and kill an LED. Don't take it too hard if you get it wrong. If the LEDs were salvaged and you have more of the same type, guess again with at a lower value for IF e.g. 10mA, and give it another shot. Most of the time you will be close enough.

Also note that if the plastic of the LED is a really dark red, the LED may be an Infra Red LED. You cannot see infra red (as used in things like TV remote controls), so if you can't make it light up no matter what, just toss it and try another one.

Finally, before we leave the subject of guessing: if the LED is going to be encapsulated for eternity in a masterpiece of terrain making: buy an LED so you can be sure of the values.

Back to the Formula

To recap:

VS the voltage of your batteries or transformer.

VF is the voltage drop for your LED.

IF is the current rating for the LED (in Amperes).

R is the perfect resister value in ohms.

And our formula is:

R = ( VS - VF ) / IF

Now as an example, lets say we're using a 9v battery and a red LED that requires a 2v forward voltage and draws 20mA. If we insert those values into our formula we get this:

( 9V - 2V ) / 0.02A = 350 Ohms

Easy huh?

Obtaining The Resistor

Mark used a single red LED in each of his lava poolsNow before we rush off to the shops for a 350 ohm resistor, there's a catch: we will probably have to get one that's merely close to the value that we've calculated because they only make them in so many different values.

A quick browse around your favourite on-line electronics story will show you what's available and as it turns out, the closest available values to the 350 that we've calculated are 330 and 360 ohms. But which should we use?

Well if you don't want to do any more maths then the simple solution is to always choose a value that is higher than the value that you calculated. This will result in the LED being very slightly dimmer than it would with the ideal value, however it will be protected. If you use a lower value it will be brighter but is also at an increased risk of being damaged.

Depending on how much higher your LEDs IMAX is than it's IF value, this might not be much of a risk, and in fact the additional maths needed to check isn't and more difficult than our previous formula. It is in fact a simple rearrangement of the same parameters:

IF = ( VS - VF ) / R

The values are the same as the ones we used before but this time we are using VS, VF and the R that we're thinking of using to calculate IF to find out what current will actually flow if we use that resistor.

How to light an LEDFirst of all, let's do it for the 330 ohm option:

( 9V - 2V ) / 330 Ohms = 0.0212A (21.2 mA)

The result is more than IF but less than IMAX so it should work just fine and your LED should last for 3 to 10 years of use, likely more.

And now for the 360 ohm resistor:

( 9V - 2V ) / 360 Ohms = 0.0194A (19.4 mA)

This is only slightly less than IF so it will work, but won't be quite as bright. If you want to be sure that the LED will not burn out for many, many years, this is the resistor to use.

The more observant amongst you may have noticed that the first illustration in this article used a 390 ohm resistor with a 9V battery. Assuming that the LED is like the one for which we've been calculating we get:

( 9V - 2V ) / 390 Ohms = 0.0179A (17.9 mA)

Once again, it'll work, will be slightly dimmer, but should go on working for a long, long time.

You Watt?

When you go to buy your resistor, another value that you might see is the amount of power that it can handle (measured in watts). In the kind of circuits that we are dealing with here, commonly available 0.25w resistors will be fine. If we were making circuits that that for things with heating elements, electric motors, or power amplifiers then we might need more, but not here. Another bit of maths shows why:

P = ( VS - VF ) * IF

Using values that we calculated earlier:

( 9V - 2V ) * 0.0212A = 0.1484W

As you can see, a 0.25W resistor will be just fine but it's worth understanding that the value of VS i.e. the voltage of your chosen power supply is probably the most important factor in determining the amount of power that the resistor will need to handle. If you use a power supply that's 12V or higher you'd be wise to do the above calculation to double check that a 0.25 resistor is enough.

Putting it to Use

In another article I'll go on to show you how to light several LEDs however even a single LED can make a huge difference to a terrain piece especially if used inside the piece such that the light comes out of the various doors and windows.

[Page Top] [Site Home]