Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers

LPF Donation via Stripe | LPF Donation - Other Methods

Links below open in new window

ArcticMyst Security by Avery

Arduino Battery Capacity Tester

Hiemal

0
Joined
Dec 27, 2011
Messages
1,443
Points
63
Hi guys.

First time really fiddling around with coding and arduino-ing. I had a teensy 3.1 (a type of fancy uC that I was gonna use for something else) that I figured I could put to use, rather than let it collect dust needlessly.

Anyway. I spent quite a lot of time researching and doing some reading on coding and how to calculate mAh.

And eventually came up with a program that allows an arduino (or equivalent in my case!) to give pretty accurate capacity readings for li-ions (and even NiCd/NiMns too).

Way it works is pretty simple. Basically, there's a relay, a resistor and a voltage divider.

The resistor is the load; this is what allows the program to read voltage, and consequently, current. Ohm's law baby!!

Because my teensy cannot handle anything over 3.3 volts in its inputs, you have to use a resistive voltage divider. I just chose something simple, 0.5 the voltage, and you compensate for it by telling the arduino to multiply its sensor reading by two.



Now, you have the current and the voltage. Great!

During this time the arduino has been keeping track of time from the start of the test. This is what allows us to get the mAh, by taking the current value and multiplying it by the number of "hours" that have passed. Once the battery has reached 2.7 volts, the test stops, and you get your mAh reading out.


The other neat thing about it is I also added in a serial output; meaning the arduino will print data to my computer!

sCyOCIa.png



And here's a picture of the actual circuit n' stuff so far. Note this not the final product, obviously!!

gR2qj1n.jpg


Which brings me to another point...

would anyone be interested in buying these as like, kits or something? I could use the supplemental income. :p
 





Joined
Sep 12, 2007
Messages
9,399
Points
113
I built one of those a while back. I used more of a hardware approach though. I constructed a 1A current sink with an enable feature. Code was like 20 lines and basically went:

enable current sink. Begin timer.
if voltage is less than 3V, disable current sink and end timer.
Ah = seconds/3600. print to LCD.

would anyone be interested in buying these as like, kits or something?

Many $10 chargers have this feature these days. I doubt it.
 
Joined
Dec 17, 2014
Messages
644
Points
28
Despite what he said^ i would be interested in buying a kit, also instead of the teensy, might i recommend an arduino nano (only 4$) that would make the price go down significantly.(heres a link if you're interested: http://www.banggood.com/
 




Top