For every LED, in order to use it properly, we need to know the Forward Voltage. What is this forward voltage? Lets explain it in a photo:
In our three-piece circuit, we have the battery (which generates voltage) and the resistor+LED (which uses up the voltage). I will now tell you a very key 'law' of electronics:
In any 'loop' of a circuit, the voltages must balance: the amount generated = the amount used
This "Voltage Loop" law was discovered by a fellow named Kirchhoff (thus it is called Kirchhoff's Voltage Law = KVL). And we can see the loop above, where one part is made of the +9V battery. The other half must use up the +9v (making it -9V so that both halves of the loop equal out).
So what does this have to do with the Forward Voltage of an LED? Well, the Forward Voltage is the 'negative voltage', used by the LED when it's on. Kinda like a 'negative battery'! So lets modify our diagram slightly.
Whenever the LED is on, the voltage it uses it up is somewhere between 1.85V and 2.5V. We'll say 2.2V for average - that's a good assumption for most red, yellow, orange and light-green LEDs. If we subtract that from 9V we get about 6.8V left. This is the voltage that must be 'absorbed' by the resistor.
Let's say we have the same circuit above, except this time its a 5V battery and an LED with a forward voltage of 2.5V, how much voltage must be 'absorbed' by the resistor?
Voltages Generate = Voltages used, so 5V = 2.5V + ResistorVoltage. The voltage across the resistor is 2.5V.
Let's say we have the same circuit above, except this time its a 5V battery and an LED with a forward voltage of 3.4V, how much voltage must be 'absorbed' by the resistor?
Voltages Generate = Voltages used, so 5V = 3.4V + ResistorVoltage. The voltage across the resistor is 1.6V.
What is interesting about the law we just learned (KVL) is that in no place do we use the resistance
of the resistor. It never shows up in the equation. Yet from our previous experiements we know for a fact that changing the resistance affects how bright the LED is. There must be something else going on, lets keep working on understanding the details….
Next we're going to throw in another important law. This one is called Ohm's Law- and it describes how resistors work.
Voltage across a resistor (volts) = Current through the resistor (amperes)* The Resistance of the resistor (ohms)
There's a more common shorthand notation which you'll see very often:
V = I * R
Or the two other ways of writing to solve for current or resistance:
I = V / R
R = V / I
The V is for voltage, the R is for resistance and the I, confusingly, is for current. Yeah, that I is a little annoying isn't it, since theres not even a single I in the word current? Unfortunately, there are 100 years working against us here, so just bear with us on that one.
If I have a 3 ohm resistor (R) with a current of 0.5 Amperes (I) going through it. What is the voltage (V) across the resistor?
We'll use the V = I * R form of Ohm's Law. V = 0.5 A * 3 ohm = 1.5 Volts.
Now I have a 1000 ohm resistor (R), and a voltage across it of 6.8V (V), what is the current (I) going through the resistor?
We will use the I = V / R form of Ohm's Law. Current = 6.8 V / 1000 = 6.8 milliAmps.
Ohm's law is very important and its worth drilling a bit to become familiar with it. We suggest coming up with other mix+match numbers of resistances, currents and voltages and using them to solve for the unknown value. If you're working with a friend, quiz each other and check your answers! There are also 'calculators' online you can check yourself against.
Solving for the current
We'll now combine both KVL and Ohm's Law with our diagram. Our LED is connected to a 1000 ohm resistor (you should verify this by checking the resistor color stripes!), and the voltage across that resistormust be 6.8V (the law of KVL) so the current through that resistor must be 6.8V / 1000ohm = 6.8 mA (Ohm's law).
Our diagram is getting a little dense, but we're pretty much done. The resistor current is 6.8mA and that current is also going through the LED, so the LED current is 6.8mA. "Big whoop," you may be saying. "What do I care about the LED current?" The reason you should care is that:
The amount of current (I) going through an LED is directly proportional to how bright it appears.
Aha! Finally, the last piece of the puzzle. If we increase the current, the LED will be brighter. Likewise, if you decrease the current, the LED will be dimmer. By picking the correct resistor, you have full control over how the LED appears.
Whenever using an LED, make sure to always have a resistor! The resistor limits the current, which will keep the LED from burning out!
Most of the time, you'll want to have a really bright LED so you'll be calculating the smallest resistor you can get away with and not damage the LED. But note that the more current used by the LED, the quicker you'll drain the battery. So there are good reasons for wanting to control the brightness if say you have a small battery and you want the lights to last a long time.
Since as we have seen, too much current will make the LED go poof, what is the best amount of current we should use? For some very big 'power LEDs', the current can be as high as 1 or 2 Amperes, but for pretty much every 3mm, 5mm or 10mm LED, the amount of current you're expected to use is 20mA. You can see this in the datasheet we talked about earlier. See the right-most column? IF is the Forward Current (I) and they use 20mA.
For 99% of LEDs you will encounter, the optimal current is 20 milliAmperes (0.02 A) but don't be too scared to push it up to 30mA if you need a litle more brightness.