0

I want to use USB-OTG on my Raspberry Pi 4, but I want to have a possibility to cut the power off and thus force reboot of the device.

Currently my RPi is powered via Power pins in 40 pin GPIO headers. I use USB-C in OTG mode to simulate external drive and/or external keyboard and mouse (depending on the test I perform).

My problem is that even when I cut the power from GPIO pins - the power provided from another device via USB-C is enough to keep my RPi from turning off.

To solve that I have a couple of ideas in mind:

  1. Using USB-C as power (again) and using OTG via GPIO pins. Unfortunately I couldn't find any information on how to connect GPIO pins to use them as OTG (maybe it is not possible).
  2. Separating each line in USB-C cable used for OTG and connecting V+/VBUS/Vcc through a relay that I could use to cut the power off. I'm worried that the breakout board I have for splitting USB-C might not be enough due to missing Tx and Rx pins - I use Adafruit 4090.

Do you think any of above solutions might work? What would be the best case?

lewiatan
  • 733
  • 2
  • 9
  • 16

1 Answers1

2
  1. You can NOT use "OTG via GPIO pins" for many reasons - the most basic is that USB uses different voltage levels from GPIO.

  2. You can NOT power a Pi via USB, but due to limitations in the very basic power circuitry once booted the Pi can continue to run from USB power.

  3. USB clients are designed to be powered by the host, but the Pi in OTG mode continues to supply power. This is a known issue and can only be resolved by isolating USB power pins.
    This can be done by cutting the USB 5V power line but a better solution is to isolate with a Shottky diode so the Pi can power peripherals but NOT be powered by USB.

NOTE it is simple to reboot the Pi via software commands; it is not necessary to interrupt power.

Milliways
  • 62,573
  • 32
  • 113
  • 225