# Will this temperature compensation work?

I have a circuit and as a part of it I need to measure the battery voltage under a load. Naturally I would need this load to be constant each time I measured it to accurately know the battery levels which is important for me. However, if temperature changed the voltage drop over the transistor would increase or decrease and that would in turn change the load that would be on the battery.

Here is the circuit I have devised, assume that the diode is matched to the transistor drop: simulate this circuit – Schematic created using CircuitLab

So the idea is that voltage drop increases in Q1 will be compensated by matched drops over D1 as that will push up the voltage at the base. In my head that is how it works but I am trying to actually step through it on paper to see how it would work and I now am doubting it...

Does anyone know if this will work and if not how I can improve it / what should I be doing instead?

• What type of battery? – Techydude Jun 12 '15 at 10:55
• @Techydude Not sure that matters to be honest but Lithium (CR123A) – MrPhooky Jun 12 '15 at 11:01

It won't provide much compensation because of the 100K resistor, and the diode won't track the self-heating of the transistor very well, even if it did. There's no reference so your current is going to be dependent on the 2V signal (perhaps that's intended). You could short out the 1K and remove the 100K and diode with little change. If the transistor heats by 25°C the current will increase about 4% (reference voltage is about 1.4V and it changes by about +2.1mV/°C as Vbe drops). A 10% drop in the input voltage will decrease the current by 15%.

The circuit you are thinking of is approaching a current mirror, but that's got some real disadvantages in this application- you will have trouble feeding it a constant current and the transistors need to be at the same temperature for it to compensate (self-heating will be significant). If you want to continue with it, check out the AD link above. If your discharge current is to be constant (not controlled by the input voltage), I would suggest a circuit with more gain such as a TL431-based circuit. Replace Vi(BATT) with your control signal. The below circuit will work down to about 2.6V. If that's not low enough there are parts (TLV431) with a lower Vref. An Energizer application note covering internal resistance can be found at http://data.energizer.com/pdfs/batteryir.pdf, and in it, they present this graphic: I believe that this dual pulse method is an industry standard way of reporting voltage on a cell, so let me do my best to explain it. Because open circuit voltage of a battery can be very misleading, they "stabilize" the voltage of the battery with a low-level 5mA current drain. After the voltage stabilizes, they measure the voltage at that level. Then they pulse the cell at a higher level, in this case 505mA to make the math nice when they calculate the change in current for the example. They maintain the 505mA high power pulse for 100ms, measure the voltage at that point, and then terminate the pulse.

At this point, they can easily calculate the internal resistance of the cell. From V=IR, R=V/I, so the (cell internal resistance) = (change in voltage)/(change in current).

So, for you to achieve what I think you're trying to achieve (consistency, repeatability, and meaning in voltage reporting), you now at this point normalize your results by always representing your cell voltage at, for instance a 100mA load, by V=IR, (voltage of cell under 0.1A drain rate)=(voltage at 5mA stabilization current) + (0.1A)*(cell internal resistance). And you don't have to use 100mA -- you can just multiply the IR by any particular current you choose that represents your application; if yours is a high current application, you would want to report the voltage represented at a higher current, and if yours is a low current application, you would want to report the voltage represented at a low current.

All you really have to do is get correct measurements for current and voltage at both measurement points to get a good cell internal resistance. Temperature compensated constant current isn't really necessary -- in the ball park should be good enough. You just need a "constant current" that is constant enough for the voltage to stabilize and get a good reading.

Note also that cell internal resistance changes constantly, not just as the energy is used up, but also with temperature (cold can significantly increase it), and even shock (dropping the battery), so the internal resistance should not be stored for too long, but recalculated at reasonable intervals (minutes).

======

After reading this page again, I saw that you're using a Lithium cell (CR123A) which is capable of 1.5A continuous discharge rate, about 3.5A of pulse power, and because it is Lithium, it generally has a fairly low internal resistance, and a fairly stable discharge voltage decay curve.

Because it's Lithium, your reported voltages are not going to vary too much until end of cell life, at which point it will start to go down quickly. I would still use this Dual Pulse method of internal resistance calculation, plugging it back into a standard current, to report the cell voltage. As all too often, it really does depend on what you want to do with that voltage information.

So, my final answer might look something sort of like this (at least, this is the idea): You fire off the circuit on the left, wait 100ms (or however long it takes to stabilize), measure voltage and current. Then you keep the left circuit on, and turn on the right circuit, and wait another 100ms. Finally, after 100ms, you measure voltage and current again, and turn off both circuits, and you're done. You then have what you need to calculate and report voltage as explained above.