That points to the calibration being off. If you give me a couple of reading pairs for externally measured current and voltage on A2 I can check what you've got?
The line of code in your last post is the current calibration, but I think the decimal place is in the wrong place 36.13 instead of 3.613? Also didn't you calculate it as 37.17 in the post before that?
Forget my bit about disabling the filtering - I was getting confused with a different bit of code sorry!
HI, here is 4 readings to work with.... 2.00A = 56 mV (35.7) 7.07A = 189 mV (37.4) 13.23A = 350 mV (37.8) 17.78A = 468 mV (38.0) 21.15A = 557 mV (37.9)
I flashed the Arduino again at 37.9 constant and checked reading at 17.8 A input and was showing 17.0A on APP. I gradually increased the amps until I got movement on the APP and it then moved to 18.0A but stepped though 3 intermediate readings on the way there over about a second.
On the above, I used power supply with 5 wraps around the sensor.
To check, I did another test using our battery test rig which was reading 16.84A (clamp meter as used above)and 16.8A (battery test meter) with corresponding A2 reading of 440mV (38.3) and the APP reading 16.0A
So, it seems to be rounding down to a whole number which I guess is in the software?
@rowan, just a quick note one this subject if testing with a power supply - does the code still contain the auto zero'ing function at init? Just wondering if this could accidentally throw off the readings if the PSU is always on and 'simulating' current.
Colinm, it may be worth checking the resistor values around the op amp with a multimeter you trust (power off, board disconnected, sensor disconnected). Ideally R20 + R21 should closely match each other (4k7) and R22 + R23 should closely match each other (10k). A mismatch here in hardware would show as a current offset.
Most of the readings you give from the app are whole numbers, then you have the occasional decimal reading... If it was rounding I don't understand how it rounds to a whole number most of the time but not all of the time. It's odd as I'd expect it to be either or. It does sound like a software issue though.