After my first battery test, I was scared with less than 7 hours of runtime. But, as always, I should have known better than use rechargeable batteries right from the package.
After a full charge of the Ikea batteries, I was able to get 21 hours out of the Raspberry Pi zero. So to answer the question that I could not find a simple answer to: “How long will a Raspberry Pi Zero W run on 4 NiMH AA batteries?” The answer is about 21 hours.
Here is the information I gathered from the Pi and how I conducted this “very un-scientific” test.
- I looked at the start time. About 7:00 am, from what I recall.
- I plugged the pre-configured Raspberry Pi Zero W into the batteries using Pins 2 and 6. Pin 2 was connected directly to the battery 4.8-volt positive side, and 6 to ground. I did not use any regulator, just a direct connection. Why? Because the batteries are about 5 volts and will not get higher, only lower.
- I used ssh to connect to the Raspberry Pi W to run a python script to record the time and date to a file every 2 minutes.
- I went to work, played some golf, went to dinner, went to sleep, and when I woke up the next day, the Raspberry Pi Zero W was finally off.
- Checking the file from the handy python script, it recorded 4:16:08 as the last time.
You get 21 hours on a Raspberry Pi Zero running a python script and connected via ssh over WiFi powered by 4 AA Ikea 2450mHa batteries.
Python Script
import time from datetime import datetime while True: f = open('uptime.txt','a') f.write(datetime.now().strftime('%Y-%m-%d %H:%M:%S')) f.write('\n') print(datetime.now().strftime('%Y-%m-%d %H:%M:%S')) f.close() time.sleep (120)
What I learned:
- A Raspberry Pi Zero W may be the way to go.
- Ikea batteries are not a bad deal.
- A Raspberry Pi Zero W in my test consumed 0.1 +/- amps
- I may want to offload some of the processing to an Arduino for driving and other operations. I am thinking of controlling the power with an old fashion relay, turning off all the power to any system at any time to save battery. I need to figure out if the power usage from a relay is going to cause more drainage than savings or if I should look at a solid-state solution. Nevertheless, I want to have the ability to cut power to something should I have an issue with charging.
What’s next?
- Testing wise I am going to try one of them fancy cheap voltage boost/regulators to see if I get more runtime. I need to charge the same set of batteries up first.
- Testing with the solar panels I have to see if I can keep it running 24/7.