Components · 4 min read

What Is a Resistor? Color Codes, Ohm's Law and Using Resistors with Arduino

What is a resistor, what does it do and how do you read the color code? A resistor guide with Ohm's law, series and parallel connections, pull-up/pull-down and voltage divider examples.

A resistor is the most basic electronic component: it opposes the flow of electric current and limits the current in a circuit. Its unit is the ohm, shown with the Ω symbol. You'll find one in almost every circuit: it protects LEDs, makes buttons read reliably and brings sensor signals to the right level.

Resistor
Carbon film resistors with color bands. The bands show the resistor's value and tolerance.

What does a resistor do?

  • Current limiting: keeps LEDs and Arduino pins from being damaged by too much current.
  • Voltage dividing: two resistors bring a high voltage down to a measurable level.
  • Pull-up / pull-down: stops an input from reading random values while the button isn't pressed.
  • Sensor circuits: forms a voltage divider with variable resistors such as LDRs and thermistors.

Ohm's law: voltage, current and resistance

Resistor calculations are based on Ohm's law: V = I × R. In other words, voltage (volts) equals current (amps) times resistance (ohms). From this formula, current is I = V / R and resistance is R = V / I. The power dissipated in the resistor is P = V × I.

Example: a 1 kΩ resistor connected to 5 V passes 5 / 1000 = 5 mA and dissipates 25 mW. Instead of doing these calculations by hand, you can use the Ohm's law calculator.

How do you read the resistor color code?

The value of through-hole (THT) resistors is printed as colored bands on the body. On a 4-band resistor, the first two bands give the digits, the third band the multiplier (number of zeros) and the fourth the tolerance. Hold the resistor with the gold or silver band on the right and read from the left.

ColorDigitMultiplierTolerance
Black0×1—
Brown1×10±1%
Red2×100±2%
Orange3×1 k—
Yellow4×10 k—
Green5×100 k±0.5%
Blue6×1 M±0.25%
Violet7×10 M±0.1%
Gray8—±0.05%
White9——
Gold—×0.1±5%
Silver—×0.01±10%

Example: Red – Red – Brown – Gold = 2, 2, ×10 → 220 Ω ±5%. Brown – Black – Orange – Gold = 1, 0, ×1000 → 10 kΩ ±5%. To see the result instantly by picking colors or typing a value, try the resistor color code calculator.

On 5-band resistors, the first three bands give the digits (e.g. 4.7 kΩ = yellow, violet, black, brown). SMD resistors carry a code like 472 instead of colors; you can read it with the SMD code decoder.

Standard resistor values (E12, E24)

Resistors aren't made in every value: the E12 series has 12 values per decade (10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82) and E24 has 24. If the value you calculated isn't available, pick the next standard value up. To get closer to a target by combining two resistors, use the standard value finder.

Connecting resistors in series and parallel

  • Series: resistances add up. 220 Ω + 330 Ω = 550 Ω.
  • Parallel: the total is smaller than the smallest resistor: 1/R = 1/R1 + 1/R2. Two equal resistors in parallel halve the value (1 kΩ ∥ 1 kΩ = 500 Ω).
  • To solve mixed circuits step by step, the series/parallel resistor calculator also shows the voltage and power of each resistor.

The most common resistors in Arduino projects

ValueWhere it's used
220 Ω – 330 ΩLimiting LED current
1 kΩTransistor base, protecting serial lines
10 kΩButton pull-up/pull-down, LDR and NTC voltage dividers
1 kΩ + 2 kΩBringing a 5 V signal down to 3.3 V (ESP32, Pico)
100 kΩ + 10 kΩVoltage divider for measuring high voltages

Pull-up and pull-down resistors

A button only opens and closes the circuit; when it isn't pressed, the input pin floats and reads random HIGH/LOW values. A pull-down resistor (usually 10 kΩ) pulls the pin to GND and a pull-up resistor pulls it to 5 V, giving a stable value. On Arduino, enabling the internal pull-up with pinMode(pin, INPUT_PULLUP) means you don't need an external resistor.

