Wiki

Technical reference for system integrators and engineers.

IMU

A six-axis accelerometer and gyroscope, reported either as raw samples or as metrics computed on the device — activity level, tilt, shock magnitude, dominant vibration frequency and a motion classification.

Both forms travel as Sensor TLV records: 0x01 raw, 0x02 aggregate. A device can emit either, and the choice is not simply a bandwidth trade.

Why aggregate

Aggregation is not about smaller frames. It decouples the sample rate from the transmit rate, and that is the only way some of the metrics can exist at all:

Raw — 0x01 Aggregate — 0x02 every sample is transmitted so the sample rate is capped by airtime ≈ 5 Hz below Nyquist for vibration analysis 12 B per sample sampled locally, summarised, then sent so the two rates are independent 100–400 Hz sampled · ~24 B every few seconds dominant frequency becomes measurable fixed 24 B regardless of rate
Raw mode sends less information for more airtime. Aggregated mode is not a compressed version of it — it reports things raw mode cannot capture.

Raw sample — 0x01

accel[3]  int16     6 B
gyro[3]   int16     6 B
                   12 B per sample

Units are the sensor's native LSBs, not physical units. The full-scale setting needed to convert them is reported once in the aggregate record rather than repeated on every sample — carrying it per sample would cost two bytes each time to say something that rarely changes.

A consumer receiving only raw records has no full-scale code and cannot convert to g or dps. Raw mode is intended alongside aggregates, not instead of them.

Aggregate — 0x02

FieldTypeUnitMeaning
window_msuint16msaggregation window
sample_countuint16samples actually included
gravity[3]int16 ×3LSBmean acceleration — gives tilt and attitude
accel_rmsuint16milli-gRMS of |a| − g — activity level
accel_peakuint16milli-gmax of |a| − g — shock magnitude
gyro_rmsuint16milli-dpsrotational activity
dom_freq_mhzuint16milli-Hzdominant vibration frequency
dom_ampuint16amplitude at that frequency
accel_fsuint8codeaccelerometer full scale — converts raw LSBs
gyro_fsuint8codegyroscope full scale
motion_stateuint8enumclassification, see below
event_flagsuint8bitsevents since the last report

Total 24 bytes, fixed regardless of how many samples went into it.

accel_rms and accel_peak answer different questions and both are needed: a machine can have high sustained vibration with no shocks, or sit quiet and take one impact. RMS describes the former, peak the latter, and an average of the two describes neither.

dom_freq_mhz is in milli-Hertz — 25 000 means 25 Hz. The resolution matters for rotating machinery, where a shift of a fraction of a hertz is the signal.

Motion classification

Classified on the device, so a consumer does not have to infer it from the numbers:

ValueState
0Static
1Moving
2Impact
3Freefall

Event flags

One byte of sticky bits, cleared once reported — so an event occurring between reports cannot be missed by sampling at the wrong moment:

BitEvent
0Impact
1Freefall
2Tilt
3No motion
Any event bit forces immediate transmission. The aggregation window is not waited out — a fall cannot sit in a buffer for ten seconds. A record arriving with event bits set will therefore have a shorter window_ms and lower sample_count than a scheduled one; that is the mechanism working, not a truncated frame.

Because the bits are sticky and cleared on report, event_flags describes the interval since the previous record rather than the instant of transmission. motion_state is the opposite — it is the state at the close of the window. The two can legitimately disagree: an impact bit set with motion_state = static means something struck a device that has since come to rest.

Measurement time

The record is stamped when the aggregation window closes, on the same clock as the ranging measurement — see Sensor TLV. The frame header carries beacon_seq and offset_ms; a beacon_seq of 0xFFFFFFFF marks an unsynced sample that must not be fused with a position.

Related

  • Sensor TLV — the record envelope and the full catalogue.
  • Barometer — vertical movement, which pairs with vert_vel for fall detection.
  • MQTT — how these fields appear in the Imu object of a /Sensors message.