Adafruit 5999 USB hub — switching downstream VBUS while Raspberry Pi r

I am evaluating the Adafruit CH334F Mini 2-Port USB Hub Breakout, manufacturer part 5999 and DigiKey part 1528-5999-ND, for an embedded model-railroad command station.

The upstream USB-C port will connect to a Raspberry Pi running JMRI. The Pi and hub may remain powered continuously. The two downstream devices are:

  1. A DCC-EX CSB1 command station
  2. A USB-to-CAN/LCC interface

Both downstream devices need to shut down when the command station’s master switch is turned off. When the station is turned back on, both devices should reconnect and enumerate automatically without restarting or unplugging the Raspberry Pi.

The published Adafruit PCB design appears to connect upstream VBUS through PTC2 to the shared 5 V output for both downstream ports. Therefore, the Raspberry Pi would continue supplying both downstream devices when the station is switched off.

The CH334 reference design shows USB power-distribution switches controlled by PWREN signals. Could you please advise:

  1. Does the Adafruit 5999 expose or use either CH334F PWREN output in a way that can control downstream VBUS?
  2. If it does not, can I leave D+ and D− continuously connected and place a station-controlled USB load switch in each downstream 5 V lead?
  3. What DigiKey-stocked load-switch part would you recommend for two USB 2.0 devices, including reverse-current blocking so the station’s 5 V supply and Raspberry Pi cannot backfeed each other?
  4. Is it necessary or advisable to switch the downstream data lines along with VBUS?
  5. Should any downstream capacitance or turn-on delay be added to obtain reliable USB re-enumeration?
  6. Is there a comparably priced USB-C-upstream hub board with this power switching already included?

This is an embedded USB 2.0 application. The hub will mount immediately behind the enclosure’s rear panel, so a small PCB with mounting holes is preferred.

Thank you for any recommended circuit, reference design, or DigiKey part numbers.

Thanks for laying this out so clearly — the trade-off you describe is a familiar one, and your instinct to keep the downstream devices powered only while the host is running is a sensible one.

A couple of points that may help:

The per-port power controls on the hub chip are not usually brought out to a pin on a ready-made hub board, so you will most likely need an external switch rather than relying on the hub itself to cut power. A small load switch with reverse-current blocking and a controlled turn-on is a good fit here, placed in the 5 V line to each downstream port.

Leaving the data lines connected while the 5 V line is off is generally workable, but do check that neither downstream device can stay partly powered through its data lines or another connection, as that can leave it half-awake and prevent a clean re-enumeration when power returns. A short delay between restoring power and expecting the device to enumerate usually helps, and staggering the two ports a little can keep the inrush current down.

It is also worth confirming the total current the two downstream devices draw together, and that the upstream supply and cabling can deliver it comfortably, with a little headroom, before adding the switches.

Good luck with the build — it sounds like a neat way to make the whole setup power up and down together.

Welcome to the forum.

According to the schematic and PCB layout on the Adafruit learning page, the breakout does not bring out the PWREN# pin.

If this is a one off project, I’d try soldering a wire onto the unconnected pin #24. The pin location and amount of exposed pad makes me confident I could do this using a microscope and 30 AWG Kynar wire-wrap wire.

If it’s a dozen or so builds, I’d look for a different USB hub breakout board that does bring out the pin.

For more than a dozen, I’d create a custom PCB based on the Adafruit layout and linked manufacturers data sheet.