USB Power Bank for Raspberry Pi

This page discusses considerations when powering the Raspberry Pi through off-the-shelf USB power banks like Anker, along with a power management shield like Witty Pi. This is sometimes necessary, for example, for IoT applications where the Raspberry Pi is connected to a sensor and the Pi needs to take measurements once in a while in a remote location for a relatively long period of time (e.g. weeks).

Power Management Board

First, a power management sheild like Witty Pi and Sleepy Pi is needed. This is because a Raspberry Pi does not have sleep functionality. If it is kept on the entire time, it will draw too much power. Raspberry Pi 3B with 10,000mAh battery lasted about 20 hours.

Another issue is that Raspberry Pi does not have an RTC (real-time-clock). If the Raspberry Pi is turned off, the time stops. It only updates the time when there is internet connection. This is especially a problem when the sensor data needs a timestamp but there is no internet connection in the remote area.

A power management board conveniently solves these two issues by adding a functionality to turn on/off the Pi at predefined times and also supply the Pi with correct date and time even if it is powered off.

Low Current Mode

The next problem is the power bank. It shuts off when the Raspberry Pi is turned off (when the Pi is sleeping) because it is drawing too little power. The Pi does not wake up because the power management board isn't powered.

Some power banks support low-current mode (also called trickle-charge mode). This essentially means that the power bank does not turn off even if the current draw is very low. This feature is implemented for charging earbuds and smart-watches. Anker PowerCore Essential, realme Power Bank, cheero Slim, and some ELECOM batteries support this.

The pitfall here is that for most of these batteries, low-current mode automatically shuts down after a predefined amount of time. The time is 1.5 to 2 hours depending on the product. The only battery I have found to not have this limitation is cheero Slim which is made for IoT projects in mind, but only has 5000mAh.

USB Light Hack

The solution is to draw current small enough to not waste energy but large enough to keep the power bank from turning off. This is achieved by connecting a cheap USB light to the Raspberry Pi and enabling "Dummy Load" feature of the power management board.

"Dummy Load" essentially turns on the Raspberry Pi for a very short time while the Raspberry Pi is in sleep and this is repeated, for example, every second. The load could be anything (like a gaming keyboard worked when I tested) but an LED light is small and compact. The Raspberry Pi by itself was not sufficient to draw enough current from the power bank.

Conclusion

The Raspberry Pi is designed to be powered from wall outlet and connected to the internet the entire time. A USB power bank is designed to charge mobile phones and tablets. Putting these two together will require some hacking to accomplish long-running remote sensing applications.