(Update - recently designed and ordered a PCB using EasyEDA for this project - see picture in gallery) When the ESP is reset it comes up in mode where it is monitoring each of the battery's cell voltages. Every one second, voltage measurements are taken; data is stored in the esp from the time it is last booted, as the time interval expands older data is averaged and newer data is decimated over an expanding window so that between 64 and 128 equally spaced data points are stored in esp memory. An I2C interface to an OLED display provides local real time monitoring of state. 

The esp runs in one of four modes:

  • Monitoring : reads and stores battery cell voltages,
  • Charging : provides a programmable battery stack current to charge the device, monitors cell voltages and keeps track of accumulated charge supplied to battery,
  • Discharging : switches in 20 ohm load on battery, monitors cell voltages and keeps track of accumulated charge discharged from battery, lower resistance loads can be added to battery manually and the value of the eternal load added to be page for correct dissipated charge calculation.
  • Storage : charges or discharges battery so that each cell is at approximately 3.8 volts.

The operation of the monitoring/charging/testing/storage-prep functions of the board can be accomplished with three push buttons with the OLED display, once the operation is started the OLED reports status and process monitoring feedback - cell voltages, accumulated (or dissipated charge), and approximate time to task completion. 

The esp is also running a web server that hosts a webpage for the control of and detailed monitoring of the state of the running application. The webpage does not need to be connected to the system while running, but easier control of the unit and much better monitoring is performed by the webpage (or a curl command). The data for graph of cell voltages vs elapsed time since reset is stored in the esp and not by the browser, so the browser does not need to be connected during operation and can be accessed from several clients at the same time (so you can check out progress from your cell phone for example).

The voltage measurements are made with two ads1015 i2c 4 channel adc modules, resistor dividers on upper channels for 25v full scale, middle channels 15v full scale and lower channels 10v fullscale. The 0-2Amp current source is made wit a FQP30N06L (actually 2x) heat-sinked fet, 0.5 ohm source follower and a  MCP4725 DAC i2c module to make the gate control voltage. The current source is adjusted by measuring the voltage across the source follower resistor and raising or lowering the gate voltage to keep the correct amount of current flowing through the source. 

The PCB also has a 20 ohm heat-sinked power load resistor which can be switched in with another FQP30N06L fet.

Output header for custom JST XH connector adapter cables to support batteries 1s-6s, built in headers for  3s and 4s batteries.

Discussion - 

Two of the webpage snapshots included in gallery show the discharge of two different 2S/350mA-hr batteries that were included with a minidrone that my daughter got for Christmas, they have gone through about 20 use cycles. Analyzing this data shows us that each of the batteries have well matched cells and exceed their rated charge specifications. The series resistance on each cell (including hookup wire) is about 0.8ohms. The charger that came with the kit takes about two hours to charge a battery and the minidrone flight time is about 8 minutes, so I'm guessing that the charge rate of the charger is about 200mA and the discharge rate during flight is about 3 Amps. Have not tried charger on these batteries yet but hope to charge at more than 200mA.

1/9/2020 - Have the current source working, only tested to a couple hundred milliamps - still need to get higher current power supply and heat sinks setup. So far closes good and stays stable.

Tested a couple type of single...

Read more »