A BLE Tag is not only a locator — bolt a sensor onto it and it becomes a wireless sensor node that reports temperature, humidity, motion, or light without any wiring. This article covers how to sample, store, and report sensor data from a tag without draining the coin cell.
What you can sense on a tag
- Temperature / humidity (SHTxx-class, ~1–5 µA when reading, sleep otherwise)
- Pressure (barometer for altitude)
- 3-axis accelerometer (motion / fall / shock)
- Ambient light, magnetic, gas
Each sensor adds a *read energy* plus the *radio energy* to ship the value.
Sampling cadence
Reading a sensor every second sounds safe but burns the battery. Tie the cadence to what the data is for:
- Cold-chain temperature: log every 5–15 min, alert on threshold breach.
- Motion/door events: event-driven, sleep otherwise.
- Environmental trend: 1–10 min is plenty.
Local storage
A tag can’t uplink constantly, so buffer locally. A ring buffer (FIFO) of the last N samples survives a missed connection; on next contact the gateway pulls the backlog. Keep it small — 32–256 samples is typical.
Reporting strategies
- Periodic: push every T regardless. Simple, predictable, wastes energy if nothing changed.
- Event-driven: send only on threshold crossing or motion. Best for battery.
- Delta/report: store deltas; send a full sample only occasionally to resync.
Data compression
Raw float32 × N samples is wasteful on a 32-sample buffer. Use:
- Delta encoding: `d_i = sample_i − sample_{i-1}` (small integers).
- Scale to int8/int16 with a known offset & gain.
- Bit-pack multiple channels.
A 16-sample float32 temp log (64 B) becomes ~16–20 B.
Power math
Per report cycle: sensor read ~5 µA·2 ms + radio TX ~8 mA·20 ms + MCU ~3 mA·50 ms.
For a tag reading temp every 10 min and reporting every hour over BLE:
- Read: 5 µA × 2 ms × 6 = 60 nAh/cycle
- TX: 8 mA × 20 ms = 44 nAh
- Total ≈ 100 nAh/cycle × 24 = 2.4 µAh/day → a CR2032 (225 mAh) lasts >20 years on paper (real life: self-discharge and deep-sleep leakage dominate, ~2–5 yrs).
Reporting over BLE
Two ways:
1. Connected GATT notify: tag connects, sends Sensor Notify, disconnects. Highest flexibility, highest energy.
2. Periodic Advertising with Responses (PAwR): tag broadcasts sensor data in periodic slots; gateway responds. Lowest energy for many tags.
Gateway ingestion
Same pipeline as a Beacon: gateway hears the advertisement/notify, dedupe + timestamp + aggregate, forward over MQTT. The tag just needs to be *heard*, not connected, for most reports.
Use cases
- Cold-chain (pharma/food): temp + door-open events.
- Asset condition: vibration before failure.
- Environmental: humidity in warehouses, light in offices.
Checklist
- [ ] Cadence tied to use case, not “every second”
- [ ] Ring buffer for missed connections
- [ ] Event-driven where possible
- [ ] Delta + int scaling compression
- [ ] PAwR or short connected windows
- [ ] Gateway-side dedupe + timestamp
- [ ] Battery model includes self-discharge
A well-tuned BLE Tag balances sensor cost against radio cost, and that balance is the whole game.
