# Correct the values of a measurement

Hello,

I built a measuring device with which I can measure the insulation in MOhm. Up to a value of 10MOhm, the device is very precise, the only way to make it more and more inaccurate. from a measured value of 10, the measured value deviates more and more from the real value.

I set up a series of measurements with the deviation in percent.

real value measured value Deviation in percent %
0 0 0
1 1 0,0
4,8 4,8 0,0
10 10 0,0
11 10,9 -0,9
14,8 14,3 -3,4
50 45,7 -8,6
60 50 -16,7
100 81,2 -18,8
110 84,4 -23,3
150 110 -26,7
200 130 -35,0

Is it possible to correct the value with Node red so that I can not only measure exactly up to 10 but up to 200?

Greetings Volker

plotting them on a chart I can see that the deviation is not changing linearly

so the simple range node we have may help but will not be accurate.

The simplest way might be to fit it to maybe three straight line segments, then use the measured value to determine which segment to use.

This looks like it should do the job https://flows.nodered.org/node/node-red-contrib-interpolate