Wiring an LED is one of the first things anyone does with a microcontroller or a DC power supply. It is also one of the things most often done wrong. The mistakes range from no resistor at all (LED dies in seconds) to resistors so conservative the LED is barely visible. Getting the calculation right takes about thirty seconds once you understand what the numbers mean.
This guide covers the resistor sizing formula, single-LED and multi-LED configurations, what changes when you drive from Arduino vs. 12V vs. mains-derived supplies, and why paralleling LEDs without individual resistors is asking for trouble.
The Resistor Formula
An LED is not a resistor. It is a diode with a fairly stable forward voltage drop (Vf) that varies by color and LED type. Once forward voltage is established, current through the LED is determined entirely by what is left over. Without a current-limiting resistor, a 5V supply sees a 2V LED as a near-short circuit.
The formula:
R = (Vs - Vf) / If
Where:
- Vs = supply voltage
- Vf = LED forward voltage
- If = desired forward current (the operating current you want, not the absolute maximum)
- R = required series resistor in ohms
Forward Voltage by LED Color
| Color | Typical Vf |
|---|---|
| Red | 1.8--2.2V |
| Yellow / Orange | 2.0--2.2V |
| Green (standard GaP) | 2.0--2.5V |
| Green (high-brightness InGaN) | 3.0--3.5V |
| Blue | 3.0--3.5V |
| White | 3.0--3.5V |
| UV (400nm) | 3.4--3.8V |
| Infrared (940nm) | 1.2--1.5V |
Check the datasheet. A generic "green" LED you pick out of a bag could be 2.0V or 3.2V depending on whether it's old-style GaP or modern InGaN -- that difference matters for the resistor calculation.
Worked Examples
Red LED from a 5V Arduino pin (target If = 15mA):
R = (5 - 2.0) / 0.015 = 200Ω → use 220Ω (next standard E12 value up)
At 220Ω: actual current = (5 - 2.0) / 220 = 13.6mA. Fine.
Blue LED from 12V supply (target If = 20mA):
R = (12 - 3.3) / 0.020 = 435Ω → use 470Ω
At 470Ω: actual current = (12 - 3.3) / 470 = 18.5mA. Acceptable.
Red LED from 3.3V Arduino (target If = 10mA):
R = (3.3 - 2.0) / 0.010 = 130Ω → use 150Ω
This one is tight. At 150Ω the current is exactly 8.7mA -- dim but safe. If you want brighter, note that running 15mA through a 3.3V pin is fine if you account for the pin's ~0.4V output impedance under load: effective supply is closer to 2.9V, giving (2.9 - 2.0) / 68Ω... which is why lower-voltage supplies need careful calculation, not guesses.
Single LED Circuit: Breadboard Layout
The standard circuit:
- Arduino digital pin (or positive supply) → resistor → LED anode → LED cathode → GND
On a breadboard: the resistor goes from the pin row to the LED anode row. The LED cathode (shorter leg, flat side on the package) goes to the ground rail.
You can also sink current instead of sourcing it -- connect the LED anode to 5V (through the resistor) and the cathode to an Arduino output pin set LOW. Either works electrically; sourcing is more common for indicator LEDs, sinking is common when driving multiple LEDs through shift registers or common-anode LED arrays.
Series LED Strings
Putting multiple LEDs in series reduces the resistor power dissipation and is more efficient at higher supply voltages.
In a series string:
- Each LED carries the same current (no need for individual resistors)
- The voltage drops add up: total Vf = Vf1 + Vf2 + ...
- The supply must exceed the sum of all Vf values
Formula for a series string of N identical LEDs:
R = (Vs - N × Vf) / If
Example: Three white LEDs in series from 12V (If = 15mA):
R = (12 - 3 × 3.2) / 0.015 = (12 - 9.6) / 0.015 = 160Ω → use 180Ω
The resistor must handle: P = (Vs - N×Vf) × If = 2.4V × 15mA = 36mW. A standard 1/4W resistor is more than enough.
You cannot string blue/white LEDs (Vf ≈ 3.2V) in series on a 5V supply -- even two in series would require 6.4V.
Parallel LEDs: Why Individual Resistors Are Required
The instinct to run multiple LEDs in parallel with a single shared resistor is wrong.
LEDs have a negative temperature coefficient: as they warm up, Vf drops slightly, which causes more current, which causes more heating. In a parallel string with one shared resistor, the LED with the slightly lowest Vf hogs current, heats up further, drops more voltage, and draws even more current. The other LEDs run dim. The hot one may eventually fail.
The correct approach: one resistor per LED, always. Each LED gets its own series resistor calculated for the full supply voltage.
Example: Four red LEDs in parallel from 5V:
- Each needs its own R = (5 - 2.0) / 0.015 = 200Ω → four 220Ω resistors
- Total current drawn from the supply: 4 × 13.6mA = 54.4mA
If driving from an Arduino digital pin (40mA absolute max), four LEDs from one pin is too much. Use a transistor or MOSFET driver, or distribute across multiple pins.
Driving LEDs from Arduino
Arduino Uno / Nano digital pins can source or sink 20mA comfortably (40mA absolute max). A single LED with the correct resistor is within spec.
For more than two or three LEDs, consider:
- 74HC595 shift register: Drives 8 outputs per chip, cascadeable. Each output handles up to 35mA.
- ULN2803 Darlington array: 8-channel sink driver, up to 500mA per channel -- good for high-brightness LEDs.
- MOSFET (IRLZ44N): N-channel logic-level MOSFET for high-current single loads (LED strip lighting, multiple LEDs in parallel).
For PWM brightness control, use a PWM-capable pin (D3, D5, D6, D9, D10, D11 on Uno) and call analogWrite(). The LED resistor calculation stays the same -- the average current changes with duty cycle, but peak current at 100% duty must still be within spec.
Simulating an LED Circuit
Before committing to component values, sketch the circuit in CircuitDiagramMaker and run a DC simulation. The simulator shows the exact current flowing through the LED at your chosen resistor value. This is particularly useful when:
- Your supply voltage is unusual (not a round number)
- You are using a constant-current driver and want to verify compliance voltage
- You want to check power dissipation in the resistor to confirm a 1/4W part is adequate
Run the DC operating point analysis and probe the resistor branch -- the current readout gives you the actual LED current with whatever exact supply voltage you specify.
LED Circuit in CircuitDiagramMaker
CircuitDiagramMaker includes LED symbols with configurable Vf values. Draw a single-LED circuit or a full parallel array, set the supply voltage and resistor values, and simulate to confirm current through each LED before building.
- Add the LED symbol, resistor, and voltage source from the component library
- Set Vf in the LED properties to match your specific part
- Run DC analysis -- current annotated on each branch
- Export the schematic as a reference for your build
Create your own LED circuit diagram -- free
Key Takeaways
- Always use a series current-limiting resistor: R = (Vs - Vf) / If. No resistor means the LED burns out immediately.
- Forward voltage varies by color -- white and blue LEDs drop 3.0--3.5V, red and yellow drop 1.8--2.2V. Use the datasheet value, not a generic assumption.
- Series strings share current and reduce resistor losses; the supply voltage must exceed the sum of all forward voltages in the string.
- Parallel LEDs must each have their own series resistor -- a shared resistor causes current hogging and premature failure.
- Arduino pins are limited to 20mA recommended, 40mA absolute max per pin; use a transistor, shift register, or MOSFET for more than one or two LEDs.
- Simulate the circuit before building to confirm LED current and resistor power dissipation at your actual supply voltage.
Originally published at https://circuitdiagrammaker.app/blog/led-circuit-diagram.
Top comments (0)