Two power sources for Yún (fail-safe power supply - backup battery)

Is it possible to power the Arduino Yún with two power sources (at the same time)?

  1. Regular power supply with micro-USB.
  2. Battery power supply as mentioned here: http://www.instructables.com/id/Powering-Arduino-with-a-Battery/.
    Important: The Arduino needs to know that the main power has been cut.

So if 1. fails 2. can power the Arduino and it can still perform tasks before running out of battery. I would have tried, but I don't want to fry my arduino, haha.
Thanks.

So finally I found some results by changing my search terms: "Arduino Backup Battery" is the correct search term here,... XD

What I found so far:

http://electronics.stackexchange.com/questions/50006/arduino-and-backup-battery-

power:

http://electronics.stackexchange.com/questions/33346/arduino-backup-power-supply

and:

The link makes it look like for the UNO one can just plug in both and the backup battery will come in to action as soon as the power supply is cut. Maybe someone else can also verify this. Is this the same for the Yún?

Also I read about the ICL7673CBAZA not sure how to use it though. If someone could sit down and shortly explain how to connect alles this, it would be highly appreciated.

Just to make things clear: The Arduino has to to able know, that main power supply has been cut.

Maybe hacking this could result in that?
http://shop.raspberry-hardware.com/rpi/cw2-piusv-001-92-pi-usv-unterbrechungsfreie-stromversorgung-fuer-raspberry-pi-schwarz/

Or maybe

I know this topic has been talked about a couple of times... I would like to make a decent tutorial from this if I get some help. I did find a tutorial for a simple diode setup - but I guess that is not really the best idea long lasting battery life.
Thanks again

arrichter:
Just to make things clear: The Arduino has to to able know, that main power supply has been cut.

Sorry, but that is the oxymoron right here...

If the power cuts, without an intermediary battery between any "line" power source and the board, there is no way to do anything, the system just cuts out/resets (if the power comes back on).
Best you could do is to check on restart a watchdog value in the EEPROM which only would have a certain value when the system has not properly been shut down.

Otherwise, the logic board that handles feeding the power to the board from the battery (and charging from/switching between different 'line' power sources) needs to be so smart to indicate that switching condition to your sketch on the board (per interrupt?!?)

Ralf

Interrupt or similar to a switch - anything would do.

Oxymoron? I never said "without an intermediary battery".

Example: There should be a Power source with both a battery and also "wall" connector. If the Wall connector is disconnected - the Arduino can sense this and turn on an RED led and CONTINUES to run on battery power (until empty).

Simple as that. In theory.

arrichter:
...
Also I read about the ICL7673CBAZA not sure how to use it though. If someone could sit down and shortly explain how to connect alles this, it would be highly appreciated.

The ICL7673 is designed for UPS (Uninterruptible power supply) , and 2 PNP transistors for support big current.

Thanks for the reply sonnyyu,
so what you are saying is, that this will do exactly what I want? Will it also charge the battery? How can the Arduino sense, that the main power supply has been cut?
Cheers