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 ads by
Signing UpStep 1This is a job for a microcontroller
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 Step | Download PDFView All Steps | Next Step » |















































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
♦The pin labeled LED- on my diagram does not exist - I assume that it is internally connected to the GND wire.
♦The pin labeled Vout on my diagram does not exist, so it can be ignored and the 4.7uF capacitor can be omitted.
♦RES is the same as RST (Reset)
♦On my diagram SDIN pin (Serial Data IN) is labeled DN(MOSI)
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
But The Code Isn't Opening In
Arduino IDE
Please Can You Send It To:
arduinocode@gmail.com OR
customer.support@labsvisual.com
Click on Rechargeable_Battery_Capacity_Tester.pde
If you are using Windows, It downloads with a weird filename (ending in .tmp)
you will need to rename it to "Rechargeable_Battery_Capacity_Tester.pde"
You will also need to get the file PCD8544.h it's a library from code.google.com
(google search for this file)
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
It was intended for a feature that I never got around to adding, but I accidentally left it on the schematic. I'll remove it when I get a chance.
Lots of error messages like the one below:
undefined reference to `PCD8544::setCursor(unsigned char, unsigned char)'
I looked at the spec sheet, and the TIP31A says the Vce when fully saturated is 1.2 volts. That's WAY to high for this circuit. The transistor may be able to handle the current, but the effective resistance will be too high (at 1 amp it would be about 1.2 ohms). The 3103 MOSFET spec sheet specifies the Resistance to be about .012 ohms (12 milli-ohms). (Don't confuse little 'm' milli with big 'M' Mega Ohms)
I find that Transistors spec sheets talk about the voltage drop across the Collector and Emitter, while MOSFETS typically give ratings of the resistance across the Drain and Source.
That said, you can probably find an inexpensive substitute with similar characteristics, but it looks like MOSFETS are the way to go. I chose the one I did because it was available (on an old PC motherboard). I then Googled the partnumber looked for the RDS and I was in business.
I see that RadioShlock also sells the IRF510 MOSFET, but the spec sheet says it has a Drain to Source Resistance of 0.54 ohms which is a bit high too. Mouser.com, Alliedelec.com and Jameco.com carry a large number of MOSFETS - under a dollar each. Check the spec sheets and look for low Drain to Source Resistance (RDS)
Here's a link I found that discusses Vce (for transistors):
http://www.electronics-tutorials.ws/transistor/tran_4.html
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?
http://www.sparkfun.com/products/10168
Their display is a lot easier to work with. I had to carefully cut the circuit board that was in the phone and solder small wires to make the display usable. But since I had it on hand I made use of it.
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
One question though, does it matter what the wattage has to be for the load resistor or does it?
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.
Thanks for the correction.
My tester will perform correctly since I disallow testing of anything over 1.7 volts.
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 :-(
By the way, nice write up. Thanks.
It's a constant defined in the first page of code.
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.
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.)