I have a UNO potentially connected to both an external battery pack and the USB connection. I control the connection to the battery pack with a relay (normally opened).
So in short,
-->UNO is powered off. -->USB connect, UNO powers on -->UNO switch the relay and starts feeding from the battery pack(9V). -->UNO wants to know when USB is removed/reconnected. -->After 5 minutes of no USB, UNO switch the relay to auto-shutdown.
Here is my issue: I would like to be able to monitor the USB power connection while connected to the battery pack.
I tried to monitor the USB power pin (direct connection to UNO analog or digital pin) and for some reason I'm getting false positive (USB is not there but I get sudden spike voltage on the pin) as if the UNO was feeding back some voltage to the USB. (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1275684149)
I also tried to monitor the data pins of the USB(less voltage) but once again I would get false positive.
Any help would be appreciated.