Seamlessly switching between batteries

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
I built a very low power circuit that consumes about 15 µA at 6V from an array of four 1.5V batteries in series. Said batteries are connected to a 3.3V regulator which in turn feeds a small MCU. I would like to have another set of batteries in standby that could kick in when the first set of batteries are nearly depleted and have the MCU itself switch between them without a glitch. Below is a very simplified diagram of the circuit I'm trying to explain, sans the regulator.

1667089374406.png

I know how to measure the batteries' voltage to determine when to perform said switch, but I'm not sure about the best circuit to switch between the arrays using the MCU itself without a glitch that could accidentally interrupt power. Any ideas?
 

WBahn

Joined Mar 31, 2012
29,979
You can probably just use two FETs and do a make-before-break switchover. If your regulator has a capacitor on the input, then you should be able to be pretty careless about things as the capacitor will sustain the regulator for the brief period.

If you are concerned about the nearly depleted batteries pulling charge from the fresh batteries, and thus shortening their useful life, you can put an RC filter on each gate input so that the switchover occurs gently without both being hard on at the same time.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
You can probably just use two FETs and do a make-before-break switchover. If your regulator has a capacitor on the input, then you should be able to be pretty careless about things as the capacitor will sustain the regulator for the brief period.

If you are concerned about the nearly depleted batteries pulling charge from the fresh batteries, and thus shortening their useful life, you can put an RC filter on each gate input so that the switchover occurs gently without both being hard on at the same time.
What you've just described is very similar to what I had in mind, more or less. But being this my first attempt I wanted to hear the opinion of more knowledgeable people first.

Thanks for your input, Bahn. It's always thoroughly appreciated.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
You can do something like below but if you are using AA batteries or larger and the load doesn't change much (15uA all the time), the first set of batteries will last 10 to 15 years.

View attachment 279562
I have in mind something similar, but using high-side pFets instead. Personally, I don't think switching power on and off from the ground is a good idea.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Why?
Ground switching will work fine in this situation, as it needs no level shifting of the control signals, and you don't have to worry about back conduction through the parasitic drain-source diode.
Thanks. I'm going to give serious consideration to what you've said. But before I proceed further, I'm going to post a more nuanced diagram of how things are working at the moment. There are a few more details that I have not mentioned yet.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Ok. This is exactly how I'm making things work right now. And so far it's working just fine.

1667180696994.png

There are two battery banks, and from each a 6V source is derived and fed to a 3.3V regulator through a couple of Schottky diodes to prevent back flow. The 3.3V regulator feeds an MCU. There are 10 batteries total in each bank, and they're also connected in parallel through corresponding diodes, and from there to a solid state relay. The MCU is in charge of activating said solenoid depending on conditions that are not important to this discussion.

The reason the battery banks are arranged and connected in such a way is mainly because of space and economics. The MCU draws less than 15 µA continuously, and the solenoid draws about 4.5A for 50 ms only twice a day. I expect this arrangement to last several years before the batteries start giving trouble. And when that happens, I expect that the first thing to fail will be the solenoid's activation, and not the MCU itself due to lack of sufficient power. And yes, to be clear, the regulator has a nice 2.2 µF tantalum cap both at its input and its output, to smooth things out for the MCU.

So my question again is, what would be the best way to make sure that the auxiliary (bank B) bank of batteries is thoroughly used before bank A kicks in? ... I think I'd start by having the MCU itself measure the voltage of each array and let it take control of that decision. But the desired circuit would have to immediately activate bank A if ever bank B is suddenly disconnected.

So yes, the MCU could switch a couple of high side pFets (or low side nFets) on and off depending on pre-programmed conditions. But there's also need for the automatic activation of bank A in case bank B is disconnected. And whatever circuit is used, it must use the least amount of power possible when standing by.
 

crutschow

Joined Mar 14, 2008
34,285
what would be the best way to make sure that the auxiliary (bank B) bank of batteries is thoroughly used before bank A kicks in?
But the desired circuit would have to immediately activate bank A if ever bank B is suddenly disconnected.
Why not just let both batteries discharge at the same time?
Is bank A somehow different than bank B?

That would also allow the other bank to provide power if one is disconnected.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Bank B is an external bank of batteries stored in a different enclosure. Whilst bank A is installed inside the main circuit Enclosure. Both enclosures are water and weathertight and opening them for servicing and battery change is a PITA.

