Raspberry Pi Zero - Conserve power and reduce draw to 80mA

[Update 2015-12-01: I bought a PowerJive USB power meter and re-tested everything, and came up with ~80 mA instead of the ~30 mA reported by the Charger Doctor that I was using prior. This seems to be more in line with the results others were measuring with much more expensive/accurate meters in the Raspberry Pi forums: Raspberry Pi Zero power consumption. I've updated the numbers in the post below to reflect this change. Seems the Pi Zero is only incrementally better than the A+—still excellent news, but not nearly as amazing as I originally thought :(]

Yesterday my post comparing the Raspberry Pi Zero's power consumption to other Pis hit the Hacker News front page, and commenters there offered a few suggestions that could be used to reduce the power draw even further, including disabling HDMI, changing the overclock settings, and futzing with the lone ACT LED.

Raspberry Pi Zero - new with adapter cable

I decided to spend some time testing these theoretical power-saving techniques on my Pi Zero, and here are some of the tips I've come up with (note that these techniques work with any Pi, not just the Zero):

Technique Power Saved Notes
Disable HDMI 25mA If you're running a headless Raspberry Pi, there's no need to power the display circuitry, and you can save a little power by running /usr/bin/tvservice -o (-p to re-enable). Add the line to /etc/rc.local to disable HDMI on boot.
Disable LEDs 5mA per LED If you don't care to waste 5+ mA for each LED on your Raspberry Pi, you can disable the ACT LED on the Pi Zero.
Minimize Accessories 50+ mA Every active device you plug into the Raspberry Pi will consume some energy; even a mouse or a simple keyboard will eat up 50-100 mA! If you don't need it, don't plug it in.
Be Discerning with Software 100+ mA If you're running five or six daemons on your Raspberry Pi, those daemons can waste energy as they cause the processor (or other subsystems) to wake and use extra power frequently. Unless you absolutely need something running, don't install it. Also consider using more power-efficient applications that don't require a large stack of software (e.g. LAMP/LEMP or LEMR) to run.

A few other seemingly obvious optimizations, like under-clocking the CPU, don't make a discernible impact on idle power consumption, and make a minimal difference in any real-world projects that I've measured. Do you have any other sneaky techniques to steal back a few mA?

For the Raspberry Pi Zero, I used all the above techniques, and here were the results:

  1. Raspbian Jessie Lite nothing besides microSD card, and ACT LED on: 100 mA @ idle
  2. Same as #1, but disable ACT LED and disable HDMI: 80 mA @ idle
  3. Same as #1, but plug in a display, keyboard, trackpad, and WiFi adapter: 310 mA @ idle(!!)

As you can see, it pays to conserve—if you don't need it, cut it away to save power! With the Pi Zero and these power saving techniques, you can extract a lot of usage even in low-power scenarios, like solar energy or running off a battery.

See related:

Comments

What a noob. Did you even enable the microsleep mode on the main IC or remove the OTG pullup?

Care to share how you do this for the benefit of this noob and all the others who might come upon this article? Also, I'd rather not hack the hardware if possible, unless it results in a substantial power savings.

nerd

Wow, how rude!

I have my primary Net-facing server RPi running at pretty low power including such things as the CPU speed governor, and I don't know what you are talking about.

Thus I assume that you are a troll/bully and don't actually know anything useful, since if you did you'd have shared it rather than waving your nether regions at us.

Damon

Reminds me of this quote I came across awhile back... "Give a man a fish and he'll be fed for a day. Teach a man to fish and he'll promptly forget that he once didn't know and proceed to call anyone who asks a n00b and flame them on the boards for being stupid."

It's also possible to sleep the board. If it was doing something like monitoring and only needed to be active for 10s in every minute then that's another 6x saving on power.

I've had a hard time finding reliable instructions for this process; can you provide a link or how you do this and then I'll try to see what numbers this can get me?

Can you also measure power draw when powered on without microsd card inserted and also when resetting the board via shorting the RUN pin to the ground? This could hint at what is the lowest power draw of Pi Zero if power management would be properly implemented by switching off the ARM core when not needed. Even with old B I've seen something like 15mA when held in reset https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=73983

how did you measure the power consumption of your pi?

I used a USB 'Charger Doctor', though I am going to be getting a better USB current meter in a day or two, and will try to verify my findings with it. Others using Fluke meters have found that the draw is a bit higher, but I'm also going to try to get better measurements with a few different meters for comparison.

*disables HDMI*
under software when writing python scripts like this, put sleep statement in there to not run the CPU as fast as it can
while (GPIO.input(RCpin) == GPIO.LOW):
reading += 1

I do indeed minimise a RPI's consumption and run it from off-grid solar...

http://www.earth.org.uk/note-on-Raspberry-Pi-setup.html

Rgds

Damon

That's awesome, thanks for sharing!

Hi. I've done some tests with a Fluke 179 meter and aren't getting the same results. For me, default current (booted, idle, nothing conected) is 88mA, HDMI off drops that to 70.7mA, and with LED also off it drops to 68.1mA. I suspect your little tester is lying somewhat, especially at lower currents.

Dave

Definitely could be the case; I have another meter on the way that should be a little more accurate (though not quite as good as a Fluke), and I'll update the numbers once it arrives.

When it comes to software tweaking, is CONFIG_NOHZ enabled in the kernel? That should disable all periodic ticks from the kernel, allowing the CPU to remain in a low-power state if nothing of interest happens.

https://www.kernel.org/doc/Documentation/timers/NO_HZ.txt

In my limited research, it looks like that option might not be supported (or make a difference) on the Pi/Raspbian. However, if anyone else can figure out a way to set this (or other kernel settings) so it can conserve power, I would love to hear about it!

Any suggestions on using a RPi Zero with solar power? I tried to use an A+ with a MoPi, a solar panel and this solar charge controller (http://www.instapark.com/solar-power-panels/ss1203-3amp-solar-power-char...)

But the batteries never charged for me - it would run off of solar during the day but after a few days it would die, even though the solar panel power should have been more than sufficient to drive the device and charge at the same time.
But I never got it to actually

What watt panel did you use? As it is winter your panel may be suffering a combination of heavy shade and seasonal low power. Your panel could be providing as low as 5-10 percent of its rated wattage, and maybe not even enough to charge the battery.

Your problem could be the MoPi, that alone can draw up to 20ma itself which can be a big drain on a low power setup.

At 30mA since you are not using the HDMI circuit anyways you could use it to power the board for certain applications. Pin 18 of the HDMI standard has a +5V @ 50mA.

I dont know a lot about electricity usage so i wanted to ask you something. I have a 10000 mah battery pack. How do i calculate how much time the RBp zero will last at idle? (80 mah)

Actually, a bit less since the battery is probably rated 10000 mAh @3.3V, which is 6666 mAh @5V (minus some conversion losses).

I wonder if writing to the sd is expensive energy wise, compared to writing to memory. You could test that if you create a ram disk for common writes (/tmp, /var/log/, ...)

Nice article btw :)

Is it possible to turn off the USB bus on a RasPi Zero, as we can do with a RasPi 2? Doing so on the latter saves a ton of power. I tried it with the Zero, but had no luck. And I didn't want to press my luck for fear of bricking my Zero. (Great article by the way, I used two of your pointers to reduce my power consumption on a battery powered RasPi Zero audio recorder I'm building).

The pi2 / pi3 have onboard USB hubs, which is how they get the four USB ports... turning this off could save some power. The zero just has the single USB as implemented in the cpu, so you might not be able to turn it off and if you could it would save less power that on the bigger brothers.