Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Measure, display and log temperatures with Raspberry PI

License

NotificationsYou must be signed in to change notification settings

grillbaer/data-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Measure, display and log temperatures with Raspberry PI 3B.

This is a simple hobby project for logging temperatures of my heat pump and heating system.Feel free to use it in your own projects (Apache License Version 2.0).

It contains some icons fromFlaticon, licenseCreative Commons BY 3.0, seeCREDITS for details.

Features

Current Temperatures

Show the current readings

Measurements View

Temperature Graphs

Show how temperatures developed over the last 24 hours

Graphs View

MQTT Client

Publish all temperature readings to a MQTT broker. This allows to track and show them in common MQTT apps.The MQTT messages contain JSON with timestamp and value:

{ "status": "ok", "timestamp": "2020-11-13T17:08:57.753064", "value": 9.697, "unit": "°C", "formatted": "9.7" }

CSV Logging

The temperature readings are written to CSV files and held for 32 days. This also allows to immediately re-fill the graphs view after restart.

Hardware

  • Raspberry PI 3B
  • Official Raspberry PI 7" touch display, 800x480 (expensive, but well supported in Raspbian, multi-touch)
  • Official Raspberry power supply 5.1V/2.5A with additional 330uF capacitor for stabilization (Raspi is quite picky here...)
  • Heat sink on Raspberry CPU (... to avoid the random crashes that may occur otherwise)
  • DS 18B20 temperature sensors (1-Wire bus allows many sensors at the same GPIO port, well supported in Raspbian)
  • TSIC 306 temperature sensors (high accurracy, expensive, but already installed from a previous project)

Platform

  • Raspbian Buster
  • Python 3.7
  • UI toolkit Kivy (nice and simple UIs with multi-touch support)
  • Charts with Kivy Garden Graph (fast drawing)
  • TSIC temperature sensors: python module tsic (sensor reading based on pigpio)
  • GPIO access: pigpio (IO with precise timing)

Installation / Configuration

Steps last performed on latest Raspbian of 2021-01-23

# Install Raspbian buster to SD card,# optionally create files "ssh" and "wpa_supplicant.conf" according to doc# in boot partition for set-up without keybord and monitor before initial boot,# boot Raspi and ssh to raspberrypi as user pi password raspberry,# change user pi's password to a secure one!# Desktop packagessudo apt updatesudo apt install lightdm lxsession # Basic configsudo raspi-config- set hostname- set time zone- enable VNC for remote access to desktop- enable 1-Wire- set boot to desktop with auto-login# Serial port for powermeter IR interface support# (will disable bluetooth that is attached to UART)sudo raspi-config- disable login shell over serial, but enable serial port hardwaresudo echo "dtoverlay=disable-bt" >>/boot/config.txtsudo systemctl disable hciuart# GPIO access for TSIC sensor supportsudo apt install pigpiosudo systemctl enable pigpiodsudo systemctl start pigpiod# Data-logger and required packagessudo apt install python3-pipcd ~git clone https://github.com/grillbaer/data-logger.gitcd data-loggerpip3 install -r requirements.txt# Graphical UI Kivy 2.0.0 installation steps according # to https://kivy.org/doc/stable/installation/installation-rpi.htmlsudo apt install pkg-config libgl1-mesa-dev libgles2-mesa-dev \   libgstreamer1.0-dev \   gstreamer1.0-plugins-{bad,base,good,ugly} \   gstreamer1.0-{omx,alsa} libmtdev-dev \   xclip xsel libjpeg-devsudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev# Official Raspberry Pi 7" display multi-touch and fullscreen# nano ~/.kivy/config.ini:[graphics]...fullscreen = 1...[input]mouse = mouse%(name)s = probesysfs,provider=hidinputmtdev_%(name)s = probesysfs,provider=mtdevhid_%(name)s = probesysfs,provider=hidinput...# Display backlight switch permissions for piecho 'SUBSYSTEM=="backlight",RUN+="/bin/chmod 666 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"' | \  sudo tee /etc/udev/rules.d/backlight-permissions.rules# Disable regular screensaver in desktop preferences# Manually start data-loggerdata-logger/start.sh# Autostart data-logger at desktop loginmkdir -p ~/.config/autostartln -sf /home/pi/data-logger/data-logger.desktop ~/.config/autostart/# For data-logger configuration change data-logger/signalsourcesconfig.py,# you may use testsignalsourcesconfig.py for demo simulation# MQTT secret and TLS certificateecho "my-secret-mqtt-broker-password" >data-logger/secret-mqtt-passwordcp my-mqtt-broker-public-root-certificate >mqtt_broker_cacert.pem# set mqtt_broker_host: '' in signalsourcesconfig.py to disable MQTT
  • Log files pathlogs/
  • CSV files pathcsv/
  • Discover the DS18B20 sensor IDs in/sys/bus/w1/devices/
  • Configure data logger by changingsignalsourcesconfig.py
  • Prefer WLAN to LAN to avoid power surges depending on sensor cabling!

[8]ページ先頭

©2009-2025 Movatter.jp