USB Charger Fooled Into Variable Voltage Source

USB chargers are everywhere and it is the responsibility of every hacker to use this commonly available device to its peak potential. [Septillion] and [Hugatry] have come up with a hack to manipulate a USB charger into becoming a variable voltage source. Their project QC2Control works with chargers that employ Quick Charge 2.0 technology which includes wall warts as well as power banks.

Qualcomm’s Quick Charge is designed to deliver up to 24 watts over a micro USB connector so as to reduce the charging time of compatible devices. It requires both the charger as well as the end device to have compatible power management chips so that they may negotiate voltage limiting cycles.

In their project, [Septillion] and [Hugatry] use a 3.3 V Arduino Pro Mini to talk to the charger in question through a small circuit consisting of a few resistors and diodes. The QC2.0 device outputs voltages of 5 V, 9 V and 12 V when it sees predefined voltage levels transmitted over the D+ and D- lines, set by Arduino and voltage dividers. The code provides function calls to simplify the control of the power supply. The video below shows the hack in action.

Quick Charge has been around for a while and you can dig into the details of the inner workings as well as the design of a compatible power supply from reference designs for the TPS61088 (PDF). The patent (PDF) for the Quick Charge technology has a lot more detail for the curious.

Similar techniques have been used in the past and will prove useful for someone looking for a configurable power supply on the move. This is one for the MacGyver fans.

25 thoughts on “USB Charger Fooled Into Variable Voltage Source

    1. get one of $1 DC Boost converters on ebay and you are set, or alternatively Buck converter + laptop power supply. Just remember those are not a real lab supply replacement, even when they claim constant current mode (because converters require tons of capacity = will dump all that stored energy before it starts to cut current)

      other way around hack:
      https://www.youtube.com/watch?v=b-46fmEB0eM

  1. Yes, it can be done, depending on the charger and the voltage regulator employed.

    Step one is to find the datasheet on the vreg used.

    Many are varible and use resistor networks to set the output voltage.

    You also, if you are raising the voltage, need to insure that the output caps can handle the voltages involved.

    Step two, Using additional resistors and switches you can “reprogram” the regulator to output several voltages.

    Step Three: gloat.

    1. What voltage is typically on the output of the rectifier? I’m would have thought they would transform it down to close to 5 volts before feeding it into the regulator for efficiency,but here it seems to be as high as 12. Definitely going to measure it when I get the chance.

    2. No, you can only do that over some limited range with different consequences without rewiring the transformer.
      Best to look at people trying to get PC power supplies into variable ones, but most of times the rewire the transformer.
      The control loop also suffers. It is generally not a very good idea.

  2. Could it be extended for QC 3.0? Being more granular than QC 2.0, I can see it coming handy for making fan controllers for home network racks and whatnot. It can come in the form of a little module with a USB cable coming out one end and a few fan headers on the other. Trusted brand QC 3.0 adapters are often going on sale for less than trusted brand 12V adapters and there would be no need for a buck converter.

    BTW, I once came up with a circuit to switch a QC 2.0 adapter to 12V using just one transistor, a few resistors, a diode, and a capacitor.

    1. Hmmm. Can you share that? Would be interested to try that as well. What was the Max power delivered. Also you ask can it be used for qc3.0, counter question, why not?

      1. Yeah, I’m interested in QC 3.0 as well. But time is a bit short at the moment :/ This collaboration just happened in two evenings as a quick project. But if I (or Hugatry) find the time I’ll look into it. Must be possible but it’s not as extremely simple as this.

  3. Can this Qualcomm charger detect a Samsung phone or tablet and kick it the 1+ to 2 amps it needs, like the genuine Samsung chargers, while costing significantly less than the insane extortionist prices Samsung wants for their chargers?

    1. Many universal chargers that are capable of supplying 2A or more will have a nice IC inside on the data lines to cycle through different identification modes (by setting different voltages at the data lines). Once they detect something pulling max current they stop there.
      I found that none work best with any phone and that sometimes you need to plug and unplug the phone before it charges as fast as it can. But yes, such chargers can be cheaper (I have a 10 port one with 2.4A per port).

  4. Five-volt USB power packs are so common and cheap they’d be great for QRP ham radio gear and even better if their output could be increased to 9 or 12 volts. But I’ve also heard that they can generate noise on the RF signal. Does anyone know about that and how to fix it?

    1. I can attest to the RD noise. Tried using the FM radio on my motorbike headset while charging my phone from and Anker Astro 13000mah. All I got was noise while the charger was enabled.

      1. Err. I think you will find that the code in the first link does not apply to the top picture or video in this article.
        This article uses two dividers and four arduino pins, the picture and videos show this.
        The code shown in the video is quite different to the code by Engelgeer.
        Rather confusing for a newcomer to arduino/coding (though by no means new to electronics).

  5. I got everything setup and programmed. I get a 12v output, but after a few seconds of outputting 12V the battery turns itself off. The D+/- lines do not change state and maintain the correct voltage. Is anyone else having this issue?

    1. Not exactly the same case, but I also had issues with one low-cost QC charger which only switches to 12V “sometimes”. After it has switched, it’s quite stable, but sometimes, it just stays at 5V. I haven’t had time to confirm, but I guess it may be due to the high noise level of the charger, which causes spikes on the D+ / D- lines (very visible on oscilloscope) while a reputable (Aukey) QC2 charger exhibits no noise and no issue.
      If you have the same symptoms, maybe you could try adding small capacitors (try with 1 or 10 nF) to GND to act as a low pass filter on D+/D- and get rid of the spikes, then let us know…
      Just my 2 cents…

      1. Figured out the issue. It was that my charger was expecting to see a minimum current on the line. If it dropped below 20mA then the battery shut off. Simple circuit fixed my current draw and I have a stable 12V draw.

Leave a Reply to electrobobCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.