iPhone Battery Charger / Tester Breakout and HDQ Gas Gauge Stats

Troubleshooting iPhone problems can be a daunting task sometimes considering how complicated they are. It’s easy to overlook the simple things and on occasion you may replace parts that don’t need replacing. Batteries are no exception. I have seen technicians often replace batteries when they may not necessarily need to be or ignore the fact that they could be the cause of the issue at hand. To remedy this I designed a basic iPhone battery charging breakout board system. The system can charge a battery, has the option for expansion to support newer/other batteries and breaks out the battery status pins which can be read from a microcontroller or some other means. It consists of 6 battery connector boards (iPhone 4, 4S, 5, 5S/C, 6, 6+) and a main charging board.

Use Cases

Sometimes a battery will show no voltage when tested with a multimeter. It is possible that the LiPo cell is in fact completely dead although this typically means the battery has gone into protection mode. This can be caused by various reasons including liquid damage short, over voltage/current lockout and under voltage lockout. My battery system can revive or re-activate a battery that has entered protection mode by simply connecting it to the main charging board.

From time to time I will get a phone in for repair with a (very) low battery and will not boot up because of that fact. The repair may be as simple as a screen replacement. With this battery system you can leave the battery in the case and connect it to the charger while you move the home button, front sensor flex to the new screen. You could even create a short extension cable from the battery board to the mainboard.

As a technician I have a set of test parts for the various common phones I repair. The batteries do not usually get a full charge during the testing process. With this system you can charge your test batteries without the need for an actual phone.

Battery Boards

A single battery board can be connected to the mainboard at a time. Battery boards connect to the mainboard via 6 pin header with 1 pin missing (keyed to prevent incorrect connection). Not all the pins are needed for every battery. For example, the 4, 4S and 5 batteries have NTC thermistor pins but newer iPhones do not and thus are not connected. All 5 pins are routed to a header on the mainboard for easy access. The purpose of the separated battery boards is to allow for additional (new) connectors. I have not yet ordered any iPhone 6S series battery connectors so I do not have boards designed for them. I have, however, designed some for other devices that worked with older revisions of this battery system. I may consider adding additional battery boards in the future (6S, 6S+, Samsung, etc).

Mainboard

The mainboard contains the charging circuitry, a MicroUSB power input port and 2.54mm header pins. The MCP73831 LiPo charging IC was chosen for it’s low part count and cost. It is designed for 3.7V nominal voltage batteries but can also be used to charge higher voltage batteries. Newer batteries are 3.8V nominal voltage and will not charge completely since the cutoff is 4.2V. Regardless, you can charge a dead 3.8V nominal battery to a usable state. Two LEDs provide charging status; red for charging and green for charged (or your colors of choice). If no battery is connected the charged LED will be lit. There is a 2A fuse for input over current protection from the MicroUSB port. The program resistor (R2) determines the maximum charge current. I chose 2K which provides the MCP73831 maximum of 500mA charge current. These are the pins available on the breakout header:

  • VBAT: Connected directly to the battery positive pin (and charging output of the MCP73831)
  • GND: Ground
  • 5V: 5V input from MicroUSB
  • GAS: Battery gas/fuel gauge pin. iPhone’s use TI HDQ protocol
  • NTC: Battery thermistor pin
  • STAT: Connected to MCP73831 status pin. Can be used to read charging status from microcontroller
  • PROG: Connected to MCP73831 program pin. Can be used to set charging current or disable charging from microcontroller

Part List

RefDes Specs Part #
PCB 2 layer Order from OSH Park
C1 4.7uF 6.3V 0603 -
C2 4.7uF 6.3V 0603 -
F1 32VDC 2A Fuse 0603 -
R1 1K ohm 0603 -
R2 2K ohm 0603 -
R3 1K ohm 0603 -
U1 MCP73831
SOT23-5
MCP73831T-2DCI/OT
LEDCHGD Green 0603 -
LEDCHG Red 0603 -
USB1 Amphenol/FCI
MicroUSB
10118194-0001LF
Batt Board Header 2.54mm Straight male -
Mainboard Batt Header 2.54mm Right
angle female
-
Plug for
Female Header
(fills NC pin on
mainboard battery header)
15-04-0292
iPhone Battery
Connectors
- eBay

All the parts should be available from most of the major distributors (Digikey, Mouser, Newark/Farnell) except the battery connectors. Apple does not sell parts so your only option for the connectors is to get aftermarket parts. They are easily found on eBay or Aliexpress. After soldering the header pins on the battery connectors, remove the single pin without a solder pad using pliers. On the mainboard, plug up the “NC” pin hole header with the plug linked above. This allows the battery board to connect in one direction only and prevents short circuits.

HDQ Battery Stats

iPhone batteries use TI’s HDQ 1 wire protocol for communicating statistics to the phone. Some useful information such as Temperature, Remaining Capacity, Charge Cycle Count and more can be read out from the battery. The various iPhone batteries use different models of TI fuel gauge IC’s and Jason’s RipItApart blog has a cumulative list of them. He has a wealth of information regarding iPhone batteries and the HDQ Protocol including a utility for communicating with them.

I wrote a very basic Arduino sketch that prints out some battery stats over serial. My example sketch was tested on the Arduino Nano but should be compatible with any of the common Arduino boards. First, install the HDQLib into your Arduino IDE. Connect the GND pin to Arduino ground. Connect the GAS pin to Arduino pin 7. Use a 4.7k-10k pull-up resistor from Arduino pin 7 (or from GAS pin) to 5V. Connect the Arduino to your computer and upload the compiled sketch. Open the Arduino serial monitor and set the baud rate to 57600. The sketch attempts to detect which iPhone battery is connected based on the chip detected and the firmware version and will display some battery stats similar to:

iPhone 5S / 5C Battery Detected
Device: bq27545
Firmware: v3.10
Hardware: 0xA7
Remaining Capacity: 482 mAH
Full Charge Capacity: 971 mAH
Design Capacity: 1430 mAH
Time to empty: N/A, not discharging
Time to full: 0 minutes
State of Charge: 50%
Battery Voltage: 3.90V (3904mV)
Temperature: 29.00*C / 85.28*F / 3026 raw
Charge Cycle Count: 1138 times

Older Revisions

This is my first post specific to my battery charging board(s). There was a brief mention about an older version in my post Troubleshooting & Reviving Single Cell Batteries. The first version was made back in January 2015 and at the time there was no product on the market for testing iPhone batteries that I could find, hence I built my own. A search today found a few products made in China, here and here, that are similar to my system but contain all the battery connectors on a single board. I won’t go into detail about my older versions, but here you can see the progression in pictures.

v1 v2 v2.2

If you have any ideas or recommendations for this board, please leave a comment below.

Archives By Month

Tags