I think once you’ve cracked using LEDs You’ll not go back to bulbs and wonder what slowed you down in the first place.
If you have the patience to read my ramble then let me give it a try.
The LED is similar to a bulb, the bulb has an operating voltage, the LED has a forward volt drop (Vf).
You’ve been talking about using a 9v battery, if you put a 9v bulb on it it’d be fine. Your white LED probably has a forward volt drop of about 3.6v, imagine if you put a 3.6 volt bulb on a 9v supply, it’d light, probably quite brightly, but pretty soon burn out. The LED will do the same.
So you need that resistor.
Most LEDs run at around 20mA (0.02A) so to keep it happy we want to drop about 5.4v across the resistor, leaving 3.6v for the LED while passing 0.02A.
You work out the value of the series resistor by dividing the voltage you need to drop by the current flowing, so 5.4v / 0.02A = 270 ohm
While you have the calculator out you may as well work out one last thing, if the current flowing is 0.02A and the voltage dropped is 5.6v the resistor is dissipating (as heat) 0.02 x 5.6 = 0.112 Watts.
If you use a 0.25W resistor - fine.
Now assume it’s an 18v supply
You need to drop 18 - 3.6v = 14.4v
Still letting 20mA flow the resistor will be 14.4 / 0.02 = 720 Ohm
And the power will be 14.4 x 0.02 = 0.288W so just a little more than that 0.25W resistor will be happy about so maybe use a 0.5W resistor.
<message edited by DaveB2 on 02/02/12 08:40 PM>