Version 2.0 of an ongoing sensor-logging series - preceded by ZigBee Sensor Network (v1.0), itself preceded by an early prototype, Weather Station.
A Wi-Fi environmental sensor node built on a SparkFun Thing Plus ESP32-C6 and a BME280
breakout, reporting temperature, dew point, humidity, pressure, and battery state of charge to my
sensors ingest API. It reuses the batcave
station's old prefix and channel numbering, so its live data shows up at the same
Weather
report that a v1.0-era ZigBee weather board used to log to before going dark in 2016 -
this is that same station, revived a decade later with native Wi-Fi instead of a ZigBee/gateway hop.
There was never any question of going back to 5V for this generation, either - like the Fio before
it, the ESP32 is a native 3.3V device, and by the time this project started the world had moved on
from Arduino anyway, making ESP32 the natural choice.
The interesting part of this project isn't really the sensor - BME280 breakouts are a
commodity part - it's the firmware: a small, reusable Arduino library,
Sensor Node, that handles Wi-Fi provisioning, reconnecting after a
move, and reporting over HTTPS, so that wiring up the next sensor node is mostly just
picking a sensor and writing a loop(). See that page for how the library itself
works; this one covers what's specific to this physical device.
This device runs the BME280Node example from
github.com/larsi-org/sensor-node (MIT
licensed) essentially unmodified - see Sensor Node for the library
itself, or the repo's examples/ directory for both example sketches.
Two boards on a single Qwiic chain - no soldering, no wiring diagram needed - plus one more that's entirely optional:
0x77) - Bosch's
combined temperature/humidity/pressure sensor. Dew point is computed on the device from
temperature and humidity (the SparkFun BME280 library's own dewPointC()) rather than
server-side, so it logs as its own channel.Channel layout, matching the wire protocol's device/channel addressing (see API Reference):
| Channel | Reading | Unit |
|---|---|---|
| 0 | Temperature | °C |
| 1 | Dew Point | °C |
| 2 | Relative Humidity | % |
| 3 | Pressure | hPa |
| 15 | Battery State of Charge | % |
Channel 15 - the last of a device's 16 - is reserved sitewide across every sensor-node device for battery state of charge, leaving 0-14 free for whatever the sketch actually measures.
This device runs BME280Node from the Sensor Node
library essentially as-is - see that page for how the library's Wi-Fi provisioning,
channel/precision model, and reporting actually work; there's nothing device-specific about any
of it beyond the channel table above and the device name (batcave's "Weather
Basement," baked into the name rather than a separate location field, per the library's
convention).
This device reports into larsi.org's sensor ingest system, which
tracks every station by a short location prefix (batcave here) and up
to 16 devices per prefix, each with its own block of 16 channels. Browse other stations from the
sensors index, or check device health
across every station sitewide - last-seen timestamps, per-sensor status, that kind of thing.
Reporting requires an API key: a 16-character, per-station credential gating what prefix a device is allowed to log to. See Add a Sensor Node for how to request one, or the API Reference for the exact key format and full wire protocol if you want to log your own device to this same API.