Innacurate readings

Hi there,
I’m using a ACS711EX Current Sensor on a Photon. I’m getting a reading of around 7 amps which is way out, it should be 50 - 120mA with the loads i have on it. my interpretation of the equation is this
const float VCC=3.34;
int rawCurrent = analogRead(A2);
float cVolts = rawCurrent*VCC/4095;
Amps = (73.3 * (cVolts / VCC) - 36.7);

any idea whether this is correct, and for that matter why the absolute figure of 36.7?

Thanks
Ben

I’m not sure what is going on with the voltage conversion, the Amp conversion seems correct from the Pololu part description(The 36.7 comes from half 73.3). What I would do is output the rawCurrent and cVolts to the console and see if they are giving reasonable answers. I think that the zero points of cVolts should be at 2047 as it goes positive and negative.

Thanks Clinton,
the 36.7 make s sense now. and i found an operator error (i was reading from the wrong pin)

with almost no load on i get the following
current is much closer now with a small load of approx 0.2 amps but still reads negative amps even with a minimal load, and below remains constant no matter what…
cVolt 1.716083 (or there abouts)
rawCurrent 0.000000

You will need to output the raw currend with %d not %f as it is an integer type so it is getting confused and printing zero. Are the Negative amps of about the correct magnitude?

awesome, still learning the language, with %d i get readings in the 2049 (minimal load) but -0.050 current (should be around 0.045) and 2067 with load and 0.280 (should be around 0.200 if the LEDs rating is correct).

oddly enough, with no load at all, current now reads 7.81.

i wonder it the FAULT needs to be connected or grounded?

The 36.7 could be throwing it off as half of 73.3 is actually 36.65. Also the 73.3 volts and vcc will be typical values so you could try adjusting them to see if you can tune it to the right value.
I would change
Amps = (73.3 * (cVolts / VCC) - 36.7);
to
tuneVar= 73.3; Amps = (tuneVar*(cVolts/VCC)-(tuneVar/2));

and just tweak it until the value is right.

1 Like