Reverse engineering Apple’s recharging scheme

[Ladyada] has been hard at work reverse engineering the charging method used by Apple products. This saga takes us through the years as new devices were released and subsequently broke Minty Boost’s charging capabilities. It seems the data lines were gradually adopted as a means for iPhones and iPods to identify the charger that had been connected. By adding voltage dividers to the D+ and D- lines you can instruct the handheld to pull 1 Amp (with data voltages of 2.8v and 2.0v) for wall chargers or 0.5 Amps (2.0v on both data lines) for portable chargers. In the video above [Ladyada] removes the surface mount resistors from a commercial charger in order to measure the voltage divider and discover the secret.

52 thoughts on “Reverse engineering Apple’s recharging scheme

  1. Wow… now THIS is what hacking is all about. Uncovering apple’s dirty secrets so we wont be forced into buying more of their products :D

  2. OR and this is just a wild idea, you can tell apple where to shove their “we need to break it every generation so they have to buy new crap” attitude that has loomed over the company since the // series and not buy their device

    just a thought

  3. Why couldn’t she measure the voltage over the data lines and calculate the correct resistor value based of that (since she would then know the voltage and amps)?

  4. All apple devices use a voltage devider on the D+ and D- lines to identify the maximum the charger can support and stay with in voltage limits (4.75V to 5.25V)

    Vusb Vusb
    | |
    | |
    / /
    \ R1 \ R3
    / /
    | |
    | |
    |— D+ |— D-
    | |
    | |
    / /
    \ R2 \ R4
    / /
    | |
    | |
    GND GND

    For 2.0A charging:
    R1: 43.2Kohm
    R2: 49.9Kohm
    R3: 75.0Kohm
    R4: 49.9Kohm

    For 1.0A charging:
    R1: 75.0Kohm
    R2: 49.9Kohm
    R3: 43.2Kohm
    R4: 49.9Kohm

    For 0.5A charging:
    R1: 75.0Kohm
    R2: 49.9Kohm
    R3: 75.0Kohm
    R4: 49.9Kohm

  5. All apple devices use a voltage devider on the D+ and D- lines to identify the maximum the charger can support and stay with in voltage limits (4.75V to 5.25V)

    Vusb
    |
    |
    /
    \ R1
    /
    |
    |
    |— D+
    |
    |
    /
    \ R2
    /
    |
    |
    GND

    Vusb
    |
    |
    /
    \ R1
    /
    |
    |
    |— D+
    |
    |
    /
    \ R2
    /
    |
    |
    GND

    For 2.0A charging:
    R1: 43.2Kohm
    R2: 49.9Kohm
    R3: 75.0Kohm
    R4: 49.9Kohm

    For 1.0A charging:
    R1: 75.0Kohm
    R2: 49.9Kohm
    R3: 43.2Kohm
    R4: 49.9Kohm

    For 0.5A charging:
    R1: 75.0Kohm
    R2: 49.9Kohm
    R3: 75.0Kohm
    R4: 49.9Kohm

  6. @okay:

    Because there are no voltage on the Data lines by default. That’s the reason you need to create the voltage divider based on the 5V leg of the USB and provide the voltage to D+/-.

    But you can achieve that with a lot of different combination of voltage dividers. For example if you want to draw 5mA from the 5V line you can do that by using 400ohm-400ohm-200ohm, but if you only want to draw 100microAmp the resistor values becomes 20k – 20k – 10k etc.

  7. All apple devices use a voltage devider on the D+ and D- lines to identify the maximum the charger can support and stay with in voltage limits (4.75V to 5.25V)

  8. At one time in the history of consumer products there was an attempt to define standards in very simple requirements. If the plug fits – it works. If it will not work- that plug shall not be capable of mating into a non-compatible socket. Look at the DIN plug concept for home audio as one early example.

    Yes, there are legit applications for “permissible” deviations from or enhancements to some aspect of a standard. And there are equally valid reasons for just choosing not to violate standards in even the most trivial detail.

    The part where breaking compliance with standards becomes a Hard Epic Fail is if a device becomes so crippled by non-compliance that customers just say no.

    Sadly, some companies and devices are targeting a customer base that seems to never say no.

  9. So, she found two resistor values that result in two different amounts of current drawn. Marty seems to have identified a third. Is it possible that the i-devices are able to vary their current draw continuously given arbitrary voltages on d1 and d2 (within a range of course)?

  10. Perfect timing, yesterday a friend was complaining about their iPhone not charging then the PC was in standby mode but the USB ports had power, and that it would only charge when the PC was fully up & running (and needlessly wasting electricity just to charge a fricken phone)

    I shall have to put this information to some good use very soon.

  11. Yeeees. I was wondering why my hack-job charger wouldn’t work with my iTouch. I’m definitely going to give this a shot in the near future. I hate having to turn on my laptop whenever I want to charge my iPod, and I refuse to pay a ridiculous sum for a wall charger when I could build one.

  12. its funny I just got a usb solar charger for my touch and it wasn’t (and still isn’t)working but I had theorized that a charge was being sent down the data lines time to do some designing wonder if I can modify a usb cable

  13. I don’t know why this is being lauded as revolutionary. This info has been common internet knowledge for a very long time. I modified a D-Link 5V 2A charger to charge my iPhone in just this manner over a year ago…

  14. @maroc
    Just add an “extension” cable/board with the modifications in between. One socket and one plug, and then plug the unmodified solar panel into one end, and the unmodified itouch cable in the other.

  15. Yeah, I’m disappointed too. We did the voltage divider hack to charge our 3G iPhones back in the 80’s from the USB ports of our C64s and this is being posted as new?

    Seriously, this is a hack, and useful and well documented one. Exactly the kind of thing that Hackaday should be posting even if it doesn’t live up to some people’s 0-day standards.

  16. @cynyr that’s what I was thinking but I’m A little unsure about how to wire it up as of right now plus I don’t have an extension cable right now

  17. andrew:

    Continuously variable charging rate would be a cool trick, but I guess probably way too “analog” for anything built today. :-)

    Probably just a handful of useful ones to fit some common scenarios where you’d might want to charge. (wall socket, USB port, emergency charger, …)

  18. @turn.self.off:

    Of course not, it’s Apple. Every other device needs shorted data lines, and theirs needs some weird voltage divider. Awesome, now you have to carry two ‘standard’ USB chargers around.

  19. Imagine if car factories used all kinds of custom screws and bolts, they actually did that 60 years ago. Do we actually need another government involvement to stop Steve greed?

  20. @magetoo,

    I don’t know if you were referring to my post or not, but I never said that this did not belong here. On the contrary; I think this is exactly the sort of hack that belongs here, and if it hasn’t been posted here before, it is a very welcome addition(by me, at least). I was(amongst others) wondering why this was being touted as being new or an amazing discovery, when it’s not, that’s all. I mean, before one tells someone else that their “efforts are greatly appreciated” for doing some great new research, they should, at least, check first to make sure it was actually that person’s original research(IMHO)…

  21. May be handy to know someday. Thank you Ladyada, and HaD. I’m no fan of Apple, but… While Apple makes use of planned/perceived obsolescence, it certainly didn’t ingrain it into the American physcii. Kind of silly to go there as one comment did

    “If the plug fits – it works”-Oren. In event a 3rd party USB charging device doesn’t work with Apple products that’s the fault of the manufacturer of the 3rd charger, not Apple. Apple is using the data pins to retrieve data from the charging source. Evidently the product Ladyada reverse engineered, reverse engineered apple products or where aware of the battery charging specification.

    LOL HaD has new meet a new lrvel of excellance no
    ,eh? HaD is not supposed to research to insure what they post in truly new, and hasn’t existed elsewhere. Good God What some people expect for free. Requirements to be a HaD reporter 10′ tall, and skin thick enough to stop 50 caliber slugs.

  22. Hitek146:
    No, I wasn’t responding to you.

    (But to respond to your point: neither HaD or ladyada really claimed it was a new idea either, at least not in the article that’s linked, so I don’t see where the “touted as new” comes from.)

  23. if this is a sick joke way for apple to make more money i would rather pay an extra $ 5 or $10 for an apple product or even start paying for software upgrades.

    ok when itunes 10 comes out that would be $5.

    same goes for firmware upgrades for the ipod and iphones.

    i can understand a little better if apple wants to eliminate or reduce the risk of fires due to the battery being charged by un official chargers.

    but come on!!!!! all the batteries have the protection board on the battery.

  24. “”i can understand a little better if apple wants to eliminate or reduce the risk of fires due to the battery being charged by un official chargers.””

    irronicly Apple has had some of the worst luck with their batteries catching fire

  25. @magetoo,

    Sorry, my bad. I should not have been so vague. I wasn’t referring to Hackaday or Ladyada, I was referring to the comments above…

  26. THis is great, it will probably decrease the rate of the battery life (cycles) but still it would be nice to be able to quickly charge an iPhone.

    I now need to somehow integrate my universal dock (and remote) into a tomtom compatible in car charger.

  27. very impressive – good finding ,i thote the internal resistance of the power source determine the current. any idea why apple doing this way?

    1. In this case, the resistor values don’t affect the charging current directly, but instead, the resistors supply a reference voltage to the data pins. The iPhone sees those voltages, and then decides, “Okay, based on those voltages, I’m going to draw such-and-such a current.” The actual current is supplied via pins 1 and 4 (power and ground), at 5 volts DC… No current is actually supplied over the data pins, or if so it’s negligible.

  28. Does anyone know if it would be possible to install these resistors on the data lines of a powered USB hub (Belkin (Belkin 4 port # F5U404) to trick the IPhone into charging when not connected to the computer? Could this work at all or would it completely inhibit the hubs capability to connect to a computer?
    Any help hacking Apples fascist proprietary schemes would be greatly appreciated.
    Cheers

  29. Working at a local electronics store (hardcore, components and the like, none of that plasma tv crap), this hack is brilliant insight because I often got people coming in asking questions regarding this. I only ever had sneaking suspicions about data line pullup/down resistors, but its good to see that someone has taken the time to take it all apart properly.

  30. I did seem to notice that even with D+/- floating, the phone draws about 75mA from a power supply. This is a laboratory supply, with a current readout. So, even when the phone reports the “accessory not supported” error, does it continue to charge? Of course, it will take forever at that rate.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s