Hi again! In this post I'm going to show you how to add an external power supply to a cheap USB hub. :)

(Click the photo for better resolution in Picasa Photostream)

I've been running some experiments with two Logitech Quickcam for Notebooks Pro and the Raspberry Pi and unfortunately I haven't been getting any good results. I can't get many fps and some of the captured frames contain corrupted data but I think I may have found out the reason for that. After some reading I verified that the USB ports of the Raspberry Pi can only source 100mA to a device and maybe the cameras are consuming more than that. To bypass that problem I went out to buy a USB hub with external power supply.

However, I verified that hubs with external power supply can be quite more expensive than the ones that don't have external power supply. No big deal, "I'll just by a cheap one and add the external power supply", I thought. And that's what I did! After all I just had to add a wire on VCC, another on GND and cut the VCC wire of the USB cable that connects to the computer... So, I went to a shop and bought the cheaper USB2.0 USB hub that I found and took it home for some small hacking.

The hacking started with a close inspection of the device, which made me realize that maybe the small hacking was going to be even easier than I thought it would be. The USB hub has the shape of a 4-pointed star and in one of the corners there's the USB cable. However, I noticed that on another corner of the enclosure there was just a small hole. "Weird! Why is this hole here?", I thought. I opened the case and right next to that unexpected hole, there were three holes in the PCB without any component inserted on them. I started to guess that those holes in the PCB and the hole in the enclosure were to solder the connector for an external power supply. I used my multimeters' sound probe to verify if my suspicion was correct and fortunately it was! :) Two of the holes were on a GND trace and the another one was on the VCC trace.

(Click the photo for better resolution in Picasa Photostream)

(Click the photo for better resolution in Picasa Photostream)

Probably there are two versions of the same USB hub being the only difference the presence or the absence of the external power supply connector. I guess it's a lot cheaper for companies to manufacture a big amount of a single printed circuit board than to order smaller amounts of two different boards :)

So, after this finding I began to search for a fitting connector and luckily I had one that I had scavenged from some other device. I soldered the connector and cut the VCC (red) wire of the USB cable that connects to the computer and the hacking was complete. I plugged in the regulated 5V power supply, the green led of the USB hub turned on. Everything OK :) I plugged in the USB cable on the computer and entered "lsusb" in the terminal, USB hub successfully recognized! Still everything OK :) At last I plugged in the webcams and opened the "/dev/video0" and "/dev/video1" streams in VLC and I had two webcams streaming in my screen! Hacking complete and some bucks saved! :)

Get the flash player here: http://www.adobe.com/flashplayer

You can do this hack in any USB hub, even if the hub doesn't come with holes to place the connector. The only things you have to do are:

Locate the GND and VCC traces and solder a wire to each one of them.

Solder a connector to the wires.

Cut the VCC (red) wire of the USB cable that connects the hub to the computer.

The USB hub also works with the Raspberry Pi. However I didn't test the webcams with the Raspberry Pi yet. If you want you can check my previous post about my first impressions on the Raspberry Pi.

And that's it! Hope you liked this simple hack and found it useful for your own projects :) Take care!

Did you find this post helpful? Do you wish to contribute to other projects regarding computer science, electronics, robotics or mechatronics that will be posted in this blog? If you wish to do so, you can donate via paypal using the button below. Thanks! :)

Yes, you need to do it. Otherwise you will have two power supplies "fighting" to supply the hub and the devices connected to the hub. And that's something you surely don't want to happen because it can damage any of the power supplies :\ If you don't want to cut it, you can also desolder the Vcc cable so that you solder it again someday later.Regarding connection an external power source to 1 port of the hub, it can be done if all ports share the same power lines. However, you still have to cut/desolder the Vcc wire that goes to the computer.

Hi! You can't just put it in the three holes that are already on the board since two of the holes belong to the same track. The only way is to put the 7805 with the input and output capacitors in a small separate board and then connect that board to the three holes with 2.54mm pin headers.

Hi,Can the modified usb hub be used to charge smartphones like iPhones and Android and also mp3 players ? How is the connection for data - and data + lines made in this usb hub? I heard different smartphones have different data lines settings.

Hi! Yes, you can use it to charge any USB Device. Just make sure that the power supply that you use can provide enough current for all the devices. If you just want to charge devices, The data lines are not used. If you just use the VCC and GND lines the devices will begin charging. The data lines are only used for communication, not for charging. Take care!

Hi! Yes you can do it. You can cut the VCC wire and connect the wire that is soldered to the board to the external power. Make sure it doesn't touch the VCC wire from the Hub's USB cable. Also, connect the GND wire from the external power to the GND wire of the USB cable. Do not cut this one. I hope I have explained myself well. If you still have any doubts just let me know. Oh, and make sure that the external power provides a stable 5V voltage.

Hi! Yes, the camera worked fine with the RasPi :) I tested a Logitech Quickcam for Notebooks and a Logitech C510 :) Both worked buth v4l support for the Quickam is a little buggy. the Logitech C510 works perfectly :)

Hi Thomas! Unfortunately it has no reference about the model. I bought it in a local chinese shop and it was the cheapest thing I could find. The only thing written on the PCB was something like wwww.medotech.com.cn but I tried searching for it and found nothing :\

