Powering project from USB 5V lithium powerbank, a few decisions to make

I'm planning to power a project of mine (possibly needing up to 1.5 Amps at a peak, probably taking about 500mA most of the time) over a USB lead, from, depending on where I am and when I use it, either a lithium USB powerbank or a USB plug socket adapter. My powerbank can output up to 2.4A if needed, and my charger plug adapter can too. I only need power like this, not data. Note that I have no need or intention to ever power my project from a computer's USB port. I just had a few specific questions to check about this matter:

  1. Picking between type B (like the ones for printers), mini USB (common on cheaper and older small electronics) and micro USB (most non-apple phones). I was planning to just buy some female USB ports like these https://www.amazon.co.uk/USB-TYPE-RECEPTACLE-67068-9000-MOLEX/dp/B01I7QDUI2/ref=sr_1_1?ie=UTF8&qid=1527960672&sr=8-1&keywords=molex+usb+type+b (I've found them much cheaper elsewhere but am not typing from my usual PC right now so don't have the cheap link in my bookmarks, just quickly searched for any option so I can show you a picture) or the mini or micro USB equivalents and solder them to my veroboard. Any suggestions on picking between mini, micro and type B? My charger and powerbank both have the usual female USB type A port, that one can plug a USB cord into, and I have plenty of USb cords of all types so I think I'm free to pick whichever port type is best for this.

  2. USB negotiation, I read that accordingly to the original USB standard only about 100mA will be supplied until the device and power source have exchanged some data regarding capabilities and decided how much current the charge can allow the device to take. I don't want to have to negotiate, for what I'm planning I don't want to have to have extra microcontrollers about just to ask for the amount of current wanted. Do chargers and powerbanks typically require negotiation before they'll supply the 1.5A or so I need? How can I check whether my specific charger and powerbank need a device to negotiate before they'll give it the desired current, the obvious way is to plug n my finished project without any negotiators at it's end and see if it works, but right now the project isn't quite finished and I'm hoping to find this out sooner rather than later so I have plenty of time too deal with negotiation if necessary. If negotiation is necessary are there any simple dirty tricks to avoid it, I hear that shorting the two data wires can help but I'm not sure if this is always true or if doing so carries risks of overdrawing from the USB power source.

  3. Other than the possible problems of the the negotiation aspect, is there anything else that might make me need to get something like this SparkFun Breadboard Power Supply USB - 5V/3.3V - PRT-08376 - SparkFun Electronics rather than just buying a female port and soldering it's Gnd and 5V wires directly to my veroboard?

  4. My battery pack has got safety features built in, or so the manufacturer claims and they seem a pretty reputable one, but given that it is lithium, any specific safety tips I should be aware of. I've read up about the difficulties of lithium batteries, but think I should be immune from most of them for this as I'm powering from a manufactured USB supply device with inbuilt protection, voltage regulation and controls. Aside from not shorting the 5v and Gnd wires of the USB, and of not designing my project to draw more than 2.4A, are there any other things I should do?

Thanks

P.S. for the sake of some context my project contains an ATMEGA328P microcontroller programmed with arduino software, a few small motors, some LEDs and some sensors. The motors and LEDs are the thing that could possible altogether draw up to 1.5A at peak and will typically draw around 500mA or a little less.

  1. I guess even a USB micro socket can tolerate 2 amps. I see 3 Amp raspberry pi power supplies using these. You can get a breakout board with the socket attached.
  1. USB negotiation. I don't know much about that, but I doubt if either your power bank or the ATMega328P, which your are connecting together will be affected by this because a negotiation would take place over the data lines which you will not be using.

