Resistor Color Bands
Circuit Diagram
How LED Resistors Work
Every LED (Light Emitting Diode) requires a current limiting resistor to operate safely. Unlike incandescent bulbs, LEDs have very low internal resistance. Without a resistor, the current would spike to destructive levels, burning out the LED in milliseconds.
The resistor value is calculated using Ohm's Law:
Where:
- R = Resistance in ohms (Ω)
- Vs = Supply voltage (e.g., 5V from Arduino, 9V from a battery)
- Vf = LED forward voltage (varies by color, typically 1.8V–3.4V)
- If = Desired forward current (typically 20mA for standard LEDs)
Example Calculation
For a red LED powered by a 5V Arduino:
- Vs = 5V, Vf = 2.0V, If = 20mA = 0.020A
- R = (5 − 2.0) / 0.020 = 150Ω
- Nearest standard value: 150Ω (E12 series) or 220Ω for extra safety margin
- Power dissipated: P = (5 − 2.0) × 0.020 = 0.06W — a 1/8W or 1/4W resistor works fine
Common LED Specifications
Different LED colors have different forward voltage drops because they are made from different semiconductor materials. Here are the typical specifications:
| LED Color | Forward Voltage (Vf) | Typical Current (If) | Wavelength | Resistor for 5V |
|---|---|---|---|---|
| Red | 1.8 – 2.2V | 20mA | 620–645nm | 150Ω |
| Orange | 2.0 – 2.2V | 20mA | 600–620nm | 150Ω |
| Yellow | 2.0 – 2.2V | 20mA | 585–600nm | 150Ω |
| Green | 2.0 – 3.2V | 20mA | 520–570nm | 100–150Ω |
| Blue | 3.0 – 3.4V | 20mA | 460–490nm | 68–100Ω |
| White | 3.0 – 3.4V | 20mA | Broad | 68–100Ω |
| UV | 3.1 – 3.5V | 20mA | 380–400nm | 68–100Ω |
| Infrared | 1.2 – 1.6V | 20mA | 850–940nm | 180Ω |
Note: Always check your specific LED's datasheet for exact values. The numbers above are typical ranges for standard 5mm through-hole LEDs.
Arduino LED Circuit Guide
Connecting an LED to an Arduino is one of the most common beginner projects. Here's everything you need to know:
Arduino Uno / Nano (5V logic)
Arduino digital pins output 5V when set HIGH. Each pin can source up to 40mA (recommended max 20mA). For a standard red LED:
- Connect the longer leg (anode, +) of the LED to the resistor
- Connect the other end of the resistor to the Arduino digital pin
- Connect the shorter leg (cathode, −) of the LED to GND
- Use a 220Ω resistor for safe operation (provides ~13.6mA)
Arduino ESP32 / ESP8266 (3.3V logic)
These boards use 3.3V logic. For a red LED on 3.3V:
- R = (3.3 − 2.0) / 0.020 = 65Ω → use a 68Ω standard resistor
- For blue/white LEDs (Vf ~3.2V), the voltage margin is very small (0.1V). Consider using a lower current (5–10mA) or a transistor driver from a higher voltage supply.
Arduino Code Example
Basic blink sketch for pin 13:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // LED on
delay(1000);
digitalWrite(13, LOW); // LED off
delay(1000);
}
Important Tips
- Never connect an LED directly to an Arduino pin without a resistor
- The built-in LED on pin 13 already has an on-board resistor
- For driving multiple LEDs or high-power LEDs, use a transistor or MOSFET to avoid exceeding pin current limits
- The total current from all pins combined should not exceed 200mA on an Arduino Uno
Resistor Color Code Chart
Standard through-hole resistors use colored bands to indicate their value. Here's the complete color code reference:
| Color | Band | 1st Digit | 2nd Digit | 3rd Digit (5-band) | Multiplier | Tolerance |
|---|---|---|---|---|---|---|
| Black | 0 | 0 | 0 | ×1 | — | |
| Brown | 1 | 1 | 1 | ×10 | ±1% | |
| Red | 2 | 2 | 2 | ×100 | ±2% | |
| Orange | 3 | 3 | 3 | ×1K | ±0.05% | |
| Yellow | 4 | 4 | 4 | ×10K | ±0.02% | |
| Green | 5 | 5 | 5 | ×100K | ±0.5% | |
| Blue | 6 | 6 | 6 | ×1M | ±0.25% | |
| Violet | 7 | 7 | 7 | ×10M | ±0.1% | |
| Grey | 8 | 8 | 8 | ×100M | ±0.01% | |
| White | 9 | 9 | 9 | ×1G | — | |
| Gold | — | — | — | ×0.1 | ±5% | |
| Silver | — | — | — | ×0.01 | ±10% |
Reading a 4-band resistor: Band 1 (1st digit) + Band 2 (2nd digit) + Band 3 (multiplier) + Band 4 (tolerance). Example: Brown-Black-Red-Gold = 10 × 100 = 1000Ω (1KΩ) ±5%.
Series vs Parallel LED Circuits
Series Configuration
In a series circuit, LEDs are connected end-to-end so the same current flows through all of them. You only need one resistor for the entire chain.
- Formula: R = (Vs − Vf1 − Vf2 − ... − Vfn) / If
- Advantage: All LEDs have identical brightness (same current)
- Limitation: Supply voltage must be greater than the sum of all LED forward voltages
- Example: 3 red LEDs (2.0V each) on 12V: R = (12 − 6) / 0.020 = 300Ω
Parallel Configuration
In a parallel circuit, each LED (or each LED+resistor pair) is connected across the supply. Each LED needs its own resistor.
- Formula: Each LED uses R = (Vs − Vf) / If (same as single LED)
- Advantage: Works even if supply voltage is barely above a single LED's Vf
- Advantage: If one LED fails, the others keep working
- Disadvantage: Total current draw = If × number of LEDs (higher power consumption)
Which Should You Use?
Series is more efficient for higher voltage supplies (9V, 12V, 24V). Parallel is better when your supply voltage is low (3.3V, 5V) or when you need independent control of each LED.