Can I have backup power for an Arduino device? I have an arduino project that will work while plugged into a generic outlet. But I want to connect a battery in case the power goes out. I know there are various power sources (coin cell, polymer lithium, 9V, etc.). But if I code my project to use the backup power if the main power goes down, would that mean the backup always has to be running? How would I go about this?

Thanks for the help! Every time you help me you save a kitten!!
you could set up a relay to work in reverse with the mains power, 

have your backup battery connected to the gate contacts of the relay, and then use the mains power running your project to open the relay and keep it open as long as there is power. if the mains turns off, then the relay closes and the battery is connected. 

you might want to put something in line with the power to the arduino to make sure you don't get any spikes when things switch. 

hope this helps as i love kittens