Backup Battery for 12V DC Motor
You want something that runs off mains power when available, but when the mains power fails, it keeps running off battery power -- right?

Maybe it would be simpler and better to use a battery charger and a diode, rather than a relay:







simulate this circuit &ndash; Schematic created using CircuitLab