# Switching power supplies with a relay, how to account for delay between connections? [duplicate]

this is my first post on this site (but I will have more, have no doubt), so if I have posted in the wrong section or something please forgive me.

Anyway, I am currently doing a battery powered pc build and I have wired up a DPDT mechanical relay to automatically switch between a battery and a 12V regulated powersupply. The problem I have run in to is that the amount of time when the relay actually switches over from one pin to the next is too long and it will shut off my dc-dc powersupply for the computer (it is an M4 ATX PSU). My first thought was to try to find a make-before-break relay but those seem scarce and may damage my lithium battery. The other idea that I had was to maybe use a capacitor bank to supply the necessary 20A at 12V for about 10-50 milliseconds, but I have honestly no idea how to find the right size of capacitors for the job. I might have to deal with the shut-down when plugging it in if the capacitor bank is too large because space is tight in the case I'm building.

## marked as duplicate by uint128_t, PeterJ, Daniel Grillo, Adam Haun, Community♦Mar 29 '16 at 22:53

• Your battery powered PC draws 20A?! What kind of battery do you have? – uint128_t Mar 29 '16 at 5:44
• If I understood your question correctly, the setup consists of a 12 V input ATX power supply (for e.g. car use) powering a desktop computer, and you would like to switch the input of that supply on the fly between a three cell li-ion/lipo battery and the 12 V output of a mains powered standard ATX PSU. Are my assumptions correct? This application is ripe for adding MOSFETs. – jms Mar 29 '16 at 5:46
• My battery is a 10000 mAh 3S LiPO, and the computer will not be always drawing 20A but that is the maximum (Max 20A, lowest probably around 5A). I will check out that thread and see if it helps.And to anwser jms, yes your assumptions are correct, the problem is I have no idea how to use mosfets. – Laessen Mar 29 '16 at 22:26

The fundamental property of a capacitor that relates current and voltage to capacitance is: $$I=C\frac{dV}{dt}$$ In other words, one amp of current flowing through a one Farad capacitor will change the voltage across that capacitor by one volt per second. Any amount of current flow will result in a change in voltage. Therefore, you need to decide how much voltage change you can live with. You may need to experiment to see how far the voltage on the power supply can drop before the PC reacts badly (browns out, powers off, locks up, etc).
Let's assume that the PC can handle a temporary voltage droop down to 8V. In the worst case, the PC is consuming a constant 20A from the supply. And the worst case relay deadtime is 50ms. Plugging into the equation above: $$20A = C\frac{(12V-8V)}{50ms}$$ Solve for C: $$C=0.25F$$ That translates to: A 0.25F capacitor charged to 12V that is suddenly cut off from the power source can supply 20A to your PC for 50ms and drop in voltage by 4V during that time.