SolarTrap
Computer
- May 5, 2014
- 89
Hello All,
I am using a hall sensors (ACS756, 24VDC, 50A bi-directional, link) to build a battery gauge. The problem is the 'zero point' of the sensor. The sensor is fed by 5V and by the specs sheet it should deliver 2.5V if no current is flowing. I am using the analog input of an ATmeaga2560 to measure that voltage. This is my code:
V_ARDUINO = 5.0 and the zeroAbOffset is a value that I have measured when I 'calibrate' the sensor. I take 10000 measurements when no current is flowing and average them.
This comes out between 511-509 and seems to fluctuate for unknown reasons. It also seems to be temperature dependent. Since the minimal resolution of the sensor (in combination with 10 bits A/D) is +/- 0.122A this means quite a big difference and could throw SOC by a lot.
Any experience with this?
Markus
I am using a hall sensors (ACS756, 24VDC, 50A bi-directional, link) to build a battery gauge. The problem is the 'zero point' of the sensor. The sensor is fed by 5V and by the specs sheet it should deliver 2.5V if no current is flowing. I am using the analog input of an ATmeaga2560 to measure that voltage. This is my code:
C:
float currBattAmps(float raw)
{
return ((V_ARDUINO*(raw -zeroAbOffset)/1023.)/ -.04); // 0.04 for 50A
}
V_ARDUINO = 5.0 and the zeroAbOffset is a value that I have measured when I 'calibrate' the sensor. I take 10000 measurements when no current is flowing and average them.
This comes out between 511-509 and seems to fluctuate for unknown reasons. It also seems to be temperature dependent. Since the minimal resolution of the sensor (in combination with 10 bits A/D) is +/- 0.122A this means quite a big difference and could throw SOC by a lot.
Any experience with this?
Markus