Author Topic: Jellybean Li-ion capacity tester  (Read 2191 times)

0 Members and 1 Guest are viewing this topic.

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Jellybean Li-ion capacity tester
« on: July 21, 2022, 07:49:18 am »
Hey folks,

I recently got interested in Li-ion cells, so I threw together a capacity tester / logger out of junk-box parts.  It appears to work!

It is a basic constant-current load controlled via an Arduino Pro Micro PWM output.  The Arduino spits out CSV data, which is captured by a laptop and later graphed in google sheets.

In other news, Li-ion cells from ebay perform about as expected  :-DD

Schematic and an example run attached.
« Last Edit: July 21, 2022, 07:19:32 pm by cellularmitosis »
LTZs: KX FX MX CX PX Frank A9 QX
 
The following users thanked this post: 1001

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #1 on: July 21, 2022, 08:14:57 am »
LTZs: KX FX MX CX PX Frank A9 QX
 
The following users thanked this post: kripton2035, 1001

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #2 on: July 21, 2022, 03:50:13 pm »
I also had a few of these Ultrafire 26650 cells from eBay.  These tested at about 1792mAh.
LTZs: KX FX MX CX PX Frank A9 QX
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3465
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #3 on: July 21, 2022, 04:56:23 pm »
Nice project!

In your source code I saw these comments:

Code: [Select]
    // 230: 1389 mA (oscillation)
    // 240: 1445 mA (oscillation)
    // 250: 1496 mA (oscillation)

In a lot of electronic loads there is a small valued capacitor between the output of the op-amp and the inverting input whose purpose is to quell oscillations. For instance, see this discussion:

https://www.eevblog.com/forum/beginners/problem-with-diy-cc-load/msg4041931/#msg4041931

 
The following users thanked this post: cellularmitosis

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8549
  • Country: us
    • SiliconValleyGarage
Re: Jellybean Li-ion capacity tester
« Reply #4 on: July 21, 2022, 05:45:00 pm »
you have a measurement error. the base current of the 3055 is flowing through the sense resistor. use mosfets instead of bipolars.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 
The following users thanked this post: cellularmitosis

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #5 on: July 21, 2022, 06:18:05 pm »
Nice project!

In your source code I saw these comments:

Code: [Select]
    // 230: 1389 mA (oscillation)
    // 240: 1445 mA (oscillation)
    // 250: 1496 mA (oscillation)

In a lot of electronic loads there is a small valued capacitor between the output of the op-amp and the inverting input whose purpose is to quell oscillations. For instance, see this discussion:

https://www.eevblog.com/forum/beginners/problem-with-diy-cc-load/msg4041931/#msg4041931

Thanks!

I'll give the capacitor a shot, but I suspect this is just the natural result of the LM358 being pushed too close to its positive supply (5V).

When I look at the scope, there is naturally a small 490Hz sine wave due to the filtered PWM from the Arduino.  As I get up near 1200mA or so, you can see the waveform start to get distorted, as the 358 nears its limit.  As you push it further, that distortion then becomes a small, then a larger oscillation.

Of course it is inevitable that the 358 will run out of room, as increasing load current causes the sense resistor to float the transistor up, the op amp output must also rise, until it runs out of room.  Resizing the sense resistor would give a trade-off of increased load range vs decreased resolution.

(though I am curious if I could squeeze just a bit more range out by dropping the op amp output resistor from 10R to 1R).
LTZs: KX FX MX CX PX Frank A9 QX
 

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #6 on: July 21, 2022, 06:23:32 pm »
you have a measurement error. the base current of the 3055 is flowing through the sense resistor. use mosfets instead of bipolars.

Ah, actually I think the only error current is through the 2N3904 base, from the op amp, and that should only be a few milliamps.
LTZs: KX FX MX CX PX Frank A9 QX
 

Offline mycroft

  • Regular Contributor
  • *
  • Posts: 70
  • Country: br
Re: Jellybean Li-ion capacity tester
« Reply #7 on: July 21, 2022, 08:48:13 pm »
I'll give the capacitor a shot, but I suspect this is just the natural result of the LM358 being pushed too close to its positive supply (5V).

You can get 0.5 Volt changing the 2N2904 to a 2N2906 (Darlington -> Sziklai) and complementing the PWM signal.
 
The following users thanked this post: cellularmitosis

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4069
  • Country: nl
Re: Jellybean Li-ion capacity tester
« Reply #8 on: July 24, 2022, 06:02:30 pm »
Total HFe of 2n3904 and the 3055 darlington is probably around (or above) 1000, so about (or less) 0.1% error, so it's pretty much below an ADC count and negligible, and you can get an order of magnitude better by calibration. I'd say, do not measure the resistance of your shunt directly, but put a DMM in current mode in series with the battery and use that to calibrate the current.

I don't like the dotted blue lines much. Just the big fat captions are clear enough, and the dotted lines add too much time for maintenance during modifications. It's really a bad idea.
And there are indeed plenty of examples of stabilizing a circuit like this.

Also:
In KiCad V6 you can assign net classes to nets in the schematic. You can also change the color of wires and make them thicker, just by labeling them into a properly set up net class. That looks much better then your coax cables on the output. The setting is in: Schematic Editor / File / Schematic Setup / Project / Net Classes

It's also a bit naughty to discharge your batteries to 2.5V. It's much easier for them if you don't go below 3.2V and it won't matter much for your measurement either.
« Last Edit: July 24, 2022, 06:07:26 pm by Doctorandus_P »
 
The following users thanked this post: cellularmitosis

Offline cellularmitosisTopic starter

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #9 on: July 25, 2022, 06:47:37 am »
Interesting to hear what's available in recent Kicad, I'm on the 2013 version and have no plans to upgrade  :-DD

Thanks for the feedback about discharge level, I was curious what the standard discharge voltage is.
LTZs: KX FX MX CX PX Frank A9 QX
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3465
  • Country: us
Re: Jellybean Li-ion capacity tester
« Reply #10 on: July 25, 2022, 09:59:12 am »

When I look at the scope, there is naturally a small 490Hz sine wave due to the filtered PWM from the Arduino.  As I get up near 1200mA or so, you can see the waveform start to get distorted, as the 358 nears its limit.  As you push it further, that distortion then becomes a small, then a larger oscillation.

Sounds like you're using the default Arduino PWM frequency. Here's a blog post on how to increase it -- a faster PWM frequency should decrease the ripple.

https://nerdytechy.com/how-to-change-the-pwm-frequency-of-arduino/
 
The following users thanked this post: cellularmitosis


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf