Power off a USB device

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.

37 comments to Power off a USB device

  • xavi

    Why do you want to power off that?

  • 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.

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

  • Al_

    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.

  • Rick

    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.

  • 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.

  • ivan

    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


  • Akash Pal

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

  • 調整剤/バクテリア 中和+コンディショナーサイト

    pintant… » Arxiu » Power off a USB device

  • Hello just wanted to give you a brief heads up and let
    you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two
    different web browsewrs and both show the same outcome.

  • Sergio

    Have you tried using an usb switchable hub? I have seen some solutions on the web… like this one https://www.yepkit.com/products/ykush

  • Very soon this web page will be famous among all blogging visitors,
    due to it’s pleasant articles

  • Can I just say what a comfort to uncover an individual
    who really understands what they are discussing over the internet.

    You actually realize how to bring a problem to light and
    make it important. More and more people really need to check this out and understand this side of the story.

    I was surprised you aren’t more popular because you certainly possess the

  • I read this piece of writing fully regarding the difference of
    latest and preceding technologies, it’s amazing article.

  • That is really attention-grabbing, You’re a very skilled blogger.
    I have joined your rss feed and stay up for in search of extra of your great post.
    Also, I have shared your site in my social networks

  • I go to see day-to-day a few web pages and information sites to read
    content, however this webpage offers feature based posts.

  • Thanks for your personal marvelous posting! I definitely
    enjoyed reading it, you will be a great author. I will make sure to bookmark your blog and will often come back very soon. I want to encourage you to
    ultimately continue your great work, have a nice holiday weekend!

  • It’s in reality a nice and helpful piece of info.

    I’m happy that you just shared this useful inco with us.
    Please stay us up to datte like this. Thanks for sharing.

    Feel free to surf to myy web-site dien dan mua ban mien phi

  • Do you have any video of that? I’d like to find out some additional information.

  • Definitely imagine that thqt you stated. Your favorite reason ppeared to be at the weeb the
    easiewst thing to take into account of. I say tto you, I definitely get annoyed even as folks consider worries that they plainly do
    not realize about. You managed to hitt the nail upon the highest and defined oout the
    entire tthing with no need side-effects , folks can take a signal.
    Will likely be again to gett more. Thank you

    Lookk into my web page – cay ghep implant

  • Excellent post! We will be linking to this great article on our website.
    Keep up the good writing.

  • barney

    hi friend, i have new android TV BOX, i have problem. After quit Pover off (suspend off same) is external HD still running why? Why isnt turned OFF? i must manualy unpluged cable from TV BOX to turnig off. pls can you help me? thanks exist any app to android but OTHER?

  • Thanos Chatz

    Dear sir I m very interested in learning your python code that turns on the device please contact me with the code or instructions

  • Hi there, just became alert to your blog through Google,
    and found that it’s really informative. I am going to watch out for brussels.
    I will appreciate if you continue this in future. Many people will be benefited from your writing.

  • Quality content is the key to interest the viewers to go to see the web
    site, that’s what this website is providing.

  • Hello, i feel that i saw you visited my blog thus i camee to go back the choose?.I’m trying to in finding things
    to improve my website!I guess its ok to make use of some
    of your ideas!!

  • AndrewUndum

    Имеется такая услуга – добровольное медицинское обслуживание (или ДМО).
    Она предполагает, что пациент вносит небольшую сумму за то, что ходит на прием в течение года не платя за каждый прием.
    Однако соцопросы показали, что лишь 6% жителей города знают об этом.
    Да потому что частным клиникам намного выгодней брать плату за каждое посещение.
    А если честный врач посоветует добровольное медицинское обслуживание клиенту – это сулит ему увольнением.
    Информация о ДМО уже спровоцировала много скандалов, после того как информацию об услуге распространил один возмущенный врач.
    Его уволили “по собственному желанию”, после того, как он посоветовал ДМО своему пациенту.
    Самое ужасное, что информация по ДМО находились в открытом доступе, просто находили на эту информацию единицы.
    Как отстоять свои права?
    О правилах оказания услуги и обязанностях частных клиник можно узнать, просто вбив в Яндекс фразу: “добровольное медицинское обслуживание”.
    Обязательно обслуживание, а не страхование.


  • Bqmstalp

    valwaysh cialis
    buy cialis online doctor
    xcarriagez cheap generic cialis tadalafil

  • Definitely imagine that thqt you stated. Your favorite reason ppeared to be at the weeb the
    easiewst thing to take into account of. I say tto you, I definitely get annoyed even as folks consider worries that they plainly do
    not realize about. You managed to hitt the nail upon the highest and defined oout the
    entire tthing with no need side-effects

  • viagra cost with insurance viagra pills can i buy viagra online without prescription


  • […] to do this, and with my USB hardware I couldn’t. I wrote a hacky way how to do it here: http://pintant.cat/2012/05/12/power-off-usb-device/ . In short way: I used a USB relay to open/close the Vc of another USB […]

  • MaxMin

    Ivan makes an interesting comment about this being a bad solution because the power pins on a USB device are longer than the data pins. This implies that when you insert the device into a USB receptable, power comes on first, then the data lines. Conversely, when you pull the USB device from the receptable, the data lines go offline before the power lines.

    This could mean that one should never have the data lines connected unless the device already/still has power. For this reason, a relay device similar to this:


    would be better suited, because you have enough relays so that both the data and power lines can be relay-controlled. Your programming may then disconnect the data lines a (split) second before the power lines, and reconnect the power lines prior to the data lines when you want the device to come online again.

  • What’s up everyone, it’s my first go to see at this web site, and paragraph
    is actually fruitful in favor of me, keep up
    posting such articles.

  • Hi there colleagues, how is all, and what you want to say
    concerning this article, in my view its in fact amazing for me.

  • I’m impressed, I must say. Rarely do I come across a blog that’s both equally educative and amusing, and
    let me tell you, you’ve hit the nail on the head.
    The issue is something too few folks are speaking intelligently about.
    I am very happy that I found this in my hunt for something regarding this.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>