Friday, February 22, 2019

MacBook battery replacement requires calibration

A few years ago I bought a second hand Mid 2010 MacBook Air 11 as a standby machine. It came with a dead battery. A cheap Chinese replacement was purchased via eBay but while the battery life was usable (for reading the news over breakfast) it would warn that it was going to shut down after about two hours. Shown here in activity monitor.



I did what they advised in that I charged it up and then used it until it warned me on the first cycle.

The battery actually reported that it had more than the design capacity and I figured this was a lie.


Figuring I'd bought a low capacity battery pretending to have more mAh than it really did, I ordered a new one from a reputable dealer, iFixit Australia.

While waiting for the new battery to arrive I read up on battery manager calibration and this time did the following:

  • Fully charged the battery over night
  • Ran the laptop with screen and disk never sleeping, also no screen dimming (Energy saver)
  • Left it like that to run until it shut itself down
  • Left it another 5 hours to really go flat
  • Fully charged it over night
Interestingly as it discharged there was a long flat part of the charge graph before it actually turned off.


After this exercise, the battery had much better life, perhaps five or six hours of heavy use.

The new battery turned up and I figured I might as well put it in to see if it's better. Replacing the battery in an old MacBook Air is pretty easy if you have the pentalobe screwdrivers.



Interestingly, it reports less capacity in CoconutBattery and the Chinese import.


I again followed the calibration process outlined above and this time, just for fun, I ran a bash script to record screen shots for a movie.


For my own future reference, create a folder on the Desktop called "ScreenRecord" and run this command line to capture screen shots periodically:

while [ 1 ];do vardate=$(date +%d\-%m\-%Y\_%H.%M.%S); screencapture -t jpg -x ~/Desktop/ScreenRecord/$vardate.jpg; sleep 1; done


To make the folder full of jpeg images into a movie I used ffmpeg:

ffmpeg -r 24 -pattern_type glob -i '*.jpg' out.mp4

(-r is the frame rate).

Measuring real world battery life is not easy as load varies wildly. I think the new battery is slightly better than the old one after calibration, but I wish I had done this earlier and saved my money.

No comments:

Post a Comment