The effect of code on power consumption

Of course putting a microcontroller into sleep mode or changing the clock rate has an effect on the power consumption of the chip, but what about different bits of code? Is multiplying two numbers more efficient than adding them, and does ORing two values consume more power than NOPping? [jcw] wanted to compare the power draw of a microcontroller running different loops, so he threw some code on a JeeNode and hooked it up to an oscilloscope.

For his test, [jcw] tested two instructions: multiply and shift left. These loops run 50,000 and 5,000 times, respectively (bit shifting is really slow on ATMegas, apparently) and looked at the oscilloscope as the JeeNode was doing its work.

Surprisingly, there is a difference in power consumption between the multiply and shift loops. The shift loop draws 8.4 mA, while the multiply loop draws 8.8 mA. Not much, but clearly visible and measurable. While you’re probably not going to optimize the power draw of a project by only using low-power instructions, it’s still very interesting to watch a microcontroller do its thing.

Open Source Wireless Mesh Networking Energy Meter

[Jay Kickliter] writes in to tell us about his open source energy/power meter. With his buddy [Frank Lynam] they designed a small device that crams into existing power boxes and uses and 8 core propeller (P8X32A) microcontroller to perform true RMS voltage and current measurements using a current transformer. [Frank] and [Jay] don’t stop there. The meter also features an xbee pro 900 MHZ to provide wireless (and even mesh networking) capabilities to the whole ordeal.

[Jay and Frank] estimate a total unit cost of around $80 (US) per prototype. With volume the price goes down by about half. With a larger number of units, and the magic of mesh networking, we could see cheaper xbee’s driving the cost down some. Check out the Google code page for details or the schematic (pdf) if you are interested.

So far the project is in the beta stages, and only features a single module sending data to a PC running an OS X Cocoa application. [Jay] is about to be otherwise occupied by the Merchant Marines and [Frank] the Navy, so they figured we could have a go at it for awhile.

We have seen other hardware used to monitor power consumption, but cramming this circuit into each power box is a neat idea.

[Frank] explains the whole project in the video after the jump.

[Read more...]

Clamp sensor power monitoring

[Bill Porter] has joined in the pursuit of an inexpensive yet effective way to monitor his power usage. He calls his project the Not So Tiny Power Meter, and shared both his successes and follies involved in seeing it through to implementation. There are problems; sizing issues with enclosures and his PCB, issues with noise when measuring low-current signals with the clamps, and even some wireless communications issues. But it looks like he’s got the system running despite these hurdles. Right now it streams data wirelessly so that he can display the current energy consumption, but he plans to add Google Power Meter functionality next.

We’ve seen commercial units using the same sensing principles that have been hacked to show data online.