Sunday, February 3, 2013

More Raspberry Pi Power Saving (Part 3)

Be sure to read part 1 and part 2.
Further adding to the Raspberry Pi's superfluous power draw are the linear 1.8V and 3.3V regulators (RG1 and RG2 respectively). Currently in place of the 3.3V regulator is the NCP1117/SE8117TA (which in turn feeds the 1.8V regulator in series). People are reporting that a modification of RG2 to a switch mode variant sees reductions in power consumption between 10 to 25%. I will not be looking to replace the 1.8V regulator as it seems to only offer marginal improvement on top of replacing RG2.

I have chosen to replace this regulator with the RECOM R-783.3-0.5 high efficiency/low ripple switching supply. It offers very high efficiency (91%) at it's minimum voltage limit (4.75V) so at 5V it should offer about the same. It has the following pinout:
Be careful, because it has a slightly different pinout to the NCP1117 on the board (which also uses the tab rather than pin2 for Vout).
Remove the NCP1117 and replace with the RECOM R-783.3-0.5. You will need to work some magic with the pins (be sure to pre-plan as you don't want to have to re-bend the legs as they can break off quite easily). As a tip, I decided to solder Vout to the top of capacitor C11 for convenience, rather than the pad/tab.
Alright, now to check it's still working.
Now for some new measurements:
25.7mA - After "sudo halt"
93.6mA - Idle (avg)
96.2mA - Idle (avg) (with HDMI connected)
136.0mA - Running stress test
138.8mA - Running stress test (with HDMI connected)
Comparing that to the previous tests, we achieve a load reduction of 13.5-16.4% (27.2% when halted) which is nothing short of awesome.

But we can't stop there. All this power has gone to my head. We can now enable a power saving mode which will throttle back the CPU when idling.

Install the following (note, you will need a USB NIC on a hub to connect to the internet if you have removed the LAN9512):
sudo apt-get install cpufrequtils

Edit /boot/config.txt and insert the following values:
force_turbo=0 #turns on frequency scaling
arm_freq=700 #sets max frequency
arm_freq_min=100 #sets min frequency
Then you can now set the 'ondemand' governor. This will alter the CPU clock speed depending on load.

cpufreq-set -g ondemand

Now reboot. If you don't perform all of this before rebooting (contrary to what's on the site linked above), you will have issues with the pi rebooting because the CPU frequency is too low (as the Broadcom's watchdog time kicks in) or USB devices acting bizarre.

You can check you current speed in Hz with "cpufreq-info"

Now for the stats:
90.5mA - Idle (avg) - 100Mhz
93.6mA - Idle (avg) (with HDMI connected) - 100Mhz
134.9mA - Running stress test - 700Mhz
137.93mA - Running stress test (with HDMI connected) - 700Mhz
While this isn't a significant decrease, it still provides some benefit over not having it on and it doesn't take too much effort to enable it.

1 comment:

  1. I have looked all over and can't find the answer to this question. You removed the lan chip on a RPI but, can this be done to a RPI 2?