A word about switching USB ports on and off21 Oct 2019
For various reasons it may be beneficial to be able to turn off or toggle an USB connection or a USB port.
Using the Per-Port-Power-Switching (PPPS)
USB 2.0 Specification contains a part about disabling/enabling power (the VBUS line) on USB-Hubs. Most (if not nearly every) Hub uses a chip that either does not support switching or the manufacturer saves a few cents and omits the external components on the circuitboard to switch power.
One of the few hubs that does support that is D-Link’s DUB-H7 in the older (gray) revision.
Great Hub, btw. Allows PPPS, has LED indicators for every single port, has overcurrent protection, etc. Only mounting holes are missing, cheap bastards… No, for sure: It’s reasonably priced and performs well in it’s intended function as a regular USB hub.
uhubctl allows listing and toggling PPPS and works great for that reason.
Only problem: the DUB-H7 is quite strict about the current limits in the USB specification. When using large loads (>500mA) the hub ist not able to supply enough power and turns off the ports.
In addition to that this blog post claims that even when switching off a port, the output voltage of the port is just reduced to slightly above 1 volts (depending on the voltage converter in the USB device, that still allows operation).
Apple Thunderbolt Displays and Apple Keyboards with integrated Hubs support PPPS out of the box, btw.
Yepkit / ykush
The portugese company Yepkit sells USB-hubs with a PIC microcontroller and a TI load switch. They provide their firmware code and example programs as well as their schematics.
Nice stuff. Got one, works well.
Build your own stuff.
Yeah, that’s always an option, though not quite sure if it’s worth the hassle.