Author Topic: USB power  (Read 2582 times)

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
USB power
« on: May 05, 2013, 05:26:01 PM »
I'm trying to get a Raspberry Pi running off a custom power supply.

I looked at the USB spec and found that pins 1 and 4 are power.  I cut up a usb cable, and attached the corresponding wires to the output of my bench power supply, with a constant voltage output of 5.00VDC.  Data pins 2 and 4 were left open.

The Pi didn't come on.  I tried my cell phone. [same connector] Interestingly, my cell phone recognized that it was connected to something via USB, but refused to charge off it.  Neither device appears to be any worse for the trial.

What am I missing?

charby

  • Necromancer
  • Administrator
  • Senior Member
  • *****
  • Posts: 29,295
  • APS's Resident Sikh/Muslim
Re: USB power
« Reply #1 on: May 05, 2013, 05:48:54 PM »
polarity?
Iowa- 88% more livable that the rest of the US

Uranus is a gas giant.

Team 444: Member# 536

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
Re: USB power
« Reply #2 on: May 05, 2013, 05:50:39 PM »
Hmm... Looks like apple started some jankery with having the data pins pulled to specific voltages to communicate what type of charger was connected and how much it could cheat the spec with reguards to amperage over USB.  Going to try an applelicious voltage divider to see if that gets this thing to kick on...

Details: http://www.ladyada.net/make/mintyboost/icharge.html

41magsnub

  • friend
  • Senior Member
  • ***
  • Posts: 7,579
  • Don't make me assume my ultimate form!
Re: USB power
« Reply #3 on: May 05, 2013, 06:10:02 PM »

Azrael256

  • friend
  • Senior Member
  • ***
  • Posts: 2,083
Re: USB power
« Reply #4 on: May 05, 2013, 06:26:38 PM »
Um... I don't have a direct answer, but I think you're working too hard.  Mine is running off the "unused" USB port on my cable box.  USB power is pretty easy to come by. 

Marnoot

  • friend
  • Senior Member
  • ***
  • Posts: 2,965
Re: USB power
« Reply #5 on: May 05, 2013, 06:27:48 PM »
AFAIK, the crap Apple does with USB power is specific to Apple. I'm pretty sure the Pi (just got one, but feeding it off a USB "charger") uses the actual, regular USB spec. Polarity was my guess as well, though I'm assuming you've eliminated that?

birdman

  • friend
  • Senior Member
  • ***
  • Posts: 3,831
Re: USB power
« Reply #6 on: May 05, 2013, 06:46:32 PM »
For an upstream port to send power (as a dedicated or standard charging port), it tests the data lines.

All USB ports can deliver at least 100mA however, that is when seeing a device,  dedicated charging ports at least 500mA, but those simply check to see that the D+/D- lines are shorted together.

The apple stuff is what the downstream device must do for the charger to work, so if using an apple charger, that may be the case, if they put smarts in it for the 1 or 2A chargers.  However, any cell phone charger is 500mA capable, and will likely only test (if it does at all) that D+\- are shorted together.

