Introduction: Software Controlled Battery Capacity Measurement Tester

This Circuit was inspired by https://lygte-info.dk/ magnificent work and eevblog

I wanted to create a simple Battery Capacity Measurement Tester for personal use, and measure different brands battery capacity ,calculating their mah/$. This doesn't limit to 9V battery ,it's also suitable for 1.5v battery and many more.

It may look kind of messy,but i will clean it up in version 2

Supplies

Arduino x1(i use Mega , you can use something else)

MCP4725(12bit-DAC) module x1

Transformer (a terminal with output 16v)x1

DC boost and buck converter x1

Relay (SPDT single pole dual throw) x1

INA219 current sensor module x1

battery connector(depends on battery type) x1

Terminal Socket (DT-126VP-2P) x1

LM358 amplifierx1

Power MOSFET x1(i use IRFZ44N you can use similar ones)

heatsink x1 (for Power MOSFET)

333 capacitor(33nF) x1 , 1000uF capacitor x1 , 10uF capacitor x1

some Jumper Wire cables/Dupont wire

Step 1: Circuit Schematic and Block Diagram

Step 2: Circuit and Funtions Explanation

What are the functions?

arduino will print sensor value as output, and receive input from PC

its main function is Constant Current Discharge, Constant Resistant Discharge, Constant Power Discharge, Pause and Charging

Pause function isn't trigger actively but it's written in the flowchart

The Battery Control Software will connect to arduino, control send desired funtion to arduino and monitor arduino output, export arduino output in excel and txt form

excel file will have a calculated mAh of the battery charging/discharging, graph of V-t and I-t

How does the discharging part work?
You can watch these

by GreatScott!

https://youtu.be/8uBcywBUTkw?t=154

by EEVblog

https://youtu.be/R8hTQXqURB4?t=1226

Step 3: Code Flowchart

there are two flowchart one is for Arduino another for the Battery Control software, Battery Control Software Flowchart isn't detailed but some are explained.

i have explained Sendout, Timer

now i will explain

Export funtion/button

//create excel and worksheet

//copy DataGridView1 and paste to excel

//fill some rows with "Time", "Voltage", etc

//clean empty rows

//draw graph(V-t) ,graph(I-t) and calculate mah ,etc

//prompt where to save, and save it

//close excel

Step 4: Sofware GUI and Excel Sample

made in vb language in Visual Studio 2019

and some sample of the export excel it has graph and calculated mAh

Step 5: The Download

Arduino Code + Vb Code ,images and schematic

download(updated on 22/01/2021, kill bug on vb software discharge)

https://gitlab.com/XXXXDD/software-controlled-batt...

requirements: windows 10, Microsoft office 2019, arduino software, visual studio 2019, 1080p screen

additional arduino library

MCP4725 by adafruit

INA219 by Adafruit

Step 6: Future

The next Version will have

Added modularity

Lcd/oled screen for people to cant use a PC or just need the mAh value without a PC

Physical buttons for increase,decrease DAC value,select battery ,select functions

Trickle charging like smartphone battery

charge/discharge more battery at the same time while recording it's output

Most importantly better Code for vb and arduino

if you have any question you email me at sandescobao@gmail.com