A resistor limits current, divides voltage, and sets bias points in nearly every circuit you will ever build. Pick the wrong value, tolerance, or wattage and an LED burns out, an ADC reads garbage, or a pull-up fails to pull. This guide covers resistor types, how to read the color code, how tolerance and power rating affect real designs, and how to calculate values with working firmware examples.
Quick Takeaways
- Resistance is measured in ohms (Ω). Ohm’s law: V = I × R.
- Tolerance (±1%, ±5%) tells you how far the real value can drift from the marked value.
- Power rating (1/8W, 1/4W, 1/2W, 1W) is the maximum heat the part can dissipate. Derate it by 50% for reliable designs.
- The color code encodes value and tolerance in 4, 5, or 6 bands. Read from the end closest to the first band.
| Spec | Typical Hobby Value | Typical Pro Value |
|---|---|---|
| Tolerance | ±5% (carbon film) | ±0.1% to ±1% (thin film, metal film) |
| Power rating | 1/4W | 1/10W (SMD 0603) to 5W+ (wirewound) |
| Temp. coefficient | 200–500 ppm/°C | 5–100 ppm/°C |
| Series | E12 | E24, E96 |
What Is a Resistor and What Does It Do?
A resistor opposes current flow. It converts electrical energy into heat in proportion to the current through it. Three jobs account for most resistor use:
- Current limiting. A 330Ω resistor in series with an LED keeps current near 10mA on a 5V rail.
- Voltage division. Two resistors in series scale a voltage down, for example 12V battery sensing into a 3.3V ADC pin.
- Pull-up and pull-down. A 10kΩ resistor holds a GPIO or an I2C line at a defined logic level when nothing drives it.
Ohm’s Law and Power Formulas
| Quantity | Formula | Example |
|---|---|---|
| Voltage | V = I × R | 20mA × 150Ω = 3V |
| Current | I = V / R | 5V / 1kΩ = 5mA |
| Resistance | R = V / I | 3.3V / 10mA = 330Ω |
| Power | P = I² × R = V² / R | (0.02A)² × 150Ω = 60mW |
Resistor Types Compared
Construction decides noise, accuracy, stability, and price. Choose by application, not habit.
| Type | Tolerance | Temp. Coeff. | Noise | Cost | Best For |
|---|---|---|---|---|---|
| Carbon film | ±5% | 200–500 ppm/°C | Medium | Lowest | LEDs, pull-ups, general use |
| Metal film | ±1% (to ±0.1%) | 25–100 ppm/°C | Low | Low | ADC dividers, audio, precision analog |
| Thick film (SMD) | ±1%–±5% | 100–200 ppm/°C | Medium | Very low | Mass-produced PCBs |
| Thin film (SMD) | ±0.05%–±0.5% | 5–25 ppm/°C | Very low | High | Instrumentation, references |
| Wirewound | ±1%–±5% | 20–100 ppm/°C | Low (high inductance) | Medium | High power, current sensing |
| Metal oxide | ±2%–±5% | 300 ppm/°C | Low | Low | Surge and flameproof duty |
| Carbon composition | ±5%–±20% | High | High | Rare | Legacy and vintage audio |
Variable and Special Resistors
| Component | Function | Typical Use |
|---|---|---|
| Potentiometer | 3-terminal adjustable divider | Volume knobs, analog input to an ADC |
| Trimmer (trimpot) | Board-mounted adjustment | Calibration, contrast setting |
| Thermistor (NTC/PTC) | Resistance changes with temperature | Temperature sensing, inrush limiting |
| LDR (photoresistor) | Resistance drops in light | Light sensing, dusk switches |
| Varistor (MOV) | Voltage-dependent clamp | Surge protection on mains input |
| Shunt resistor | Milliohm-range sense element | Current measurement with an INA219 |
Resistor Tolerance Explained
Tolerance is the allowed deviation from the nominal value at 25°C. A 1kΩ ±5% resistor can measure anywhere from 950Ω to 1050Ω.
| Tolerance | Band Color (4-band) | 10kΩ Actual Range |
|---|---|---|
| ±20% | None | 8kΩ – 12kΩ |
| ±10% | Silver | 9kΩ – 11kΩ |
| ±5% | Gold | 9.5kΩ – 10.5kΩ |
| ±2% | Red | 9.8kΩ – 10.2kΩ |
| ±1% | Brown | 9.9kΩ – 10.1kΩ |
| ±0.5% | Green | 9.95kΩ – 10.05kΩ |
| ±0.1% | Violet (5/6-band) | 9.99kΩ – 10.01kΩ |
When Tolerance Matters
- LED current limiting: ±5% is fine. A 5% swing in current is invisible.
- Voltage dividers feeding an ADC: use ±1% metal film or better. Two ±5% resistors can shift your divider ratio by up to 10%.
- Op-amp gain networks and filters: use ±1% or ±0.1%. Gain error and cutoff frequency drift track resistor error directly.
- Pull-ups on I2C: ±5% works. The bus tolerates wide variation.
E-Series Preferred Values
Manufacturers produce values from standardized decade series, not every integer.
| Series | Values per Decade | Typical Tolerance |
|---|---|---|
| E6 | 6 | ±20% |
| E12 | 12 | ±10% / ±5% |
| E24 | 24 | ±5% / ±2% |
| E96 | 96 | ±1% |
| E192 | 192 | ±0.5% / ±0.1% |
E12 base values: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82. Multiply by 10ⁿ to cover the range.
Resistor Power Rating and Derating
Every resistor turns current into heat. Exceed the power rating and the part drifts, discolors, cracks, or opens.
Standard Power Ratings
| Rating | Common Package | Typical Use |
|---|---|---|
| 1/16W | SMD 0402 | Dense mobile and IoT boards |
| 1/10W | SMD 0603 | General SMD design |
| 1/8W | SMD 0805 / small axial | Logic-level circuits |
| 1/4W | Axial through-hole | Breadboard and hobby standard |
| 1/2W | Axial through-hole | Higher current limiting |
| 1W – 5W | Large axial / wirewound | Power supplies, loads, motor circuits |
The 50% Derating Rule
Never run a resistor at its full rated power. Keep dissipation at 50% of the rating or lower. Heat shortens life, shifts value, and overheats nearby parts.
Worked example: A 100Ω resistor across 5V.
- P = V² / R = 25 / 100 = 0.25W
- A 1/4W part sits at 100% load. Too hot.
- Use a 1/2W part, or raise R.
Ambient Temperature Derating
Most datasheets specify full power only up to about 70°C. Above that, the allowable power falls linearly to zero near 155°C. In an enclosed enclosure near a regulator, treat your real limit as well below the nameplate.
The Resistor Color Code
Through-hole resistors use colored bands to encode value, multiplier, and tolerance.
Color Value Table
| Color | Digit | Multiplier | Tolerance |
|---|---|---|---|
| Black | 0 | ×1 | — |
| Brown | 1 | ×10 | ±1% |
| Red | 2 | ×100 | ±2% |
| Orange | 3 | ×1k | — |
| Yellow | 4 | ×10k | — |
| Green | 5 | ×100k | ±0.5% |
| Blue | 6 | ×1M | ±0.25% |
| Violet | 7 | ×10M | ±0.1% |
| Gray | 8 | ×100M | ±0.05% |
| White | 9 | ×1G | — |
| Gold | — | ×0.1 | ±5% |
| Silver | — | ×0.01 | ±10% |
How to Read 4-, 5-, and 6-Band Resistors
| Bands | Digits | Multiplier | Tolerance | Extra |
|---|---|---|---|---|
| 4-band | Bands 1–2 | Band 3 | Band 4 | — |
| 5-band | Bands 1–3 | Band 4 | Band 5 | Precision parts |
| 6-band | Bands 1–3 | Band 4 | Band 5 | Band 6 = temp. coefficient |
Reading steps:
- Find the tolerance band. It is usually gold, silver, or brown and sits slightly apart from the others.
- Orient the resistor so that band is on the right.
- Read digits left to right.
- Apply the multiplier.
Worked Examples
| Bands | Calculation | Result |
|---|---|---|
| Brown, Black, Red, Gold | 10 × 100, ±5% | 1kΩ ±5% |
| Yellow, Violet, Orange, Gold | 47 × 1,000, ±5% | 47kΩ ±5% |
| Red, Red, Brown, Brown, Brown | 221 × 10, ±1% | 2.21kΩ ±1% |
| Orange, Orange, Black, Red, Brown | 330 × 100, ±1% | 33kΩ ±1% |
Memory aid: Black, Brown, Red, Orange, Yellow, Green, Blue, Violet, Gray, White map to 0 through 9. Learn the order once and you can read any through-hole part.
SMD Resistor Markings
Surface-mount parts print numbers instead of bands.
| Code | Meaning | Value |
|---|---|---|
| 103 | 10 × 10³ | 10kΩ |
| 472 | 47 × 10² | 4.7kΩ |
| 4R7 | R = decimal point | 4.7Ω |
| 1002 | 100 × 10² (4-digit, 1%) | 10kΩ |
| 01C | EIA-96 code | 10.2kΩ |
Always verify an unfamiliar marking with a multimeter in resistance mode.
Resistors in Series and Parallel
| Configuration | Formula | Example |
|---|---|---|
| Series | R_total = R1 + R2 + … | 1kΩ + 2.2kΩ = 3.2kΩ |
| Parallel | 1/R_total = 1/R1 + 1/R2 + … | 1kΩ ‖ 1kΩ = 500Ω |
| Two in parallel | (R1 × R2) / (R1 + R2) | (10k × 10k)/(20k) = 5kΩ |
Parallel combinations also split power. Two 1/4W resistors in parallel safely handle about 1/2W total when their values match.
Voltage Divider
Vout = Vin × R2 / (R1 + R2)
Practical Project 1: Calculating an LED Resistor
Goal: Drive a red LED from a 5V Arduino pin.
Given: Vsupply = 5V, LED forward voltage Vf = 2.0V, target current = 15mA.
- R = (5V − 2.0V) / 0.015A = 200Ω
- Nearest standard E12 value: 220Ω
- Actual current: 3V / 220Ω = 13.6mA
- Power: (0.0136)² × 220 = 40.7mW. A 1/4W part is plenty.
Wiring
| Connection | From | To |
|---|---|---|
| 1 | Arduino D9 | 220Ω resistor, pin 1 |
| 2 | 220Ω resistor, pin 2 | LED anode (long leg) |
| 3 | LED cathode (short leg) | Arduino GND |
Firmware (Arduino C++)
// LED current-limiting demo
// Resistor: 220 ohm in series with LED on D9
const uint8_t LED_PIN = 9; // PWM-capable pin
void setup() {
pinMode(LED_PIN, OUTPUT); // GPIO as push-pull output
}
void loop() {
// Fade up: analogWrite uses 8-bit PWM (0-255) at ~490Hz on D9
for (int duty = 0; duty <= 255; duty++) {
analogWrite(LED_PIN, duty);
delay(5);
}
// Fade down
for (int duty = 255; duty >= 0; duty--) {
analogWrite(LED_PIN, duty);
delay(5);
}
}
Practical Project 2: Voltage Divider for a 12V Battery Monitor
An ESP32 ADC pin tolerates a maximum of about 3.3V. A 12V lead-acid battery reaches roughly 14.4V while charging, so you must scale it down.
Design:
- R1 = 47kΩ (top), R2 = 10kΩ (bottom), both ±1% metal film
- Ratio = 10k / (47k + 10k) = 0.1754
- At 14.4V input: Vout = 14.4 × 0.1754 = 2.53V. Safe for the ADC.
- Divider current: 14.4V / 57kΩ = 0.25mA. Low battery drain.
- Power in R1: (0.00025)² × 47k = 2.9mW. Trivial.
Wiring
| Node | Connection |
|---|---|
| Battery + | 47kΩ (R1) pin 1 |
| R1 pin 2 / R2 pin 1 | ESP32 GPIO34 (ADC1_CH6) |
| R2 pin 2 | GND (shared with ESP32) |
Add a 100nF capacitor from GPIO34 to GND to stabilize the reading.
Firmware (Arduino C++ for ESP32)
// Battery voltage monitor using a 47k/10k divider
const int ADC_PIN = 34; // ADC1 pin, input-only
const float R1 = 47000.0; // top resistor (ohms)
const float R2 = 10000.0; // bottom resistor (ohms)
const float ADC_REF = 3.3; // nominal ADC reference (V)
const int ADC_MAX = 4095; // 12-bit resolution
void setup() {
Serial.begin(115200);
analogReadResolution(12); // 12-bit ADC
analogSetAttenuation(ADC_11db); // full ~0-3.3V input range
}
void loop() {
int raw = analogRead(ADC_PIN);
float vPin = (raw / (float)ADC_MAX) * ADC_REF;
float vBat = vPin * (R1 + R2) / R2; // undo the divider ratio
Serial.printf("Raw: %d | Pin: %.3f V | Battery: %.2f V\n", raw, vPin, vBat);
delay(1000);
}
Calibrate against a multimeter. The ESP32 ADC is nonlinear, so expect a few percent error without correction.
Practical Project 3: Choosing I2C Pull-Up Resistors
I2C uses open-drain lines (SDA, SCL) that need pull-ups to VCC.
| Bus Speed | Typical Pull-Up | Notes |
|---|---|---|
| 100kHz (Standard) | 4.7kΩ – 10kΩ | Safe default |
| 400kHz (Fast) | 2.2kΩ – 4.7kΩ | Lower R for faster rise time |
| 1MHz (Fast-plus) | 1kΩ – 2.2kΩ | Watch sink current limits |
Rule of thumb: Pick the largest value that still meets rise-time limits. Smaller values waste power and can exceed the 3mA sink current of a standard device. Many breakout boards already include 10kΩ pull-ups. Multiple boards in parallel lower the effective resistance, so check the total.
Troubleshooting Resistor Problems
| Symptom | Likely Cause | Fix |
|---|---|---|
| Resistor smells or discolors | Overpower | Recalculate P, use a higher wattage or larger R |
| LED too dim | R too high, or wrong band read | Measure R with a multimeter |
| LED burns out | R too low or missing | Recompute with Ohm’s law |
| ADC reading drifts | Poor tolerance or temp. coefficient | Use ±1% metal film |
| Floating input, random readings | Missing pull-up/pull-down | Add 10kΩ to VCC or GND |
| Measured value off in-circuit | Parallel paths | Lift one lead, then measure |
Measuring With a Multimeter
- Power off the circuit and discharge capacitors.
- Set the meter to the Ω range.
- Isolate the resistor by lifting one leg.
- Touch both leads without pinching with your fingers, which adds your body’s resistance.
- Compare against the nominal value and tolerance.
How to Choose the Right Resistor: Checklist
- Value: Calculate with Ohm’s law, then round to the nearest E-series value.
- Power: Compute P = I²R and keep it below 50% of the rating.
- Tolerance: ±5% for indicators, ±1% or better for measurement and analog paths.
- Temperature coefficient: Under 100 ppm/°C for stable analog circuits.
- Package: Through-hole axial for prototyping, 0603 or 0805 SMD for production.
- Voltage rating: Check maximum working voltage, especially for small SMD sizes in high-voltage dividers.
FAQ
What does the tolerance band on a resistor mean?
It states the maximum deviation from the nominal value. A gold band means ±5%, so a 1kΩ resistor may read between 950Ω and 1,050Ω. Brown means ±1%.
How do I know what wattage a resistor is?
Check the datasheet or package. Through-hole carbon and metal film parts are usually 1/4W (about 6mm long). Larger bodies indicate 1/2W or 1W. SMD size sets the rating: 0603 is typically 1/10W, 0805 is 1/8W.
Can I use a higher wattage resistor than the circuit calls for?
Yes. A higher power rating never harms the circuit. It only changes the physical size and cost. A lower rating is the risk.
What resistor do I need for an LED on 5V?
Use 220Ω to 330Ω for a standard LED at 10–15mA. For other supply voltages or LED colors, use R = (Vsupply − Vf) / I.




