# Innacurate readings

**URL:** <https://forum.core-electronics.com.au/t/innacurate-readings/3668>\
**Category:** Pololu\
**Created:** [12 October 2018 03:01 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668 "2018-10-12T03:01:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben31563](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Ben31563](https://forum.core-electronics.com.au/u/Ben31563)\
**Post date:** [12 October 2018 03:01 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/1 "2018-10-12T03:01:33Z")

</div>

Hi there,  
I’m using [a ACS711EX Current Sensor](https://core-electronics.com.au/acs711ex-current-sensor-carrier-31a-to-31a.html) 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

---

<div class="post-metadata">

**Author:** ![Clinton](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/clinton/32/1515_2.png) [@Clinton](https://forum.core-electronics.com.au/u/Clinton)\
**Post date:** [12 October 2018 03:47 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/2 "2018-10-12T03:47:04Z")

</div>

I’m not sure what is going on with the voltage conversion, the Amp conversion seems correct from the [Pololu](https://www.pololu.com/product/2453) 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.

---

<div class="post-metadata">

**Author:** ![Ben31563](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Ben31563](https://forum.core-electronics.com.au/u/Ben31563)\
**Post date:** [12 October 2018 04:41 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/3 "2018-10-12T04:41:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Clinton](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/clinton/32/1515_2.png) [@Clinton](https://forum.core-electronics.com.au/u/Clinton)\
**Post date:** [12 October 2018 04:47 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/4 "2018-10-12T04:47:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Ben31563](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Ben31563](https://forum.core-electronics.com.au/u/Ben31563)\
**Post date:** [12 October 2018 05:24 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/5 "2018-10-12T05:24:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Clinton](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/clinton/32/1515_2.png) [@Clinton](https://forum.core-electronics.com.au/u/Clinton)\
**Post date:** [12 October 2018 10:01 UTC](https://forum.core-electronics.com.au/t/innacurate-readings/3668/6 "2018-10-12T10:01:28Z")

</div>

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.
