Kemp’s Blog

A technical blog about technical things

Be careful with relative error

When looking at sensor datasheets or similar documents there is a subtlety about relative error that may not be immediately apparent. Relative error is quoted as a percentage of the reading, but in some cases the range of interest to you might be small and have a large offset from zero.

Let’s take an extreme case. Imagine you have a temperature sensor that reads in Kelvin and you are measuring human skin temperature. It’s contrived I know, but bear with me here. In this case, your measurement range of interest is going to be around 300 K to 315 K. Now image you have a sensor with a relative error of 0.5%. Sounds good doesn’t it? Unfortunately that means that at a reading of 305 K (31.85 °C), your error is going to be 1.525 °C. That is slightly over 10% of your range—not so great anymore. Note that I was optimistic with the range size as well (you’re probably not going to be measuring skin temperatures around 40 °C), which makes the error even worse.

How does this translate to a more sensible measurement approach? In most cases you won’t have to worry. Op-amps historically have problems when the inputs have large DC offsets because the difference in the inputs becomes tiny versus the absolute input values. Weighing people is something I’m looking at currently, where a 1% relative error in the scales becomes more like a 2.25% error compared to the useful range. Not a crippling problem, but something to be aware of.