Why are there 3 pins on some batteries?

The third pin is usually for an internal temperature sensor, to ensure safety during charging. Cheap knock-off batteries sometimes have a dummy sensor that returns a "temp OK" value regardless of actual temperature.
Some higher-end batteries have internal intelligence for charge control and status monitoring, in which case the third pin is for communications.


That third contact is connected to an internal thermistor, enabling the charger to measure the battery temperature.

enter image description here


In mobile phones, some Li+ battery packs have 3 terminals. Two possibilities:

  • positive, negative, thermistor (as was already mentioned in previous answers)
  • positive, negative, 1-wire bus. The latter is a digital communication bus that’s connected to a gas gauge IC inside the pack.

If you want to explore what’s inside single-cell Li+ battery packs, look-up bq27000 gas gauge IC and associated application notes. Could be a good starting point.

Some packs have 4 terminals: positive, negative, SDA, SCL. The latter 2 lines are I2C or SMBus. Look up the bq27200 gas gauge IC (shares datasheet with bq27000).

EDIT: This was written as an answer to a duplicate question, which got merged with this one.