EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: edy on January 15, 2014, 01:19:27 pm

Title: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: edy on January 15, 2014, 01:19:27 pm
Hi folks,

I have a question about an iPhone charger but first wanted to direct you to Dave's Apple charger teardown video to refresh memories...

EEVblog #388 - Fake Apple USB Charger Teardown (https://www.youtube.com/watch?v=wi-b9k-0KfE#ws)

Dave found all sorts of extra circuitry in the real iPhone charger. I wonder if part of the purpose is to also detect that there is a real iPhone plugged on the end or not. I will explain why below.

I have a brand-new Apple iPhone 5c so I know the charger is real. I thought all of these chargers just take mains voltage and output 5V on the power pins of the USB port, and just ignore the data pins. So I thought you can plug in any device that will charge off USB into the charging dongle, and as long as the AMPS on the charger are high enough, it will charge (I believe the Apple charger is 2A). Don't see how it could damage the device... worst thing that could happen is device charges slowly or not at all.

So I decided to charge a BlackBerry and Android phone using a standard USB to micro-USB cable that came with the BlackBerry by plugging it into the iPhone 5c wall charging dongle (which I had on me at the time) instead of the same-looking one that came with the BlackBerry. Except for some reason IT DID NOT WORK. Both non-iPhones showed no indication they were charging. When I plugged the iPhone USB-to-lightning cable to the iPhone, it charged fine. I also tested my BlackBerry USB cable on a computer and was able to charge both BlackBerry and Android phone.

I've asked others and they say they had no problems. I want to test this further.... Any idea why this happened? I'm pretty sure I'm losing my mind but will have to try again to confirm. I feel like perhaps the newest Apple charging dongle may recognize either the USB-lightning cable, or it recognizes an iPhone on the other end. Either way, it can be built to prevent charging.

I can imagine that it can be simple to construct a cable were the data pins are shorted internally with a resistor of known value which the charger can detect, but which may not interfere with use of the cable on a computer. Or perhaps the iPhone itself communicates to the charger across those data-pins, to enable the charger to work a certain way to optimize charging current.

Any ideas or am I completely lost? Any advice appreciated...

Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: nitro2k01 on January 15, 2014, 01:52:11 pm
Typically the charger contains a voltage divider for each of the data pins to present a constant voltage on each data pin. I'm not sure whether each manufacturer just selects random values, or if there's a standard (de facto or standardized) for signalling the capacity that the charger can deliver. You could google for "usb charger resistors" and try to find out. I don't feel like doing that homework for you atm.

As for your suggestions, it may be either of those things. These phones might not be charging because the phones don't like the resistors in the Apple charger. Or the charger might be communicating over actual USB, though I imagine that would cost a few too many cents to produce.

Another option might be that it's the cables fault. It might be a "charge-only" cable with the data pins disconnected, which the charger may not like and cut the power or only provide 200 mA. (USB 1.0) Of course, in this case you should not be able to get a data connection on the computer using this cable either.

Another possibility is that the cable ground/Vcc wires have a high resistance, which results in a voltage drop over the cable. When plugging it in to the computer, the computer reports that it can deliver x mA and the phone happily keeps charging even though it sees maybe a Vcc of 4.5 V on its end. When plugging it into the Apple charger, it just sees the dropped voltage and interprets that as a fault condition and refuses to charge.

