Sensor Data Acquisition¶
TinyMeasurement — The Data Acquisition Pipeline for SHM Nodes
From ADXL355 accelerometer readings to MQTT remote transmission. Covers three acquisition modes and three real-time processing architectures. Fully command-driven via MQTT.
Architecture¶
-
Online Sensing
Continuous timer-based streaming (1~20 Hz)
MQTT / serial real-time output
Long-term structural monitoring -
Offline Sensing
High-rate batch acquisition (100~4000 Hz)
Memory / SD card storage
MQTT report on completion
Modal analysis, impact testing -
RT Processing
Three compile-time architectures:
Ring buffer / DMA double buffer / Dual-core
Real-time threshold-triggered detection
Online damage detection -
Command Handler
MQTT remote commands → control acquisition
SENSE,ONLINE/OFFLINE/RT
Scheduled and delayed triggering
Use Case Index¶
-
Long-term SHM monitoring
→ Online Sensing, low rate (1~20 Hz), continuous MQTT upload
-
Impact testing / modal analysis
→ Offline Sensing, high rate (100~4000 Hz), SD card storage
-
Real-time impact / damage detection
→ RT Processing + threshold trigger, microsecond response
-
Remote command & control
→ Command Handler, start/stop acquisition remotely via MQTT
Quick Start¶
#include "tiny_measurement.h"
// === Online (long-term monitoring) ===
online_sensing_config_t online_cfg = {
.sampling_frequency_hz = 20.0f,
.enable_mqtt = true,
.enable_serial = true,
};
online_sensing_start(&online_cfg); // start 20 Hz streaming
// === Offline (modal test) ===
offline_sensing_config_t offline_cfg = {
.sampling_frequency_hz = 100.0f,
.sampling_duration_sec = 30.0f,
.enable_memory = true,
.enable_sd = true,
.enable_mqtt_report = true,
};
offline_sensing_start(&offline_cfg);
// === RT Processing (impact detection) ===
rt_process_config_t rt_cfg = {
.sampling_frequency_hz = 100.0f,
.enable_accel_detection = true,
};
rt_process_init(&rt_cfg);
rt_process_start();
Mode Comparison¶
| Online | Offline | RT Processing | |
|---|---|---|---|
| Rate | 1~20 Hz | 100~4000 Hz | 20~1000 Hz |
| Duration | Continuous | Bounded (seconds) | Continuous |
| Output | MQTT stream / serial | Memory / SD / MQTT report | Processed results |
| Use case | Long-term monitoring | Modal analysis | Impact/damage detection |
| Trigger | MQTT command | MQTT (supports delay) | MQTT + auto-threshold |