The use of an external "battery booster" pack (bank B) simplifies things maintenance-wise because when discharged all one has to do is unplug it from the main system and plug a new one. This way the internal main battery pack (bank A) does not have to be serviced but once every 5 to 7 years and keeps the system running as continuously as possible.

As a side note, the batteries are of the ordinary non-rechargeable alkaline type. I might change them in the future for non-rechargeable lithium batteries to compare their performance. But the main thing is that they're installed in a place where solar or some other type of recharging power source is not available.
 

MrSalts

Joined Apr 2, 2020
2,767
Both sets of batteries will die at the same time.

Your microcontroller does not measure battery consumption / "level" in any way to warn users of what should be done soon (which would be a good idea if changing the batteries is a PITA).
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Both sets of batteries will die at the same time.

Your microcontroller does not measure battery consumption / "level" in any way to warn users of what should be done soon (which would be a good idea if changing the batteries is a PITA).
Actually, it does measure battery "level". I just omitted said circuitry from the diagram to keep my explanation simple. My design does measure the level of each memory bank.

But you're right. Both sets of batteries will die at the same time, and that's what I'm trying to avoid. I'm trying to make sure that battery bank B gets used before battery bank A
 

strantor

Joined Oct 3, 2010
6,782
So you're actually trying to measure two thing:
1. If there is still enough battery level to actuate the solenoid.
2. If the booster pack (or, either pack) has been removed.
Is that correct?

If so, I would suggest measuring the voltage across the solenoid with voltage divider during the 50ms pulse, and also measuring the constant voltage of both packs like you seem to have already done.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
So you're actually trying to measure two thing:
1. If there is still enough battery level to actuate the solenoid.
2. If the booster pack (or, either pack) has been removed.
Is that correct?

If so, I would suggest measuring the voltage across the solenoid with voltage divider during the 50ms pulse, and also measuring the constant voltage of both packs like you seem to have already done.
You make a very valid point ... a battery's available voltage is not a good tell of the current it can actually source.

Anyway, I'd like to have a small external circuit that would instantly activate battery bank A if bank B is ever removed. And vice versa ... that more or less is the sum of my request.
 

strantor

Joined Oct 3, 2010
6,782
You make a very valid point ... a battery's available voltage is not a good tell of the current it can actually source.
Yes that's where I'm coming from. Internal resistance will increase over time and voltage level at rest will not be the best indicator that you still have sufficient charge to accomplish your goal. Also monitoring during the pulse can alert you to open/disconnected solenoid if the voltage doesn't drop at all.

Anyway, I'd like to have a small external circuit that would instantly activate battery bank A if bank B is ever removed. And vice versa ... that more or less is the sum of my request.
Has this been answered already or are you looking for further input?
 

MrSalts

Joined Apr 2, 2020
2,767
Yes that's where I'm coming from. Internal resistance will increase over time and voltage level at rest will not be the best indicator that you still have sufficient charge to accomplish your goal. Also monitoring during the pulse can alert you to open/disconnected solenoid if the voltage doesn't drop at all.


Has this been answered already or are you looking for further input?
You'll need an active component like the Mosfets I suggested in post above or a latching relay.

also, you don't need to measure voltage across the solenoid while it fires,, you can just measure at your tap in the stack of batteries while the solenoid fires. The only possible issue is if one of the upper cells dies before the lower cells to cause a misfire of the solenoid while the lower cell is measured.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
You'll need an active component like the Mosfets I suggested in post above or a latching relay.

also, you don't need to measure voltage across the solenoid while it fires,, you can just measure at your tap in the stack of batteries while the solenoid fires. The only possible issue is if one of the upper cells dies before the lower cells to cause a misfire of the solenoid while the lower cell is measured.
Thanks, I'm also thinking about measuring the current through the solenoid as it fires. Gonna try and see if that's not too complicated.
 

strantor

Joined Oct 3, 2010
6,782
Thanks, I'm also thinking about measuring the current through the solenoid as it fires. Gonna try and see if that's not too complicated.
Good call. That could give you even better data.
Measuring voltage across it could tell you if it had enough voltage to fire and drew enough current to not be an open circuit, but actually measuring current could additionally tell you if it drew enough current to actually actuate (not weak) or drew so much current that something is wrong (shorted coil, plunger failed to move).

I hasn't been answered yet ... and of course I can work on an answer myself, I'd just like to hear the advise of more knowledgeable people before getting started.
I would go with a latching relay but I've been known to favor overly primitive means with little justification. Others have suggested fets and that seems reasonable. Is there something holding you back from using fets? My apologies if this has been answered already, I might have missed it.
 
Top