Good batteries should have a low internal resistance, but measuring the internal resistance commonly requires special equipment. However, thanks to chdk, it can also be measured with just your camera. This script switches the LCD successively on and off, it measures the battery voltage in both cases, and then calculates the internal resistance of the batteries. The formula is R = (V2-V1) / (P1/V1 - P2/V2), where R = collective resistance of batteries in series, P = consumed electrical power, V = measured battery voltage, (1) = LCD-on, (2) = LCD-off.
@title BatteryCheck
gosub "Init"
for i = 1 to n
for j = 1 to k
gosub "ClickAndMeasure"
next j
d = v - u
e = (p * 1000 / u) - (q * 1000 / v)
r = 1000 * d / e
print d, "mV dif; R", r, "mOhm"
next i
end
:Init
@param k Click cycle length
@default k 3
@param n Sample size
@default n 2
@param p LCD-on power (mW)
@default p 1300
@param q LCD-off power (mW)
@default q 350
@param t Delay (sec)
@default t 10
return
:ClickAndMeasure
click "display"
z = get_display_mode
rem z=2 means LCD off
if z = 1 or z = 2 then
gosub "Measure"
else
sleep 1000
endif
return
:Measure
gosub "Delay"
if z = 1 then let u = get_vbatt
if z = 2 then let v = get_vbatt
return
:Delay
gosub "BlueBlink"
for m = 1 to t
gosub "OrangeBlink"
next m
return
:BlueBlink
set_led 8 1 60
sleep 100
set_led 8 0
return
:OrangeBlink
set_led 7 1 60
sleep 100
set_led 7 0
sleep 900
return
- The script can be used to compare batteries of different brands, of different age, fully loaded vs. nearly empty, or NiMH vs. alkaline.
- Note: the formula is based on my observation that the camera (A720) draws a current which is reciprocal to the battery voltage. As a result it consumes a constant power if the battery voltage varies (unlike an ordinary resistance).
- The parameters P1 and P2 should be known; I measured it once for my camera using a current meter: 1300 mW with LCD on, and 350 mW with LCD off (camera model A720). These values probably depend somewhat on the camera model.