# Computing stuff tied to the physical world

## What is “power”?

In Musings on Dec 3, 2010 at 00:01

Here’s something which may be totally obvious to some, yet clear as a mud to others…

Voltage, current, power – what are they? Here are some puzzles I’ll go into:

• Why does a 4x AA battery pack run out almost as fast as a 3x AA battery pack?
• Why does a 9V battery last about 1/4th as long as a 3x AA pack?
• Why does the 1x AA Power Board run out of juice 3 times as fast as a 3x AA battery pack?

Let’s take it one step at a time. An often-used analogy for electricity is water (see hydraulic analogy). To simplify, let’s say that electricity flows from a high voltage to a low voltage, such as ground. Likewise, water flows from a high location to a lower location. So let’s make the analogy that high voltage equals water high above the ground.

This is what happens in a circuit where a 3.6V battery powers a JeeNode:

While in the battery, the voltage is “at” 3.6V. When it goes through the on-board voltage regulator, it is made to drop to 3.3V, and then that electricity flows through the ATmega, RFM12B, etc, to ground.

Let’s assume the circuit draws 10 mA. The thing about current is that it’s doesn’t change across a circuit, like voltage does. Using the water analogy: current is the amount of water flowing. And no matter where it flows, the amount at the top is the same as the amount lower down. It might trickle down in different ways, but the amount into the whole circuit is the same as the amount coming out:

So what we have is a battery, where the electricty “starts out”, and then it traverses first the voltage regulator, then the ATmega, etc, and then it flow back into the battery at 0V, which in effect “pumps” it back up to 3.6V. And the the cycle repeats.

I’m taking many liberties here. Electricity doesn’t really flow from + to -, and there’s no pumping involved either. But as a mental model, this actually works pretty well.

So what’s “power” then, eh?

Well, power is defined as “voltage times current”. I’ve added the calculations in that second diagram. As you can see, with a 10 mA current consumption, the battery generates 36 mW, of which the voltage regulator consumes (i.e. wastes) 3 mW, and the ATmega, etc, get the remaining 33 mW.

What you may not realize, is that “consuming power” is basically equivalent to “turning electricity into heat” – because that’s what happens, essentially. Think about it: the JeeNode is really just a mini electric heating. It isn’t very much heat, and it happens over a long stretch of time. But in the end, when the battery is dead, you’ve done nothing but heat up the surroundings a teeny bit…

Well, almost: a small amount will have been emitted as radio energy when the RFM12B is transmitting.

Ok, so now let’s try to answer the above three questions.

Why does a 4x AA battery pack run out almost as fast as a 3x AA battery pack?

This is due to the voltage regulator. If you feed it say 4.8V, instead of 3.6V, it will simply waste that extra energy: the voltage drop over the regulator will be 1.5V instead of 0.3V, so that the output of he regulator stays at 3.3V. That’s the whole purpose of the regulator after all: to deliver a constant voltage, regardless of the voltage placed on its input pin.

Here’s what would happen if you put 9V on the voltage regulator:

And here’s how that works out in terms of power consumption:

(correction: the 5.3V – bottom middle – should have been 5.7V)

In other words: you can raise the voltage all you like, it won’t have any effect on the amount of power needed or used by the ATmega, etc. They will always get 3.3V, and will continue to draw 10 mA as before.

The only thing that happens, is that the voltage regulator works a little harder, and wastes a bit more power by turning it into more heat!

Conclusion: if your circuit doesn’t need the higher voltage to work properly, power it at the lowest practical voltage. Keep in mind that the “low-drop” voltage regulator on the JeeNode likes to have at least 0.1..0.2V to do its job properly. Both 3x AA packs and LiPo batteries are just about perfect for JeeNodes.

Another very important lesson from this is that if you’re trying out stuff, and you notice that the voltage regulator is getting very hot because some part of your circuit draws a lot of current, then you should try to reduce (!) the voltage you’re feeding into it: you’ll help the regulator, by giving it less power to eat up and waste.

