Measurement principles and uncertainty
UAT 205 Sensors and Instrumentation Systems
Lesson
By the end of this module you will be able to
- Explain the measurement chain and sensor characteristics such as range, resolution, sensitivity and nonlinearity
- Build a calibration curve by least squares and compare it with two-point calibration
- Evaluate combined uncertainty with the law of propagation and sensitivity coefficients
- Compute ADC resolution and predict the apparent frequency when aliasing occurs
- Distinguish accuracy, trueness and precision, and systematic, random and gross errors, using the VIM definitions
- Design simple signal conditioning: a Wheatstone bridge, an instrumentation-amplifier gain and an RC anti-alias filter
- Compare NTC thermistors, RTDs, thermocouples and IC temperature sensors, and read an NTC through a voltage divider
Why this matters
A drone knows everything about itself through sensors. If a sensor reads slightly wrong, the controller decides on wrong numbers, and the result is a drone that will not hold still, an altitude that drifts, or survey data that cannot be used. This course teaches how each type of sensor measures, how it can be wrong, and how to calibrate it.
The whole course uses one hypothetical case: a lab building a fixed-wing VTOL drone to survey farm plots, which must calibrate its whole sensor set before mission flights. All numbers are made up for practice unless a source is given. The Python code for every module can be downloaded from /downloads/uat-205/.
The measurement chain
A single measurement passes through several stages. The sensor converts a physical quantity, such as temperature or pressure, into an electrical signal. Signal conditioning amplifies and filters it, the ADC converts it to a number, and software applies calibration to convert it back into the desired unit. Every stage can add error, so a complete measurement result always has both a value and an uncertainty (Fraden, 2016).
Characteristics to read from the datasheet before choosing a sensor:
- Range: the lowest to highest measurable value; the top of the range is full scale (FS).
- Resolution: the smallest change the system can distinguish, which is not the same as accuracy (see the section on accuracy and precision below).
- Sensitivity: output change per unit input, such as mV/°C.
- Nonlinearity: deviation from the straight line used to represent the sensor, often given as %FS.
- Bandwidth and response time: how quickly the sensor follows changes.
The calibration curve
Calibration compares sensor readings with reference values of known uncertainty, then finds the relationship used to correct readings. The simplest method is two-point, using the two end points. Least squares uses every point to find the line with the smallest sum of squared errors, as described in the NIST statistics handbook.
Once the equation is found, the uncertainty of the result is needed. The GUM (JCGM 100:2008), clause 5.1.2, gives the law of propagation of uncertainty: if and the inputs are uncorrelated, the combined uncertainty is , where is the sensitivity coefficient, telling how strongly that input affects the result.
Example 1 Calibrating a battery temperature sensor
The sensor is immersed alongside a reference thermometer (standard uncertainty 0.10 °C) at six temperatures. The multimeter reads voltage with a standard uncertainty of 2 mV.
import math
import statistics as st
T_REF = [0, 10, 20, 30, 40, 50] # °C from the reference thermometer
V = [0.502, 0.598, 0.701, 0.797, 0.905, 1.001] # V from the sensor
FS = 50.0 # °C full scale
U_V, U_REF = 0.002, 0.10 # V, °C standard uncertainties
two_point = ((V[-1] - V[0]) / (T_REF[-1] - T_REF[0]), V[0])
mt, mv = st.mean(T_REF), st.mean(V)
gain = sum((t - mt) * (v - mv) for t, v in zip(T_REF, V)) / sum((t - mt) ** 2 for t in T_REF)
least = (gain, mv - gain * mt)
for name, (a, b) in (("two-point", two_point), ("least squares", least)):
res = [(v - b) / a - t for t, v in zip(T_REF, V)]
print(f"{name:<14} {a * 1000:.3f} mV/°C, offset {b:.4f} V, residuals "
+ " ".join(f"{r:+.2f}" for r in res) + f" °C, worst {max(map(abs, res)) / FS:.2%} FS")
a, b = least
res = [(v - b) / a - t for t, v in zip(T_REF, V)]
u_fit = math.sqrt(sum(r * r for r in res) / (len(res) - 2))
c_v = 1 / a # °C per V (sensitivity coefficient)
u_c = math.sqrt((c_v * U_V) ** 2 + U_REF ** 2 + u_fit ** 2)
print(f"c_V = {c_v:.1f} °C/V, u from voltage {c_v * U_V:.2f} °C, u_fit {u_fit:.2f} °C")
print(f"combined u_c = {u_c:.2f} °C, expanded U = {2 * u_c:.2f} °C (k = 2)")
two-point 9.980 mV/°C, offset 0.5020 V, residuals +0.00 -0.38 -0.06 -0.44 +0.38 +0.00 °C, worst 0.88% FS
least squares 10.034 mV/°C, offset 0.4998 V, residuals +0.22 -0.21 +0.05 -0.38 +0.38 -0.05 °C, worst 0.76% FS
c_V = 99.7 °C/V, u from voltage 0.20 °C, u_fit 0.31 °C
combined u_c = 0.38 °C, expanded U = 0.77 °C (k = 2)
The least-squares line spreads the error across all points, so its worst error is lower than two-point calibration. The combined uncertainty comes from three sources: the multimeter, magnified by ; the reference thermometer; and the nonlinearity the straight line cannot explain. The largest source is the nonlinearity; to improve the result, reduce it first, for example by fitting a quadratic instead of a line.
ADC and sampling
An -bit ADC with reference voltage divides the range into levels; one level is one LSB. Analog Devices tutorial MT-001 shows that ideal quantization noise has an rms value of , and the ideal SNR for a full-scale sine wave is dB.
The other key issue is the sampling rate. Following Shannon (1949), you must sample faster than twice the highest frequency in the signal. Otherwise high frequencies disguise themselves as low frequencies that are not really there, which is called aliasing, like car wheels in a video that seem to turn slowly or backwards. On a drone, propeller vibration sampled too slowly can become a slow oscillation that the controller tries to correct. Signal conditioning therefore needs an anti-aliasing filter before the ADC.
Example 2 ADC resolution and alias frequencies
import math
N, VREF = 12, 3.3
lsb = VREF / 2 ** N
print(f"LSB {lsb * 1000:.3f} mV, quantization noise {lsb / math.sqrt(12) * 1000:.3f} mV rms, "
f"ideal SNR {6.02 * N + 1.76:.1f} dB")
def alias(f, fs):
return abs(f - round(f / fs) * fs)
for f, fs in ((180, 200), (1170, 1000), (450, 1000)):
print(f"{f:>5} Hz sampled at {fs:>4} Hz appears at {alias(f, fs):>3.0f} Hz")
diff = max(abs(math.sin(2 * math.pi * 180 * n / 200) + math.sin(2 * math.pi * 20 * n / 200)) for n in range(200))
print("180 Hz samples match an inverted 20 Hz wave:", diff < 1e-9)
LSB 0.806 mV, quantization noise 0.233 mV rms, ideal SNR 74.0 dB
180 Hz sampled at 200 Hz appears at 20 Hz
1170 Hz sampled at 1000 Hz appears at 170 Hz
450 Hz sampled at 1000 Hz appears at 450 Hz
180 Hz samples match an inverted 20 Hz wave: True
A 180 Hz vibration sampled at 200 Hz produces samples identical to a 20 Hz wave at every point; once sampled, software cannot tell them apart, so filtering must happen before sampling. 450 Hz sampled at 1,000 Hz does not alias because it is below half the sampling rate.
Accuracy, precision and measurement error
Datasheets and test reports use “accurate” and “precise” loosely, but the International Vocabulary of Metrology (VIM, JCGM 200:2012) gives each word a fixed meaning, and UAT 106 module 1 used the same definitions:
- Measurement error (VIM 2.16) is the measured value minus a reference value. It has two parts
- Systematic error (VIM 2.17) stays constant, or changes predictably, when the measurement is repeated. Its estimate is the bias (VIM 2.18), such as a rangefinder that always reads 5 cm long. The NIST statistics handbook (section 2.1.1.3) notes that bias can be removed or reduced by calibration
- Random error (VIM 2.19) varies unpredictably from one repeat to the next. It cannot be corrected reading by reading, but it shrinks when many readings are averaged
- Trueness (VIM 2.14) is how close the average of many repeats is to the reference value; it is the opposite of bias
- Precision (VIM 2.15) is how close repeated readings are to each other under stated conditions, usually given as a standard deviation. Repeatability means the same operator, instrument and place over a short time; reproducibility means different operators, instruments or places
- Accuracy (VIM 2.13) is how close a single measured value is to the true value, so it needs both trueness and precision. VIM notes that accuracy is a concept, not a number, so a report should give the bias and standard deviation, or an RMSE, or the uncertainty from the calibration section above, rather than “accuracy = 2 cm” with no definition
Two more kinds of error do not fit the scheme above. Resolution (the smallest step the output can show) limits how finely we can read, but a sensor can have fine resolution and still be badly biased. A gross error (blunder), such as reading the wrong channel or a laser spot landing on a leaf instead of the ground, is not random scatter; it must be found and removed with its cause recorded, not averaged in.
Example 3 Two rangefinders at a known height
For the VTOL’s landing sensor the lab holds two rangefinders still at a reference height of 2.000 m, set with a calibrated tape, and records 10 readings from each (values assumed).
import statistics as st
REF = 2.000 # m, height set with a calibrated tape
readings = {
"sensor A": [2.052, 2.049, 2.051, 2.050, 2.048, 2.052, 2.050, 2.049, 2.051, 2.050],
"sensor B": [1.97, 2.04, 1.99, 2.03, 1.96, 2.02, 2.01, 1.98, 2.05, 1.97],
}
bias = {}
for name, x in readings.items():
err = [v - REF for v in x]
bias[name] = st.mean(err)
rmse = st.mean([e * e for e in err]) ** 0.5
print(f"{name}: bias {bias[name] * 1000:+.1f} mm, SD {st.stdev(x) * 1000:.1f} mm, RMSE {rmse * 1000:.1f} mm")
fixed = [v - bias["sensor A"] for v in readings["sensor A"]]
print(f"sensor A after bias correction: RMSE {st.mean([(v - REF) ** 2 for v in fixed]) ** 0.5 * 1000:.1f} mm")
print(f"sensor B, averaging 10 readings: SD of the mean {st.stdev(readings['sensor B']) / 10 ** 0.5 * 1000:.1f} mm")
sensor A: bias +50.2 mm, SD 1.3 mm, RMSE 50.2 mm
sensor B: bias +2.0 mm, SD 32.2 mm, RMSE 30.7 mm
sensor A after bias correction: RMSE 1.2 mm
sensor B, averaging 10 readings: SD of the mean 10.2 mm
Sensor A is very precise (SD 1.3 mm) but not true: it reads 5 cm long every time, so its accuracy is poor. Sensor B is almost unbiased but imprecise. The two problems need different cures. A’s systematic error is removed by calibration, which brings its RMSE down to about 1 mm; B’s random error is reduced by averaging, but only by , and averaging costs time that a landing drone may not have. The correction for A was estimated from these same 10 readings, so, as in Example 1, it must be checked with new readings at other heights before it is trusted.
Signal conditioning: bridges and amplifiers
Signal conditioning is the circuitry between the sensor and the ADC that turns a weak or awkward signal into a clean voltage that fills the ADC’s range. Its main jobs are:
- Converting a change in resistance, current or charge into a voltage, for example a Wheatstone bridge for resistive sensors or a transimpedance amplifier for photodiodes (module 4)
- Amplifying a millivolt signal so that it spans most of the ADC’s input range
- Rejecting common-mode voltage, the voltage that both inputs share, while keeping the small difference between them
- Filtering out noise and frequencies above half the sampling rate (the anti-aliasing filter of the previous section)
A Wheatstone bridge is two voltage dividers side by side across an excitation voltage . TI application note SBOA575 gives its output as , which is zero when the bridge is balanced. A strain gauge changes its resistance by , where is the gauge factor and the strain (Fraden, 2016), so a bridge with one active gauge gives about . A load cell, such as the one in a motor thrust stand, has four gauges in a full bridge and is rated in mV of output per V of excitation.
The bridge output sits on top of about half the excitation voltage, so it is amplified with an instrumentation amplifier (in-amp), which amplifies only the difference between its inputs and has a very high common-mode rejection ratio (CMRR). For TI’s INA128 the gain is set by one resistor, . Before choosing a part, check its datasheet for the allowed common-mode range and output swing at your supply voltage.
Example 4 A thrust-stand load cell into a 12-bit ADC
The lab’s thrust stand uses a 5 kg load cell rated 2 mV/V, excited at 5 V, read by the same 12-bit, 3.3 V ADC as Example 2 (values assumed). The gauge values in the first part are also assumed.
import math
def bridge(v_exc, r1, r2, r3, r4):
return v_exc * (r2 / (r1 + r2) - r3 / (r3 + r4)) # TI SBOA575 equation 1
R, GF, STRAIN = 350.0, 2.0, 1000e-6 # Ω gauge, gauge factor, 1000 µm/m (assumed)
dr = R * GF * STRAIN
print(f"quarter bridge: exact {bridge(5.0, R, R + dr, R, R) * 1000:.3f} mV, "
f"approximation V*GF*strain/4 = {5.0 * GF * STRAIN / 4 * 1000:.3f} mV")
V_EXC, SENS, FS_G = 5.0, 2e-3, 5000 # load cell: 5 V, 2 mV/V, 5 kg (assumed)
v_fs = V_EXC * SENS
lsb = 3.3 / 2 ** 12 # 12-bit ADC from Example 2
print(f"full-scale bridge output {v_fs * 1000:.1f} mV; without an amplifier one ADC count = {lsb / (v_fs / FS_G):.0f} g")
g_target = 3.0 / v_fs
rg = 50e3 / (g_target - 1) # INA128 gain equation G = 1 + 50 kΩ / RG
gain = 1 + 50e3 / 169 # nearest standard resistor 169 Ω
print(f"gain wanted {g_target:.0f} -> RG {rg:.1f} Ω -> use 169 Ω, G = {gain:.1f}, "
f"full scale {v_fs * gain:.3f} V, one count = {lsb / (v_fs / FS_G) / gain:.2f} g")
fc = 1 / (2 * math.pi * 1e3 * 1e-6) # RC low-pass, 1 kΩ and 1 µF
print(f"RC anti-alias filter: cutoff {fc:.0f} Hz, passes {1 / math.hypot(1, 500 / fc):.0%} of a 500 Hz vibration")
quarter bridge: exact 2.498 mV, approximation V*GF*strain/4 = 2.500 mV
full-scale bridge output 10.0 mV; without an amplifier one ADC count = 403 g
gain wanted 300 -> RG 167.2 Ω -> use 169 Ω, G = 296.9, full scale 2.969 V, one count = 1.36 g
RC anti-alias filter: cutoff 159 Hz, passes 30% of a 500 Hz vibration
Wired straight to the ADC, the whole 5 kg range would use only about 12 of the 4,096 codes, and one count would be about 400 g, useless for measuring thrust. With a gain of about 300 the full scale reaches 2.97 V, leaving headroom below 3.3 V, and one count becomes about 1.4 g. The quarter-bridge line shows the approximation is good to 0.1% at this strain. A simple RC low-pass filter at about 160 Hz before the ADC still passes 30% of a 500 Hz vibration, half of a 1 kHz sampling rate, because one resistor and one capacitor roll off slowly; strong vibration near that frequency needs a higher-order filter or a faster sampling rate. Remember that the amplifier also multiplies its own offset and the bridge’s zero error, so the stand still needs the calibration of Example 1, with known weights.
Temperature sensors
Temperature matters all over the VTOL: battery packs must not be charged or flown too hot or too cold, ESCs and motors report their temperature, and the barometer and IMU drift as they warm up. Four kinds of sensor are common (Fraden, 2016):
- NTC thermistor: a ceramic resistor whose resistance falls as temperature rises. TDK’s technical information (following IEC 60539) gives a temperature coefficient of about 2 to 6% per kelvin, roughly ten times that of metals, so it is very sensitive but strongly nonlinear. It is cheap and small, which is why battery packs and chargers use it
- Resistance temperature detector (RTD): a metal, usually platinum, whose resistance rises almost linearly with temperature; a Pt100 has 100 Ω at 0 °C. It is stable and accurate but gives a small change, so it needs a bridge or a precise current source and careful wiring
- Thermocouple: two different metals joined at the hot end produce a small voltage that depends on the temperature difference between that junction and the reference (cold) junction. It covers very high temperatures, such as engine exhausts, but needs cold-junction compensation and tables such as NIST’s thermocouple database (SRD 60) for types B, E, J, K, N, R, S and T
- IC (semiconductor) sensor: a chip with a nearly linear analog output, such as the 10 mV/°C sensor of Example 1, or a digital output; barometers and IMUs contain one to correct their own drift
Two traps apply to all of them. A resistive sensor is heated by its own measuring current, called self-heating; TDK defines the dissipation factor in mW/K as the power that raises the body temperature by 1 K, so the error is about . And the sensor measures its own temperature, not the battery’s core, so good thermal contact matters as much as the electronics.
Example 5 A battery NTC thermistor in a voltage divider
The battery pack has a 10 kΩ NTC thermistor with a B value of 3950 K, read through a divider with a 10 kΩ resistor from 3.3 V (values assumed; real ones come from the thermistor’s datasheet). TDK’s formula 1, with in kelvin, gives the resistance.
import math
R25, B, T25 = 10_000.0, 3950.0, 298.15 # NTC: 10 kΩ at 25 °C, B value in K (assumed datasheet)
VCC, R_FIXED = 3.3, 10_000.0 # divider: fixed resistor to 3.3 V, NTC to ground
def ntc_r(t_c):
return R25 * math.exp(B * (1 / (t_c + 273.15) - 1 / T25)) # TDK formula 1
def divider_v(t_c):
r = ntc_r(t_c)
return VCC * r / (r + R_FIXED)
for t in (25, 45, 60):
print(f"{t} °C: R = {ntc_r(t):>6,.0f} Ω ({ntc_r(t + 1) / ntc_r(t) - 1:+.1%} per °C), "
f"V = {divider_v(t):.3f} V ({(divider_v(t + 1) - divider_v(t)) * 1000:+.0f} mV per °C)")
r45 = ntc_r(45)
p = (VCC / (r45 + R_FIXED)) ** 2 * r45 # power heating the NTC
DELTA = 1.5e-3 # dissipation factor W/K (assumed datasheet)
print(f"self-heating at 45 °C: {p * 1000:.2f} mW / {DELTA * 1000:.1f} mW/K = {p / DELTA:.2f} °C too warm")
25 °C: R = 10,000 Ω (-4.3% per °C), V = 1.650 V (-37 mV per °C)
45 °C: R = 4,348 Ω (-3.8% per °C), V = 1.000 V (-27 mV per °C)
60 °C: R = 2,486 Ω (-3.5% per °C), V = 0.657 V (-18 mV per °C)
self-heating at 45 °C: 0.23 mW / 1.5 mW/K = 0.15 °C too warm
The resistance changes by about 4% per degree, inside TDK’s 2 to 6% range, and the divider turns it into tens of millivolts per degree, far more than one 0.8 mV ADC count, so no amplifier is needed. But the slope halves between 25 °C and 60 °C, so software must convert with the B formula or the manufacturer’s table, not a straight line. Self-heating adds only about 0.15 °C here; a smaller fixed resistor or a higher supply would raise it, which is why low measuring power is a design rule for thermistors.
Module lab
Lab: calibrating a temperature sensor
- Connect an analog temperature sensor to the lab’s microcontroller board and record the ADC resolution.
- Measure alongside a certified reference thermometer at five or more temperatures, waiting for the temperature to settle before each reading.
- Use the code from Example 1 to find the calibration equation and uncertainty budget.
- Measure again at temperatures not used for calibration and check that the errors fall within the computed uncertainty.
- Record a signal from a shaker or motor at two sampling rates and explain the apparent frequencies with Example 2.
Common mistakes
Watch out
- Treating resolution as accuracy.
- Two-point calibration without checking nonlinearity in between.
- Not reporting the uncertainty of the calibration result.
- Checking the result with the same points used for calibration.
- Sampling without an anti-aliasing filter.
- Averaging to fix a bias: averaging reduces random error only; systematic error needs calibration.
- Connecting a millivolt bridge output straight to the ADC, so only a few codes are used.
- Converting an NTC reading with a straight line, or measuring it with so much current that it heats itself.
Summary
- The measurement chain has several stages, and a result needs both a value and an uncertainty.
- Least squares uses every calibration point and reveals nonlinearity through the residuals.
- Combined uncertainty follows the GUM law of propagation with sensitivity coefficients.
- An ADC adds quantization noise of LSB/√12, and signals must be filtered before sampling to prevent aliasing.
- Accuracy needs both trueness (small bias) and precision (small spread); calibration removes systematic error, averaging reduces random error, and gross errors must be found and removed.
- Signal conditioning converts, amplifies and filters: a bridge turns resistance into voltage and an instrumentation amplifier scales millivolts to the ADC range.
- Temperature sensors trade sensitivity, linearity and range: NTC thermistors are sensitive but nonlinear, RTDs stable and nearly linear, thermocouples reach high temperatures, and IC sensors are simple to use.
Check your understanding
- What is the LSB of a 10-bit ADC with a 5 V reference?
- If with V/°C, what is the sensitivity coefficient of ?
- Three uncertainty sources of 0.3, 0.4 and 0 °C combine to what?
- A rangefinder reads 3 cm too long every time with a standard deviation of 1 mm. Is it precise, true, accurate? What fixes it?
- Why filter before the ADC rather than in software afterwards?
Answers
- mV
- °C/V
- °C
- Precise but not true, so not accurate. The error is systematic, so calibration (subtracting the 3 cm bias, then checking with new readings) fixes it; averaging would not.
- Once sampled, the alias and the true frequency produce identical samples, so software cannot separate them.
Key formulas
| Law of propagation of uncertainty (uncorrelated inputs) | |
| ADC resolution and quantization noise | |
| Apparent frequency under aliasing | |
| Wheatstone bridge output | |
| Instrumentation amplifier gain (INA128) | |
| NTC thermistor B-value equation |
Key references
- JCGM. (2008). Evaluation of measurement data — Guide to the expression of uncertainty in measurement (JCGM 100:2008). BIPM. link
- Fraden, J. (2016). Handbook of modern sensors: Physics, designs, and applications (5th ed.). Springer. link
- NIST/SEMATECH. Linear least squares regression (section 4.1.4.1). e-Handbook of statistical methods. link
- Kester, W. Taking the mystery out of the infamous formula, "SNR = 6.02N + 1.76dB," and why you should care (Tutorial MT-001). Analog Devices. link
- Shannon, C. E. (1949). Communication in the presence of noise. Proceedings of the IRE, 37(1), 10–21. link
- JCGM. (2012). International vocabulary of metrology — Basic and general concepts and associated terms (VIM, JCGM 200:2012). BIPM. link
- NIST/SEMATECH. e-Handbook of statistical methods. National Institute of Standards and Technology. link
- Hertneky, B. (2023). High accuracy Wheatstone bridge amplifier circuit to 4-20-mA current loop transmitter (Application Note SBOA575). Texas Instruments. link
- Texas Instruments. (2026). INA12x precision, low-power instrumentation amplifiers (INA128, INA129) datasheet (SBOS051G). link
- EPCOS AG, a TDK Group Company. (2018). NTC thermistors: General technical information. link
- National Institute of Standards and Technology. NIST temperature scale database: Thermocouple tables for the ITS-90 (NIST Standard Reference Database 60, Version 3.0). link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
การสอบเทียบและความไม่แน่นอนของการวัด
Applied level: reading an IMU, fusing data and communicating on time
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results