I designed a circuit to do the switching from a 12V car battery to a 8.4V Li-Po battery with a relay. Both batteries go through an LM7805 regulator to supply a constant 5V to a Raspberry Pi.
When I connect the output of the circuit to the Raspberry Pi and do the switching from main battery to backup battery the Raspberry Pi resets because it drops the voltage while switching the relay.
How I can I switch sources without the Raspberry Pi rebooting?