battery backup status indication?

I was curious as to if theres a variable linked to the chip that switches the power source to board. I found a thread about battery backup doing usb as primary power source then power lead for battery backup so it auto switches. but is there something in programming that i can say light up led and possibly change motor speed when switched on battery.

Im looking to use a 12v power supply to power 2 motors on motor shield and the arduino. and would like to have 12v battery/charger setup for backup in power outage. and would like to be able to have the motors run slower if running on battery vs adapter.

dont have one yet but researching 1st. thinking of getting the uno. guess ill just have to get a ups board, saw one of those in a post. or think my power supply has a led, can maybe tap into that so if led goes off signal changes to change my speed thru arduino. might be easier than wiring on the arduino board.

basically im planning to use arduino with motor sheild to power 2 12vdc motors as circulation for aquarium. using one 12vdc power supply. Id like to be able to do a battery backup for the unit and the motors(using a 12v battery or few as backup power like) id like to be able to have the unit be able to tell if running on the battery and if so slow the motors down to some % so the batteries can drain a little slower.

My thought was that from what i read in forum if my 12v PS is connected via usb cable to arduino unit, and a 12v battery is connected to the power port on arduino if (power out) ps disconnected, the arduino will switch to battery(power port) for powering the unit. As for powering the motors figured i could wire in a 12v relay so that when ps is powering the unit/motor the 12v from battery is off to motors, and on if power from ps is off. my only missing piece is how to get arduino to slow the motors

I'm not so keen on sharing supply with the motors - if the supply is not up to it this is a recipe for brown-outs when the motors are drawing large currents, causing resets. Also motors can put loads of noise and high-voltage spikes on the rails. Or put another way make sure the power source can protect the Arduino from the vaguaries of the motors in question, or else use separate power.

Depends on the motor - stall currents can be amps even for a small motor.

ok thanks sounds like the 5v ps to input to sense outage is what i was needing to add. Ill have to research the float charge idea for powering. So basically the charger keeps up with the load and battery? similar to alternator of car?