The simplest is an ORing diode on the power supply. If all you want is a hot-swappable power supply and you have a bit of leeway for your inputs, you can connect backup battery to the anode of a diode, and connect the cathode to your main battery.
What is a back-up power supply solution?
This application note details a back-up power supply solution that uses a voltage supervisor to monitor a main power rail and if the main power rail falls to an undervoltage condition, a secondary power rail from a back-up battery is automatically switched into the system to provide continuous power to the output.
This application note introduces automatic switchover design not using GPIO(General Purpose Input Output) signal from MCU (Micro Controller Unit) for increasing battery run time. This is a requirement for applications using solar cell or variable source as main power and battery as backup power.
Without the switchover, this could cause the downstream load to reset or enter an undervoltage lockout condition. The battery is generally used as backup power to maintain minimum VOUT for the system. Battery must last as long as possible to run the system without interrupting normal operation.
Do I need a battery backup?
And a battery backup is required for fire safety. the 5V represents the mains power supply, yes. The reason for 5V is because that is what the Arduino supplies, and what I plan to use. I only connected a LED here to illustrate where the usage part lays. C1 is shorted, it does nothing !
Main power needs to source the VOUT while it is above the backup power. However, main power can fall below backup power due to weather conditions. If the main power is low, then the system needs to switchover to a backup power source without interrupting normal operation.
Why do I need a back-up battery?
For the portable or battery powered applications, a back-up battery is used to preserve data and send communications if needed before shutting down. Often times these devices utilize volatile memory such as DDR SDRAM to save data and volatile memory requires power otherwise the data is lost.