Electronic – Power a circuit off USB the correct way

powerpower supplyusbusb devicewiring

I'd like to properly power a gadget off USB (2.4A USB powerbank https://www.amazon.com/Anker-20100mAh-Portable-Charger-PowerCore/dp/B00X5RV14Y/ref=sr_1_3?ie=UTF8&qid=1512261941&sr=8-3) consisting of:

  • A cheap power only USB Y-splitter
  • Raspberry Pi Zero
  • A boost converter from 5V USB to 12V
  • 4 LEDs in series
  • An ULN2003A used to control a unipolar stepper motor
  • Some sort of graphical output (OLED/Character LCD)

Adding all the respective current values together, the max. current draw of my gadget should be:
180mA RPi Zero + 500mA LEDs (384mA for perfect transformation, I assumed 75% efficiency) + 165mA Stepper Motor + 165mA Character LCD = 1010mA total power draw.

What I know so far:

Having delved into (and having been overwhelmed by) the USB specification, I have found that USB can under some circumstances supply 5V@1.5A (or even more).

Back in the day, there apparently used to be a kind-of handshake process (enumeration/negotiation/…) which was necessary to allow >100mA. I found an article explaining some aspects of USB charging: http://www.electronicdesign.com/interconnects/introduction-usb-power-delivery

It’s important to note that BC-1.1 was released as an Engineering
Change Notice (ECN) to USB 2.0 and it significantly deviated from the
sanctions of USB 2.0. As per USB 2.0, any USB device could be
classified as either low power (5 V @ 100 mA) or high power (5 V @ 500
mA). On connection, a USB device was allowed to draw 100-mA current
initially while enumerating and negotiating its power budget with the
host. Based on the enumeration, the host would either raise the power
delivery to 2.5 W or continue at 0.5 W.

The battery-charging spec went on to define more power sources than
what was recommended above:

  1. Standard downstream port (SDP): power source compliant with USB 2.0 Spec.

  2. Charging downstream port (CDP): power source not compliant to USB 2.0. CDP can supply up to 7.5 W (5 V, 1.5 A) and the 1.5-A current can be supplied before enumeration.

  3. Dedicated charging port (DCP): There’s no enumeration here, and charging
    occurs without any digital connection. DCP supplies up to 1.5 A and 5 V.

There has been a similar question before ("Dumb" power from USB), but it does not mention SDP and CDP. Apparently, you can achieve CDP-mode when you short the data lines together.

My question:

  1. Can I get the full 5V 1.5A (or even 1.8A) power from an ideal (100% USB standard-conforming, protocol-following) port without any fancy enumeration/registration/…
  2. Can I get the full 5V 1.5A (or even 1.8A) power from a real world (a decently beefy power bank like the Anker in the Amazon link) port without any fancy enumeration/registration/…
  3. In case I need negotiation, couldn't the Pi just handle it in the name of both sides of the Y-splitter (they terminate in one Micro-USB port, so the power bank shouldn't even know that the cable splits somewhere downstream…

Here's how I intend to wire it up:
My intended wiring

Best Answer

You are approaching the problem upside-down.

First, all BC/QC etc. charging protocols are used primarily for DEVICES, so the devices can understand the source capability, and then configure itself internally to align their consumption with the source. There could be another stage to negotiate the voltage level, but this in this case both provider and consumer must use the same protocol/standard.

The ANKER powerbank is just a source of 5 V 2.4 A. It doesn't even follow any announced standards. Their "PowerIQ" is utter BS.

(Disclaimer: there used to be ideas of intelligent chargers that are supposed to change advertised standard, and select the "best" based on maximum current draw. The problem is that phones also use some intelligence and take different charges depending on the battery's state of charge, so the algorithm doesn't converge. These "chargers" might work a bit better than the dumb ones, but no guarantee).

Therefore, if you have the Anker powerbank, you don't need to do anything, just split the power as you suggested yourself.

Regarding your specific qiestions,

(1) No, you can't be sure that any USB (legacy Type-A) port will let you draw 1.5 A. While usually you can do much more than that, some ports may have current limits set for 500-600-900 mA, so the port will sense overcurrent and will be shut down; [A 100% USB standard-conforming, protocol-following port with 1.5 A capability must be specifically designed as "charging port", and shall be explicitly labeled as such.]

(2) Yes, if a bank is rated above 1.8 A (say, 2100 mA), you can safely draw 1.8 A from it without any fancy reservations;

(3) Since this is a case when you don't need to do anything, the question is moot. But no, Pi-3 or whatever can't handle any of the "negotiations" even if the bank follows one of intelligent charging standards. First, the power supply port on Pi doesn't have any connections to D+/D- pins. Second, to bring in negotiations, you would need a special IC that is designed for this.