I'm creating a board which takes an external power source to drive motors which are controlled by a ULN2003A connected to the Raspberry Pi GPIO.
It would be nice if when the external power source is connected it could provide power to the Raspberry Pi itself through the 5V GPIO pin.
I appreciate this would require a voltage regulator, a polyfuse (to replace the one I'm bypassing that would normally protect the Micro B USB power input) and an ultrafast rectifier for reverse polarity protection.
My question is whether or not it is possible to detect that the Pi is already powered through USB and therefore block the back powering feature (to avoid having two sources connected).
Ideally if the user were to yank the Micro B USB cable the back powering would just kick in and take over. And likewise if the Micro B USB cable we re-inserted to disable it again. I don't really see how that could be possible so maybe it isn't!