I am designing a device with USB OTG that has some power-hungry components that should run only from an external supply, but the device still should be configurable from a PC via USB. I have come up with the following scheme:
USB data lines and capacitors omitted for clarity.
The firmware can detect the state of the ID pin, disable the load switch to prevent backfeeding the host from the 5V line.
When an OTG cable is connected the ID pin is grounded, MCU reads ID as zero and enables the load switch feeding the device.
When a device cable is connected the ID pin is floating, MCU reads the ID pin as high (internal pullup) and disables the load switch.
The MCU is powered from either the 5V line or VUSB.
I don't need exact current limiting in host mode (the load switch has internal limiting) nor any kind of battery management.
Is such a scheme viable or am I missing something?