Software-Controlled Per-Port Power Switching for USB Hubs

[Befi] wanted to add a second stage backup disk to his ODROID embedded-board server, which typically draws ~1.5W at idle. After adding the disk, he saw power consumption increase by 2W when the new disk wasn’t spinning. He thought about using one of those USB hubs with the adorable little rocker switches for each port and replacing them with transistors, but that was going to be messy. After some poking around in the USB standard, he found that most support per-port power switching (PPPS), and set about to hack a USB hub to enable software-controlled per-port switching.

[Befi]‘s NEC hub uses a uPD720112 chip which supports PPPS according to the datasheet. After tying the configuration pin labeled GANG_B to +3.3V, the hub declared itself PPPS-compatible. Of course, the manufacturer saved a penny or two by omitting the  individual switches, so [Befi] added an open-drain NMOS to each port. He is using this program to switch the port on and off and made the switching transparent with autofs. [Befi]‘s current script has the bus ID and device ID of the hub hard-coded, but he intends to update it to find them automatically. This hack saves him 10W on average, which is about €30 ($40) per year.

If your hub is under powered, you could try adding an external power supply.


  1. pedro says:

    30€ per year? where does he buy the electricity from?!?! that’s crazy expensive.
    It would only save me about 8€. And that is if I had the hub connected 24/7 without ever disconnected in the entire year.

    • Jonimus says:

      I think he is talking about the devices attached to the hub which can much more power than the hub itself. The whole point of this hack is to turn off power to each of the ports

    • Carl Hage says:

      Even if only $10/year, that’s $100 over a 10 year life. If the hub manufacturer increased the price by $5 that would more than pay for the missing transistors. Why not make electronics less wasteful? We should be labelling prices for wasted vampire power on all electronics. The worst was a cable-TV box. I calculated about $60/year electricity cost for the DVR, $40/year for plain box, when the unit was turned off (standby). The cable company doesn’t pay the electricity and consumers don’t know power is wasted. We need all product designers to be as clever and resourceful as Befi.

    • Whatnot says:

      I think he might have shifter the dot one place too many..

  2. StinkySteve says:

    Very cool! It’s a bit of a hassle but very good hack!

  3. dave says:

    8760 Hours/year x 10 watts x $0.08/KWh x 0.001 KW/watt = $7.008/year

  4. Kaijuu says:

    Don’t know where this guy lives, but the cheapest price for 1kWh over here in the Netherlands is roughly €0.22, or US$0.30. So that’s nearly €20 each year.
    No, it will not buy you a new car, but it’s still quite a lot if you manage to make a save like this a couple of times.

  5. 0xfred says:

    Let’s be honest, the cost saving is just a convenient excuse to hack something and make it perform how you want it to rather than to a level the manufacturer thought was “good enough”.

  6. Whatnot says:

    I’m astounded about the stuff that’s available in common chips that are ignored completely, Stereo mic positioning in sound codecs, serial and parallel ports in motherboard management chips, temp sensors in MCU’s, switches in USB hubs, USB support in chips used in routers that don’t supply USB ports, the list is endless.

    • SavannahLion says:

      It’s been like that for a long time.

      Put it another way, how many projects do you see here on HAD that use an AVR actually make use of all of the chips features?

    • rasz says:

      ++ this

      it pisses me off that we are being bombarded by castrated crap because someone decided to save $.20 in parts.
      Rigol power supply EEVBlog’s Dave tested is another example, some retard decided to put LM317 instead of properly speccing power transformer or SMPS chip = whole thing is a big heater and leats to power supply RESETS because lm317 is dissipating tens of watts of heat.

      or every other dump network switch build using same smart switch controller as proper managed switches, but someone decided $.20 serial eprom was too much.

      the list goes on and on.

  7. Sven says:

    Please note that one needs to €30 (just like the $) and not 30€. Many Europeans tend to write the Euro symbol after the amount and not before. I think it’s historical since we noted our old currencies after the amount.

    It’s just a detail; and it is a cool hack, thanks for posting

  8. NATO says:

    How is this a “HACK”?????

    The rest of the world has been aware of this functionality for about a decade now???

    WHY does HaD insist on posting things like this that have been done a million times over???? Can you guys PLEASE stop posting garbage like this???

    • befinitiv says:

      Well, I would very much like to see another project (or better a million? ;) that adds per-port power switching to a USB hub. Plesse share!

      • NATO says:

        You wasted your time hacking up an ancient hub… If you look at the datasheet for a quality/more recent hub controller IC (Think TI/SMSC/VIA/etc), you will see that most incorporate high-side current limited switches inside the IC which can be controlled independently… I think you know this… This has been standard for quite some time. This allows software control of port power for each port individually… You could have just gone out and bought a newer $10 hub and saved a lot of time.

        My rant was targeted at HaD – Calling this a “hack” – There is nothing novel here – To be a “hack”, you must be doing something novel – Something that has not been done before – Something that the device was never intended to do, etc – You simply modified a cheapo hub to mimic a slightly more expensive one – The functionality already existed in the hub controller and you were correct in stating in the writeup that the manufacturer left this functionality out on purpose.

        I wish that this site would publish interesting and novel things. I really like the color scheme, but everything else here is garbage.

        • befinitiv says:

          Those hubs are quite uncommon. I went to a shop, tested 10 hubs from different manufacturers plus my 4 hubs at home. None of them supported PPPS out of the box. So again, please share your knowledge and give us a link to some $10 hubs that do support PPPS!

          • NATO says:

            And it would not surprise me if the “10 hubs” you tested all used the same crappy hub controller IC… Ignore cheesy un-powered hubs. Any self-powered hub should support this. Find one that uses a quality hub controller. LOOK AT DATASHEETS. I have a 5-year-old D-link hub on my desk that supports this. It is not hard to find.

            Do you want a pat on the back? *pat pat* there you go. Is that what you needed?

          • rasz says:

            oh, so your one hub that you have is those “done a million times over”?
            I havent seen a SINGLE usb hub with PPPS and I fix shit all the time.
            95% of computer crpa swims straight from one hung lo chinese manufacturers, and they remove every non essential component from the pcb.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 97,581 other followers