Choosing the right resistor for an LED is a fundamental skill in electronics. It's not difficult, but it's crucial for preventing your LED from burning out.
Here’s a clear, step-by-step guide, from the simple calculation to the practical considerations.
The Core Concept: Ohm's Law
An LED has a very low resistance. If you connect it directly to a power source without a resistor, too much current will flow, destroying it instantly. The resistor limits the current to a safe value.
We use Ohm's Law for the calculation: V = I × R
Where:
-
V = Voltage in Volts (V)
-
I = Current in Amps (A)
-
R = Resistance in Ohms (Ω)
Step-by-Step Guide & Calculator
You need four pieces of information for the calculation:
-
Source Voltage (V_s): The voltage of your power supply (e.g., 5V from USB, 9V from a battery, 12V from a car).
-
LED Forward Voltage (V_f): The voltage "used up" by the LED. This depends on the LED's color and is usually between 1.8V and 3.6V.
-
Red: ~1.8V - 2.2V
-
Amber/Yellow/Green: ~2.0V - 2.4V
-
Blue/White: ~3.0V - 3.6V
-
*Check your LED's datasheet for the exact value. If you don't have it, 2.2V is a safe guess for standard colors, and 3.3V for blue/white.*
-
-
Desired LED Current (I_f): The ideal current for the LED. A standard LED is typically rated for a maximum of 20mA (0.02A), but you can often run them brighter at 15-18mA or dimmer at 10mA.
-
*Check the datasheet for the absolute maximum! High-power LEDs can be 350mA, 700mA, or more.*
-
The Formula
The resistor value (R) is calculated as:
R = (Source Voltage - LED Forward Voltage) / Desired LED Current
Or, in our notation:
R = (V_s - V_f) / I_f
Example Calculation
Let's say you have:
-
A 5V Arduino pin (
V_s = 5V
) -
A standard Red LED (
V_f = 2.2V
) -
You want to run it at 20mA (
I_f = 0.02A
)
Step 1: Calculate the voltage that must be dropped across the resistor:V_s - V_f = 5V - 2.2V = 2.8V
Step 2: Apply Ohm's Law to find the resistance:R = 2.8V / 0.02A = 140 Ω
Result: A 140 Ω resistor is the calculated ideal value.
Practical Considerations & Next Steps
1. Choosing a Standard Resistor Value
You won't find a 140 Ω resistor easily. Resistors come in standard values. Always round UP to the next highest standard value to ensure the current is slightly less than your target, which is safer for the LED.
Common standard values: 100, 120, 150, 180, 220, 270, 330, 470, 560, 680, 1k.
In our example, you would use a 150 Ω or 180 Ω resistor. A 150 Ω would be slightly brighter, an 180 Ω slightly dimmer and safer.
2. Calculating Resistor Power Rating
The resistor doesn't just resist; it also turns the excess power into heat. We need to make sure it can handle it.
Power (in Watts) = (V_s - V_f) × I_f
From our example:Power = (5V - 2.2V) × 0.02A = 2.8V × 0.02A = 0.056W
Standard resistors are typically 1/4 Watt (0.25W). Since 0.056W is much less than 0.25W, a standard 1/4W resistor is perfectly fine. If you were using a much higher voltage or current, you might need a 1/2W or 1W resistor.
Quick Reference Table (using 20mA current)
Power Supply | LED Color (V_f) | Calculated R | Use Standard R |
---|---|---|---|
5V | Red (2.2V) | 140 Ω | 150 Ω |
5V | Blue/White (3.3V) | 85 Ω | 100 Ω |
9V | Red (2.2V) | 340 Ω | 390 Ω |
12V | Red (2.2V) | 490 Ω | 560 Ω |
12V | Blue/White (3.3V) | 435 Ω | 470 Ω |
Circuit Diagram
This is how you wire it. The resistor can be placed on either side of the LED (anode or cathode).
(This diagram illustrates a standard LED circuit with a current-limiting resistor.)
Advanced Case: Multiple LEDs
You can connect multiple LEDs in series with a single resistor.
Rule: The sum of the forward voltages must be LESS than the source voltage.
Formula: R = (V_s - (V_f1 + V_f2 + ...)) / I_f
Example: Two blue LEDs (3.3V each) in series from a 12V supply.
-
Total V_f = 3.3V + 3.3V = 6.6V
-
Voltage for resistor = 12V - 6.6V = 5.4V
-
R = 5.4V / 0.02A = 270 Ω → use a 330 Ω standard resistor.
Summary Checklist
-
Find your
V_s
(Battery, power supply voltage). -
Find your LED's
V_f
(Check datasheet or use general values: Red ~2.2V, White ~3.3V). -
Choose your
I_f
(10-20mA for standard LEDs). -
Plug into the formula:
R = (V_s - V_f) / I_f
-
Round UP to the nearest standard resistor value.
-
Check power rating:
P = (V_s - V_f) * I_f
. If it's below 0.25W, a standard resistor is fine.
By following these steps, you'll reliably protect your LEDs and have them shining brightly for a long time.