# Smooth switching between 12 V batteries, with a toggle switch

I have a number of instruments (12 volts, drawing a few hundred milliamperes) that occasionally need to be switched between one of two 12 volt lead acid batteries.

The toggle switch is break-before-make, so there's a fraction of a second interruption to the supply that causes a couple of the instruments to re-boot.

The instruments are black-boxes, and I don't know what's in them or how they work.

How can I smooth-out the power drop during the switchover and prevent re-booting? Will a capacitor and resistor in series across the load side of the toggle switch be adequate?

The internal characteristics of the instruments are unknown to me (that's part of the problem), so I don't know what sort of interruption to the supply is acceptable. Also, there are several instruments that may or may not be switched on at the time, which adds to the complexity of the issue, so I'm looking for the simplest most generic solution that doesn't require much sophistication - that's why I was thinking of just a 12 V capacitor and resistor across the switch.

• What dip in voltage is allowed in the transition period? Jun 1 '19 at 9:14
• a large-enough capacitor may damage your switch. Jun 1 '19 at 9:23
• I doubt that. Switches take a hit on "break", particularly when it is inductive. And the cap will deal with that. The hit on "make" isn't nearly as bad, and better still since the voltage diff on make will be fairly small due to the cap. Jun 1 '19 at 21:41
• Wouldn't two switches work? First you switch one of them, then the other.
– data
Jun 3 '19 at 8:56
• A capacitor behind a switch can end up causing brutal inrush current spikes after "make" .... which might not cause sparks, but resistance welding... Jun 3 '19 at 10:35

A little simple maths:

In a capacitor charge, Q, and voltage, V, are related by $$\ Q = CV \$$.

Current is the rate of charge flow so, differentiation gives us $$\ I = \frac {dQ}{dt} = C \frac {dV}{dt} \$$

You want to calculate your voltage drop for the duration of the switch transfer so we'll rearrange as

$$C = \frac {I}{\frac {dv}{dt}} = I \frac {dt}{dv}$$

So, throwing in some rough figures, we'll say you are drawing 250 mA, you can tolerate a 0.8 V drop and your switch takes 50 ms to throw then

$$C = I \frac {dt}{dv} = 0.25 \frac {0.05}{0.8} = 0.015 \ \text F = 15,000 \ \mu \text F$$

simulate this circuit – Schematic created using CircuitLab

Figure 1. The circuit.

@Jasen makes the point that "a large-enough capacitor may damage your switch". The point here is that a capacitor acts as a short-circuit when first connected to a power supply because it is completely discharged. As a result there will be an initial current surge through the already closed switch. You can use a beefy switch or add a current limiting resistor in series with C1.

Once initially charged the switching current will be close to the load current during each switch transision.

• use a switch rated for 20A or more to reduce contact burn. Jun 1 '19 at 11:09
• I considered that but it's not switching 20 A but only a few hundred mA. It needs to be able to carry a high current for a very brief duration on power-up but that's all. The problem is that few datasheets will show a current-carrying rating as, in most applications, it's the switching rating that's important. Jun 1 '19 at 11:28
• that brief time is when the contacts are bouncing, the worst time it could be, Jun 1 '19 at 23:10
• I think we're envisaging different scenarios. In mine the initial surge is when the circuit is first powered up by connection of a battery, not by toggling the switch so the switch doesn't have to switch the current. Once the initial charge is complete all subsequent switching is just the load current plus a bit extra due to the voltage droop during switching. Jun 2 '19 at 8:13
• @Jasen That brief time the contacts are not moving Jun 2 '19 at 14:49

You could add two Schottky diodes to the switch, allowing either battery to power the load via a diode. During switchover the voltage will drop 0.35 V (1N5817 @200 mA) below the voltage of the battery with the most charge, and it avoids the current surge caused by adding a capacitor. You could even remove the switch if a 3% power loss is acceptable.

simulate this circuit – Schematic created using CircuitLab

• A fully charged lead acid is more than 0.5V above a discharged one, so connecting it will effectively make it pick up load immediately via the diode. Jun 1 '19 at 18:02
• @vidarlo two diodes instead of one, then? Jun 3 '19 at 12:23
• No, one diode is fine Jun 3 '19 at 12:25

This might seem overly simplistic, but I have worked around this in the past with a simple momentary switch across the main toggle switch. Holding it in connects the two 12 V sources together while you flip the main. So at no point is the power interrupted. And with this the two sources are completely isolated during normal operation and cannot be accidentally left connected.

• A lot of power may flow from the fully charged battery to the discharged battery when connected. Jun 4 '19 at 9:02
• @IanRingrose That may or may not be a problem; in any case, it can mitigated with a resistor or such. Jun 4 '19 at 9:22
• @George With the present setup, connecting the sources will not help much; the "break before make" switch will disconnect the load. Jun 4 '19 at 9:23

You could check out the Texas instruments Power MUX range: link.

There are some 12V versions. I have a 5V one to switch LiPo batteries on a microprocessor but I do not think it reboots as it does not matter in my case.

They are not that expensive and you can get a evaluation module if you are not happy soldering small footprint components.

Get a SP3T switch with make-before-break contacts to connect each battery to the one end contact. And both batteries to the middle contact via a Schottky power diode.

That way there will be no "dead time" during the switchover.

Finding a suitable switch may be tricky.

• Thanks @Jansen - I'm aware of this option, but as you mentioned finding a suitable switch isn't easy, and is made harder in my case because space is tight and the switches have to be very small. Jun 1 '19 at 9:32
• RS has them available but you have to buy 500 Jun 1 '19 at 9:33

I use this device for pretty much exactly your problem:

I would assume it's easy for someone with experience in this area to duplicate if you'd rather roll your own.

Note: I have no affiliation with the site selling the above, and I'm not sure whether it's currently available being that there's no price listed, only "request quote". When I purchased it many years ago (probably nearly 10) it was inexpensive, though.

Could you use two small switches make one break the other? Would it put too much strain on charger? It is a charger I assume? Or would it be too much strain on batteries due to different charge levels? Also, the original circuit diagram would help. This would assist a visual learner such as myself see the current configuration. Or switch it sooner before battery is so dead that it causes a drop. There is on market a smart switch made for automotive for deep cycle/starting battery combination. You mentioned little space so not sure it'll work for you. There is a solution in someone's mind somewhere that will work perfectly.

• Parts of this answer would work better as comments. Right this doesn’t directly answer the question, so is likely to be voted down. Worth remembering that Stack Exchange is not a discussion forum, it is a Q&A site. Jun 2 '19 at 21:32

Depending on the context, this can be a hard or even a very hard problem.

If the load does not tolerate any interruptions, you have to make it a 2-step process w/ 2 diodes and a special switch that passes thru a state when both sources are on.

(or even 4-step if you don't want a diode constantly eating a volt, rotary switch becomes your friend).