If you measure a 140Amp sensor (+70, -70) with a 10-bit A/D (1024 values),
then don't expect a resolution of two decimal places.
Two decimal places would require at least 14000 counts.
This seems to be a ratiometric sensor, in which case the datasheet is wrong (and so is your code).
This sensor sems to outputs VCC/2 with zero current. That might be 2.500volt on a 5.00volt supply.
But an Arduino 5volt supply is never exactly that.
The code should use an A/D value of 512 as zero reference, not 2.5volt.
All you need is this line.
float current = (analogRead(wcs1700) - 512) * 0.1386;
Then print to one decimal place.
Serial.println(current, 1);
const byte wcs1700 = A0;
float zero = 511.5; // zero calibrate
float span = 0.1386; // max Amp calibrate
float current;
void setup() {
Serial.begin(9600);
}
void loop() {
float current = (analogRead(wcs1700) - zero) * span;
Serial.print(current, 1);
Serial.println(" Amp");
delay(1000);
}
Smoothing code (multiple reads and averaging) might still be needed.
Leo..