Why does a 9V battery last about 1/4th as long as a 3x AA pack?

Now with the above explanation, it should be clear that the 9 volts won’t give you a longer-running JeeNode. But why is it so much shorter?

The reason is that not all batteries contain the same amount of energy. The capacity of a battery is specified in terms of milli-Ampere-Hour: an AA battery often has over 2000 mAh. This means it can supply 2000 mA for one hour. Or 1000 mA for 2 hours, 500 mA for 4, etc. And then it’s empty.

Energy is defined as Voltage x Current x Time (or equivalently: Power x Time). The unit is watt hour.

So the amount of power you get when draining an AA battery in one hour (voltage x current) is: 1.5V x 2000mA = 3.0 watt. Consquently, the amount of energy in a a 3x AA pack is 9.0 watt hour.

For a standard 9V battery, the figure is around 500 mAh. This is 9V x 500 mAh = 4.5 watt hour of energy.

Great, so a 9V battery has half as much energy as a 3x AA battery pack, and should last about half as long, right?

Wrong! – go back to that first discussion about feeding the voltage regulator with 9V instead of 3.6V: it just turns that extra voltage into heat.

The way to estimate lifetimes, is to use the current draw as starting point. We assumed in all these examples that the circuit is drawing a constant 10 mA.

On a 3x AA pack (or 4x AA, for that matter), this means we get 2000 mAh / 10 mA = 200 hours of run time.

But on a 9V battery, we’ll only get 500 mAh / 10 mA = 50 hours of run time!

Conclusion: don’t use 9V battery packs for JeeNode projects. They are an expensive way to waste energy, and you’ll keep running to the shop to get new ones.

Why does the 1x AA Power Board run out of juice 3 times as fast as a 3x AA battery pack?

Before even going into that, the first puzzling fact about running a JeeNode off a single AA is really: how can a 3.3V circuit run off a 1.5V power source in the first place? Think about it. As you know, most electrical circuits don’t work at all when the supply voltage is too low.

It’s equivalent to asking: how can you get water which flows at a certain level to lift itself to a higher level?

Hint: there exists an ingenious type of water pump which can do this!

To be continued in tomorrow’s post…

1. Excellent subject for a tutorial. Good discussion of the voltage regulator’s role in power consumption. If you go further into this, you might distinguish between power and energy. Power is the instantaneous product of current flowing through a device at a voltage (Voltage x Current = Watts). Energy is the power used (or delivered for a battery) over a period of time (Voltage x Current x Time = Watt-hours).

• Ah, that’s a great way to clarify. I’ll see if I can adjust the wording some more. Been tweaking it a bit already. Thank you!

2. Awesome post! One thing you might comment on as well is the difference voltage and mAh ratings even between AA batteries. NiMH rechargables versus alkalines.

3. I don’t want to seems pedantic, but “The thing about current, is that it’s doesn’t vary, like voltage” doesn’t apply when a transformer is involved. I know that in this instance you are talking about batteries and DC, but should you add a caveat? Otherwise, a great start.

• Good point, thx. I’ll rephrase and go into it a bit more in tomorrow’s post.

4. Great tutorial. I seem to spend most of my life looking at designs using a 9v battery and crying “Whyyyyyyy?!!!!”.

Two AA batteries an a JeeLabs AA power board are about the same physical size as a PP3, but last so much longer.

Actually, slightly on this subject (and bridging a previous one), did you find any good boxes with a battery compartment that takes either 1 or 2 AA or AAAs?

5. did you find any good boxes with a battery compartment that takes either 1 or 2 AA or AAAs?

Sorry, no. I’ve combed through some lists with box offerings in the past, but I always stopped at €10, which I consider too expensive for “just” a box.

6. There is a hint, let’s make a guess… My guess is the “ram pump” Lovely application of physics, made one myself once. Could take a shower by the end of the day with the water it pumped up to a height of 2 meters :-)

• Bingo!