Attempt to run a Raspberry Pi Zero completely on solar power. Uses an Arduino (Pro Mini) to shutdown/bootup Pi based on battery voltage.
Add to /boot/config.txt
:
dtoverlay=gpio-poweroff,gpiopin=21,active_low="y" # GPIO pin 21 (physical pin 40) will go high when the Pi is on and low when off.
dtoverlay=gpio-shutdown,gpio_pin=20 # Pull GPIO pin 20 (physical pin 38) low to shut down Pi.
- Turn off HDMI with
/usr/bin/tvservice -o
(/usr/bin/tvservice -p
to reenable). Set this automatically at boot by adding it to/etc/rc.local
. Saves about 30mA on my setup. - Turning off wifi interface tx with
iwconfig wlan0 txpower off
saves about 30mA. You can turn it back on withiwconfig wlan0 txpower auto
. - Turning off the ACT LED using
echo none | sudo tee /sys/class/leds/led0/trigger
saves about 2mA, which is hardly worth it imo since it makes it harder to know if the Pi is on or not. Turn the LED back on usingecho mmc0 | sudo tee /sys/class/leds/led1/trigger
. - Instead of the default
deadline
I/O schedular, usenoop
, which has less CPU overhead. In/boot/cmdline.txt
, setelevator=noop
. This saves me about 5mA.
- Lower the swapiness setting so the system doesn't swap nearly as often, saving on I/O. In
/etc/sysctl.conf
, addvm.swappiness = 1
. - Disable bluetooth. In
/boot/config.txt
, adddtoverlay=pi3-disable-bt
. - Turning off USB using
echo 0 | sudo tee /sys/devices/platform/soc/20980000.usb/buspower >/dev/null
. Could be because I don't have anything connected to the USB port. (Turn it back on usingecho 1 | sudo tee /sys/devices/platform/soc/20980000.usb/buspower >/dev/null
)