Push button

Voltage divider

When two resistors are connected in series and the output is taken from the middle, the input voltage is divided in proportion: Vout = Vin × R2 / (R1 + R2). This is used to bring a high voltage like 12 V down to a level the Arduino can read, or to adapt a 5 V sensor signal to the ESP32's 3.3 V input. The voltage divider calculator works out the values and also suggests ready-made resistor pairs.

Potentiometer
Potentiometer
LDR
LDR
NTC thermistor
NTC thermistor
A voltage divider is not a power supply; if you connect a motor, relay or LED to its output, the voltage drops. Use it only for measurement and signal level shifting.

Why does a resistor's power rating (watts) matter?

Current through a resistor turns into heat. The most common resistors in projects are rated 1/4 W (0.25 W). If the dissipated power approaches this rating the resistor heats up, and if it exceeds it, the resistor burns. For a safe design, choose a resistor rated for at least twice the power it dissipates.

Frequently asked questions

Does a resistor have a direction?

No, standard resistors have no polarity and can go in either way. When reading the bands, just put the tolerance band on the right.

What does a 10k resistor mean?

10 kΩ, that is, 10,000 ohms. The color code is brown, black, orange plus the tolerance band. On Arduino it's used most for pull-up/pull-down and sensor circuits.

How do I measure a resistor with a multimeter?

Set the multimeter to the ohm (Ω) range, take the resistor out of the circuit and touch the probes to both ends. Measuring it in circuit can give a wrong result because of the other components.

My resistor is getting hot. Is that normal?

Slight warming is normal, but if it's too hot to touch, the resistor's power rating is too low or there's a fault in the circuit. Calculate the power with P = I² × R and use a higher-wattage resistor.

What is a potentiometer?

A potentiometer is an adjustable resistor whose value changes when you turn its knob. On Arduino its middle leg goes to an analog input for things like volume, speed or brightness control.

See all projects
LED Blink
AR-1Beginner

LED Blink

The very first hello of electronics: switching a single LED on and off. The Arduino keeps the LED on for one second and off for one second, so you can easily follow every blink.

4.6(203)
1379
LED Control with a Push Button (Push)
AR-9Beginner

LED Control with a Push Button (Push)

Just like a doorbell: the light stays on as long as you press, and goes off when you let go.

4.8(118)
283
Toggle an LED with a Button (On/Off)
AR-10Beginner

Toggle an LED with a Button (On/Off)

Press the button once and the light comes on, press it again and it goes off, just like the light switch in your room.

4.7(105)
183
Measuring Light Intensity with an LDR
AR-11Beginner

Measuring Light Intensity with an LDR

Want to see how bright your room is as a number? The LDR, a small part that reacts to light, measures the light around it, and the Arduino writes the value to your computer screen every half second.

4.5(86)
154
Night Light with Ldr
AR-12Beginner

Night Light with Ldr

A little night light that turns on by itself when it gets dark and goes off when morning comes.

4.7(107)
247
Temperature Measurement with NTC and 2x16 Lcd Display
AR-44Beginner
Premium

Temperature Measurement with NTC and 2x16 Lcd Display

Measure the temperature around you with a sensor that looks like a tiny bead. This part, called an NTC, lets electricity through more easily as it warms up; the Arduino reads that change, turns it…

4.5(33)
44
Digital Voltmeter with LCD Display
AR-56Intermediate
Premium

Digital Voltmeter with LCD Display

Find out how much voltage a battery or power adapter gives with a meter you built yourself.

4.5(27)
36
Servo Motor Operation with Potentiometer
AR-36Beginner
Premium

Servo Motor Operation with Potentiometer

As you turn the potentiometer knob, the servo motor's arm turns right along with it: one end of the knob means zero degrees, the other end means half a turn.

4.6(37)
54