Skip to main content
Insights

IoT & Embedded Systems

Electronics Basics for Students: Resistor Colour Codes, Ohm's Law and Number Systems Explained

Three basics you use in almost every electronics project: reading resistor colour codes, applying Ohm's law to choose an LED resistor, and converting between binary, decimal and hexadecimal. Worked examples and free tools included.

By Team Gopafy · 13 Oct 2026 · 9 min read

A row of colour-banded resistors lined up on a white surface in close-up, showing the colour code.

Whether you build with an Arduino, an ESP32 or just a breadboard, three basics come up again and again: reading resistors, Ohm's law and number systems. This guide explains each with worked examples, and shows where the free resistor calculator and number converter can check your answers.

Part 1: The resistor colour code

A resistor limits the flow of current. Its value is printed as coloured bands. In a 4-band resistor, the first two bands are digits, the third is a multiplier and the fourth is the tolerance. A 5-band resistor has three digit bands, then the multiplier and the tolerance.

ColourDigitMultiplierTolerance
Black0×1
Brown1×10±1%
Red2×100±2%
Orange3×1,000
Yellow4×10,000
Green5×100,000±0.5%
Blue6×1,000,000±0.25%
Violet7×10,000,000±0.1%
Grey8±0.05%
White9
Gold×0.1±5%
Silver×0.01±10%

Examples

  • Yellow, violet, red, gold: 4, 7, ×100, ±5% gives 4,700 Ω, which is 4.7 kΩ ±5%.
  • Brown, black, orange, gold: 1, 0, ×1,000, ±5% gives 10 kΩ ±5%.
  • Green, blue, black, brown, brown (5-band): 5, 6, 0, ×10, ±1% gives 5,600 Ω, which is 5.6 kΩ ±1%.

Hold the resistor with the gold or silver band on the right, and read from the left. If you are unsure, measure it with a multimeter, or enter the colours in the resistor calculator.

Part 2: Ohm's law

Ohm's law links voltage (V), current (I) and resistance (R):

V = I × R, so I = V ÷ R and R = V ÷ I.

Power is P = V × I, which tells you how much heat a part must handle. A common small resistor is rated for about a quarter of a watt.

Example: which resistor for an LED?

You power a red LED from the 5 V pin of an Arduino. The LED needs about 2 V and you want about 20 mA (0.02 A).

  1. Voltage left for the resistor: 5 V − 2 V = 3 V.
  2. Resistance: R = 3 ÷ 0.02 = 150 Ω.
  3. Choose a standard value at or above this, such as 150 Ω or 220 Ω. With 220 Ω the current is 3 ÷ 220 ≈ 14 mA, which is safe and bright enough.

On a 3.3 V board such as the ESP32, the same LED leaves 1.3 V for the resistor. For about 10 mA, R = 1.3 ÷ 0.01 = 130 Ω, so a 150 Ω resistor works and gives about 8.7 mA.

Resistors in series and parallel

  • Series: add the values. 1 kΩ + 2 kΩ = 3 kΩ.
  • Parallel: the total is less than the smallest one. Two 1 kΩ resistors in parallel give 500 Ω. For two resistors, use (R1 × R2) ÷ (R1 + R2).

Part 3: The voltage divider

Two resistors in series divide a voltage:

Vout = Vin × R2 ÷ (R1 + R2), where Vout is measured across R2.

Example: to bring a 5 V signal down for a 3.3 V board, use R1 = 1 kΩ and R2 = 2 kΩ. Vout = 5 × 2,000 ÷ 3,000 ≈ 3.33 V. This is how many students connect the 5 V echo pin of an HC-SR04 to an ESP32 pin. Use it for signals only, and not to power parts that draw current. A divider is also how an LDR or thermistor becomes a voltage a board can read.

Part 4: Binary, octal, decimal and hexadecimal

The same number can be written in different bases. Computers use binary (base 2), people use decimal (base 10), and programmers often use hexadecimal (base 16) because it is a short way to write binary.

DecimalBinaryOctalHexadecimal
10101012A
15111117F
100110010014464
24011110000360F0
25511111111377FF

Binary to decimal

Add the powers of two for each digit that is 1. For 1010, the digits from the right are worth 1, 2, 4 and 8, so 8 + 2 = 10.

Binary to hexadecimal

Split the binary number into groups of four bits from the right, and convert each group. 1111 0000 becomes F and 0, so the result is F0, which is 240 in decimal. This is why I2C addresses, memory addresses and colour codes such as #FF0000 are written in hex.

Check any conversion in the number converter, which handles large numbers exactly.

Put it to use

Gopafy's IoT Lab offers project kits with circuit diagrams and documentation for engineering students. Whatever you build, check your calculations and learn why each value was chosen, because that is what examiners ask.

Frequently asked questions

How do I read a 4-band resistor?

The first two bands are digits, the third band is the multiplier and the fourth is the tolerance. Yellow, violet, red and gold means 4, 7, then ×100, with ±5% tolerance, which is 4,700 Ω or 4.7 kΩ. Hold the resistor so the gold or silver tolerance band is on the right when you read it.

What resistor should I use with an LED?

Use Ohm's law: resistance equals the supply voltage minus the LED voltage, divided by the current you want. For a 5 V supply, a red LED of about 2 V and 20 mA, that is (5 − 2) ÷ 0.02 = 150 Ω. A common 220 Ω resistor gives about 14 mA, which is safe and bright enough. Always use a value at or above the calculated one.

What is a voltage divider used for?

A voltage divider uses two resistors in series to produce a lower voltage from a higher one. The output equals the input times R2 divided by (R1 plus R2). With a 1 kΩ and a 2 kΩ resistor, 5 V becomes about 3.3 V, which is useful for connecting a 5 V sensor output to a 3.3 V board. It is for signals, not for powering loads.

Why do programmers use hexadecimal?

Hexadecimal is a compact way to write binary. Each hex digit stands for exactly four bits, so 11110000 in binary is F0 in hex. It is used for memory addresses, colour codes and register values, because long strings of 0s and 1s are hard to read and easy to get wrong.

What does resistor tolerance mean?

Tolerance shows how far the real resistance can differ from the marked value. A 1 kΩ resistor with ±5% tolerance can be anywhere from 950 Ω to 1,050 Ω. For most LED and pull-up uses this does not matter, but precise circuits such as measurement dividers need tighter tolerances like ±1%.

How do two resistors in series or parallel add up?

In series, the resistances add: 1 kΩ plus 2 kΩ gives 3 kΩ. In parallel, the total is lower than the smallest resistor: two 1 kΩ resistors in parallel give 500 Ω. For two resistors in parallel, multiply them and divide by their sum. These rules help when you do not have the exact value you need.

Sources and further reading

Last reviewed 26 October 2026 by the Gopafy team. Rules, rates and prices change, so confirm anything important with the official source.

Try these free tools

Need a website, SaaS or digital campaign?

Tell us what you need and we'll get back within 48 hours.

Start your project

Call us for quick response +91 89042 76807

Keep reading

All insights →

Newsletter

Get new articles by email.

Practical articles on websites, SaaS, SEO and IoT, sent to your inbox when we publish.

  • IoT & Embedded Systems
  • Free Tools
  • SaaS & Startups
  • Digital Growth
  • Digital Engineering
  • No spam, ever
  • Unsubscribe anytime

Subscribe to Gopafy Insights

Add your name and your work email.

No spam, ever. Unsubscribe in one click, anytime.