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.

9 comentaris a l'entrada “Power off a USB device”

  1. xavi ha dit:

    Why do you want to power off that?

  2. carles ha dit:

    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.

  3. fsafsa ha dit:

    fasgad

  4. pintant… » Arxiu » Olfactory notifications: presentation, code ha dit:

    [...] Previously I talked about how to power off a USB device. [...]

  5. Al_ ha dit:

    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.

  6. Rick ha dit:

    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.

  7. carles ha dit:

    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.

  8. ivan ha dit:

    I’m sorry but this bad solution and can damage your device at list. Just look to usb connetcor. Pins for power longer than data pins. This was made for disconnetion data pins before disconnecting power. I don’t remember where i found this information, may be in USB specification or in Cypress site. Any way, just look on this direction, it can be safer: http://www.analog.com/en/interface-isolation/usb-isolators/adum4160/products/product.html

    http://www.aliexpress.com/item/free-shipping-USB-port-protection-board-USB-port-Isolator-ADUM4160-Full-Low-Speed-USB-Digital-Isolator/508402173.html

  9. Akash Pal ha dit:

    can u please upload some more pictures of your work? please..

Pots deixar un comentari