Read Input 4-10 mA

Hi all

i have a problem to read input 4-20 mA in my loop calibrator (fluke) show 15,6 mA then serial read arduino show 15,0 this my sketch

float analog=A0; float sen=0; float lop=0;

void setup() { Serial.begin(9600); }

void loop() { sen = analogRead(analog); lop = map(sen,205,1023,5,20); Serial.println(lop,DEC); Serial.println("\n"); delay(500); }

any suggestion ??

  lop = map(sen,205,1023,50,200);

As knut_ny has pointed out (without any explanation), you are throwing away the decimal place in your map function (it only does integer maths). Map it to a larger range then divide later or just do the map function yourself using floating point values.