LEDs do not behave like ordinary resistors. Once forward biased, a small change in voltage can cause a large change in current. That is why a basic LED circuit normally uses a resistor in series. The resistor does the predictable part of the job: it sets the current.
The basic circuit
A simple LED indicator usually looks like this:
Supply voltage -> resistor -> LED -> ground
The resistor and LED are in series, so the same current flows through both. The supply voltage is shared between them. The LED takes roughly its forward voltage, and the resistor takes the rest.
Use volts for voltage, amps for current, and the result will be in ohms. If the current is written in milliamps, convert it first: 10 mA is 0.010 A, 20 mA is 0.020 A, and 2 mA is 0.002 A.
Worked example: 5 V supply, red LED
Suppose you have a 5 V supply, a red LED with a forward voltage of about 2.0 V, and you want roughly 10 mA:
R = (5 V - 2 V) / 0.010 A
R = 3 V / 0.010 A
R = 300 ohm
300 ohm is a real standard value in some resistor series, but 330 ohm is extremely common and usually a better practical choice. It gives a little less current:
I = 3 V / 330 ohm
I = 0.0091 A
I = 9.1 mA
For an indicator LED, 9.1 mA is normally plenty. Many modern LEDs are bright at much lower currents, especially indoors.
Forward voltage is not a fixed magic number
LED forward voltage depends on colour, current, temperature, and the exact part. A red LED may be around 1.8 to 2.2 V. A blue or white LED may be around 2.8 to 3.4 V. Infrared LEDs can be lower. Power LEDs and LED modules have their own specifications.
For rough indicator work, using a typical forward voltage is usually fine. For production work, tight brightness matching, battery-powered devices, or high-current LEDs, read the datasheet and design for the expected current range.
Pick the current for the job
The old beginner default is often 20 mA, because many small indicator LEDs list 20 mA as a common test current. That does not mean every LED should run at 20 mA. In real products, indicator LEDs often run at 1 to 5 mA, sometimes less, depending on brightness and viewing distance.
| Use case | Typical starting current | Comment |
|---|---|---|
| Indoor status LED | 1 to 5 mA | Often enough for modern LEDs. |
| Panel indicator | 5 to 10 mA | Depends on lens, colour, and ambient light. |
| Bright warning indicator | 10 to 20 mA | Check LED and driver ratings. |
| Lighting LED | Part-specific | Use a suitable current driver, not only a casual resistor. |
Check resistor power
After choosing the resistor value, check the power in the resistor:
In the 5 V red LED example with a 330 ohm resistor and about 9.1 mA:
P = I^2 x R
P = 0.0091^2 x 330
P = 0.027 W
That is about 27 mW, comfortably below a 0.125 W or 0.25 W resistor. But higher supply voltages change the picture quickly. A 24 V panel indicator with a 2 V LED at 10 mA leaves 22 V across the resistor:
R = 22 V / 0.010 A = 2200 ohm
P = 22 V x 0.010 A = 0.22 W
A quarter-watt resistor is now close to its rating. It may work, but it will run warm. A half-watt resistor, lower current, or different circuit may be more sensible.
Microcontroller pins need their own checks
If a microcontroller pin drives the LED, the LED current is also pin current. A pin may have an absolute maximum rating and a recommended operating current. Those are not the same thing. Designing close to absolute maximum ratings is poor practice.
Also check total current through a port and through the whole device. One LED at 10 mA may be fine. Ten LEDs at 10 mA from the same port may not be fine, even if each individual pin looks acceptable.
Common mistakes
- Using 20 mA by habit when 2 mA would be bright enough.
- Forgetting to convert milliamps to amps before calculating resistance.
- Ignoring resistor power at higher supply voltages.
- Assuming LED forward voltage is identical for every colour and part.
- Driving too many LEDs directly from microcontroller pins.
- Putting LEDs in parallel with one shared resistor and expecting equal brightness.
About parallel LEDs
If multiple LEDs are placed in parallel with one shared resistor, current may not split evenly. Small forward-voltage differences can make one LED take more current than another. For predictable results, give each parallel LED its own resistor, or use a proper LED driver.
When a resistor is not enough
A resistor is fine for many indicators. It is less ideal when supply voltage changes widely, brightness must be controlled accurately, or the LED current is high. In those cases, consider a constant-current driver, transistor driver, PWM control, or a dedicated LED driver IC.
This is the difference between a simple LED indicator and LED lighting design. The basic calculation is still useful, but the surrounding circuit needs more care.
A practical selection process
- Choose the LED and estimate its forward voltage from the datasheet.
- Choose a sensible current for the job, not just the maximum current.
- Calculate the resistor using R = (Vsupply - Vled) / Iled.
- Pick the nearest standard resistor value, usually rounding up for slightly lower current.
- Check resistor power and choose a suitable power rating with margin.
- Check the driver pin, transistor, or supply can handle the current.
- Build and view it in the real environment, because brightness is subjective.
Start a project