Automatic Switch to Battery Backup when Power fails
You can use possibly something like this

This is from the "Arduino Programmable Constant Current Power Resistance Dummy Load" by wigman27 on Instructables.

The relay RL1 is normally closed to allow VCC to be supplied from VUSB. If something is plugged in at VIN, the relay switches over to power the board from VIN.