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:


simulate this circuit – Schematic created using CircuitLab

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?

  • \$\begingroup\$ Looks good to me. Maybe the MCU side of digital VUSB input could have something like electronics.stackexchange.com/a/391291/117785 \$\endgroup\$ – Ale..chenski Aug 26 '18 at 15:14
  • \$\begingroup\$ My MCU's VUSB is also the input to the internal regulator of the USB peripheral & PHY so it needs 5V. \$\endgroup\$ – filo Aug 26 '18 at 17:01
  • \$\begingroup\$ Okay then, no problema. But usually if you use Vcc=3.3V, the 5-V input is unnecessary. \$\endgroup\$ – Ale..chenski Aug 26 '18 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.