IanSauce
Posts: 3
Joined: Wed Nov 20, 2013 2:07 am

Creating a powered USB cord?

Wed Nov 20, 2013 2:53 am

I just got my pi in the mail!!!!

I have a couple project i would like to do, and a couple of them involve powering my Pi using a battery, and i happen to have a USB battery pack so its perfect. But some of the things i would like to do need a powered USB hub. So obviously this causes a problem.

BUTTT! I had an idea, What if i took a USB extension cable and did a little modification to it....Here is what i was thinking. Say about in the middle of the cable i cut it open, I find the power cables and cut them, then on the side that would lead to my accessory I wire in a another USB cable. Then on the ends that lead to the Pi i just seal up and leave them alone. So basically the data is being transmitted to the Pi but the power for the accessory is coming from the other USB cable i plugged in.

Would this work? Or i am just going to blow something up?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5645
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Creating a powered USB cord?

Wed Nov 20, 2013 11:12 am

Why not just simply acquire a 'Y' cable and use it "upside down"? (They're normally sold to draw "extra current" from a second USB port to power HDD's etc.) However, whatever cable you use, the majority of USB ports can only supply 500mA (the exception is a "charging port", present on some newer laptops perhaps, and labled or colour-coded as such).
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

psc
Posts: 8
Joined: Thu Jun 13, 2013 6:55 pm

Re: Creating a powered USB cord?

Wed Nov 20, 2013 12:12 pm

I use a modified cable and it works. The data cables are going to the Pi and the power cables to a 5V PSU. The only difference is that I also tied togheter all the grounds.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Creating a powered USB cord?

Wed Nov 20, 2013 12:39 pm

You must keep the ground connection between the Pi and the USB device. You can cut the power line as you suggest, but you should just 'tap into' the ground line.

IanSauce
Posts: 3
Joined: Wed Nov 20, 2013 2:07 am

Re: Creating a powered USB cord?

Wed Nov 20, 2013 5:15 pm

So all the grounds should be connected? Would it work to simply inject the 5V into the wire so that it is reaching both the Pi and the Wifi adapter in this case? That way i dont have to worry about grounds? Also my charger outputs 1A this isnt going to be a problem since a device only takes as much Amperage as it needs....Correct?

User avatar
jbeale
Posts: 3689
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Creating a powered USB cord?

Wed Nov 20, 2013 5:22 pm

You always have to have a common ground between all devices in the same circuit. Otherwise it is not a "circuit" and power and signals cannot flow.
Correct about the amp rating on your charger. The amp rating is just the maximum current it can provide. The actual current that flows is controlled by the load, in this case the Pi, plus whatever accessories or other loads are attached.

IanSauce
Posts: 3
Joined: Wed Nov 20, 2013 2:07 am

Re: Creating a powered USB cord?

Wed Nov 20, 2013 5:34 pm

So like i have in this VERY crude diagram? (really need to learn eagle so i can make some proper diagrams. :mrgreen: )
Attachments
Untitled.png
Untitled.png (8 KiB) Viewed 1230 times

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Creating a powered USB cord?

Wed Nov 20, 2013 11:51 pm

Well, firstly you need to learn KiCad, it's better than Eagle because it's entirely unrestricted.

Secondly, yes, the diagram looks ok, but there's a trick that makes it unnecessary. You can actually power the Pi via its USB port (it's called backpowering or backfeeding). So, what you could do is break into the USB cable and tap into the power and ground lines (don't cut them) and feed power in that way. That means you don't need the power cable into the Pi's micro-USB power socket.

I am doing something similar with an external hard drive. It needs more current than the Pi USB port can provide. I am using a pre-made USB 'Y' cable (came with the external hard drive enclosure). It connects the Pi and the hard drive, and I can inject power to both devices using the other part of the 'Y'.

Return to “Beginners”