(I've been building a device lately that as a dedicated USB charging port, so I actually made a universal USB charging port that allows me to set the D pins in any config--individually pulled to same/different voltages or pulled to ground and/or shorted, and/or floating). Simple circuit, the test circuitry is high impedance, so its a three channel DIP switch, two pots, and a 5V LDO regulator.)

Brad Johnson

  • friend
  • Senior Member
  • ***
  • Posts: 18,092
  • Witty, charming, handsome, and completely insane.
Re: USB power
« Reply #7 on: May 05, 2013, 07:39:23 PM »
Try a different cable. I ran into a data-only cable once.  Also, does usb do the same thing as hdmi - device sensing for power, data, etc?

Also, you know that usb wall adapters are only about five buck s a pop, right? Why go through all the hassle of fabbing up a custom setup?
« Last Edit: May 05, 2013, 07:50:36 PM by Brad Johnson »
It's all about the pancakes, people.
"And he thought cops wouldn't chase... a STOLEN DONUT TRUCK???? That would be like Willie Nelson ignoring a pickup full of weed."
-HankB

Gewehr98

  • friend
  • Senior Member
  • ***
  • Posts: 11,010
  • Yee-haa!
    • Neural Misfires (Blog)
Re: USB power
« Reply #8 on: May 05, 2013, 08:03:36 PM »
Quote
Why go through all the hassle of fabbing up a custom setup?

Brad, you do know this is Nick we're talking about, right?

The same guy who uses a metal lathe to open a can of tuna...
"Bother", said Pooh, as he chambered another round...

http://neuralmisfires.blogspot.com

"Never squat with your spurs on!"

Jim147

  • friends
  • Senior Member
  • ***
  • Posts: 7,597
Re: USB power
« Reply #9 on: May 05, 2013, 08:11:06 PM »
Brad, you do know this is Nick we're talking about, right?

The same guy who uses a metal lathe to open a can of tuna...

I don't think he would do that to his lathe.

jim
Sometimes we carry more weight then we owe.
And sometimes goes on and on and on.

BAH-WEEP-GRAAAGHNAH WHEEP NI-NI BONG

birdman

  • friend
  • Senior Member
  • ***
  • Posts: 3,831
Re: USB power
« Reply #10 on: May 05, 2013, 08:23:31 PM »
Try a different cable. I ran into a data-only cable once.  Also, does usb do the same thing as hdmi - device sensing for power, data, etc?

Also, you know that usb wall adapters are only about five buck s a pop, right? Why go through all the hassle of fabbing up a custom setup?

Sensing depends on the upstream device.  Power consumption depends on both.
You can have "dumb" devices on both ends (USB coffee mug heater and wall wart from 7-11) or overly smart devices on both ends (apple stuff).

The reason apple stuff is weird is as Nick said.  To claim USB compatibility, they must -accept- the USB charging specs (500mA), but then they tweak their stuff to have an additional high current capability (1,2A).  So both devices then must check to see if the other end is special.   Apple isn't the only company to do this ind you, others do as well.

Fortunately, its pretty easy to tell, there re really only a few options:
D+{float,5V,gnd,xxV) {shorted to/not shorted to} D-{float,5V,gnd,xxV}
The standard is the simplest--shorted floating pins, as its the easiest to signify "I am not a negotiating smart device, so send me whatever my input impedance allows at 5V but no more than 500mA (ie, maximum input impedance of 10 Ohms). 

Since virtually everything smart uses buck/boost chare controllers, they can effectively "set" their apparent input impedance to whatever they want, and the chargers D+/- pin settings make it simple to do so, not to mention easier than monitoring the voltage of the +5V line.

Also, smart chargers will monitor their output voltage and go into a reset if the input impedance on the connected device is too low, rather than sag voltage below 4.9V and potentially fry their output regulator with excess current.

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
Re: USB power
« Reply #11 on: May 05, 2013, 08:54:00 PM »
I found my problem.  I'm not sure why the pi didn't run using the bench power supply, but my homemade dedicated supply was not providing clean enough power.  A full bridge rectifier cleaned up the input enough to get it running.  Shame, I thought I could get away with a half-wave and appropriately large filtering caps [2200uf].  Apparently not. 

Of course, doing full wave rectification caused the input to the LM7805 to exceed 35V, upon which it quickly stopped working.  :facepalm:

Also, you know that usb wall adapters are only about five buck s a pop, right? Why go through all the hassle of fabbing up a custom setup?

I'm not going from mains power, I'm using a control bus that already exists in the piece of equipment I'm installing this pi in.  As such, the power supply circuit is custom.

AJ Dual

  • friends
  • Senior Member
  • ***
  • Posts: 16,162
  • Shoe Ballistics Inc.
Re: USB power
« Reply #12 on: May 05, 2013, 09:15:48 PM »
Sensing depends on the upstream device.  Power consumption depends on both.
You can have "dumb" devices on both ends (USB coffee mug heater and wall wart from 7-11) or overly smart devices on both ends (apple stuff).

The reason apple stuff is weird is as Nick said.  To claim USB compatibility, they must -accept- the USB charging specs (500mA), but then they tweak their stuff to have an additional high current capability (1,2A).  So both devices then must check to see if the other end is special.   Apple isn't the only company to do this ind you, others do as well.

Fortunately, its pretty easy to tell, there re really only a few options:
D+{float,5V,gnd,xxV) {shorted to/not shorted to} D-{float,5V,gnd,xxV}
The standard is the simplest--shorted floating pins, as its the easiest to signify "I am not a negotiating smart device, so send me whatever my input impedance allows at 5V but no more than 500mA (ie, maximum input impedance of 10 Ohms). 

Since virtually everything smart uses buck/boost chare controllers, they can effectively "set" their apparent input impedance to whatever they want, and the chargers D+/- pin settings make it simple to do so, not to mention easier than monitoring the voltage of the +5V line.

Also, smart chargers will monitor their output voltage and go into a reset if the input impedance on the connected device is too low, rather than sag voltage below 4.9V and potentially fry their output regulator with excess current.

And the 1.2A USB sources are a Godsend. My kids Kindle chargers will fill up my Droid Razr Maxx in 2 hours, as opposed to six for the stock charger or a PC's port.  =)
I promise not to duck.

Jim147

  • friends
  • Senior Member
  • ***
  • Posts: 7,597
Re: USB power
« Reply #13 on: May 05, 2013, 10:20:22 PM »
For USB power have any of you tried this?

http://asus-ai-charger.en.softonic.com/

jim
Sometimes we carry more weight then we owe.
And sometimes goes on and on and on.

BAH-WEEP-GRAAAGHNAH WHEEP NI-NI BONG