I seem to have the same issue 'Ali One' asked about a few years ago (How to create automatic dual battery changeover/switching circuit for uninterruptible power?), except I have a twist that a relay is involved too. So the answers to that question don't fully apply.
There are two supplies involved
- 4 x 18650 batteries
- an external power supply
When on the power supply, the batteries are configured individually and each has its own charger.
And, thanks to Olin's suggestion, the supply goes through a Schottky diode to power the load.
When the power supply disconnects, the relay configures the batteries as a 2S2P set to power the load at 7.4V.
I can switch TO the power supply without incident - the diode is quick enough.
Going the other way though, I can't find a way to hold the voltage whilst the relay switches.
The load is typically about 1.5A. I tried a cap on the end, but I am up to 11,500uF and it still won't hold.
Does anybody have a more elegant answer?
P.S. I am just a mess-about hobbyist with this stuff, so I could easily have missed an obvious solution.
As requested, I have added the diagram for the relay, you will have to imagine this as one 5PDT relay - the drawing tool won't allow any annotation! The empty boxes are 'TP4056 Lithium Battery Charger Modules'.
The final output is nominally 7.4V feeding Arduino (which is very forgiving) and +5V to a Raspberry Pi3B (which is very finnicky)
27 Dec
I have a solution to my problem - it works, but I am not confident enough to say that it is safe so would appreciate any feedback.
I acquired some high current super-caps. They are low voltage, so by the time I string a few together in series, it comes out at 5F.
Way over the top, I know, but as a hobbyist you work with what you can lay your hands on.
I have moved this 'voltage-holding-device' into the power supply rail only and isolated with an additional diode as shown.
My reasoning is ....
At the moment, there is no inrush current regulation to the capacitors as the bench power supply can do that nicely.
At power-on, the power supply will be dragged down until the capacitors have some charge (I have set the power supply to 9V 4A) and during this time, the batteries can continue to power the circuit.
Eventually (several seconds, if caps are completely discharged) the voltage can maintain 6V at which time:
a) the relay coil will pick - flicking the batteries to charge mode
b) there are enough volts in the cap to supply the circuits without reboots.
At power-off, the relay will be dropped instantly (the extra diode prevents the cap from holding the relay picked).
The capacitors will continue to power the circuits until their voltage drops below the battery voltage when the batteries take over (after about 20sec) .
All taken care of by the fast switching Schottky diodes
Is it safe/prudent/good practice to leave the caps charged?