Smart Battery Tester

An intelligent test device that tests batteries by discharging them to measure capacity

Similar projects worth following
I salvage a lot of lithium-ion cells from old devices, but I don't really know what condition they're in. This device can discharge a battery while monitoring the battery voltage and current. By testing the battery like this, the device can tell you the exact mAh rating of the cell you're using.

I made a simple version of this device using an MSP430 Launchpad and a basic constant current load. Using the USB-Serial capabilities of the MSP430, I sent the battery voltages over time to my PC and logged them to a file. That data can then be used in a program like excel to graph out the battery discharge.

This project now uses an Arduino Nano, as seen in the schematic below:

  • Code Rewrite

    Adam Oakley01/09/2017 at 01:49 0 comments

    After running into some bugs with the old software, I became fed up with the messy code and decided to start fresh. The new code is more organized and the documentation is much more complete.

    The user interface is somewhat simpler now as well. Instead of selecting battery chemistry and number of cells, the user just enters the desired cutoff voltage. The code for this is simpler and it also makes the load tester more useful. For example, you could discharge lithium cells to about 70% charge for long term storage by entering the appropriate cutoff voltage. You could also test supercapacitors down to 0V.

    You can find the source code by following the github link on the project page

  • I ain't dead yet!

    Adam Oakley11/29/2015 at 00:44 0 comments

    After putting this project on the shelf for months, I've put some work in and the project is in a reasonably finished state. There's more that I want to do with the software so I may work on that and post updates. I have posted the current source code and uploaded a few pictures. The source code is not pretty. It needs better documentation, but it does the job.

    As for what work I have done, most of my effort has been put towards 3D printing the case for this project. The case was a big headache. I spent a decent chunk of time modeling the case in Autodesk Inventor and I was pretty happy with the design. I designed some 3D printed buttons that make use of standard tactile switches. These buttons feel very satisfying and I like that the parts are very cheap.

    Albert and I ran into quite a few problems actually printing the case out. The case is fairly long because it has to hold all the circuitry and a big heatsink. The long case is very difficult for us to print because with ABS plastic on a print this large we get warping issues. Aside from that Albert's printer broke before we could print out the project case properly. The printer had all sorts of feeding issues, from the nozzle getting clogged and also from the extruder failing midway through prints.

    Albert put a lot of effort into repairing his printer and now it's working again, but not fully. We managed to print out my case with some minor warping. The warping made it difficult to fit things in properly but I managed to make it work. I soldered everything together and closed up the case.

    As it happens right when I finished assembling the load tester, my home's alarm system began complaining about a low battery. I removed the sealed lead acid battery and tested it with my load tester. The tester worked great, and reported that the alarm battery had a remaining capacity of 93mAh. The battery was originally 4.5Ah so it's clearly worn out now and needs to be replaced.

  • It works!

    Adam Oakley04/22/2015 at 03:03 0 comments

    I'm getting close to finishing this project. I decided not to add a charger IC, as it would be very difficult to be able to charge all the different types of batteries I want to support. Right now I can test LiPo/LiIon, LiFe and Lead Acid batteries. I can basically test any battery under 14V, so I'll be adding a few more types to the software in the near future.

    As for software, I have an LCD connected to the arduino as well as a few pushbuttons. I've implemented a fairly simple interface on the LCD, which allows you to pick your battery type and test current before beginning the test. You can run the test without a PC, but if you connect a PC the arduino will output CSV format data over the serial interface which you can record.

    The load testing works pretty well. Due to the limited resolution of the PWM output from the arduino, I can only set the load current within about 10mA of my target, which should be fine. The important part is that it reads the load current accurately within +/-2mA. I've already been using the load tester to check some of my salvaged batteries.

    Here's what the hardware looks like now. I put a beefy heatsink + fan on the power transistor. The tiny heatsink I was using before got quite hot testing a 12V battery at 150mA. On the right you can see one of the batteries I've been testing. I think this was salvaged from an old macbook, and was supposed to be rated for around 2000mAh. I tested it at 300mA which resulted in 1540mAh and also at 500mA which gave me 1082mAh. This leads me to believe that this cell is somewhat worn out and has a high internal resistance. It would be a good candidate for something that needs decent capacity but with low current draw.

    Now that the software is almost done and the hardware is tested, it's time to take this off the breadboard and build it into a proper enclosure. I was going to use a metal project box, but since I have a pretty good heatsink now I can get away with using a plastic box. The software works well enough but I'm not quite ready to release it. I've been lazy with commenting so I need to go back and add some information and tidy up the code a bit.

  • Progress!

    Adam Oakley12/22/2014 at 03:22 0 comments

    After months of inactivity I've started working on this project again with some prodding from a friend. We prototyped the constant current load circuit. At first we tested the circuit just with a potentiometer providing the input. It worked fine, so we added an arduino to provide the PWM signal driving that controls the current draw. We also used a few analog inputs on the arduino to monitor the voltage on the current shunt resistor, and the input to the opamps.

    We noticed that the voltages we were reading on the arduino were not stable at all, so we changed a couple things to improve that. First, by looking at our opamp input with an oscilloscope we noticed that the RC filter output had about 70mV of ripple. Not a whole lot, but something easily fixed by increasing the 15k resistor to 150k. That improved the readings a bit but didn't entirely fix the problem, so then we changed the code to take 50 samples in a row and average them. Now the readings are fine.

    Because we're not using a signal conditioning amplifier, we don't have a whole lot of resolution to read the shunt resistor voltage. The current can be read to a resolution of about 10mA, which should be fine for this. I also decided to change the design of this project somewhat. I'm not so concerned about the charging, so I'm going to use a dedicated charger IC just to top off the battery before we do a load test, and recharge it after we're done. I also want this device to be usable without a PC, so I'll be adding an LCD screen and some controls to allow you to operate it completely PC-free.

  • Constant Current Load

    Adam Oakley07/15/2014 at 03:38 0 comments

    I've designed the constant current load portion of this project, which you can see here:

    If you want to know how it works I describe the circuit in detail on that page, but the gist of it is that a PWM signal determines how much current the load will draw.

    This circuit is fairly common, but typically uses an N-channel MOSFET instead of the two transistors I've used. A MOSFET would be problematic for my circuit, because the op-amp would have to output a voltage at least as high as the voltage across R2 plus the threshold voltage of the MOSFET, which is typically around 4V. With a 5V supply, that doesn't give me much room to work with. With two transistors set up as a darlington pair, I only need 1.4V for both transistors instead of 4V, which gives me a lot more breathing room.

