How it works
Ohm’s Law relates three fundamental electrical quantities:
V = I × R
Where V is voltage in volts, I is current in amperes, and R is resistance in ohms. Rearranged to solve for any variable:
I = V / R
R = V / I
Power dissipation ties them together:
P = V × I = I² × R = V² / R
Practical embedded examples
GPIO current limiting
An STM32 GPIO pin driven to 3.3 V through a 330 Ω resistor:
I = 3.3 / 330 = 10 mA
P = 3.3 × 0.01 = 33 mW
10 mA is within the 25 mA GPIO limit. The resistor dissipates 33 mW — a 0.125 W (1/8 W) resistor handles it with margin.
Pull-up resistor quiescent current
A 10 kΩ I2C pull-up on a 3.3 V rail:
I = 3.3 / 10000 = 330 µA per line
P = 3.3 × 0.00033 = 1.1 mW
At 400 kHz (Fast Mode), the bus is mostly idle. This quiescent current matters in sleep-critical designs — use 47 kΩ for battery-powered nodes where timing slack allows it.
Resistor power rating
Calculate power before selecting a part. Common ratings: 0.063 W (1/16 W), 0.1 W, 0.125 W, 0.25 W, 0.5 W, 1 W. Use a part rated at least 2× calculated dissipation for thermal headroom. A 12 V supply through a 100 Ω resistor:
I = 12 / 100 = 120 mA
P = 12 × 0.12 = 1.44 W → use a 2 W or 3 W rated resistor
Common mistakes
Wrong units. Ohm’s Law uses base SI units: volts, amperes, ohms. Plugging in milliamps without converting gives a result 1000× off. Convert first: 20 mA = 0.020 A.
Assuming Ohm’s Law applies to LEDs. An LED is not a resistor. Its I-V curve is exponential — doubling the voltage does not double the current, it multiplies it. Always compute the series resistor current from (Vs − Vf) / R, not Vs / R.
Ignoring power. A 1 kΩ resistor across 24 V dissipates 24² / 1000 = 576 mW. A standard 0.25 W resistor will fail. Check power, not just resistance.
Temperature effects. Resistance increases with temperature for metals (positive temperature coefficient). A wire that measures 0.1 Ω at 25 °C measures roughly 0.12 Ω at 85 °C. For precision current sensing, use a low-TCR shunt resistor (Vishay WSL series, < 50 ppm/°C).