Skip to content

Automated Battery Load Testing Over Ethernet

GitHub code

This project takes a high precision Load tester (I used an HP 6063B) and a network adapter to automate testing of batteries, generating an accurate WH rating and a discharge graph over a TCP connection. Written in Rust.

First I made a library to wrap the TCP connection to the machine which can be found here . Next I made the actual battery testing script which implements the testing logic as a CLI tool with the following arguments:

Usage: hp606n-battery-tester.exe [OPTIONS] --ip-string <IP_STRING> 
    --gpib-addr <GPIB_ADDR> --discharge-current <DISCHARGE_CURRENT> 
    --output-file <OUTPUT_FILE> --polling-rate <POLLING_RATE>

Options:
  -i, --ip-string <IP_STRING>
          IP address of the controller
  -g, --gpib-addr <GPIB_ADDR>
          the address to find the load device (HP606n) on the GPIB bus
  -d, --discharge-current <DISCHARGE_CURRENT>
          the current to draw from the battery in Amps
  -c, --current-range <CURRENT_RANGE>
          the range for the current sensor on the machine. this differs on different machines, 
          so check which range best matches your discharge current. This field is the index of the range, 
          so for the 6063B which has ranges [0, 1A] and [0, 10A], you would enter `0` for discharge currents 
          less than 1A, and `1` otherwise [default: 1]
  -v, --cutoff-voltage <CUTOFF_VOLTAGE>
          the voltage to stop discharging the battery [default: 0]
  -p, --output-file <OUTPUT_FILE>
          path and name for the output file
  -r, --polling-rate <POLLING_RATE>
          number of times to check the voltage per minute. This affects cutoff voltage checks if set too low
  -h, --help
          Print help
I used this to measure the quality of some 18650 cells I had lying around before making a pack.

Example AA discharge graph:

The graph is made with Google Sheets from the csv file this program outputs.

AA discharge graph