Search This Blog

Saturday, September 30, 2017

The Secret Life of USB Chargers

I am writing this so that I and you can understand what USB charging technology is about.  One thing that's clear is that all phone and vaping charging system are not created equal.  Some work better and/or faster than others.

I want to create one that does as good a job as possible so that my new creation can, as quickly and efficiently as possible, charge you phone.

So first we need to understand the standard USB interface.

First off, the USB 1.0, 2.0 and 3.0 interface has the same pins on the top of the connector.  Typically these are used for the charging process (from here):
You can see more here but the basic idea is that all three standards are compatible from the charging perspective.

Another common issue is why do certain chargers work better than others charging a given device?

Well, for one thing USB communicates information.  In the case of non-charging applications D+ and D- are basically very fast serial lines for sending data around.  

From this site we see that the way a charger sets D+ and D- allows the phone to determine if the charger supports its needs.  This table showing how D+ and D- are set by the charger, taken from the linked site, shows some options:
  • 2.0V/2.0V – low power (500mA)
  • 2.0V/2.7V – Apple iPhone (1000mA/5-watt)
  • 2.7V/2.0V – Apple iPad (2100mA/10-watt)
  • 2.7V/2.7V – 12-watt (2400mA, possibly used by Blackberry)
  • D+/D- shorted together – USB-IF BC 1.2 standard
  • 1.2V/1.2V – Samsung devices
So you can see that your generic USB 1A charger does no good on your iPhone.  In fact your iPhone will generally barf if offered a mere 1A.

So to build a generic device capable of usefully charging most or all phones (and everybody has their own phone favorite) it will be necessary to emit the proper D+ and D- voltages.

The basic wiring diagram looks like this (from here):

Apparently the values of the resistors don't matter except in the contexts of battery drain.  The specific voltages as indicated above matter exactly.  How we get there probably does not.

Note that all the values in the table above are above 3.3V so that we can use Atmel GPIO pins to set them via a resistor network.

If we replace these resistors with potentiometers then a user can set them for their phone if they have a voltmeter.  Typical Atmel's used here don't have digital-to-analog converts (DACs) but we would need that to drive this directly.

Here's some ideas:



In order to get 5V from 18650's we need a regulator such as the Pololu 5V, 2.5A Step-Down Voltage Regulator D24V22F5.


This will generate 5V from series/parallel 18650's.  In addition, it supports an enable feature (EN pin) allowing it to be disabled via a control signal (drawing a 5-10 micro amps - normally 1ma if no EN).

No comments:

Post a Comment