I've added a 'House Battery' to my vehicle, which I keep charged by various means, including solar panels. When the vehicle isn't running, I can switch various accessories from the Car Battery to the House Battery, so the Car Battery won't get run down when I camp. The actual switching is done by relays, so, ignoring details like fuses and voltage cut-off, the setup boils down to this simple circuit:
This has been working great for years, for lights, USB outlets, and accessories like that. But there's a problem when switching the car stereo: it reboots whenever it's switched between the batteries.
I presume this is caused by the split-second loss of power, and my understanding is that one way to avoid this is to add a capacitor to the circuit, like this:
My questions:
- Is this the best solution?
- What type of capacitor should I use? (Obviously it needs to be at least 15 volts, but how do I calculate the capacitance, assuming the stereo draws, say, 50 watts, and what other details are important?)
- Would any other modifications to the circuit be a good idea? e.g. Should I worry about a flyback diode?
Thanks.

