Improve Your Arduino-Based Measuring Devices by Implementing Error Correction

There are countless projects for measuring devices based on Arduino, often using quite basic measurement sensors and circuits. Still, we can improve accuracy with a one-time calibration against a reference device at a few (or more) points, implementing the simplest linear interpolation/mapping/correcting function, just a few lines of code. Please see the first picture. It’s a shame to miss this easy opportunity to – potentially dramatically – upgrade your device’s capabilities. Be it a wattmetter, a weighing scale, an SWR-meter, a thermometer or whatever, the only prerequisite is the consistency (repeatability) of the raw measurement results that are passed to the function as arguments. The function returns final results, corrected in accordance with the calibration data.

That is all. The IDEAL[] values were produced by the reference device. The corresponding FOUND[] values were produced by the device that we are trying to improve. The reference device can be any similar device that has been proven to have more accuracy than your project aspires to.


A mathematically more advanced method would provide overall smoother interpolation. On a graph, the pairs of consecutive calibration points would be connected by line segments (splines) representing higher order polynomials. Fortunately, there are libraries that do the job while hiding the underlying complexity from the user. The added useful accuracy will rely on high sensor data repeatability, right choice of mode, floating-point precision, on the display device precision etc. So this approach could be overkill in the basic Nano/Uno context.

The picture shows a quick test program using the library from
https://github.com/luisllamasbinaburo/Arduino-Interpolation

Leave a Reply