I have a set up for a portable guitar/music stand that comprises of:
iPhone
Tablet
Mini guitar amp
All are powered/charged from a powerbank. The guitar amp uses a barrel to usb cable with a 9v step up cable.
I was looking to add in a hub with a switch where I can power these devices at once instead of hot swapping the devices needing power/charge. Then being able to turn off the power when not needed.
However power delivery to the hub doesn't occur unless it's plugged into a PC/Laptop - as the usb host.
I'm wodering if an Arduino + usb host project would provide the solution I'm after - depending if the Arduino can be powered by a powerbank to maintain portability.
Cheers
You don't really need a microcontroller for that. Each one of the USB cables has 4 wires, two data wires, a 5V wire, and a ground. You should be able to wire a switch into the 5V or Ground line as a power switch to whatever is plugged into it.
Thanks. My sticking point is getting power to/thru the hub - it only gets power when plugged into a PC/Laptop - a usb host.
My setup doesn't include a device that can act as a host.
I have tested/confirmed with a multimeter and a couple of USB cables that power is only being delivered when connected to a host. I've used ones with 2 wires (power only) and 4 wires (power + data)
The interesting part is when I have the powerbank connected at the same to to the laptop and I remove the laptop connection it continues to power from the powerbank. So I'm assuming here that once the host has made the initial connection it's not refreshing the connection when removed from the host.
I might try a different hub. They're pretty cheap.
Have you tried plugging the USB plug into a charger instead of the computer? Maybe it just needs power on the USB lines before it will power from the hub.