20 ohm resistor is the load
How much filtering or regulation is needed depends on the type of load you are powering.
Green LED in the middle is the "Main input power ON" light
Red light on the far right is the "Low battery" light, which comes on at 10.9v battery level regardless of which source is in use
15 volt source is main power
Simulate loss of mains using the switch above this source, or simulate brownout by changing the voltage
12 volt source is the backup battery (Charging circuit not shown)
Simulate battery discharge by changing voltage
The relay is switched from main input to backup power when the main input drops below 11 volts, detected by the op amp on the left (wired as a comparator)