Open Source Battery Capacity and Cycle Tester

Eric Pietrowicz
3 min readJul 31, 2020

Follow along with my latest posts here.

Rechargeable lithium batteries are becoming increasingly popular in electronics. Qualifying these batteries from unknown suppliers can be useful as more vendors become accessible. But, commercial load and cycle testing machines could be cost prohibitive for small companies and hobbyists.

At Hidrate we ran into a situation where we suspected that our battery’s performance was not quite as described in the datasheet. So, I set out to create a jig that will qualify the discharge curve over the battery’s lifetime.

The current design uses a Teensy 3.6 as the brains. I chose this more expensive 3.6 because of the integrated SD card receptacle but to reduce part cost this could be broken out onto the PCB.

Obviously, the system can exist in two states: charging or discharging. Charging kicks on when the voltage output of the regulator drops below 3V. Discharging begins when the charge controller’s status flag pulls high.

I achieve a constant discharge current by regulating the battery’s voltage at 3V and dropping it across an adjustable power resistor. The discharge current can then easily be modified across tests.

I isolate the two functional blocks, the charging circuitry and the discharging circuitry by using P-MOSFETs (DMG2305UX) in a switching configuration (remember active low). Then shift the logic level from the Teensy, in order to correctly interface with the different source voltages of the PMOS switches. For that I use NMOS DMN63D8LW FETs in a level shifter configuration.

(Check out my project!)

Since both inputs (battADC and charg_stat) can be greater than the 3V3 required by the Teensy, I drop in a few voltage dividers as shown below. Add some LED indicators and an optional battery temperature sensor (I chose the TMP36GT9Z) and that about covers it.

With some firmware thrown together to log the various inputs, you can characterize the strange batteries you dug up on all corners of the internet. I chose to log time, battery voltage, and state (charging / discharging).

All files can be found on my GitHub here:

--

--