I found this description: How do USB charging and "smart" charging ports (e.g. Anker's PowerIQ) work? - Electrical Engineering Stack Exchange

  1. See 1. You can use a 3amp raspberry pi power supply or similar.

  2. Some power banks have an auto shutoff "feature" so if the connected device is not drawing enough power, these shut off. and may cause you a problem. There are work arounds though. Also note that the rating of these power banks is at mAh at the internal battery voltage and not the output voltage.

Thanks for your tips.

That ebay breakout board seems to have nothing more than wires on it, so that indicates it should be simple enough to solder a microUSB female port to my stripboard.

As for 3Amp Pi power supplied, I have one already. But does a pi negotiate before drawing 3 amps or can those supplies give 3 amps to any dumber piece of circuitry which gets attached to them?

My atmega328p definitely won't be negotiating, I'm just giving it a 5V and a Gnd and then wiring it's digital inputs to parts of my project. I really can't be wasting program space and a pair of pins to put negotiation code on the atmega and nor do I want a dedicated microcontroller somewhere to send negotiation data to my powerbank or wall wart. That negotiation stackexchange you point to seems to imply I should probably be ok, IF my wall wart and powerbank conform to CDP or DCP rather than to an older version of the specification. A lot of versions of the standard suggest that shorting the data lines can be helpful, if that is done should one shrot them directly or throw in a 100Ohm or 1K Ohm resistor to limit any currents that may try to flow along shorted data lines?

As for those mentions on the stackexchange of up to 20V, which I do not want, I'm guessing that neither the wall wart nor powerbank should be able to provide those, and that even if they could I would have to be really foolish and attach something to the data lines which would accidentally ask for high voltages. I should therefore be getting a reliable and pretty accurate (always within 0.1V) 5V on my wires? Do USB wall warts and powerbanks typically have fairly accurate voltage regulation to ensure exactly 5V, and to make it constant not pulsed at some frequency resulting from (in the wall wart's case) rectifying mains currents?

I am guessing that workarounds would just involve putting a resistor in parallel with my whole project and making this resistor small enough to always draw enough current to never let the powerbank detect that too little current is flowing.

When you say the rating (13000mAH on mine) is at the batteries voltage, you mean that the battery will provide an amp for 13 hours at it's own voltage (which could be anything from 3.7V for Li cells not in series up to 14.4V or so) but once it has gone through it's built in regulator to produce a 5V output it could, assuming 90% voltage conversion efficiency) last for an amp of output anywhere between 7.72 hours to 33.7 hours?

Thanks

It does start getting complicated when you look at all the "standards" and proposals for "smart usb chargers" and the variety of output currents and voltages that these support. I'm sure though these are not relevant in your scenario.

The output of most USB chargers is fully isolated from the mains voltage. These usually operate with a high frequency buck converter and voltage regulator. The high frequency permits a physically small transformer.

The work arounds for the powerbank auto shutoff are minimally a resistor. But this switching the resistor with a duty cycle of say 1:100 can have he same effect with much less wasted energy. See for example some posts here: Powering the arduino nano with a Power bank - Project Guidance - Arduino Forum

What I meant with the power rating is that a powerbank with a 5volt output and a rating of 13000mAh does NOT have maximum expected stored energy of 65 watt hours. The manufacturers use a trick to inflate the printed performance rating by highlighting the capacity (mAh) at the internal battery voltage of 3.7 volts. Yes you have also to consider conversion efficiency as well.

Ok thanks.

I've found a few options for female connectors to buy, type B seems easiest to find in a form which is able to be soldered into 2.54mm stripboard. But most of these ports have datasheets that say they are rated for 1 amp. Now I'm guessing that as these ports are nothing but lumps of metal and plastic a 1 amp rated port can happily take significantly more (1.5 amps) if done for a few seconds or a few tens of seconds. Is that generally a sensible assumption to make for a component like this, things like IC chips might burn out if more current that their datasheets prescribe is sent through them, but I don't see any way that a connector should have issues with large but still reasonable currents. The ports describe themselves as having very low resistances and being able to manage up to 30V, so I'd think 1.5 A at 5V should be fine?

Any thoughts on the current matter?
Thanks

I've given this a go, things seem to be ok without negotiation. I'll elaborate when I've tried drawing bigger currents.