Hot-Swapping Lipo Batteries

Thread Starter

Smoooth

Joined Jan 2, 2017
34
Oi,

I am powering up my Raspberry Pi using a LiPo battery, and I want to “hot swap” my lipos without turning off the Raspberry.
My plan is to solder a couple of molex connectors to power and ground of the raspberry, and solder a diode to each battery - to not allow backwards current.
Hence the ideas is: run the Raspberry on Battery 1; once B1 is close to running out of charge, connect Battery 2 in parallel with B1. Since I have the diodes, B2 is not going to charge B1 - that’s what I was afraid of, since it could create pretty large currents. At this point, B2 would be powering up the Raspberry; finally, disconnect B1. Hot swap over.

Would that work? Are there serious flaws or problems in my logic? Am I damaging the batteries or the Raspberry? Are there better ways to complete that?
Again, the critical part for me is that the Raspberry stays on throughout the swap. And may be not damage any hardware in the process:)

I would greatly appreciate any feedback or advice:)
Cheers.
 

jpanhalt

Joined Jan 18, 2008
11,087
There are dual battery set-ups for RC models that do the switch automatically, indicate which pack is providing power, and most important, don't switch back. Why try to re-invent it?
 

Thread Starter

Smoooth

Joined Jan 2, 2017
34
There are dual battery set-ups for RC models that do the switch automatically, indicate which pack is providing power, and most important, don't switch back. Why try to re-invent it?
Thanks for the input!
My understanding is that such setups must have both batteries connected all the time - and the batteries would be discharging simultaneously. Due to weight constraint, I cannot allow both batteries to be connected during operation - I just don't have enough mass on the drone. I can land it and connect two batteries for a short period of time though.
 

jpanhalt

Joined Jan 18, 2008
11,087
Thanks for the input!
My understanding is that such setups must have both batteries connected all the time - and the batteries would be discharging simultaneously. Due to weight constraint, I cannot allow both batteries to be connected during operation - I just don't have enough mass on the drone. I can land it and connect two batteries for a short period of time though.
Your impression of that is incorrect. Only one battery is used at a time, and there is no going back to the "used" battery without operator input. It is used as in-flight safety in case one battery goes bad.

Unfortunately, you didn't fully describe your use. If you only want one battery on board at a time, then the simple diode switch will work and in fact that method preceded the more sophisticated system I described.
 

oz93666

Joined Sep 7, 2010
742
Not sure I fully understand .... you want to swap batteries without loosing power ????

Super capacitors could be the solution, they come in all sizes ....


Connecting one of the right voltage (or series combination) across battery terminals will maintain power for a short time ....

10F @ 11V holds 1/2 C V V = 600J .... effectively you can access half of this ...300J ...enough to power device for 30 secs @ 1A or 6 secs @ 5A without batteries
 

Thread Starter

Smoooth

Joined Jan 2, 2017
34
Unfortunately, you didn't fully describe your use. If you only want one battery on board at a time, then the simple diode switch will work and in fact that method preceded the more sophisticated system I described.
my bad! Indeed, mass is a critical factor for me.
I guess what I am proposing is basically a diode or gate. Would it maintain a consistent voltage during the swap out?
 

Thread Starter

Smoooth

Joined Jan 2, 2017
34
Not sure I fully understand .... you want to swap batteries without loosing power ????

Super capacitors could be the solution, they come in all sizes ....


Connecting one of the right voltage (or series combination) across battery terminals will maintain power for a short time ....

10F @ 11V holds 1/2 C V V = 600J .... effectively you can access half of this ...300J ...enough to power device for 30 secs @ 1A or 6 secs @ 5A without batteries
interesting, thanks! am I right that in such situation I would first put the super capacitor in parallel with the battery, and then swap the batteries?
 

oz93666

Joined Sep 7, 2010
742
interesting, thanks! am I right that in such situation I would first put the super capacitor in parallel with the battery, and then swap the batteries?
Leave the capacitor permanently soldered in the device itself . First calculate how long you want device to run with no batteries (you need to know voltage and operating current), then you can calculate cap size and keep the capacitor as small as possible , they're very light.

The caps are normally 2.7 V max. ... so two in series will power 5V device .... 5 in serries 12V (you may need balancing circuit)
 

jpanhalt

Joined Jan 18, 2008
11,087
Would it maintain a consistent voltage during the swap out?
When you add the fresh battery the diodes will allow that higher voltage to go to the rest of the electronics. Thus, there will be a small, probably <0.6 volt per cell rise (e.g., 3.6V to 4.2 volt). Your electronics probably have a voltage regulator and shouldn't be affected as that is no different than the voltage drop that occurs during use.

When physically plugging a new battery into the adapter, there will be some electrical "jiggle" similar to switch bouncing in which contact is made and broken several times over the course of 10 to 40 milliseconds before it finally settles down to a new state. The voltage regulator may deal with that fine as that fluctuation will be on top of the previous working voltage. If not, increasing the input capacitor to it may fix it.

If that fails, there are voltage regulators and "power good" circuits that are switched on or off with a logic level. I suspect you won't need to go that far.

If your MCU does reset during battery swap, how much will you lose and will you be able to detect it happened?
 

Thread Starter

Smoooth

Joined Jan 2, 2017
34
@jpanhalt Thank you so much for the detailed answer!!
The voltage regulator may deal with that fine as that fluctuation will be on top of the previous working voltage. If not, increasing the input capacitor to it may fix it.
would putting a high capacitance capacitor in parallel do the job in this case? Or would I need to use capacitor-input filter circuit?

If your MCU does reset during battery swap, how much will you lose and will you be able to detect it happened?
I will notice it, and I will lose quite a bit of unlogged data. Hoping that won't happen:)
 

jpanhalt

Joined Jan 18, 2008
11,087
@Smoooth
Fixed linear voltage regulators are typically in a configuration like this:
upload_2019-5-9_12-2-54.png

Those with adjustable voltage are similar but have a resistor in the ground connection. The output capacitor (0.1 uF) improves transient response. I am assuming that your existing components are quite small and adding anything to those circuit boards, while possible and maybe desirable, could be difficult. Of course, the regulator in your equipment could also be a switching regulator, but the same principle applies.

Datasheets refer to having a filtered supply. What I was referring to was adding an additional noise filter to your supply (the output from your diode switch) if necessary. A capacitor from that output to ground might help. That should be effectively in parallel with the voltage regulator but there should be much more space.
 

BobTPH

Joined Jun 5, 2013
11,523
Your solution is fine. Don’t bother thinking about more complex solutions unless you try the diodes and experience problems.

Bob
 
Top