3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Rechargeable Battery Capacity Tester

Rechargeable Battery Capacity Tester
Do you have a pile of AA rechargeable batteries in your drawer? Some are old, some are new, but which sets would you bring with your camera on your next trip, and which ones are past their useful life? I like using rechargeable batteries, but I’m certain that some of them are not living up to the stated capacity on the label.

So how good are those batteries? Simple battery testers measure the voltage, but that’s not what we need – we want to find the overall capacity of the battery. How long will a battery last from the time it’s fully charged to the time that the “low battery” indicator comes on your device?

You can see this in action in a video in the last step of this instructable.
 
Remove these adsRemove these ads by Signing Up
 

Step 1This is a job for a microcontroller

This is a job for a microcontroller
A simple way to test a battery would be to attach a load resistance to a fully charged battery and monitor the voltage until it drops below its useful value. The amount of time the battery lasts indicates its capacity.
That is a quick solution to the problem, but it involves watching a voltmeter for a few hours. That’s no fun at all. With a microcontroller, like the good old AVR chip, we can make a rechargeable battery tester that does the work for us. My tester puts AA batteries through a discharge test and reports the capacity in milliamp-hours (mAh) so you can compare battery capacity.

Design features
The tester can test multiple cells individually, and display the results on an LCD.
The tester discharges the battery while monitoring the voltage of the batteries. When the low threshold is reached, that cell is done it disconnects the load from the battery. When all tests are complete a series of beeps alerts the user. The tester identifies the type of battery by its initial voltage allowing both NiCd and NiMh batteries to be tested.

The design is based on the ATMega168 microcontroller, which has 6 A/D converters on the chip, so these will be used to read the battery voltages and determine the load current. Since each battery will require two A/D converters per cell, the maximum number of cells is three.

I built two of the testers, first using an Arduino board as a development system, and then a standalone device that will be more compact, and free up the Arduino for other projects.

« Previous StepDownload PDFView All StepsNext Step »
36 comments
Apr 9, 2012. 5:46 PMrsmack says:
Where did you find the battery holder
Sep 21, 2011. 11:01 AMMikey_Likes_It says:
First of all, great instructable for a very useful device!

I sourced a Nokia 5110 LCD from a supplier (not taken from an actual cell phone) and the pin configuration is slightly different than you describe. On my LCD the pins are identified as:

1 VCC
2 GND
3 SCE
4 RST
5 D/C
6 DNK(MOSI)
7 SCLK
8 LED

What connection changes do I need to make to use this LCD?
Thanks in advance,
Mike
Jun 29, 2011. 2:57 AMAquatarkus says:
Great project on this site. Unfortunately, the code for standalone version was not published, and since I don't have an Arduino board I have to re-write the code myself. It takes a lot of time and so far doesn't work, but hope never dies :)
Mar 10, 2011. 6:29 AMpaulryanmini says:
hi trying to build your circuit it is great. i have the following lcd:

http://www.dfrobot.com/index.php?route=product/product&keyword=I2C+LCD+Shield&category_id=53&description=1&model=1&product_id=135
how would i change the code for it to work with it\/ or would i be better buying a 5110 screen?

thanks
Jul 22, 2011. 4:30 AMvisuallabs says:
Hey, Cool TUT
But The Code Isn't Opening In
Arduino IDE
Please Can You Send It To:
arduinocode@gmail.com OR
customer.support@labsvisual.com
Jul 4, 2011. 3:59 PMu04797 says:
Great Project! I hope it will work for me.
Jun 15, 2011. 12:37 PMmsuzuki777 says:
Excellent job on this Instructable. I especially liked the professionally-written code. I have never seen better written code for the Arduino with structures and subroutines.

I also like and appreciate your use of MOSFETs and will try to incorporate them in a similar project of mine.

I do have one thought. It seems to me that with the MOSFETs that you used, there would be an insignificant voltage drop across it when it's on so that you could probably ignore it in your calculations. Did you ever measure that voltage in your testing? Anyway, if this was irrelevant, you could probably test four batteries at once instead of three. Of course, since you already have it built, it's just a thought.

Again, well done!

Lazy Old Geek
Apr 4, 2011. 10:26 AMarnefl says:
Great work! What is the button-1 connecting ground and dig. pin 10?
Apr 9, 2011. 4:32 PMKT Gadget says:
For the resistor to make the slot read "0 volts" when empty (no battery inserted), can the resistor be greater than 2M Ohms, or does it specifically have to be a 2M ohm resistor?
Mar 21, 2011. 7:48 PMarnefl says:
I downloaded the sketch and the pcd8544.h , but it will not compile.
Lots of error messages like the one below:

