Power Saving Tips for Raspberry Pi

Since the time I got my Raspberry Pi camera, I have been so impressed with its versatility that I have done almost all experiments that can be done with it. The thing which impressed me the most was making time lapse videos. As I made more and more Time Lapse videos, I was limited by the time I could do it as I was powering the Pi via battery banks as the setup was at remote locations. This caused me to research more ways by which I could maximize the time a Pi is ON on limited battery capacity. The first thing I did was take a battery which had a solar panel on it so that it could charge in sunlight at the same time as deliver power to the Pi. This did increase the Pi run time but it was still not enough. Following are the tips I can give for increasing the run time of the Pi based on my journey. Also, the various run times under various situations are documented in this post.

Raspberry Pi on Battery Uptime Compilation

Requirement

One of the most important thing required on your journey for power saving is a USB to TTL cable. This cable will empower you to take console to the Pi via GPIO pins. There is another possibility by which you can take console to the Pi and that is by bluetooth TTL adapter.

Tip 1 Avoid unnecessary peripherals

If you are thinking of Power saving on a Pi, things like keyboard mouse (wired or wireless), wifi, etc. are a luxury. USB to TTL cable should easily replace all keyboard mouse combos as mostly you will be working on console and for that you can use your laptop or computer to take console to your Pi. Even if you do connect keyboard mouse combos, do not in any case use WiFi dongles as they are the biggest power hoggers even when they are not doing any data transfer. Without the use of WiFi dongles, you can easily increase the run time of Pi by 20-30%. I won’t say much about the use of ethernet as in remote locations there won’t be much possibility of using it.

Tip 2 Shut the USB Hub in Raspberry Pi Model B

After searching a lot for ways to reduce power, I came across people who have inferred from their use of Pi that the USB Hub (which is the small chip close to the USB ports) is a major power hogger as it gets hot even when not much in use. This hub is what gives us an additional USB port as compared to Model A and an ethernet port. Luckily there is a way to shut this hub and reduce power consumption. As per this post, Ryan has been able to document how to shut this hub. He has posted the script here using which you can shut the hub and save power. My experiments with it show that you can increase the run time of Pi by nearly 5 hours which is phenomenal. So my suggestion is that when you are on mains power, you can use all the bells and whistles which the Pi can provide and when you want to put the Pi outdoors on battery, shut the USB Hub. As soon as you shut the hub, you can access none of the USB ports and ethernet, so the only way you can access the Pi is by console.

Script made by Ryan for shutting USB Hub

#!/bin/bash
#Code to stop
/etc/init.d/networking stop
echo 0 > /sys/devices/platform/bcm2708_usb/buspower;
echo “Bus power stopping”

#!/bin/bash
#Code to start
echo 1 > /sys/devices/platform/bcm2708_usb/buspower;
echo “Bus power starting”
sleep 2;
/etc/init.d/networking start

Update (based on Adam’s comment): If you cannot locate buspower, use the below mentioned command to locate it and replace in the above script.

find /sys/devices/ -name `dmesg -t | grep dwc_otg | grep “DWC OTG Controller” | awk ‘{print $2}’ | cut -d”:” -f1`

Update (based on Andreevym’s comment): 

step 1) find /sys/devices/ -name `dmesg -t | grep dwc_otg | grep “DWC OTG Controller” | awk ‘{print $2}’ | cut -d”:” -f1`

step 2) sudo su

step 3) echo 0 > /sys/devices/platform/soc/3f980000.usb/buspower

Tip 3 Use Raspberry Pi Model A

I cannot emphasize how important it is to get Raspberry Pi Model A if you intend to use the Pi on battery for long duration. With the previous tip, I was able to run the Pi straight for 13 hours. As I am mostly using the Pi for time lapse, I had a desire to use the Pi for 24 hours straight so that I could capture every moment of the day. The Model A has empowered me to achieve that feat. In my latest time lapse, I was able to do just that. I was able to run the Pi for 24 hours straight on the battery. The power requirement of Model A is so low that there are times the Pi gets switched on even if I don’t press the power button on the battery bank. There are times when it is difficult to know whether the Pi is on because the LEDs on the battery bank would remain steady and not blink.

Tip 4 Down-clock the Core (Based on comment by User Headpi)

if you downclock your core, i think you consume less power too.
Adding this lines to your config.txt
arm_freq_min=250
core_freq_min=100
sdram_freq_min=150
over_voltage_min=0 or 4 if you have overclocked your rasppi

i have it overclocked to 1100 mhz, it works at 250 mhz when i do nothing.
In 1100mhz mode it operates at 64ºC with fan,
and 30ºC at 250mhz mode.

Tip 5 Turn off video output (based on comment by Antonio David Alarcón Doval)

This tip has been suggested by many people. If your system is headless (no video output) you can turn off the HDMI port with:
sudo /opt/vc/bin/tvservice -o
to turn it back on:
sudo /opt/vc/bin/tvservice -p
This command will save you around 20-30mA.

Please post your Results

If you have a tip by which the run time of a Pi can be increased, please let me know so that I can experiment with it.

I hope my post has been helpful in your life but the only guide which can help you in the hereafter is the Qur’an. You can download the English translation of the Qur’an here.

30 thoughts on “Power Saving Tips for Raspberry Pi

  1. One big thing is to replace the linear regulator with a switching 3.3v. supply. I use the one from Adafruit. The quick way is just to clip the two “legs” at the edge of the board and use one of the other connectors. The harder way is to remove the regulator and run wires to the pads (mainly the big 3.3v pad since it needs lots of heat and is big and you don’t want to pull off the copper).

    http://www.adafruit.com/products/1066

    You can also shut off the video output:

    p to pe2 ftp remarked with Explicit null

    Some of the stuff I’m doing could use the added RAM, but I didn’t know how to shut off the ethernet/usb.

    You might be able to replace many connections with bluetooth. Keyboard, mouse (gpm!), network, audio.

    http://www.raspberrypi-spy.co.uk/2013/09/how-to-connect-the-perixx-bluetooth-keyboard-to-the-raspberry-pi/

    Gives a tip on how to stick with the command line and not install all the CUPS printer drivers (–no-install-recommends?).

    • Thanks for your input. I had read Dave’s article before, not for power saving but for running Pi off spare smartphone batteries. The issue here is that I cannot procure RPi or any device off adafruit so I don’t want to tamper with my existing RPis. If you have any data for power saving, I can link to you.

  2. Hi!
    Thank You the good tutorial, I tried it. I made a netradio with Python code and I inserted only the two lines in it: /etc/init.d/networking stop and /etc/init.d/networking start. It works well, because I activated the two lines with push-buttons. (so You do not need console to use it, if You have push-buttons). The problem is that, I measured the current of the RPi and I did not notice any difference, when I switch off the chip or not. Have You any experience?

    • When you insert the commands you mentioned, it only disables networking on the RPI but the network adapters, if any, are still functional. The main power hogger is the USB Hub chip which can be disabled as mentioned in the article. After disabling the chip there is considerably less power usage as I used to have remote setups for Time lapse video which would last 24 hours on power bank.

      • Yes, You are right!!! I wrote the lines in my Python and it works
        os.system(“/etc/init.d/networking stop”)
        os.system(“echo 0 > /sys/devices/platform/bcm2708_usb/buspower;”)
        and
        os.system(“echo 1 > /sys/devices/platform/bcm2708_usb/buspower;”)
        time.sleep(2)
        os.system(“/etc/init.d/networking stop”)
        I have RPi B+ with a netradio Python code:http://www.hobbielektronika.hu/forum/topic_post_1721287.html#1721287, the push buttons drive interrupts, so I can switch off and on the “standby” mode in the RPi.
        My experiences: in normal mode the current is 560-580 mA with LCD display and USB WIFI dongle. (about 2.9 Watt). If I switch off the chip, the current is 220 mA, the power is about 1.1 Watt which is about 60 % less, then in normal mode!!!
        The other thing is the temperature of the CPU chip. In normal mode it is 48Celsius(118F), in “standby” mode it is 42Celsius(107F).
        So this method is excellent if you want to use RPi in standby mode.

  3. Sorry, my english is really bad,
    if you downclock your core, i think you consume less power too.
    Adding this lines to your config.txt
    arm_freq_min=250
    core_freq_min=100
    sdram_freq_min=150
    over_voltage_min=0 or 4 if you have overclocked your rasppi

    i have it overclocked to 1100 mhz, it works at 250 mhz when i do nothing.
    In 1100mhz mode it operates at 64ºC with fan,
    and 30ºC at 250mhz mode.
    I hope my post has been helpful.

  4. Pingback: Raspberry Pi: Saving Power » Mike's Lab

  5. Also if your system it’s headless (nno video output) you can turn off the HDMI port with:
    sudo /opt/vc/bin/tvservice -o
    to turn it back on:
    sudo /opt/vc/bin/tvservice -p
    this command will save you around 20-30mA (not much), but if you use batteries those amps could means a few more minutes.

  6. I’m experimenting with a witty pi power management HAT (1), my idea is to schedule a boot via the Witty, schedule image capture and poweroff via /etc/rc.local . When powered down the Pi A+/Witty does not delectably consume any current. Booting Vanilla Rapbian (Jessie) through to desktop used about 1-2 mAh, That’s about twice the idling consumption so it starts to break even at 1 shot every 2-3 minutes and better than even at say 5+ minutes.

    (1) http://www.uugear.com/witty-pi-realtime-clock-power-management-for-raspberry-pi/

  7. Hi, How do i disable power to all USB ports. Running echo 0 > /sys/devices/platform/bcm2708_usb/buspower disabled my wireless dongle but other device is still ON.

  8. Hi,

    If mains fail device (rasberry pi) change to battery mode , if battery mode am disabling usb , Ethernet, HDMI and LCD back light off etc, any other option to disable like gpio’s, battery mode expected time not reaching and this board support any sleep or deep sleep mode ,please suggest me its any other option

    Thanks in advance,

  9. will the internal WiFi still continue working if I follow your USB disable steps? I would like to power down the USB and it is ok to power down also the Ethernet, but I need to have the WiFi working.

  10. UPDATE: Tip 2 Shut the USB Hub in Raspberry Pi Model B

    step 1) find /sys/devices/ -name `dmesg -t | grep dwc_otg | grep “DWC OTG Controller” | awk ‘{print $2}’ | cut -d”:” -f1`

    step 2) sudo su

    step 3) echo 0 > /sys/devices/platform/soc/3f980000.usb/buspower

  11. For Raspberry Pi 3 Model B+
    All functionality on (USB, WLAN), Kodi running, just reduced power and clocks:
    # 53.7’C at 26 ambient, Pi3 case, passive cooling.
    force_turbo=0
    arm_freq=900
    arm_freq_min=300
    gpu_freq=250
    core_freq_min=250
    h264_freq=250
    v3d_freq=250
    sdram_freq_min=250

    over_voltage=-3
    over_voltage_min=-4

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.