USB Power disabled, if using VIN Power pin

It seems that the usb power will be disabled, if using VIN power pin.

[   25.285889] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 78:45:58:f2:27:e3
[   33.757279] l5: disabling
[   33.760217] l16: disabling
[   33.763326] usb_vbus: disabling

I can’t use any usb devices, if I use the vin power pin source. If I use the 5V pin usb still works.

Is there any way, to enable usb power with VIN power source ?

I think that is a safety feature. You don;t want to feed the VIN power (7VDC to 24VDC) back into your PC or Mac as that destroys an expensive computer.
I have not seen anything about a data only USB connection, you may want to look at the schematics to check that out.

I cheat and use a USB hub with switches. The switch breaks the +5 but D+. D- and ground are still connected and it works just fine. Turning on that switch May fry the Arduino. Some users modify the cable and cut the +4 volt wire, typically red. Some of the Arduinos are designed to allow both to be connected. To be sure you need to check each one against the appropriate schematic. I have some clones that do not do that, got them a long time ago.

Wait a minute, if there is no power coming out of the USB,
how can a user power the USB devices when the board is powered from VIN???

I understand @sonofcy’s argument, but at least give us the ability to switch the board in host mode and re-enable usb_vbus.

I am currently troubleshooting a USB-C hub that won’t put the board in host mode, but if I power the board externally (not from the USB port), it won’t even power up the hub.
I tried a simpler configuration with an OTG USB-C male to USB-A Female, and even that doesn’t work

That makes no sense. The VIN powers everything, it's the Schotky diode that prevents back feeding.

Have you looked at the power tree for the board?

I don't understand your point.

One of us is very confused. How could powering the board externally have anything to do with a USB-HUB.
Again, have you looked at the power tree, there is no path back to the USB port.
Here is the part of the entire power tree that shows the blocking diode.

Here is a larger look at the USB part of the power tree. Remember, this is USB-C PD! The PD part is requesting the USB power supply to provide 5V at 3A.


Notice the Schottky diodes.

I have a USB-C hub with a secondary Type-C port that provides power to the board.
When I plug everything in, the board powers up but doesn’t see anything connected through the HUB (lsusb is empty).
I suspect this happens because the board didn’t switch into Host mode.

To test things out, I powered the board from VIN instead of the port on the HUB, but even though the board powered up, the hub did not.
Checking this thread, and /sys/class/regulator/regulator.24/state, I can see that usb_vbus is disabled.

If there is no power coming from the board’s USB, I will need a second power supply line to power anything connected to the HUB, but I could be getting the power configuration wrong.
I am just trying to understand how to power everything connected to the USB-C in case I power the board with VIN and GND

I checked the Power specifications, in particular the USB-C VBUS Back-Drive section.

As I suspected, there is a P-channel MOSFET (Q2801) to power the USB 5V rail when the board is in host mode.
I was thinking the problem was that the board wasn’t switching to host mode, which prevented the power rail from activating, but it seems more of a symptom than the cause.

Could it be that the MOSFET isn't being enabled?
This would explain the lack of output power on the USB and the board not switching to host, since it’s not seeing anything to be the host of.

I would really appreciate it if someone who better understands this part (or has worked on it) could help me better understand what is going on.

Hi all,

I confirm that it is not possible to use the USB-C port as a power outlet when the board is powered via VIN.

This is not a supported scenario, and the board is not designed for such behavior.

As stated above, from a powering perspective, the USB-C port can act exclusively as a Power Delivery sink, i.e., it can only receive power from an external PD power supply.

The P-channel MOSFET (Q2801) is not intended to power the USB 5V rail when the board is in host mode.

Please let us know if you have any questions about this topic.

2 Likes

Thanks for dispelling any remaining doubts.
I guess I’ll use one of those USB hubs in board form and provide power via the 5V pin or entirely externally.

Thanks again.

1 Like

I can understand the USB C port cannot provide power to the connected device. But how can we enable the USB Host mode or it is not supported? Please confirm.

@yokonav

It is supported – otherwise, USB hubs wouldn’t work! – and it is enabled using the usual Linux methods.

Currently, there is no easy way to switch from device to host/OTG mode at runtime; however, it involves interacting with files in /sys/kernel/debug/usb/4e00000.usb as root. Please check the Linux documentation for more information.

I’m using the 5V Vin pin for power source and have a usb cam attached to the usb port. Its possible to use the cam, if host mode is enabled with:

echo host | sudo tee /sys/kernel/debug/usb/4e00000.usb/mode

Now I can use the board without an external usb hub. My use case is a robotic scenario. I have to use a camera with face recognition.

2 Likes

:white_check_mark: SOLVED: USB Host Mode fix when powered via VIN

I found a solution for USB devices not working when Arduino UNO Q is powered via VIN pins.

The Problem:
The DWC3 USB controller defaults to "device" mode when there's no USB-C negotiation at boot.

The Solution:
A systemd service that writes to debugfs to force host mode:

echo host > /sys/kernel/debug/usb/4e00000.usb/mode

Full guide with automatic install script:
:backhand_index_pointing_right: GitHub - Psalmustrack/arduino-uno-q-usb-fix: Fix to enable USB Host mode on Arduino UNO Q when powered via VIN

Tested with:

  • Sonoff Zigbee 3.0 USB Dongle Plus
  • Home Assistant in Docker
  • Arduino UNO Q powered via VIN 12V

Hope this helps! :star:

A post was split to a new topic: No voltage on 5V pin when powered via VIN