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 :(

Update 2021-10-28: With the new Pi Zero 2 W, you can also disable some of the CPU cores to reduce power consumption for a heavily-utilized Pi if it doesn't need all the CPU cores running.

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.
Turn off WiFi Radio (wireless models) 10+ mA Disabling WiFi via `sudo rfkill block wifi` can save a little power, though for many applications this also removes the single communication protocol the Pi uses for things like IoT connections or remote control via SSH, so this is not always an option. Make the change persistent by adding the [`disable-bt` and `disable-wifi` overlays](https://github.com/raspberrypi/firmware/blob/2d08e8a2ae963819db9605b81f…) in your `/boot/config.txt`.

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.

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."

Wow calling a person a n00b is pretty rude 2 me. If u have a suggestion, please post it here instead of mocking people. After 4 years, you have not made another post. I'm beginning to wonder u don't know anything at all and just want to be a jerk.

Bob got lots of activity on his post! He did a good job as getting reactions from those on the internet silly enough to be offended at something so petty and insignificant. It is almost as if that was the point and people are falling for it. Five years on and he is still stirring the pot! I am impressed. ∠(^ー^)

Bob, those are newb settings. You save more power by cross-lacing the primary computing core thereby avoiding quantum radiation leaks in the L2 cache.

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.

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

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.

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-cha…)

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.

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)

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.

Hey Jeff, thank you for sharing your results/findings. I am currently looking for possibilities to add a ups to the pi to run while a power outage occured and stumbled upon your post, which is not exactly what I am looking for, but has good hints on how to reduce power in case of an outage, so thank you :)

thanks for these tips to reduce power consumption.
One thing though: I would never recommend disabling the HDMI port via automated boot script. How would you recover the Pi if there ever was an issue with ssh access?

Couldn't you pull the micro SD card, use another computer to edit the boot script (comment out the line disabling HDMI), & then be up & running?

Disabling HDMI with 'tvservice -o' no longer appears to work with the latest Pi OS based on Bullseye. I tried looking around for an alternative but haven't found one. Got any ideas?

Clean Bullseye install default to dtoverlay=vc4-kms-v3d (in /boot/config.txt)
Change it back to dtoverlay=vc4-fkms-v3d (note the 'f') and tvservice will work again.

rc.local has been deprecated in favor of systemd.

I found this article on porting commands over, it's a bit more work but worked for me: https:// www.redhat. com/sysadmin/replacing-rclocal-systemd
(can't post urls?)

In Bullseye by default there is a message with tvservice -s (or --status) that explains tvservice is not supported:

pi@raspberrypi:~ $ sudo tvservice -s
tvservice is not supported when using the vc4-kms-v3d driver.
Similar features are available with standard linux tools such as modetest from libdrm-tests.

The dtoverlay=vc4-fkms-v3d does indeed reactivate the tvservice command in Bullseye. However, I found that adding /usr/bin/tvservice -o to the end of rc.local did not work, judged by rebooting and running tvservice -s

pi@raspberrypi:~ $ sudo tvservice -s
state 0x40000 [NTSC 4:3], 720x480 @ 60.00Hz, interlaced

What did work was adding @reboot tvservice -o to crontab (root). Then:

pi@raspberrypi:~ $ sudo tvservice -s
state 0x120000 [TV is off]

If you want to use peripherals, but only sometimes... consider a Per-Port-Power-Switching (PPPS) USB HUB, such as the UUGEAR MEGA4. Using uhubctl you can enable and disable power to USB ports.