# Computing stuff tied to the physical world

## Three laws – part 1

In Hardware on Apr 27, 2013 at 00:01

It’s always a puzzle to predict just what will happen when you hook up some components.

But as mentioned in the what-if series, it’s really useful to be able to do so, to avoid surprises and damage. Also for questions such as: Why does a higher voltage cause a higher risk of damage in one case and less so in the other? Why do I need a resistor in series, and of what value? What if I don’t have the right resistor or a different voltage?

Lots of complex issues, but the simplest and most important case usually is static analysis and DC (direct current) voltages, i.e. when only one or two states are involved, and not so much the switching and AC (alternating current) behaviours.

You just need to get familiar with three “laws” of electricity:

• Ohm’s Law – given two of: voltage, current, and resistance, we can predict the third.
• Kirchhoff’s Current Law – current always adds up: what goes in, must come out.
• Kirchhoff’s Voltage Law – how voltages “spread” across interconnected components.

That and learning what the basic behaviour is of resistors, diodes, capacitors, etc, and you’ve got all the knowledge you need to “see” what a circuit does, before even building it and trying it out. And by this I really mean literally “visualising” what is going on – it only takes a little practice to turn this into a very intuitive skill.

You just have to grasp the essence of those three laws. So let’s get on with it, eh?

Ohm’s Law

This is by far the most important one. It says everything about resistance. The unit of resistance is – not surprisingly – the “Ohm”: a resistor of 1 Ohm will let 1 Ampère of current flow when you apply 1 Volt of electric potential difference over it. The formula is:

``````U = I x R
``````

(U = voltage, I = current, R = resistance)

Same law, different uses, by simple algebraic manipulation: `I = U / R`, and `R = U / I`. If you know two of the units, you can calculate the 3rd.

• What happens when I touch both poles of a car battery?
My skin resistance will be some 100 kΩ, so I = U / R = 12 / 100,000 = 0.000,12 A = 120 µA. A tiny current, I wouldn’t sense a thing, so the answer is: “nothing happens”.

• What happens when I place a metallic nail across that same 12V car battery?
Let’s say the resistance of that nail is 0.1 Ω, i.e. almost a short, so I = U / R = 12 / 0.1 = 120 A, a huge amount of current. The nail will heat up like crazy, it might even melt!

Same battery, very different outcomes.

And it’s not just useful to predict such extreme cases. It also helps understand why some hookups are inherently safe: if my power supply delivers no more than 5V, and I am playing with resistors of 1 kΩ or more, then no matter how I hook things up (apart from shorting things out), there will never be more than I = U / R = 5 / 1,000 = 0.005 A = 5 mA of current through my circuit. A 1 kΩ resistor in series with just about any component will “limit” the current to 5 mA, which virtually prevents damage to just about any component.

Another example: suppose I am using a 12 V power supply, and want to turn on an LED with it. Most LED’s glow nicely at 20 mA. So if I put a R = U / I = 12 / 0.020 = 600 Ω resistor in series with the LED, I can be certain that the LED won’t get damaged. Better still, if I only have a 1 kΩ = 1000 Ω resistor, I can predict that it’ll probably work just fine in this same circuit as the current will be at most I = U / R = 12 / 1,000 = 12 mA. Using a 100 Ω resistor would be a bad idea (max current 120 mA), and using a 10 kΩ resistor probably also wouldn’t work (1.2 mA might be too little to make the LED light up).

These are all approximations, but they are extremely useful – even as such.

Some consequences of the simple ” `U = I x R` ” formula Georg Simon Ohm gave us:

• twice the voltage => twice the current
• twice the resistance => half the current
• twice the current => twice the voltage drop

One thing to take away from all this, is that it’s not a bad idea to buy some 100 Ω, 1 kΩ, and 10 kΩ resistors. Having a bunch of spare resistors can often come in handy, as a way to limit the current (and hence avoid damage), and these three values are often all you need to try out a few things in circuits running at 1.5 .. 12V.

Tomorrow, we’ll give the stage to Gustav Kirchhoff!

1. I’ve always wondered why sometimes I see U used in ohms law (I was always taught using V). When you write 3.3V you use V, I’ve never seen it written 3.3U, I wonder why?

2. Phil, it’s the difference between the value and the units used to measure them. We might use the letter l as variable name for a length but the letter m as the symbol for the metre unit. So we’d say l = 3 m, not m = 3 l.

The funny thing with English is the use of the word “voltage” for electro-magnetic force. This sort of muddles up the quantity and the unit, as if we used “footage” or “metreage” for length (well, we do use “footage” figuratively for some purposes, e.g., film, even when it’s video in solid-state memory). German (and I think Dutch) is a bit more sensible and uses “spannung” (literally tension or similar) for the EMF but, of course, volts for the units.

3. Thanks, that makes sense, another englishism.

4. The most important law besides Ohm was the Thevenin Equivalent, where you can combine the resistors of a circuit to one equivalent resistor. Using that you can avoid Kirchhoff which only makes matters difficult imho.