Welcome to Laser Pointer Forums! If you are looking for a laser you may want to check out the database of laser pointer companies. The link will open in a new window for your convenience.

 Laser Pointer Forums - Discuss Laser Pointers Arduino Battery Capacity Tester Laser Pointer Company Database     Laser Top Sites List     Lasers by Type     Green Lasers

01-16-2015, 07:47 AM #1
 Class 3R Laser Join Date: Dec 2011 Location: Houston, TX Posts: 1,435 Rep Power: 161
Hiemal
Class 3R Laser

Join Date: Dec 2011
Location: Houston, TX
Posts: 1,435
Rep Power: 161
Arduino Battery Capacity Tester

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!

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

Which brings me to another point...

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

__________________
formerly Le Quack

Drivers and Stuff

Superboost Driver (5.5+ amp capability) End all for Boosting!

MicroSized Boost Driver

Low Dropout Linear Driver

Any electronics related questions?

Send me a PM and I'll try my best to answer!

01-17-2015, 12:31 AM #2
 Class 4 Laser Join Date: Sep 2007 Location: Wisconsin Posts: 8,852 Rep Power: 1363
Cyparagon
Class 4 Laser

Join Date: Sep 2007
Location: Wisconsin
Posts: 8,852
Rep Power: 1363
Re: Arduino Battery Capacity Tester

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.

Quote:
 Originally Posted by Le Quack would anyone be interested in buying these as like, kits or something?
Many \$10 chargers have this feature these days. I doubt it.
__________________
A problem well stated is a problem half solved.

04-21-2015, 04:23 AM #3
 Class 2M Laser Join Date: Dec 2014 Location: California Posts: 574 Rep Power: 127
joeybab3
Class 2M Laser

Join Date: Dec 2014
Location: California
Posts: 574
Rep Power: 127
Re: Arduino Battery Capacity Tester

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/

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 LinkBacks (?) LinkBack to this Thread: http://laserpointerforums.com/f60/arduino-battery-capacity-tester-92494.html Posted By For Type Date ?????-???????? : teensy :: Battery Capacity Tester This thread Refback 02-10-2015 01:47 PM

All times are GMT. The time now is 01:26 AM.

 -- DarkShadows V5 -- Responsive LPF -2562016 -- Default Style Contact Us - Laser Pointer Forums - Archive - Top