It is acceptable to use a LED without a resistor, but some method of limiting the current must be used in order to prevent the device from being destroyed. Failure to limit the current could lead to the device burning out, failing prematurely or even exploding.
I have certainly blown up a few LEDs in my younger and more inexperienced years, causing part of the casing to shoot across the room in spectacular fashion!
In many applications the easiest way to regulate the flow of current through the LED is to use a resistor, although there are more sophisticated methods such as using a constant current driver.
In this tutorial we shall take a look at why it is necessary to limit the current flowing through the LED and how we can select the correct resistor, so you can avoid having your project go up in smoke.
What is a LED?
If you didn’t already know, LED stands for light emitting diode. It is a semiconductor device that can turn electrical current in to light.
Utilising different semiconductor materials allows LEDs to be manufactured to produce different colours. However up until the mid-90s LEDs had a limited range of colours such as red, green and yellow. Most notably it was not possible to produce blue.
Developments in LED technology and the introduction of new materials in the manufacturing process expanded the range of available colours. One of the greatest developments in LED technology was the introduction of Indium gallium nitride.
This allowed the production of blue LEDs, completing the range of primary colours available, red, green and blue. It was then possible to manufacture RGB LEDs, which can produce the whole colour spectrum. This opened up many applications that we have become familiar with.
Following this development came advancements in brightness and also the white LED. Once the technology had progressed this far, the LED bulb became a reality and LED lighting was set to replace the incandescent bulb.
Now there are a wide range of different types of LED available containing various type of material. As these utilise different materials, some of the electrical characteristics are different.
It is important to understand the basic characteristics in order to calculate the value of the current limiting resistor and design a circuit that will power your LED correctly.
The LED is a beautifully simply component and requires minimal electronics knowledge to utilise, whilst giving exciting end results to the most basic of electronics project.
The single colour variant features only two pins and only requires one other component to function, the current limiting resistor. It also looks cool because, well… its a LED!
Each LED has two pins, the positive anode terminal and the negative cathode terminal. As the LED is a diode, the polarity must be correct in order for current to flow.
There are three fundamental things that we need to understand in order to calculate the size of the current limiting resistor.
- Ohm’s law
- Watt’s law
- Forward voltage and current
Once we understand these principals and can calculate the size of our current limiting resistor, we can understand why it is necessary to use the resistor (assuming a simple circuit that does not use a constant current driver).
Ohm’s law is probably the most fundamental principle in electronics. It describes the relationship between voltage, current and resistance.
If you are new to electronics it can sometimes be hard to visualise what exactly is happening ‘inside the wires,’ but this well known cartoon drawing sums it up perfectly.
We can describe this principal with in basic mathematical terms, the voltage is equal to the current multiplied by the resistance.
voltage (V) = current (I) x resistance (R)
In the case of our LED circuit, we can use Ohm’s to calculate the value for our current limiting resistor using known values for voltage and current.
Watt’s law describes the relationship between power, voltage and current. It is a measurement of the quantity of energy used over time.
1 Watt = 1 Joule per second
In simple mathematical terms we can say that the power is equal to the voltage multiplied by the current.
power (W) = voltage (V) x current (I)
Note that it is possible to substitute between Ohm’s and Watt’s law. You will notice that both laws have current (I) and voltage (V). For example you can substitute the voltage in Watt’s law for current multiplied by resistance from Ohm’s law, as current multiplied by resistance equals voltage.
V = I x R P = I x V
P = I x (I x R)
In the case of our LED circuit, we need to use Watt’s law to calculate the power dissipated by the resistor.
When current flows through a resistor the power is dissipated as heat, therefore we must ensure that our resistor is capable of dissipating a large enough amount of power as heat without being destroyed or becoming excessively hot.
Forward voltage and current
The forward voltage and forward current of the LED are the two properties that we need in order to calculate the required resistance.
When applying a voltage across the LED, some of the voltage is ‘lost’ due to the characteristics of the LED. We call this the voltage drop and the amount of voltage that is dropped is dependent on the materials used in its construction, and therefore it’s colour. This voltage is known as the forward voltage and is denoted as Vf.
The forward current is a value used to describe the amount of current we must supply the LED in order for it to illuminate to it’s optimum brightness. We must limit the current flowing through it with an external component, in our case the current limiting resistor.
Both of these values are given in the datasheet, a technical document usually supplied with all components that the circuit designer can use to obtain the technical details necessary to design a circuit using the particular component.
For our example we will use a standard red LED. As shown in the following datasheet we can see it has a forward voltage of 2.1 volts and a forward current of 25 milliamps (the same as 0.025 amps). These values are fairly common for a standard red LED.
Calculate the resistance
We know from the datasheet that the forward current should be 25mA, which we will use as the desired resistance value in our Ohm’s law equation. However the forward voltage does not give us the necessary value for our Ohm’s law voltage value, and we must also consider the power supply voltage.
For this example we will use 5 volts for the LED power supply, as this is a common voltage used by microcontrollers and it is likely you will want to use it to control your LEDs. You can of course choose any suitable voltage for your application.
We will wire our components in series so that the current flows from the positive terminal of our power supply, through the resistor, then the LED and then to ground. It does not matter whether the resistor is placed before or after the LED as the current remains constant for components wired in series.
As previously mentioned there will be a voltage drop across the LED equal to the forward voltage. The forward voltage is given in the LED datasheet.
Vf = 2.1V
The remaining voltage appears across the resistor, therefore if we deduct the forward voltage from the supply voltage, we can calculate the voltage across the resistor, Vr.
Vr = V - Vf
Vr = 5 - 2.1
Vr = 2.9
We want to supply the LED with the forward current value given in the datasheet, 25mA. As the resistor will limit the current we must use the voltage across the resistor and the desired forward current in our Ohm’s law equation.
Now we can calculate the resistance by rearranging the Ohm’s law equation in terms of resistance (the forward slash denotes ‘divided by’). Remember we must convert milliamps to amps, just divide by 1000.
25mA = 0.025 A
R = Vr / I R = 2.9 / 0.025 R = 116 ohms
Now we know that in order to provide the LED with 25mA we must use a resistor with the value 116 ohms. It is always best to exercise a little caution as resistance values have a tolerance and may vary slightly from the given value.
In a practical sense we should round up this value to the nearest common resistor value. It is important to round up and not down, as if we rounded down we would be supplying more than the recommended current to the LED.
We shall use a value from the E12 resistor values, giving us the nearest higher value of 120 ohms.
Resistor Heat dissipation
Unlike the LED, which converts electrical current to light (and some heat), the resistor converts electrical current almost entirely to heat.
We know the voltage across the resistor and the current flowing through it (and the LED). We can use Watt’s law to calculate the power dissipated by the resistor.
P = I x V
P = 0.025 x 2.9
P = 0.0725
The resistor will dissipate 0.0725 watts of power as heat, also written as 72.5 milliwatts (mW).
Therefore when we choose a resistor, we need to check the datasheet to see if it can dissipate 72.5mW of heat without being damaged.
Smaller standard resistors can usually dissipate 125mW (also stated as 1/8th of a Watt), therefore our combination of LED, resistor and power supply will work well.
Do I REALLY need a resistor?
One question I have seen asked several times but one that is rarely explained in similar tutorials concerns a scenario where the forward voltage equals the supply voltage.
Let’s do the maths to see what this looks like on paper. For this example we will use a blue LED with a forward voltage of 3.3V and a forward current of 25mA. For the power supply we will use 3.3V, a common supply voltage found in microcontroller circuits.
First we calculate the voltage across the resistor.
Vr = V - Vf Vr = 3.3 - 3.3 Vr = 0V
Now we can use Ohm’s law again to calculate the required value of resistance for the known voltage across the resistor and desired current.
R = Vr / I
R = 0 / 0.025
R = 0 ohms
What?! Haven’t we just proven with Ohm’s law that no value of resistance is required and thus no resistor is required if the supply voltage and forward voltage are equal?
It is easy to see why so many people reach this conclusion using the basic electronics principles. I myself once asked the same question!
In fact I recently saw someone ask this question in a forum, which is what inspired me to write this article.
Real world application
The first thing to remember is we are dealing with absolute numbers in our calculations but in the real world your 3.3V supply will probably not be exactly 3.3V. It may be 3.34V and likewise the forward voltage will not be exact, it may be 3.28V.
Next we need to consider a scenario where no resistor is present in the circuit. In this case the resistance governing the flow of current through the LED will be the internal resistance within the LED itself.
Note that in the practical application, the LED internal resistance is summed with the value of resistance chosen for the current limiting resistor. However the value is so small, it is almost always ignored as it makes no noticeable difference to the calculation.
So what happens if we rely on the internal resistance within the LED? First we must calculate the internal resistance. This can be done using the forward current vs forward voltage data from the datasheet.
First let’s choose two voltage points on the graph in the linear region. We will choose 3.25V and 3.5V. Then let’s make a note of their current values, 10mA and 20mA respectively.
The difference between these values is 0.25V and 10mA. We can use these values with Ohm’s law to calculate the internal resistance.
R = V / I R = 0.2 / 0.015 R = 25 ohms
Next we need to calculate the LEDs intrinsic voltage, Vint. This is the voltage across the LED and can be subtracted from the supply voltage to get the voltage across the internal resistance.
Vint = Vf - (If x Rint) Vint = 3.25 - (0.01 x 25) Vint = 3 V
Don’t worry if you didn’t follow all of that, it is a little more advanced than the scope of this tutorial, but I thought I would include it anyway.
Let me clarify things a little. There are two values here that are important, the intrinsic voltage Vint and the internal resistance Rint. This is the same as our earlier example, only it is the voltage and resistance for the internal resistance of the LED, rather than an external resistor.
Vint = 3 V Rint = 25 ohms
The calculation for current flow through the LED is the same as before, we use Ohm’s law to calculate the value of current using the values above.
Let’s try it with an arbitrary supply voltage of V = 3.5 V. First we subtract Vint from V to get Vr = 0.5 V. Then we can use this voltage with the internal resistance to calculate the current.
I = Vr / Rint I = 0.5 / 25 I = 0.02 A
As expected we get 20mA, matching the graph. However in the real world our supply voltage will not be exact. Therefore let’s calculate for 3.4 V, a 100mV difference.
First we subtract Vint to get 0.4 V, then we calculate the current again using the internal resistance.
I = Vr / Rint I = 0.4 / 25 I = 0.016 A
As you can see we have a noticeable change in current for only a small change in voltage.
Finally we can compare the result with and without the resistor. We know that a drop in voltage of 100mV can reduce the current flowing through the LED with no external resistor by 4mA.
External resistor and 12 V supply
First we calculate the size of the resistor required to achieve 20mA of current through the LED using the typical forward voltage of 3.3 V given in the datasheet. We can use an arbitrary power supply voltage of 12 V.
R = (V - Vf) / I R = (12 - 3.3) / 0.02 R = 435 ohms
Now we can simulate the same drop in supply voltage. The forward voltage of the LED is fixed, therefore the 100mV drop will affect the voltage across the resistor. This in turn will affect the current flowing through the LED and is calculated as follows.
I = ((V - Vf) - 100mV) / R I = 8.6 / 435 I = 0.0198
The result shows that we only experience a 200 nanoamp reduction in current, or 0.2mA.
External resistor and 24 V power supply
It is also worth noting that the more voltage across the resistor, the less difference a change in supply voltage will make. For example if we increase our supply voltage to 24 V, the 100mV drop in supply voltage will make the following difference to the current.
R = (V - Vf) / I R = (24 - 3.3) / 0.02 R = 1035 ohms
I = ((V - Vf) - 100mV) / R I = 20.6 / 1035 I = 0.0199
Now we can see that with a 24 V power supply we only see a difference in current of 100nA, or 0.1mA!
Don’t forget the heat dissipation!
So the higher the supply voltage the better, right? Well, not exactly because you still need to consider heat dissipation. Using a 24 V power supply with an LED that has a 3.3 V voltage drop will mean there will be 20.7 V across the resistor. How much heat must it dissipate?
P = I x V
P = 0.02 x 20.7
P = 0.414 watts
Our resistor needs to be rated for at least 500mW or 1/2 a watt. Even this is quite close to the requirement and therefore the resistor will get hot.
As with many things in electronics, there is always a trade-off and you must select the correct component values to get the best compromise.
It is important to regulate the current flowing through a LED in order for it to function consistently and correctly. It is perfectly acceptable to limit the current by means of a resistor, or other current regulating device.
Theoretically it would be possible to limit the current using the internal resistance of the LED, but in reality is it just not practical to do so. The voltage would need to be very precise.
It would also need to be tuned to each LED to match the exact forward voltage characteristic, which would also differ for each LED due to the manufacturing tolerances involved in producing the LED.
The most simplistic way to prevent your LED meeting a premature death or even exploding, is to use a current limiting resistor!
I hope this tutorial was insightful and gave you some new and useful knowledge about the humble and ubiquitous LED! Please let me know what you thought in the comments below.