Power a 12V DC wifi-router using 6V relay as switch between two power sources
The most common approaches to this kind of buffered (battery backed) power supply are as follows:

1) Use a power supply (adapter) that is capable of charging the battery, connect it directly to the battery and to the load. Some protection circuitry can be used to disconnect the battery when fully discharged in case of a long power outage. The power supply must have foldback current limiting - to be able to lower its voltage when its current limit is reached. Most adapters restart when overloaded (also known as hiccup mode), which is not suitable. The adapter's max voltage should be selected based on battery type - like 13.8V for a lead-acid battery or 12.3V for 3 Li-Ion in series. The current limit should be enough to supply the load, but not more than the battery's safe charging current. In your case with the WiFi router as a load a 1A limit will be OK with most batteries you could try to use.







simulate this circuit &ndash; Schematic created using CircuitLab

2) Use a power supply with a voltage a bit higher than battery's max voltage and connect them using diodes. This technique can be used in case of a non-rechargable battery. Diodes could be schottky to minimize voltage losses, like 1N5822. D1 could be ommited but the adapter would slightly discharge the battery in case of a power outage. 







simulate this circuit