i'm trying to build a system with a Raspberry Pi and 2 switchable 5V DC Batteries (USB Powerbanks). I want to switch using Arduino and Relays. I would like to switch almost instantaneous, in order to avoid that Pi is booting. But this might result in a powersurge of a few milliseconds, i guess of 10V. Switching time of the relays should be arround 10ms.

The device that contains the Raspberry Pi is rather expensive, so i figured, i'd better ask than try: How big is the risk that the Raspberry Pi is being damaged in those milliseconds?

The switch would be every 2hours, at most.

And how would you rate the chance that the Pi is not rebooting while switching? is there some grace-time that i could take while switching?


More information: im trying out different routes here. the other one is, using Power Multiplexers like this one: https://www.ti.com/product/TPS2121 (havent received it yet, hard to get). is this a better solution?

Edit: it's not a huge deal if the device is rebooting every couple hours, but i'd rather try not to.

  • 2
    I'm not sure how many microseconds it would take to destroy the Pi. Likely to be microseconds rather than milliseconds.
    – joan
    Jan 20, 2022 at 18:16
  • 2
    Why not use diodes to connect 2 powerbanks? Voltage drop may be an issue. 2x12v banks then diodes then 12v to 5v converter may work better.
    – CoderMike
    Jan 20, 2022 at 18:24
  • Thanks. @CodeMike yes, that's one thing i've heard before, but i lack the knowledge to do it :-( it seems to me that some switcher like this should exist prebuilt... Jan 20, 2022 at 21:32
  • 1
    Powerbanks are NOT Batteries and are not designed for the purpose. DO NOT do this.
    – Milliways
    Jan 21, 2022 at 0:24
  • it seems to me that some switcher like this should exist prebuilt. ... it probably does exist, but it is off topic to ask where to get one
    – jsotola
    Jan 21, 2022 at 4:06

2 Answers 2


I can't imagine any plausible reason why switching 5V powerbanks with a relay would result in a surge of 10V. If a powerbank can spontaneously deliver 10V when connected to a 5V load, the manufacturer would be bankrupt by now because of lawsuits from people with blown up iPhones.

What you should expect is a short drop to 0V: while the relay's armature is moving, both NO and NC contacts will be shortly disconnected.

To answer the question at hand, the amount of damage a 10V 10ms pulse would do depends directly on the current rating of a power bank and the current consumed by the load.

Imagine a power bank that is capable of delivering 2A and 1A is consumed by the Pi. When it decides to deliver 10V instead of 5, it will be pushing the full 2A, from which 1A will still be consumed, and another 1A will start overcharing the capacitors, both inside the power bank and on the Pi. From experience, consumer 1A power supplies are rarely capable of more than 50V/s, so in 10ms it would gain 0.5V and thus reach 5.5V. Out of spec, but still something I would expect a Pi to survive.

Now consider a 10A power bank which can push extra 9A into the load. It would be able to raise the voltage 10 times faster and reach 9.5V within 10ms. Your Pi would certainly be dead by then.


You could isolate the power supplies from each other as suggested previously with diodes or P=Channel MOSFETs on the positive side with the grounds connected. Then use a SEPIC converter (buck/boost) to generate your final voltage. Adding come capacitance to the load side side to ground would help minimize the glitch. The SEPIC converter will make up for the drop and or spike in the power source. I doubt there will be a voltage spike, where is the inductance?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.