0

In a pinch I bought a $3 "phone recharger" from the bin shown below, but now I am too scared to connect it directly to my phone, which costs orders of magnitude more. While a poor design could present undesirable qualities to the 5V power output, I have no idea if there's something inside connected to the data lines - part of the 21st century USB angst that has many people saying "not in my USB port you don't". See this security SE answer for some background on USB angst.

I'll check my "cable museum" drawer for a power-only USB link to connect it to my phone's power without connecting to the data lines. If I can't find one I am planning to just carefully cut into a USB cable and sever the two data lines which I am assuming will be a twisted pair, leaving the black and red power lines, and do whatever seems to be necessary to temporarily repair the mechanical and shielding integrity.

Am I missing something important here, or should this be as simple as I think?

enter image description here

enter image description here

above: From here.

enter image description here

above: From a USB 2.0 specification (update) at USB.org.

enter image description here

above: Image borrowed from this question.

uhoh
  • 3,399
  • 2
  • 23
  • 63
  • 3
    If you cut the data lines, your phone won't recognize the charger as being able to deliver higher charge current. Your phone will charge very slowly. – JRE Aug 16 '17 at 11:01
  • @JRE wow, so I should generally expect there to be a legitimate connection to the data lines in most/all phone chargers? – uhoh Aug 16 '17 at 11:06
  • @uhoh see https://electronics.stackexchange.com/questions/123172/what-is-the-ideal-way-to-handle-data-pins-d-and-d-on-a-usb-power-adapter-to-be – Mark Aug 16 '17 at 11:10
  • @JRE please reread the question more carefully. If you want to plug random $3 USB items from third-world manufacturers into your electronics, good luck! But you should not diminish the security issues here. – uhoh Aug 16 '17 at 11:17
  • @Mark This is exactly the kind of information I was looking for, thanks! – uhoh Aug 16 '17 at 11:18
  • You've also misunderstood the linked question on Security SE. Those plug in to a USB host and do nasty things to them by pretending to be a diffetent type if device. Your charger is the host in this case, and so can't present itself as any other device to your phone. It could (maybe) implement a host and install drivers (on itself) for the USB devices your phone presents, but it would have to be setup for a particular type of phone. – JRE Aug 16 '17 at 11:21
  • @JRE if you reread the question again you will see that the link is described as "...some background on USB angst." You've misrepresented what I wrote there. There is nothing wrong with being careful about the data connection to USB ports, and to dismiss it is not helpful to other readers. "What do you think it's going to do?" suggest that it's safe as long as you can't immediately think of something bad it might do. You can play as unsafe as you like, but it's not good to suggest that others should think that way as well. – uhoh Aug 16 '17 at 11:23
  • I'd be more worried about it damaging my phone than about some nebulous "security" problems. I repeat: What do you think it is going to do? Be more concerned about what facebook, candy crush, random programs from the playstore are spying on you than some piece of hardware that has no way to take use of any info it gets from you. – JRE Aug 16 '17 at 11:24
  • You are in a panic over something you half understood. – JRE Aug 16 '17 at 11:25
  • @JRE there is no panic, only a carefully written SE question. This is a second misrepresentation of what I've written. In the mean time someone has left a [very helpful comment](https://electronics.stackexchange.com/questions/324224/#comment757441_324224) and someone else has spent their time effectively, and posted a [very helpful answer](https://electronics.stackexchange.com/a/324230/102305) with exactly what I needed to know! – uhoh Aug 16 '17 at 11:28
  • 1
    @JRE These chargers can be pretty awful. The charge speed on my cheap charger is incredibly fast, but really harmful to my phone; the battery gets so hot I can barely hold it (heat is a battery's worst enemy). They also have a tendency to drain the cellphone's battery if the charger's charge is lower than the phone's. It doesn't even have a simple diode to prevent this. Don't use these chargers unless there are no other options... – Mr. Cheezits Aug 16 '17 at 11:54
  • @pasabaporaqui You won't find the concept of "no risks" mentioned anywhere in the question nor my comments. This is a nonsequitor. – uhoh Aug 16 '17 at 12:24
  • 1
    I strongly recommend *not* to use a cheap charger: These can **kill you**, not just your phone. – Turbo J Aug 16 '17 at 12:34
  • @TurboJ Thanks! This is probably good advice. In addition to the $3, I've lost minutes of my life fending off the trolls here. While one [comment](https://electronics.stackexchange.com/questions/324224/#comment757456_324224) accuses me of panicking, you've told me the thing could potentially kill me. I'll stick with the sage advice [Don't Panic](https://en.wikipedia.org/wiki/Don%27t_Panic:_The_Official_Hitchhiker%27s_Guide_to_the_Galaxy_Companion) but inn the mean time, I probably won't be connecting this to my phone anytime soon. – uhoh Aug 16 '17 at 12:45
  • @TurboJ: These are not AC powered chargers. They are rechargeable power banks. While they may not properly regulate the output voltage, they are unlikely to electrocute you. Having the battery catch fire is a possibility, though. – JRE Aug 16 '17 at 12:59

2 Answers2

2

The data lines should be shorted together to identify the charger as a dedicated charging port (DCP). Some phone manufacturers, however, have their own non-standard ways of identifying charging ports.

Now, the phone charger may not like being treated like a DCP, but alternatives are it is a standard downstream port (SDP), which is slow and allows data transfer, or a charging downstream port (CDP), which is fast and also allows data transfer, or something non-standard. Some devices can change how they appear. Your phone may refuse to change if it does not like how the USB port is configured.

Definitions for DCP, SDP, CDP can all be found in Maxim's Tutorial 4803, The Basics of USB Battery Charging: A Survival Guide.

USB charing ports from https://www.maximintegrated.com/en/app-notes/index.mvp/id/5801

Source: https://www.maximintegrated.com/en/app-notes/index.mvp/id/5801

uhours
  • 661
  • 3
  • 7
  • Thank you for the excellent answer! Not only have you addressed "...as simple as cutting the data lines?" but you've anticipated the next two questions I'd be likely to ask: *Why doesn't this work?* and *Why does this still not work?* It's great when someone takes the time to post a complete and helpful answer with supporting material. – uhoh Aug 16 '17 at 11:59
  • 1
    The odds of the charger actually being a proper dedicated charge port is pretty darn low. In a previous job, we had a device where we looked for the DCP. We bought and opened up over a dozen chargers to find one that truly was a DCP, and it was hard to source. The number that had pads for a resistor between the data lines unpopulated though... The big boys and their custom voltages on the data lines have really dilluted this "standard." – Matt Young Aug 16 '17 at 16:59
1

The maxim tutorial @uhours pointed you to is a good resource. Note that in addition to doing the resistor patching you can also introduce your own USB power controller chip.

You can set the correct resistor patching for high current draw from your battery bank then put in a usb power controller chip that will negotiate with downstream devices (your phone, other phones, etc) that implement the standard differently. That way your downstream devices will both be isolated and able to negotiate on their own without you having to get the resistor patching correct on a per device basis.

Various commercial usb data blockers are available that do this for you if you don't want to make it yourself. YMMV with regard to their negotiating abilities though.

cgram
  • 53
  • 1
  • 6
  • Thanks! Actually if you look at the edit log I added that myself. I should have walked past that bin and not bought the device in the first place. I'll probably take it apart and see what I can learn, to try to add a little more value to my "$3 electronics education". It's good to understand what is going on with power negotiation though, and that usb data blockers exist. But probably with any project involving lithium batteries, one should either purchase something of reasonable quality, or do a well-researched project with sufficient research. – uhoh Aug 16 '17 at 14:58
  • 1
    Trying to professionally interface to cheap USB devices on occasion has taught me that they're almost invariably done wrong. I'd encourage you to open it up and take a look but I doubt you'll learn the right way to do anything in there :) – cgram Aug 16 '17 at 15:01
  • 1
    Oh, and thanks for the tip on the edit log; I'm new and didn't know to go take a look at that. – cgram Aug 16 '17 at 15:01