A data logger specializing in reading an array of DS18B20 sensors.
A temperature sensor matrix with heatmap visualization for bee hive monitoring, using Raspberry Pi, Linux, Python, DS18B20, MQTT, Kotori DAQ, and Grafana.
View from outside | View from inside (sensor tip details) |
---|---|
Lab protocol and development details: https://community.hiveeyes.org/t/laborprotokoll-4x5-temp-matrix-mit-ds18b20/5102
» Documentation | Changelog | PyPI | Issues | Source code | License
- The
ds18b20-datalogger
program, reading DS18B20 sensors and publishing readings to MQTT in JSON format. - Configuration file in YAML format, like
datalogger.yaml
. - JSON representation for a corresponding Grafana Dashboard
grafana-dashboard.json
, when measurement data is submitted and acquired through Kotori DAQ.
Acquire single reading, and echo it on STDOUT in JSON format.
ds18b20-datalogger read datalogger.yaml
Take a single reading, and publish it to the configured MQTT topic.
ds18b20-datalogger run datalogger.yaml
In order to see a running system in action, please enjoy inspecting the Live Grafana Dashboard.
Install the ds18b20-datalogger
package from PyPI using pip
.
pip install --upgrade ds18b20-datalogger
See also alternative installation methods and hands-on walkthroughs at development sandbox and production setup.
In order to operate the data logger successfully, you will need to configure two important details:
- Sensors: Map one-wire sensor sysfs paths to self-assigned sensor names.
- Telemetry: Adjust MQTT connection settings and MQTT topic.
You can create a blueprint configuration file by using the make-config
subcommand.
ds18b20-datalogger make-config > datalogger.yaml
Be aware that you might have to adjust your resistors size. With 30 sensors i had erratic sensor mapping using a 4.7k resistor. I am getting valid mapping using a 2.2k resistor.
Please read more about sensor mapping on our community forum. In practice,
just edit the one-wire
section within the configuration file according to
your setup.
The data logger will publish measurements to an MQTT topic, where Kotori DAQ can pick it up, in order to converge into a timeseries database, and displays it on a Grafana Dashboard.
The package includes a corresponding Grafana Dashboard, which can be created
by invoking the make-dashboard
subcommand.
ds18b20-datalogger make-dashboard > dashboard.json
On our community forum, you can find relevant discussions about this topic.
The original code of this implementation has been discovered on the element14 community forum at Multiple DS18B20 Temp sensors interfacing with Raspberry Pi, shared by @laluha. Thanks!
In order to learn how to start hacking on this program, please have a look at the documentation about how to install a development sandbox.
Contributions of any kind are always welcome and appreciated. Thank you.