Raspberry pi 4 restarts switching from main power to power bank

Power bank has pass-through charging with led that show lower power. As soon as I plug the main power to charge the bank, RPi restarts. Setup is main power to power bank to RPi 4.

How can I avoid the restarts?

Your power bank probably produces lower voltage than 5V, when you connect gthe power supply, the voltage jumps up and this triggers the power on reset circuit.

I would use a 12V battery with a charger and a 12v->5V DC/DC converter. This way the Pi would get stable 5V.

1 Like

Nope it produces 5.1V and RPi 4 runs smoothly on it. Its only when power bank is low on charge and I plug it to charge, RPi restarts.

So obviously your power bank doesn’t stay at 5V when you plug it in. There’s nothing we can do here. Get a better power bank, or a separate battery backup for the Pi.

I’m a big fan of the board from https://lifepo4wered.com/ – works flawlessly with my RPi servers; you want the large battery when powering a RPi 4. Best feature: you can feed it with anything from 5 to 12+V.

I think you misunderstood. Power bank provides stable output and RPi runs without any trouble. RPi is powered by power bank continuously. It has 4 LEDs each denoting 25% charge. As soon as I see just 2 LEDs remaining lit on power bank (2 are off because RPi used the charge) I start charging my power bank while it is STILL powering RPi, this is when RPi restarts.

If the power bank has unregulated output, the voltage may drop when the battery is discharged. RPi probably can work down to 4.5V or even 4V, so for a while there is no problem.

Then you notice that the power bank is almost discharged and pug in the power supply. This results in the votlage jumping from the 4V or whatever it was to 5V. This jump triggers the power-on reset circuit which resets the Pi.

Measure the voltage when the power bank is at half charge and you should see the difference.

That makes sense & I will test it but is there a way to buffer the power or something to avoid those restarts.

Well, I would use a DC/DC converter in front of the Pi, the power that from a 12V battery that is attached to a float charger. This way the DC/DC converter would provide stable voltage and ignore the voltage changes on its input.

Something like
AC in -> 12V charger -> 12V battery -> 12V/5V converter -> Rpi
And you have your own “on-line” UPS… The charger has to be big enough to charge the battery and provide power to the Pi.

Or, I guess, you can find a power bank that has a voltage regulator.

I start charging my power bank while it is STILL powering RPi, this is when RPi restarts.

Which is obviously the exact moment when the power bank drops its output for a moment.

Mine does that too, because it wants to protect itself against somebody plugging it into its own output.

You’ll be able to see that with a 'scope. Your basic voltmeter isn’t fast enough.

AC in → 12V charger → 12V battery → 12V/5V converter → Rpi

Or simply “AC → 12V → LiFePo4wered Pi board → Pi”. Cheaper than a 12V battery too.

Or, I guess, you can find a power bank that has a voltage regulator.

Every 5V charger has a voltage regulator. You simply won’t find one that drops down to 4V, they turn themselves off first.
@nerdatwork simply needs one that doesn’t interrupt itself when you connect its power. (Or a LiFePo4wered board. There are others.)

for RPI i use 12v MAKRAI power suply with battery backup and then impuls power regulator amsr2 with 2 capasitors 50v 10uf and 16v 22uf work perfect. or just DC/DC regulator can use.

Most commercial power banks can’t charge and discharge at the same time. I have a feeling that instead of charging the batteries and having a step up/down converter separately, it is switching the output to the input. Because of the switching there is no power for a short time and the pi shuts down. You might be able to fix this by adding a capacitor in parallel to the USB output, maybe chain a few 4700 microfarad capacitors together?

If you want to DIY, I don’t recommend using a car battery like others have recommended above. They are heavy, expensive and need maintenance. If you spend some time to find a good supplier in your country, lithium ion batteries are very cheap (don’t buy them from chinese webshops!). I could get 2500mAh cells for a 3 euros per cell. Buy 3 or 4 cells, get a 3S or 4S BMS from ebay for $2. Use a step up/down converter in combination with a random switching mode power supply you have laying around for charging, and a step down converter to get it to 5V. I’d recommend those “300W” constant voltage constant current step down converters with heatsink for $3-4, they can easily deliver 6 amps at 5 volts.

Like that you have a reliable ~40Wh UPS for your raspberry pi for around $20