Don't use power banks!
Pretty much every Raspberry Pi based forum has a tonne of questions from people asking if it is ok to use a power bank as the battery back-up supply in their project. But with a mix of answers, it is sometimes hard to judge if it is a good idea or not.
Of course, you’d expect us to say “NO!, don’t do it!“, but let’s summarise why we think that you could be heading for trouble with a normal power bank design.
Still, we’re very pleased that you are considering to use a back-up power supply in your project!
So, when reading this, let’s not forget that the purpose of this is to prevent your device crashing and corrupting the SD card in the event of a power cut or whilst using your project as a portable device.
Can it deliver enough power?
The Raspberry Pi’s don’t negotiate for higher power delivery like phones and fast chargers. So you have to rely on the maximum current available at 5volts. That is typically up to 2 Amps, but by the time your CPU’s are running flat out, and you have attached a few devices like a display and USB peripherals you most probably need more than that, in which case the CPU will throttle back its performance significantly, complain about low voltage, or worse, crash.
Power banks are only designed to deal with the steady current draw needed to charge another battery, and so they can’t manage the voltage regulation required to deal with the constantly changing demands from the CPU, GPU, on-board systems like WiFi and BT, and your USB peripherals. So even if that total needed was less than 2 amps, it can’t be delivered instantly and the voltage drops significantly as a result.
Can you charge the battery whilst drawing power?
Most power banks cannot supply external power whilst they are being charged, but some models can. But in that case, you are typically also drawing power from the battery which means that the battery never fully completes its charging cycle, which has quite an impact on battery life.
Can the power bank seamlessly switch from external power to the battery?
As mentioned above, because power banks are not designed for peaky power demands, the switch over will cause quite a drop in voltage. If you’re lucky that will just temporarily show you the lightning symbol, but it may cause a brown-out and crash your system during heavy loads.
When will the battery run out?
Well, firstly, your software cannot tell the difference between mains and battery power operation, so you’ll have no idea if your battery could run out. Secondly, although power banks may have nice LED’s to show you battery status, that’s of no use to your software, so you’ll also have no idea how much charge is left in the battery.
Some new power banks claim to output 3 Amps or more, but this is typically only after high power negotiation – like a fast charger – and the Raspberry Pi is not capable of requesting that from a power bank. So just be aware of that if you’re expecting more!