Quote
I have a brand-new Apple iPhone 5c so I know the charger is real. I thought all of these chargers just take mains voltage and output 5V on the power pins of the USB port, and just ignore the data pins. So I thought you can plug in any device that will charge off USB into the charging dongle, and as long as the AMPS on the charger are high enough, it will charge (I believe the Apple charger is 2A). Don't see how it could damage the device... worst thing that could happen is device charges slowly or not at all.
To answer this generally, not in terms of your situation, no there are problems. A charger which is not well-built could either burst into flames if it's overloaded, or it could produce interference. For example, if your fake Chinese charger really sucks, the touch screen will start working very badly.
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: andtfoot on January 15, 2014, 02:09:37 pm
There is some info in a previous thread here:
www.eevblog.com/forum/beginners/usb-charging-current-detection/ (https://www.eevblog.com/forum/beginners/usb-charging-current-detection/)
There are a few ways that a charger can tell a phone what it is, such as shorting D+ and D-, or supplying a particular voltage on the D pins.

So maybe the other phones don't recognise the method that the Apple charger uses to signal that it's a charger.
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: Len on January 15, 2014, 06:15:12 pm
Typically the charger contains a voltage divider for each of the data pins to present a constant voltage on each data pin. I'm not sure whether each manufacturer just selects random values, or if there's a standard (de facto or standardized) for signalling the capacity that the charger can deliver.
Yes this is specified in the USB standard, and no, Apple doesn't follow the standard because they don't want people using non-Apple accessories with their iPhones. Details on how this works are available on the web. I think they put a specific voltage on the data lines.
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: bitwelder on January 15, 2014, 06:21:47 pm
Ladyada explains it all:
http://learn.adafruit.com/minty-boost/icharging (http://learn.adafruit.com/minty-boost/icharging)
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: Len on January 15, 2014, 07:00:20 pm
Ladyada explains it all:
http://learn.adafruit.com/minty-boost/icharging (http://learn.adafruit.com/minty-boost/icharging)
Thanks, I was going to look up that video but then my lunch arrived.  :D
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: edy on January 15, 2014, 07:01:45 pm
Thanks so much for the replies!!! Yes that helps a lot. I had originally asked this question to the iMore Apple forum and nobody seemed to believe me. The LadyAda video explains it, there is a lot more going on with these chargers (especially the Apple ones) to verify what is on the other end.
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: edy on January 15, 2014, 11:00:59 pm
So if I understand correctly...

The bottom line is if I use my BlackBerry or another cheap 120V mains to USB "dumb" charger (non-iPhone) it will probably work with ALL devices... Android, BlackBerry, iPhone... since the phones will think the charger could even be a computer or car port (they don't know what they are plugged into)... the phone simply takes the 5V at whatever it can supply and charge.

If using the Apple 120V mains to USB "smart" charger, it will be checking across the data pins what i-device it is plugged into, and will refuse to output current for devices which do not provide the correct feedback signals to "handshake" the maximum current. So then it may default to some low current like 100mA or less and most phones cannot charge at that rate. May be enough for a BlueTooth earpiece, that's it, or charger may even completely shut down and not supply anything.

Someone linked this in a previous message:

http://digital-diy.com/forum/electronics-projects/iphone-ipad-charger-t2819.html (http://digital-diy.com/forum/electronics-projects/iphone-ipad-charger-t2819.html)

It shows how to use a resistor divider network to set up voltages on the D+ and D- pins. I'm not exactly sure how this works. It shows different combinations of voltages on D+ and D- (2.0/2.7, 2.7/2.0, 2.77/2.77) to signal the maximum current draw.

So I assume the i-Device sets up these voltages on the D+/D- pins when it is plugged in and the charger then senses the voltages returning on the D+/D- pins to know what device it is plugged into, and therefore what current limit to set (1.0A, 2.1A, 2.4A)? When the data pins are not connected (floating) perhaps on non-Apple devices, or there is no voltage or ground, the charger sees that it is not an i-Device and therefore defaults to some other current limit? What does a non-Apple phone show on the D+/D- pins when it is being charged?

I guess I could get a cable and plug it into the charger but cut the data pins and read the voltages (relative to ground) on the side of the phone? That would be the phone sending back the appropriate voltage to signal the charger? What happens when the phone is plugged into a computer USB?
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: ttp on January 16, 2014, 12:02:20 am
http://digital-diy.com/forum/electronics-projects/iphone-ipad-charger-t2819.html (http://digital-diy.com/forum/electronics-projects/iphone-ipad-charger-t2819.html)

It shows how to use a resistor divider network to set up voltages on the D+ and D- pins. I'm not exactly sure how this works. It shows different combinations of voltages on D+ and D- (2.0/2.7, 2.7/2.0, 2.77/2.77) to signal the maximum current draw.

So I assume the i-Device sets up these voltages on the D+/D- pins when it is plugged in and the charger then senses the voltages returning on the D+/D- pins to know what device it is plugged into, and therefore what current limit to set (1.0A, 2.1A, 2.4A)? When the data pins are not connected (floating) perhaps on non-Apple devices, or there is no voltage or ground, the charger sees that it is not an i-Device and therefore defaults to some other current limit? What does a non-Apple phone show on the D+/D- pins when it is being charged?

It is other way around, the charger sets the voltages on D+ and D-, device senses the voltages and decides if it "likes" this particular charger or not.
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: IanB on January 16, 2014, 12:27:04 am
My iPhone charger seems to work fine as a generic 5 V USB power supply when I plug other non-iPhone devices into it (I recently tried it with a portable laptop sound bar).
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: edy on January 16, 2014, 02:25:46 pm
Okay, so if it works the other way around, how does the charger decide what voltages to put out on the data pins before you plug in? And how does the phone communicate back? Does it cycle through different voltages on the data pins quickly and then when the device gets the combo that represents the code for a certain amp rating, it shorts the data pins for a second (which the charger detects) in effect responding "hey I'm a device that likes 2A current because when you gave me a voltage signal of 2.77/2.77 and I responded to you"?

Or do all the chargers have fixed voltages on them already on the data pins telling the devices that it is a 1A or 2A charger and if the device can then know how much it can safely draw? That would make more sense. The iDevice would see it is plugged into a 1A charger or no-name without pin voltage and refuse to charge. But I can't figure out why the other non-Apple phones didn't charge... Wouldn't they just ignore the data pins voltages and wouldn't the Apple charger just keep on supplying 5V?
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: Rufus on January 16, 2014, 02:41:36 pm

The USB charging specification is a free download and tells you how things are supposed to work

http://www.usb.org/developers/devclass_docs/USB_Battery_Charging_1.2.pdf (http://www.usb.org/developers/devclass_docs/USB_Battery_Charging_1.2.pdf)
Title: Re: Apple iPhone 5c charger with BlackBerry USB cable can't charge
Post by: edy on January 16, 2014, 03:14:17 pm
Thanks everyone...I am reading through the specs, it is starting to make a lot more sense now. I also had a look here which is a bit less technical which will also help me. Thanks!

http://www.maximintegrated.com/app-notes/index.mvp/id/4803 (http://www.maximintegrated.com/app-notes/index.mvp/id/4803)