Power off a USB device
per carles
I wanted to power off a USB device. Searching in Google for “power off usb” returns different results but I didn’t succeed in any of the suggestions (Linux version 3.2.0).
I asked on the linux-usb mailing list (question, see one of the relevant answers (from Alan Stern). In short: not possible. When using a USB hub it’s then maybe possible -some models only-. The answer includes a link to a small program to try to disable the port. I could disable the port, but the device had still power.
I still didn’t want to give up. I remembered that I bought, 2 years ago, a USB relay. Actually that one could be used, as it says, with 220VAC/10A, so I could power on a heating or some big device.
I did a bit of very bad-done hardware work: I “broke” a USB cable, got the red inner-cable to pass through the relay. Then using one USB port I control the relay and I can switch on and off the other USB device like I initially wanted.
As you can see in the photo I broke the shield too much -because a confusion that wasn’t directly related to the project-. Still, it works well with my dumb device and other devices.

14 de maig, 2012 - 11:22
Why do you want to power off that?
14 de maig, 2012 - 13:27
Xavi: because it’s off and I can turn it on when something happens. For example, I have a Python script that when I receive an email of a some people I turn it on. It’s a aroma notificaton instead of visual or audio notification.
24 de maig, 2012 - 03:45
fasgad
2 de juny, 2012 - 10:44
[...] Previously I talked about how to power off a USB device. [...]
9 de desembre, 2012 - 15:12
Aroma notification? An amazing idea! Another, slightly more common example, why it makes sense to power off an USB device: to save energy and wear and tear of external harddisks connected to a mediaserver. As for the aroma notification, the harddisks can be restarted (and mounted) by a script if someone accesses a song or movie on it.
13 de desembre, 2012 - 21:00
I found a relay exactly the same as yours for sale. Can you tell me how to hook it up and make it work? Can you provide more details about the red inner-cable, etc.
13 de desembre, 2012 - 23:15
Hi Rick,
Could you read this other entry: http://pintant.cat/2012/06/02/olfactory-notifications-presentation-code/ ? There are some slides that should have the schema.
Actually here a LibreOffice presentation: http://git.pinux.info/?p=misc.git;a=blob;f=smell/presentation.odp
There is one slide that may help, but a small description:
a) with one USB Port you need to control (on and off) the USB relay. You need to start with this.
b) then you need to buy a new USB cable, cut the plastic cover, cut the red cable. The USB has 3 connectors: you need to put one side of the red cable in the center, other side in one of the sides (I can take a photo if this is not clear).
Then with the port from a) you can control if your device is on or off.