Notes / Sensors & Signal Processing
Sensor basics: the numbers to look at in a datasheet
How a physical quantity becomes a voltage or data, and the range, resolution, accuracy and response speed you compare when choosing a sensor.
A sensor turns a physical quantity (temperature, acceleration, magnetic field, distance) into an electrical signal. There are three main kinds of output.
| Output | Examples | MCU connection |
|---|---|---|
| Analog voltage | Thermistor divider, Hall current sensor | ADC |
| Digital communication | MPU6050, BME280, VL53L0X | I2C, SPI |
| Pulse / frequency | Encoder, ultrasonic echo, Hall switch | Timer capture, GPIO interrupt |
Datasheet terms
| Term | Meaning |
|---|---|
| Measurement range | ±2 g, -40 to 125 °C |
| Resolution | The smallest change that can be distinguished |
| Accuracy | Difference from the true value (offset + gain error + non-linearity) |
| Sensitivity | Output per unit of the physical quantity (mV/g, LSB/°/s) |
| Noise density | µg/√Hz and the like. More bandwidth means more noise |
| Response time / ODR | How quickly and how often it gives a new value |
| Temperature drift | How much the offset changes with temperature |
Resolution and accuracy are different
Even a 16-bit sensor is not accurate if its offset is large. Resolution is "how finely it divides" and accuracy is "how right it is". Most sensors get close to their datasheet accuracy only after calibration of the offset and gain.