Hello!
This is my first post
. I have heard several times about Arduino and its products.
Hoping that this is the right place to ask, I would like to create a USB hub, a collection of three / four USB connectors, available for lamps and mobile phones. These connectors should be individually manageable by software (turned on and off, for example). Ideally it should also be able to perform a data-transfer to/from a pc, but this is not a priority now.
This is currently almost impossible using a pc (each USB device automatically receives a 5 V feed, which can't be turned off). Is this possible to achieve with an Arduino card, or a (possibly cheap) collection of cards? I've considered Arduino Uno, but it has just one USB Connector and I'm not sure about its use.
Any suggestion would be very useful.
Thank you!
Rob
Your project is "do-able" but the Arduino at least should receive power from somewhere.
Would be a matter of breaking into the cables for the positive line and routing it via a relay or similar device.
(plenty of relay devices just for Arduino's)
Might be better if you explain WHY you need to do that as I cannot see a reason.
This is a relatively advanced project. You can't just turn off the power wire while the data wires are still connected to the PC.
You can't use regular switches on the data wires. USB is very sensitive to the exact length of wire pairs. So the PCB layout is very important.
If you don't connect the data wires to anything then most devices won't charge properly. There are chips to use to give the correct voltages on the data wires to convince the device that it is connected to a proper charger. I don't have the part numbers close to hand right now. They are extremely small and can't be soldered by hand.
ballscrewbob:
Your project is "do-able" but the Arduino at least should receive power from somewhere.
Ok, this would not be a problem.
ballscrewbob:
Would be a matter of breaking into the cables for the positive line and routing it via a relay or similar device.
(plenty of relay devices just for Arduino's)
Sorry, I can not fully understand. What do you mean by "breaking into the cables for the positive line"?
ballscrewbob:
Might be better if you explain WHY you need to do that as I cannot see a reason.
Mobile phone charging with possibility to turn power off after a specific time, turn on and off light from some lamps having a USB connector as power feed.
MorganS:
This is a relatively advanced project. You can't just turn off the power wire while the data wires are still connected to the PC.
Ok!
MorganS:
You can't use regular switches on the data wires. USB is very sensitive to the exact length of wire pairs. So the PCB layout is very important.
If you don't connect the data wires to anything then most devices won't charge properly. There are chips to use to give the correct voltages on the data wires to convince the device that it is connected to a proper charger. I don't have the part numbers close to hand right now. They are extremely small and can't be soldered by hand.
So, disconnection of power wires could happen only after disconnection of data wires through some device: this can be verified by software.
The devices "faking" data connections seem to be very simple. I never heard of them, but I hope that they can be found easily.
Lots of people have broken into USB cables with seemingly no issues

You would only be breaking the red wire (assuming standard USB colouring)
This would then be routed via a relay or other on off device maybe even a simple MOSFET.
I have two of these devices and there is nothing inside but a switch on the positive line.
My RasPi has never once complained. Neither has the UNO attached as a CNC machine.
Did you have any other devices on the same hub while the switch is off? A good hub will cope with this fault but I don't think it is part of the USB specification.
For a lamp, you don't need the data wires at all. But anything which wants more than 500mA must have data to request that power from the hub. For a simple phone charger, it can be done entirely with passive components (resistors) but it won't work for all different phones.