nRF54L15 BLE Sensorhub: Live FFT & IMU via WebBluetooth
nRF54L15 sensorhub with PDM microphone FFT (32 bands), LSM6DS3TR-C IMU, and a browser-native WebBluetooth dashboard. No app, no server, live spectrogram in the browser.
Same XIAO nRF54L15 hardware as the LoRa P2P project, but a completely different firmware profile. BLE is on, LoRaWAN runs in the background, and the PDM microphone feeds a real-time 32-band FFT that streams live to a browser dashboard. No native app, no server, no cloud.
What It Does
The device runs two sensor pipelines in parallel on Zephyr RTOS:
- Audio pipeline: PDM microphone sampled at 16 kHz, 512-point FFT computed on-chip via CMSIS-DSP, result compressed to 32 frequency bands and streamed over BLE every ~50 ms
- Motion pipeline: LSM6DS3TR-C IMU polled every 500 ms, X/Y/Z acceleration sent as JSON over the same BLE connection
Both streams land in a single browser tab over Web Bluetooth. No pairing dialog, no driver install, just a URL.
Hardware Platform
The sensorhub runs on the same stacked module setup as the LoRa post:
- XIAO nRF54L15: Cortex-M33, 1.5 MB Flash, 256 KB RAM, onboard LiPo charger and DC/DC buck
- LSM6DS3TR-C: 3-axis accelerometer + gyroscope via I²C, 104 Hz ODR
- PDM microphone: connected to the nRF54L15’s hardware PDM cont
- Battery ADC: 10kΩ/10kΩ voltage divider on AIN7, read via SAADC
Firmware Architecture
Four Zephyr threads handle the workload:
Audio thread (priority 3) captures PDM blocks, runs the 512-point FFT via CMSIS-DSP, and maps the result into 32 logarithmically-spaced bands (0–8 kHz). Each band value is normalised to uint8. The thread signals a semaphore when a fresh FFT frame is ready.
BLE TX thread (priority 5) wakes on that semaphore and pushes the 32-byte band array over BLE NUS (Nordic UART Service). A 50 ms minimum spacing keeps the BLE stack from getting flooded.
Sensor thread (priority 7) reads the IMU every 500 ms and sends a compact JSON payload with timestamp, X/Y/Z acceleration and battery voltage over the same NUS characteristic.
Industry thread (priority 6) is a triggered measurement mode: 10 IMU samples over a 100 ms window, followed by a PDM audio burst. It computes RMS, peak magnitude and audio peak, then sends a combined payload. Useful for periodic spot-checks without continuous BLE streaming.
Both modes are selectable via build config, continuous streaming for live monitoring and industry mode for battery-conscious field use.
BLE Transport
Data flows over BLE NUS (Nordic UART Service), a standard Nordic characteristic that behaves like a serial pipe over BLE. BAS (Battery Service) reports charge level, DIS (Device Information Service) exposes firmware version and model string.
TX power is +8 dBm, giving comfortable indoor range of 10–20 m through walls. The BLE device name is nRF54L15 Bluetooth LE.
WebBluetooth Dashboard
The dashboard is a single index.html. Open it in Chrome or Edge, click Connect, and it pairs directly to the device via the Web Bluetooth API. No installation, no backend, no data leaving the local network.
What the dashboard shows:
- 32-band FFT bar chart with smooth rise/decay and peak-hold markers
- Waterfall spectrogram: scrolling history, neon colormap, GPU-accelerated pixel-scroll
- IMU live chart: X/Y/Z acceleration plotted in real time
- Battery indicator: percentage and voltage, colour-coded (green/yellow/red)
- VU-style loudness indicator driven by the peak FFT band value
The dashboard runs at ~20 fps over the BLE connection. Canvas rendering is done without Chart.js to keep frame overhead low, all plots are drawn directly via the 2D Canvas API.
Use Case
This build was put together for vibration and acoustic monitoring of rotating machinery, motors, pumps, compressors, where you want to see frequency content live without installing anything on a laptop. The waterfall display makes it easy to spot resonance peaks, harmonic content or bearing defect frequencies.
The industry mode makes the same platform work for periodic inspection rounds: walk up to the machine, trigger a measurement, walk away. Battery runtime in that mode is significantly longer than continuous streaming.
Interested in a custom BLE sensorhub with browser dashboard? Get in touch.
Michael Neumüller
Embedded & hardware engineer · Bern