undefined reference to `PCD8544::setCursor(unsigned char, unsigned char)'
Mar 21, 2011. 8:13 PMarnefl says:
Never mind. The folder in libraries had to be named "PCD8544"
Mar 2, 2011. 6:33 PMnewrev426 says:
Can you suggest a specific mosfet? Would a TIP31A transistor work as well instead? Can handle 3A and they seem to be a lot cheaper what is your professional opinion?
Mar 8, 2011. 8:49 PMnewrev426 says:
Wow I was expecting a yes or a no but man I love the response! I appreciate the time you spent and you explained it very well. Trying to go to school for this stuff and I can always use more info. Thanks!
Feb 13, 2011. 10:45 AMduncan_a says:
Brilliant - just what we need in our house...

Only problem is, I can't locate Nokia 5510 LCD screens on eBay on either side of the Atlantic (I'm in the UK) - are there other screens that would work?
Feb 23, 2011. 2:23 AMarnefl says:
eBay item 200399485981 from seller szdigitalsquare $8.00 and free shipping. It also has an adapter PCB
Feb 13, 2011. 1:08 PMaugur45 says:
I didn't immediately get that the part specified is the LCD FOR the Nokia 5510 cell phone. I googled "nokia 5510 lcd" and found that the LCD for the Nokia 5510 is widely available as a repair/replacement part online in the price range 4.00 to 9.00 GBP (plus tax and shipping). You can probably get one locally from a cell phone store that does repairs.

Here are a few links I found:
http://www.wholesalemobilephoneaccessories.co.uk/nokia-5510-lcd-new.html

http://gsmserver.com/shop/spares/lcd/nokia/lcd_for_nokia_5510_with_keyboard.php

http://www.mytrendyphone.co.uk/shop/original-nokia-5510-1269p.html

http://www.blueunplugged.com/Nokia-LCD-Lens.aspx
Feb 19, 2011. 11:37 AMKT Gadget says:
This is a great instructable and I've been trying to find something that would test a lot of the rechargeable batteries I have at home. Gonna try and make this when I get the time.

One question though, does it matter what the wattage has to be for the load resistor or does it?
Feb 8, 2011. 9:41 PMironsmiter says:
ok, so Quick note for some of us... .PDE files open well in "wordpad" on windows systems.

Was just trying to look at the code, to determine what, if anything, would need to be changed besides the FET and load, to change it into a 18650 capacity tester.

AA batteries are nice, but nothing says power to weight like good, used laptop battery cells.

As a note, contrary to the code notes... a fully charged Li-Ion will read 4.2V NOT 3.6.


I'll have to dissect the code when I'm not so tired, unless you already have it sitting around? ;-)
I have a feeling there's going to be more to it than swapping 2 components, and a few variables. I think it best to simplify, and use a separate tester, instead of trying to cram all the functions into one little PIC. But I could be wrong. I don't have much experience with micros, other than burn-and-play with other peoples code.
Feb 9, 2011. 7:07 AMironsmiter says:
ok, just thought I should re-comment....

This is GREAT looking project.
really well executed.
and useful to boot.

And the commenting in your code is VERY helpful to those of us just starting in the micro-controller arena. Bravo and 2 thumbs up!

And freehand routing the enclosure with a drill press? Impressive!
Thanks for your contribution to our collective knowledge.

My previous comment was driven more though despair at my lack of knowledge in this area, than from anything lacking in your 'Ible.
If you find the time or energy, it's be great if you could show the modifications needed for different battery types. A 'universal' modification list, to handle things like li-ion, li-po, 6/12V SLAs...

From the hardware standpoint, It still looks like it would only require recalculating the load resistor, making sure the mosfet can handle the current, and using different battery terminals. but the software code... I think that's a little beyond me at the moment :-(
Feb 10, 2011. 7:57 AMjimk3038 says:
Without digging into your code, I'm wondering, what voltage do you consider the battery to be drained. In other words, when do you stop draining the battery and consider it dead?

By the way, nice write up. Thanks.
Feb 10, 2011. 3:03 PMcachehiker says:
0.95 Volts.

It's a constant defined in the first page of code.
Feb 10, 2011. 11:46 AMSpokehedz says:
You are my PERSONAL hero! I have piles of the 168's laying around from upgrading all my 'duinos to the 328... So this is going to be a nice use for them and all my piles of rechargeable batteries.
Feb 8, 2011. 10:08 PMjrossetti says:
I know this may be a really dumb question, but would we need the arduino bootloader on the chip, or would a plain-jane atmega328 work?
Feb 10, 2011. 7:15 AMroycepipkins says:
Arduino sketches work fine on "plain jane" atmega328/168/88/48s. (If they fit on the chip) The bootloader contains no runtime code. But, you have to have the ISP programmer and you need to set the clock speed flags.

With out the bootloader, there is no software inside the AVR that is listening to the AVR's serial port or waiting for the Arduino IDE commands. With out that software, you must use the AVR's built-in hardware mechanism to program the AVR. That built-in hardware works over the SPI port, not the serial port, and uses a different protocol.
Feb 8, 2011. 6:20 PMJoshuaZimmerman says:
That is awesome! Kudos to you good sir.

When I finally start learning how to do Microcontroller stuff, this will be on my list of projects. (Though I doubt it'll look as nice.)
Feb 8, 2011. 4:40 PMSinAmos says:
Oh, I like this and need this or do I?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
56
Followers
5
Author:BrianH