recently i've been looking at measuring currents using an mcu. and one of those things that keep coming back are the shunt wires.
while i'd guess many people would simply buy pre-made shunt resistances, the low costs ones aren't really expensive, but that literally even very slight connections variation between the shunt and the measuring device e.g. a current sense amplifier would have changed those milli-ohms and affects the accuracy of the measurements.
given this i've decided to make do with simple bare nichrome or constantan wires
here is a little python script
and sample run
this would let you estimate the length of wire needed, and the somewhat harder task would be to literally measure that resistance.
i'd guess things like kelvin bridges would help but that it isn't easy to make a good kelvin bridge and the precision parts may be costly.
but if extreme precision (and accuracy) isn't too critical, one could use precision resistors that cost modestly higher to calibrate the shunt that is perhaps soldered in place with its current sense amplifier. in this way using the precision resistor in series with the shunt, one could estimate the currents from the voltage measurements i = v/r.
the current sense amplifier will amplify the voltage across the shunt so that it is within the voltage granularity of conventional adcs common to micro controllers.
with the voltage across the shunt known and the current known (estimated from the precision resistor), one can estimate the shunt resistance that is connected in place with the current sense amplifier.
while i'd guess many people would simply buy pre-made shunt resistances, the low costs ones aren't really expensive, but that literally even very slight connections variation between the shunt and the measuring device e.g. a current sense amplifier would have changed those milli-ohms and affects the accuracy of the measurements.
given this i've decided to make do with simple bare nichrome or constantan wires
here is a little python script
Code:
#!/usr/bin/python3
import math
resistivity = { 'nichrome' : 1.1E-6, \
'constantan': 4.9E-7}
# mat material
# d diameter mm
# R needed resistance milli ohm
def calcres(mat, d, R):
print(mat)
print ('diameter : ' + str(d) + ' mm')
r1 = d * 1E-3 / 2.0
a = math.pi * r1 * r1
print ('resistivity : ' + str(resistivity[mat]) + ' ohm.m')
print ('resistance : ' + str(R) + ' milli ohm')
l = R * a / resistivity[mat]
print ('length : ' + str(l) + ' mm')
#50 milliohm
ohms_needed = 50
#wire dimeter mm
d = 0.5
calcres('nichrome', d, ohms_needed)
print('')
calcres('constantan', d, ohms_needed)
Code:
nichrome
diameter : 0.5 mm
resistivity : 1.1e-06 ohm.m
resistance : 50 milli ohm
length : 8.924979129516457 mm
constantan
diameter : 0.5 mm
resistivity : 4.9e-07 ohm.m
resistance : 50 milli ohm
length : 20.035667433608374 mm
i'd guess things like kelvin bridges would help but that it isn't easy to make a good kelvin bridge and the precision parts may be costly.
but if extreme precision (and accuracy) isn't too critical, one could use precision resistors that cost modestly higher to calibrate the shunt that is perhaps soldered in place with its current sense amplifier. in this way using the precision resistor in series with the shunt, one could estimate the currents from the voltage measurements i = v/r.
the current sense amplifier will amplify the voltage across the shunt so that it is within the voltage granularity of conventional adcs common to micro controllers.
with the voltage across the shunt known and the current known (estimated from the precision resistor), one can estimate the shunt resistance that is connected in place with the current sense amplifier.
Last edited: