May 28, 2012

DIY Powered USB Cable for Raspberry Pi

I've got a Logitech c270 webcam working on the Raspberry Pi with Archlinux, since the current Debian image does not include the video modules. The main issue is power. I've measured the current that the camera is using and it goes up to 240mA when capturing video which is well over the Pi's specification. If you can get a powered USB hub I guess that will work, just keep an eye on the power consuption of all the devices connected to it.

I have built a powered usb cable from a USB extension cable and a USB Type A-B cable. The extension cable is the one that has on each side a Type A male and female (receptacle), and is used to access a remote USB port. The type A to B cable is the one that is commonly used to connect a host to a device, like a computer to a printer, and that seems to be used less nowadays.

USB connectors. Three right-most are: Type A female (receptacle), Type A male and Type B

Please note that doing this may be dangerous or risky for your devices, since a shortcut or an incorrectly plugged terminal may damage or blow any of them. Build this at you own risk!. Also take into account that this cable will be less reliable than the original cables.

The USB standard pinout consists of four conductors: Ground (GND - black), VBUS (+5V - red), Data+ (D+ - green) and Data- (D- - white). We will connect the GND and VBUS lines from the extension cable to the GND and VBUS lines of the Type A side of the other cable, leaving both Data lines untouched in the extension cable. The Data lines of the Type-A from the AB cable will not be used (will be unconnected). The Type-B side of the AB cable will be thrown away.

Cut the extension cable from the middle. If possible, do not touch the green and white lines. If you need to cut them, resolder both later to keep the same configuration as the original.

Cut the A-B cable and throw away the B side. Peel the red and black lines of the A side and trim the white and green lines since they will not be used. Connect and solder the red conductors of the two Type A male sides and the Type A female. Connect and solder the black conductors of the three connectors. Isolate the connections (I used thermofit). Use some electrical tape to strengthen the cable. Test using a multimeter.

You will have a cable with two Type A male connectors and one Type A female connector (receptacle).

You can now connect the cable to the devices. I recommend this order:

  • The Type-A (male) from the A-B cable to a USB power source (like a phone's charger)
  • The Type-A (male) from the extension cable to the Raspberry Pi
  • The Type-A (female, receptable) to the device, in my case, the webcam.

Everything should run smoothly since the power for the device is now taken from the charger and not from the board.

Once again, do this at your own risk and evaluate your skills. The procedure is simple but it may produce irreversible damage to your devices if done improperly.


Owen said over 3 years ago
Hi Will one usb goes into rasberry Pi and one goes to another external power source e.g. USB port from a computer? The usb cable that is going to be plugged into external power source will only use Red and black not green and white? Am i right? Thanks
eduardofv said over 3 years ago
Yes, you are right. The terminal that was "bridged" to the first cable must go to the power source, and the other end to the pi. If USB is not detected by the pi, switch them and must work. Remember that this is a "suboptimal" workaround and it's strongly recommended to get a powered usb hub. Anyway, hope this helps.
Owen said over 3 years ago
OK thank you so much for your help. I am looking forward to getting my PI! I know that it is recommended to get powered usb hub but I will try this first as I have some soldering skills and had fix some usb wires in the past for my electronic projects.
eduardofv said over 3 years ago
Great Owen, then I'm sure you know what you're doing. For me, this cable has been good enough.
owen said over 3 years ago
Hi Just got mine and I just made this cable. But I have a question When the power supply is removed the USB cable that is plugged into external source begins to power the PI. Is that normal? I don't think it should draw power from the usb ports?
eduardofv said over 3 years ago
Hi Owen. You have a great point. I'm not sure if this could affect in some way the RPi. As far as I have seen, the power from the USB does not power the full RPi and only one led remains on. Anyway, I'm taking the following precaution when turning off the RPi 1. Unplug the USB cable from the RPi 2. Disconnect USB cable power source 3. Disconnect the RPi power source (after shutting down the OS, of course)
owen said over 3 years ago
Yes that is a good idea. Another idea is to cut the power lead in the USB male lead so that no power will get to the raspberry pi only the data. Would this be a good idea?
eduardofv said over 3 years ago
Owen, I would rather leave connected the power lines, specially the ground, to ensure levels are right.
Power cable said over 2 years ago
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else Thanks
Diesel Dewatering Pumps  said over 2 years ago
I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else Thanks

Add Comment

Your comment 
Enter the verification code