Close

TL;DR: Troubleshooting

A project log for Quick Charge 3.0

An device-side implementation of the new modes from the Quick Charge 3.0 protocol to provide voltages from 3.6-20V in 0.2V increments

dracodedracode 08/08/2017 at 21:060 Comments

There's really nothing in this post that you'll need in order to replicate the QC3.0 hack, it's mainly just describing some of the silly problems I ran into.

-----

A couple of days later, my new power bank arrived!  I plugged it in to ensure it was ready to go before I began experimenting.

Using C to program a microcontroller permanently is great, but for quick development and testing, I greatly prefer something like Python.  It's great to be able to use the command line to try out an idea in one or two lines as opposed to write, compile, reflash...  So I chose to use an ESP8266 module with MicroPython for my experiment.  I got it on eBay for around $5.  I have a few of this particular dev board and I think they're great.  The pins are broken out to standard 0.1" headers, indicator LED for each GPIO, voltage regulator onboard, a jumper block for setting the flash into programming mode.  One little improvement I make is to remove the little battery box and replace it with a standard USB connector; just plug it into any USB socket and your board is powered up.  

First, I did a quick and dirty re-implementation Hugatry's QC2.0 code in Python.  Hit my first major problem: it didn't work.  All I could get out of the power bank was the normal 5V.  Was the problem with my code?  My circuit?  The power bank itself?  Time to troubleshoot.  I stepped through Hugatry's QC2.0 video and decided to validate my circuit by disconnecting the ESP8266 and doing the handshake by hand with jumper wires.  Nope, didn't work.  His document said "Device should allow the voltage on D- -line to drop below 0.325V, for example by keeping D- disconnected."  When building my circuit, I had interpreted that as "D- needs to go low" with the "keeping D- disconnected" as just a suggestion.  In my implementation, I was tying D- to ground.  Turns out, that doesn't work -- it must be left floating.  After correcting that, the voltmeter showed 12V now.  The circuit and power bank worked.

But it still didn't work when hooked up to the microcontroller.  There must be a bug in my code.  I pored over the code, tweaked some things, still no success.  I hooked the voltmeter into the circuit to observe it in action.  Bmm, that's weird: when I'm trying to set the D- pin to high impedence ("disconnected"), I'm actually getting a residual voltage of 0.1V.  That's when I realized: those nice LEDs on my dev board hooked up to each GPIO, they were also providing another path for current from my GPIO pin.  I desoldered the current-limiting resistors from the two GPIOs I'm using for control of D- and...  it works!  I've replicated the existing QC2.0 hack, finally, with a bit extra logic to allow for a new state that Hugatry was not using (3.3V on D-) that was required for the two new modes.

Now to move on to the new features contained in QC3.0.  At this point, I wasn't really hopeful that it would work.  The CHY103 datasheet says "At this point the Quick Charge 2.0 handshake followed by the Quick Charge 3.0 handshake can take place", and I haven't found any documentation of this new handshake for QC3.0.  But what the heck, I'll try the new entries in the state table for the two new modes anyway, with only the QC2.0 handshake.  The 20V mode: failure.  Continuous mode: no obvious signs of success or failure.  Try out an "increment" pulse on D+, with my wild guess of 200us pulse width.  And, shockingly, it WORKED!  I can't guarantee that this works for all QC3.0 power sources, but it worked on this one.

I incremented and decremented until the voltage stopped changing.  My particular device accepted decrement pulses until it should be (nominally) 3.6V, though the voltmeter continued to display 4.27V.  I suspect that's the actual output voltage of the LiPo cells inside the device, and that the power bank does not really regulate downward from there.  In the upward direction, I could increment until 12.0V and no further.  Annoyed that I could not get to the 20V I'd expected from QC3.0, I did some more reading to see if there was something I was missing.  It seems that QC3.0's high voltage mode is not widely implemented.  This source notes that "although the QC 3.0 standard supports 20 V, none of the QC accessories currently give 20V".  I wish I'd known that before I bought this power bank.  Although nothing explicitly states that this device supports 20V, it does claim QC3.0, which is always reported to support up to 20V.  I feel mildly cheated.

Discussions