View all 5 project logs

Enjoy this project?



willbaden wrote 04/13/2015 at 20:11 point

It is shown in the second picture down of:

It is a vented cage to allow the heater wire to breathe.  I had thought of using a fan to keep the temps down, but really have not had a problem yet.  The coils do not glow red except one of the mid range resistance values.  It is only a dull red. 

I am looking forward to the posts and source if possible. . . 

  Are you sure? yes | no

Adam Oakley wrote 04/13/2015 at 20:21 point

Nice project! I will likely have to add a fan to my project. The whole thing will be in a metal box which should help somewhat. I will certainly post my code when I'm done. I've tried to write it in a way that makes it easy for someone else to build this project.

  Are you sure? yes | no

willbaden wrote 04/13/2015 at 20:30 point

Great!  I look forward to the code and the write up.

  Are you sure? yes | no

willbaden wrote 04/13/2015 at 19:35 point

I like the project. . . Any more updates to your tester?

It has been a while, but I have been working on a 12V battery tester that drains it by pulling around 40 amps.  It switches banks of heater wire in and out of circuit to pull roughly 40 amps.

The LCD addition would be a nice addition to your project.  That is one hang up with the tester I built.  It would be nice to not be tied to a pc, but it is nice to have it automatically dumped into a csv file.

  Are you sure? yes | no

Adam Oakley wrote 04/13/2015 at 19:55 point

Thanks for asking :)

I'm actually almost done my software. I've been making a lot of progress but I was planning to get some things finished before posting an update here.

I have the LCD working pretty well so far. With the addition of a few pushbuttons, you can pick which battery chemistry you're using (LiPo, LiFe and Lead-acid). It also lets you choose how many cells your battery pack has (1-3 cells for LiPo and LiFe, 6 or 12V for lead acid). Finally, you set the discharge current that you want. It then shows you the settings you picked and you can choose to start the test or quit and re-enter the settings.

So right now I have the current and voltage displayed on the screen. I just need to finish the cutoff voltage logic and test it with a power supply, and I'll be ready to test some batteries. During the test you can see elapsed time as well as battery voltage and current draw. When the test is finished the total capacity in mAh and test duration will be shown.

By the way, how do you deal with the heat produced by your heater wire? Most of the heat in my project comes from the big power transistor. Since I plan to put this project in a fairly small box I'm trying to figure out a good way to get rid of all the heat.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates