{"id":496,"date":"2015-05-26T21:11:50","date_gmt":"2015-05-26T20:11:50","guid":{"rendered":"http:\/\/axotron.se\/blog\/?p=496"},"modified":"2015-10-11T17:12:25","modified_gmt":"2015-10-11T16:12:25","slug":"battery-tester-based-on-a-teensy","status":"publish","type":"post","link":"https:\/\/axotron.se\/blog\/battery-tester-based-on-a-teensy\/","title":{"rendered":"Battery tester based on a Teensy"},"content":{"rendered":"<p>I am taking care of a number of <a href=\"http:\/\/www.sportident.com\/index.php?option=com_content&amp;view=article&amp;id=338&amp;Itemid=2670&amp;lang=en\" target=\"_blank\">Sportident units<\/a>, which are used in the sport of orienteering. These are small embedded systems powered by non-rechargeable lithium batteries, specifically <a href=\"http:\/\/en.wikipedia.org\/wiki\/Lithium_battery\" target=\"_blank\">thionyl chloride (Li-SOCl<sub>2<\/sub>) batteries<\/a>, and every few years the batteries need to be replaced, depending on how much the unit has been used. The units themselves tries to keep track of the battery status by dead reckoning and by measuring the battery voltage, apparently while it is doing something that consumes current. The state of the battery voltage under load can be read out as can the value of the estimated remaining capacity.<\/p>\n<p>To help in determining the status of such batteries, I wanted to have a device that could measure the voltage and the internal resistance in a convenient manner. I had a <a href=\"http:\/\/axotron.se\/blog\/getting-started-with-teensy\/\" target=\"_blank\">Teensy<\/a> laying around and since it has a DAC output and several analog inputs, it looked like a good platform to quickly hook something together that could do the task.<\/p>\n<p>This is the schematics I came up with:<\/p>\n<figure id=\"attachment_501\" aria-describedby=\"caption-attachment-501\" style=\"width: 632px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/battery_impedance_schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-501\" src=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/battery_impedance_schematic.png\" alt=\"The schematic of the Teensy-based battery impedance tester.\" width=\"632\" height=\"366\" srcset=\"https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/battery_impedance_schematic.png 632w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/battery_impedance_schematic-300x174.png 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/a><figcaption id=\"caption-attachment-501\" class=\"wp-caption-text\">The schematic of the Teensy-based battery impedance tester.<\/figcaption><\/figure>\n<p>The circuit works like this:<\/p>\n<p>R1 and R2 forms a voltage divider that reduces the battery voltage to below 3.3 V which is the limit of the ADC of the Teensy. Q1 and Rs forms a current sink controlled by the voltage on the A14\/DAC pin. Basically the DAC pin sets the base voltage and since the base-emitter voltage is fairly constant, a constant voltage will develop over the emitter resistor Rs. To maintain this voltage Q1 will conduct as much current as required from the battery. The emitter current can be measured by measuring the voltage drop across Rs using analog input A1.<\/p>\n<p>The purpose of having A2 and A3 connected across the base resistor is to be able to measure the (small) base current so that it can be subtracted from the emitter current when calculating the battery current. This is only a small correction and not really important, but since the inputs were available and it was easy to do, I added this little feature.<\/p>\n<p>I built the physical circuit on perfboard and it looks like this:<\/p>\n<figure id=\"attachment_502\" aria-describedby=\"caption-attachment-502\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_close.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-502\" src=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_close.jpg\" alt=\"The battery tester board.\" width=\"800\" height=\"533\" srcset=\"https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_close.jpg 800w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_close-300x200.jpg 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-502\" class=\"wp-caption-text\">The battery tester board.<\/figcaption><\/figure>\n<figure id=\"attachment_503\" aria-describedby=\"caption-attachment-503\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_far.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-503\" src=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_far.jpg\" alt=\"The battery tester board with clips.\" width=\"800\" height=\"533\" srcset=\"https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_far.jpg 800w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/teensy_current_far-300x200.jpg 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-503\" class=\"wp-caption-text\">The battery tester board with clips.<\/figcaption><\/figure>\n<p>As can be seen, the whole thing is very simple to build as the Teensy does all the heavy lifting.<\/p>\n<p>I did of course need a program to control the whole thing and do all the measuring, calculations and presentation of results. This is the program I came up with:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\/* Lithium battery tester\r\n\r\n\u00a0\u00a0 Tests the internal resistance of a small 3.6 V lithium battery by ramping up the load current and measuring \r\n\u00a0\u00a0 the pole voltage and calculating the internal resistance.\r\n\u00a0 \u00a0\r\n\u00a0\u00a0 Written by Per Magnusson, http:\/\/www.axotron.se\r\n\u00a0\u00a0 v 0.1 2015-05-24\r\n\u00a0\u00a0 This program is public domain.\r\n*\/\r\n\r\nconst float Rtop = 1817;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Top resistor of divider, ohms\r\nconst float Rbot = 8170;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Bottom resistor of divider, ohms\r\nconst float Rs = 32.8;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Current sense resistor, ohms\r\nconst float Rb = 995;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Base resistor, ohms\r\nconst float Vref = 3.3;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ ADC reference voltage, volts\r\nconst int ADCbits = 12;\r\nconst int DACbits = 12;\r\nconst float voltPerADC = Vref\/((1&lt;&lt;ADCbits) - 1.0); \/\/ Factor to convert ADC codes to volts\r\nconst float voltPerDAC = Vref\/((1&lt;&lt;DACbits) - 1.0); \/\/ Factor to convert DAC codes to volts\r\nconst float DACperVolt = 1\/voltPerDAC;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Factor to convert volts to DAC codes\r\nconst int detectLimit = 0.8\/voltPerADC;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Limit for detecting battery \r\nconst float curLim = 35.0e-3;\u00a0 \/\/ Maximum test current in A\r\nconst float curStep = 5.0e-3;\u00a0 \/\/ Target current step\r\nconst int maxIter = 3;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Number of iterations to reach target current\r\n\r\nconst int vsensePin = A0;\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Voltage sense pin\r\nconst int curSensePin = A1;\u00a0\u00a0\u00a0 \/\/ Emitter current sense pin\r\nconst int baseSenseHiPin = A2; \/\/ High base current sense pin\r\nconst int baseSenseLoPin = A3; \/\/ Low base current sense pin\r\nconst int dacPin = A14;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Current control pin\r\nconst int ledPin = 13;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ LED for debug\r\n\r\nconst byte sWaitNoBat = 0;\r\nconst byte sWaitBat = 1;\r\n\r\nbyte state;\r\n\r\nvoid setup() {\r\n\u00a0 Serial.begin(57600);\r\n\u00a0 analogWriteResolution(DACbits);\r\n\u00a0 analogReadResolution(ADCbits);\r\n\u00a0 analogWrite(dacPin, 0);\r\n\u00a0 pinMode(ledPin, OUTPUT);\r\n\u00a0 state = sWaitNoBat;\r\n\u00a0 Serial.println(&quot;Battery tester&quot;);\r\n\u00a0 digitalWrite(ledPin, HIGH);\u00a0\u00a0\u00a0\u00a0 \/\/ turn\u00a0 LED on\r\n\u00a0 delay(3000);\r\n\u00a0 digitalWrite(ledPin, LOW);\u00a0\u00a0\u00a0\u00a0 \/\/ turn\u00a0 LED off\r\n\u00a0 Serial.println(&quot;Waiting for a battery to be connected...&quot;);\r\n}\r\n\r\nvoid loop() {\r\n\u00a0 int voltCode;\r\n\u00a0 int baseVoltCode;\r\n\u00a0 int curCode;\r\n\u00a0 int dacVal;\r\n\u00a0 int dacStep;\r\n\u00a0 float volt;\r\n\u00a0 float voltNoLoad;\r\n\u00a0 float curNoLoad;\r\n\u00a0 float cur;\r\n\u00a0 float baseCur;\r\n\u00a0 float res;\r\n\u00a0 float prevCur;\r\n\u00a0 float targCur;\r\n\u00a0 float stepCur;\r\n\u00a0 byte testBat;\r\n\u00a0 byte iter;\r\n\u00a0 \r\n\u00a0 analogWrite(dacPin, 0);\u00a0 \/\/ Make sure we are not loading the battery in this state\r\n\u00a0 testBat = false;\r\n\u00a0 voltCode = analogRead(vsensePin);\u00a0 \/\/ Read battery voltage to see if it is connected\r\n\u00a0 if(state == sWaitNoBat) {\r\n\u00a0\u00a0\u00a0 \/\/ We are waiting for at battery to be connected\r\n\u00a0\u00a0\u00a0 if(voltCode &gt; detectLimit) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ A battery was connected\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 testBat = true; \/\/ Proceed to test it\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 } else if(state == sWaitBat) {\r\n\u00a0\u00a0\u00a0 \/\/ We are waiting for a battery to be disconnected\r\n\u00a0\u00a0\u00a0 if(voltCode &lt; detectLimit) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ A battery was disconnected\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(&quot;\\nWaiting for a battery to be connected...&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 delay(1000); \/\/ Delay to not react on glitches while the battery is being disconnected\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 state = sWaitNoBat;\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 }\r\n\u00a0 \r\n\u00a0 if(!testBat) {\r\n\u00a0\u00a0\u00a0 \/\/ Not in a situation that a battery should be tested\r\n\u00a0\u00a0\u00a0 return;\r\n\u00a0 }\r\n\r\n\u00a0 \/\/ Test the battery\r\n\u00a0 Serial.println(&quot;Battery connected, waiting for connection to stabilize.&quot;);\r\n\u00a0 delay(1000); \/\/ Wait for the connection to stabilize\r\n\u00a0 voltCode = analogRead(vsensePin);\r\n\u00a0 if(voltCode &lt; detectLimit) {\r\n\u00a0\u00a0\u00a0 \/\/ The battery is gone, it was just a glitch\r\n\u00a0\u00a0\u00a0 state = sWaitNoBat;\r\n\u00a0\u00a0\u00a0 Serial.println(&quot;Battery removed, aborting.&quot;);\r\n\u00a0\u00a0\u00a0 Serial.println(&quot;Waiting for a battery to be connected...&quot;);\r\n\u00a0\u00a0\u00a0 return;\r\n\u00a0 }\r\n\u00a0 digitalWrite(ledPin, HIGH);\u00a0\u00a0\u00a0\u00a0 \/\/ turn\u00a0 LED on\r\n\u00a0 Serial.println(&quot;Testing battery.&quot;);\r\n\r\n\u00a0 voltNoLoad = voltCode * voltPerADC * (Rtop+Rbot)\/Rbot;\r\n\u00a0 volt = voltNoLoad;\r\n\u00a0 curNoLoad = voltNoLoad\/(Rtop+Rbot); \/\/ &quot;No load&quot; current\r\n\u00a0 \r\n\u00a0 Serial.println(&quot;&quot;);\r\n\u00a0 Serial.print(&quot;Unloaded voltage: &quot;);\r\n\u00a0 Serial.print(voltNoLoad);\r\n\u00a0 Serial.print(&quot; V (current = &quot;);\r\n\u00a0 Serial.print(curNoLoad*1000);\r\n\u00a0 Serial.println(&quot; mA)&quot;);\r\n\u00a0 \r\n\u00a0 \/\/ Ramp up the current\r\n\u00a0 cur = 0;\r\n\u00a0 targCur = 0;\r\n\u00a0 dacVal = 0.66*DACperVolt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Base drive starting value, 0.66 V, low current\r\n\u00a0 dacStep = 5.0e-3*Rs*DACperVolt; \/\/ Increment ~5 mA per iteration\r\n\u00a0 prevCur = 0;\r\n\u00a0 iter = maxIter;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ First step is to read whatever current the starting DAC value results in\r\n\r\n\u00a0 \/\/ Loop to set a number of different battery test load currents and measure the battery performance at each current\r\n\u00a0 while(1) {\r\n\u00a0\u00a0\u00a0 if(targCur &gt; curLim) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ We are beyond the maximum target current, normal exit from loop\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 if(dacVal &gt;= (1&lt;&lt;DACbits)) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ The DAC value is too big, exit from loop\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot;Warning: Above maximum DAC setting (&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(dacVal);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(&quot;), exiting&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 break;\r\n\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0 analogWrite(dacPin, dacVal);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Drive the base of the transistor\r\n\u00a0\u00a0\u00a0 delay(10);\r\n\u00a0\u00a0\u00a0 voltCode = analogRead(vsensePin);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Battery voltage reading\r\n\u00a0\u00a0\u00a0 volt = voltCode * voltPerADC * (Rtop+Rbot)\/Rbot;\u00a0 \/\/ Calculate battery voltage\r\n\u00a0\u00a0\u00a0 baseVoltCode = analogRead(baseSenseHiPin) - analogRead(baseSenseLoPin); \/\/ Read voltage drop across base resistor\r\n\u00a0\u00a0\u00a0 baseCur = baseVoltCode * voltPerADC\/Rb;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Calculate base current\r\n\u00a0\u00a0\u00a0 curCode = analogRead(curSensePin);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Emitter current reading\r\n\u00a0\u00a0\u00a0 \/\/ Calculate battery current and compensate for base current and divider current\r\n\u00a0\u00a0\u00a0 cur = curCode * voltPerADC\/Rs - baseCur + curNoLoad;\r\n\r\n\u00a0\u00a0\u00a0 if(voltCode &lt; detectLimit) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ The voltage is too big, exit from loop\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot;Warning: Below minimum battery voltage (&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(volt);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(&quot; V), exiting&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 break;\r\n\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0 if((cur - curNoLoad) &gt; 0) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 res = (voltNoLoad - volt)\/(cur - curNoLoad); \/\/ Calculate internal resistance\r\n\u00a0\u00a0\u00a0 } else {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 res = 0; \/\/ Avoid dividing by zero\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 if(iter &lt; maxIter) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Make a small adjustment to get closer to the target current\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if(cur != prevCur) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dacVal += dacStep*((targCur-cur)\/(cur-prevCur));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 iter += 1;\r\n\u00a0\u00a0\u00a0 } else {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Print result\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot;Voltage: &quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(volt);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot; V&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot; Current: &quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(cur*1000);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot; mA&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot; Resistance: &quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(res);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(&quot; ohms&quot;);\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Move to next target current\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 targCur += curStep;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if(prevCur &gt; 0 &amp;&amp; (cur-prevCur &gt; 0)) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Estimate the step size required to reach the next target current\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 dacStep = dacStep*((targCur-cur)\/(cur-prevCur));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 dacVal += dacStep;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 prevCur = cur;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 iter = 0;\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 if(cur &gt; curLim*1.2) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ The current is too big, exit from loop\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(&quot;Warning: Maximum current exceeded (&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.print(cur);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(&quot; mA), exiting&quot;);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 break;\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 }\r\n\u00a0 analogWrite(dacPin, 0);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Stop the battery current drain\r\n\u00a0 digitalWrite(ledPin, LOW);\u00a0\u00a0\u00a0\u00a0 \/\/ turn\u00a0 LED off\r\n\u00a0 state = sWaitBat;\r\n\u00a0 Serial.println(&quot;Done&quot;);\r\n\u00a0 Serial.println(&quot;Disconnect battery.&quot;);\r\n}\r\n<\/pre>\n<p>The program sends information to a serial terminal (I used the one inside the Arduino development environment). It waits for a battery to be connected and then ramps up the current and reports the pole voltage as well as the internal resistance at a couple of different load currents. This is what the output can look like:<\/p>\n<pre>Waiting for a battery to be connected...\r\nBattery connected, waiting for connection to stabilize.\r\nTesting battery.\r\n\r\nUnloaded voltage: 3.67 V (current = 0.37 mA)\r\nVoltage: 3.63 V Current: 1.39 mA Resistance: 39.36 ohms\r\nVoltage: 3.47 V Current: 4.97 mA Resistance: 41.95 ohms\r\nVoltage: 3.27 V Current: 9.99 mA Resistance: 41.26 ohms\r\nVoltage: 3.08 V Current: 15.03 mA Resistance: 40.23 ohms\r\nVoltage: 2.89 V Current: 19.98 mA Resistance: 39.33 ohms\r\nVoltage: 2.72 V Current: 24.97 mA Resistance: 38.56 ohms\r\nVoltage: 2.54 V Current: 29.99 mA Resistance: 37.88 ohms\r\nVoltage: 2.37 V Current: 34.99 mA Resistance: 37.33 ohms\r\nDone\r\nDisconnect battery.<\/pre>\n<p>With a different program, the circuitry can of course also be used to test batteries in different ways.<\/p>\n<h3>Update on 2015-10-11<\/h3>\n<p>As requested by Alex in the comments, here is a picture of the bottom side of the board (and the corresponding picture of the top).<\/p>\n<figure id=\"attachment_710\" aria-describedby=\"caption-attachment-710\" style=\"width: 604px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6796.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-710\" src=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6796-1024x683.jpg\" alt=\"The bottom of the board.\" width=\"604\" height=\"403\" srcset=\"https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6796-1024x683.jpg 1024w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6796-300x200.jpg 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-710\" class=\"wp-caption-text\">The bottom of the board.<\/figcaption><\/figure>\n<figure id=\"attachment_711\" aria-describedby=\"caption-attachment-711\" style=\"width: 604px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6797.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-711\" src=\"http:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6797-1024x683.jpg\" alt=\"The top of the board.\" width=\"604\" height=\"403\" srcset=\"https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6797-1024x683.jpg 1024w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6797-300x200.jpg 300w, https:\/\/axotron.se\/blog\/wp-content\/uploads\/2015\/05\/DSC_6797.jpg 2037w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption id=\"caption-attachment-711\" class=\"wp-caption-text\">The top of the board.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I am taking care of a number of Sportident units, which are used in the sport of orienteering. These are small embedded systems powered by non-rechargeable lithium batteries, specifically thionyl chloride (Li-SOCl2) batteries, and every few years the batteries need to be replaced, depending on how much the unit has been used. The units themselves &hellip; <a href=\"https:\/\/axotron.se\/blog\/battery-tester-based-on-a-teensy\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Battery tester based on a Teensy<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,2],"tags":[],"class_list":["post-496","post","type-post","status-publish","format-standard","hentry","category-arduino","category-electronics"],"_links":{"self":[{"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/posts\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/comments?post=496"}],"version-history":[{"count":8,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":1405,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/posts\/496\/revisions\/1405"}],"wp:attachment":[{"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/categories?post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/axotron.se\/blog\/wp-json\/wp\/v2\/tags?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}