Very nice work! But cutting the VCC to the computer means you can't use the hub if not externally powered, right? I bought a no-brand powered hub and I noticed that whenever it was connected, it would power the port that connects to the computer. I was going to cut VCC to the computer as you did there, but I wonder if a diode would solve this problem instead.

Yes, if you cut the VCC wire it won't work unless externally powered. Adding a diode might work if the hub electronics are able to work with a power supply of 4.3V (due to the 0.7V voltage drop of the diode). Thanks for your comment :)

Or use a schottky diode, which only has a voltage drop of 0.2v.Useally the type of connector you used has a build in switch, so if you plug in external power the batteries of a device are disconnected.Hence the 3 pins on the connector. Did you check with an ohm meter if the power coming over usb from a pc is disconnected by the switch if you insert a plug in the connector ? The tracks are a bit hard to make out in the pictures, so i cant really see if external power goes to the switch pin of the connector.

Arend-Paul, yes a schottky diode would be more appropriate and would probably work without any issues. Regarding the switch of the connector, in this picture you can see that both the side pins of the connector are in the same pcb track and therefore the switch of the connector has no effect: https://picasaweb.google.com/103809777771058938576/AddingExternalPowerToCheapUSBHub#5785826801600536226With some tweaking it could be done as you said but since I didn't need it for my application I didn't do it. Thanks for your suggestions :) I'm sure they'll help others :)

Ah ok..I had been thinking about powering an unpowered hub. What concerned me was how does the hub know it was powered now. As in unpowered mode it knows it can distribute 400mA over 4 ports. But in powered mode it can distribute 2000mA over 4 ports. So it can power more power hungry devices. I was afraid there was some pin you needed to put voltage on if the hub has external power, that else it would still only allow 4 low power usb devices. Even if it has capacity for more with external power.

Very nice, and fortunate you found a hub that was intended to have an external supply :) could this really be considered modification though, considering the manufacturers already had the board made that way? :P awesome job!

Yes, I think it can be considered as a modification since I only found out that it had the holes for the power connector by opening it and inspecting the pcb. Moreover, although in this case the holes were already there, I describe it in a way that anyone can add external power to any hub, even if it doesn't have the holes :) I was just lucky to get this one :) If it didn't have the holes I would have added the external power anyway :P Thanks for your comment :)

That's an interesting thought but I think what applies to computers also applies to smartphones with OTG capability. If you plug a USB pen drive into a USB OTG cable connected to the smartphone, it will power the pen drive. Electrical current will flow from the smartphone to the USB device. I don't now how the USB controller on the smartphone manages the connection to switch between a device and a host. Maybe in device modive it accepts current and in host mode it delivers current...

Are there any concerns with ground connected from two different power supplies? Should I put a diode inline with the ground from the auxiliary power supply? (I intend to use a 5v rail from a 650W computer power supply I have set up as a charging station supply built into my workbench, so it's a nice, regulated supply...)

Hi! I guess you'll have to be lucky since it is probable that some of these may come with wrong labeling. However, the one shown in this article shows up in Ubuntu as Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub and when I type the command "lsusb -v" the field bcdUSB shows 2.00. So, the one I used is really a 2.0 USB hub, but there may be other similar hubs that are not :\

Need some serious help... I have a Android tablet and want to connect a external hard drive to it...Drive is self powered and my Galaxy tab 2 cannot supply enough power..

I needed a y-csble to power it from a source and use with the tablet

I made the c as ble in the following wayCut a usb extension cable (male - female) and srip off the data +/- , 5v & grnd cable..Simmilarly with a usb male cable

Now I choosed ine usb male cable for power supply and tapped the red and black wire of it to the usb female cableThe other male cable was for data transfer so connected the other two wires of it to the female cable.

Now the power cable in the usb wall charger...Hard drive was connected to female cable..And the third one to the otg of tablet

Sadly it doesn't work...Even hard drive doesn't light up...Connecting it directly with the same source lights it up..

Hi! I'm sorry but I couldn't completely understand you explanation. However, maybe you should check this image that explains how to make the connections: http://www.head-fi.org/content/type/61/id/693652/width/500/height/1000/flags/LL

Instead of the phone you'll have your android tablet.Just make sure you cut the red wire (VCC) that goes to the tablet so that no current is pushed into it or pulled from it.

I suggest you to make the cable in two steps: (1) make a simple cable for hard drive + power supply, connect both and make sure the hard drive lights up; (2) add the third connector that goes to the phone.

by the way, be careful if you're using cheap chinese cables. Sometimes the colors of the inside wires are not correct. Hope to have helped. If you have any other questions, feel free to ask them.

Hello, I did this with mine, but now whenever I plug it in it gives me the "USB Device Not Recognized" message. Tried different 5v supplies with different amps, namely 350mA and 2000mA. I've also used a volt meter to verify its constantly at 5v. Makes no difference, Any suggestions?

Hi! Maybe you should try to check if all the wires VCC, D+, D- and GND are correctly soldered. In some hubs the cables are very thin and sometimes they get broken or desoldered during the hack. By the way, did you test your hub before modifying it?

Well there is no leak between VCC to negative, and doesn't seem like that with the D+ or D- either, might just have to get a new one and start over. The hub worked fine before. Thanks for the reply! :)