If you try to detect power loss by testing the supply you have lost power to the Arduino as well so how do you detect with the Arduino turned off?You need to rethink how you do this.Weedpharma
Look at the UNO schematic. The USBVcc is switched OFF by a mosfet when Vin > 3.3V.You can use zn opto- isolator to deyect 5V. It' very straightforward.
Look at the UNO schematic. The USBVcc is switched OFF by a mosfet when Vin > 3.3V.
You basically have a voltage divider into your analog pin. There is another thread explaining this.http://forum.arduino.cc/index.php?topic=367136.0
I don't understand how this 5V goes backwards to USBVcc, but apparently it does.
How did you conclude you had 5V going back to the USBVCC ?Was there a USB cable plugged in and if not where did you measure it ?