Skip to main content

A data logger specializing in reading an array of DS18B20 sensors.

Project description

ds18b20-datalogger

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, Python, DS18B20, MQTT, Kotori DAQ, and Grafana.

View from outside View from inside (sensor tip details)
Außen Innen

Lab protocol and development details: https://community.hiveeyes.org/t/laborprotokoll-4x5-temp-matrix-mit-ds18b20/5102

Project Information

» Documentation | Changelog | PyPI | Issues | Source code | License

CI Coverage Status License Downloads per month

Supported Python versions Status Package version

What's Inside

  • The ds18b20-datalogger program, reading DS18B20 sensors and publishing readings to MQTT.
  • JSON representation for a corresponding Grafana Dashboard, when acquired through Kotori DAQ.

Setup

We recommend to install the program into a Python virtualenv.

python3 -m venv .venv
source .venv/bin/activate
pip install 'ds18b20-datalogger @ git+https://github.com/hiveeyes/ds18b20-datalogger.git'

In this spirit, you keep the installation separate from your system Python, so you can easily nuke it and start from scratch in case anything goes south.

Prerequisites: This program needs the paho-mqtt package. https://pypi.org/project/paho-mqtt/#installation

Operations

Sensor Wiring

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.

Sensor Mapping

https://community.hiveeyes.org/t/ds18b20-temperatur-sensoren-am-one-wire-bus-anordnen/1399

Data Publishing

ssh youruser@yourpi
screen
source /path/to/ds18b20-datalogger/.venv/bin/activate
ds18b20-datalogger

MQTT data upload to Hiveeyes

https://community.hiveeyes.org/t/daten-per-mqtt-und-python-ans-backend-auf-swarm-hiveeyes-org-ubertragen/94/6

Format your array

https://community.hiveeyes.org/t/how-to-visualize-2-dimensional-temperature-data-in-grafana/974/9

matrix = [[temp_ir_1_1, temp_ir_1_2, temp_ir_1_3, temp_ir_1_4, temp_ir_1_5, temp_ir_1_6],
          [temp_ir_2_1, temp_ir_2_2, temp_ir_2_3, temp_ir_2_4, temp_ir_2_5, temp_ir_2_6],
          [temp_ir_3_1, temp_ir_3_2, temp_ir_3_3, temp_ir_3_4, temp_ir_3_5, temp_ir_3_6],
          [temp_ir_4_1, temp_ir_4_2, temp_ir_4_3, temp_ir_4_4, temp_ir_4_5, temp_ir_4_6],
          [temp_ir_5_1, temp_ir_5_2, temp_ir_5_3, temp_ir_5_4, temp_ir_5_5, temp_ir_5_6]]

Data visualization in Grafana

https://swarm.hiveeyes.org/grafana/d/Y9PcgE4Sz/mois-ex-wtf-test-ir-sensor-svg-pixmap-copy

Bonus: Sensor offsets

https://community.hiveeyes.org/t/temperatursensoren-justieren-kalibrieren/1744/2

Cron Configuration

*/5 * * * * cd /path/to/data-directory && /path/to/ds18b20-datalogger/.venv/bin/ds18b20-datalogger

Contributing

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ds18b20_datalogger-0.0.2.tar.gz (61.3 kB view hashes)

Uploaded Source

Built Distribution

ds18b20_datalogger-0.0.2-py3-none-any.whl (46.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page