Skip to content

smartz921/bme280dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

BME280 Dashboard.

Plain Python with a dash of Flask, HTML and SystemD.

Purpose

To make a script/application that can:

  1. Interface with a BME280 sensor via I2C.
  2. Record and display data.

Project Layout

/
├── bme280-dashboard.service (the service that starts the script on pi boot)
├── bme280dashboard.py (the script that does everything)

Project Constraints

  1. Must be accessible over a network.
  2. Must have a high uptime.
  3. Must have a rolling average of readings.
  4. Must have a rolling minimum and maximum reading.

Install Notes

Use this BME280 library:

pip3 install RPI.BME280

I put the SystemD service in:

/etc/systemd/system

Reasoning & Decisions

The reason I chose a Raspberry Pi was because I had one spare and at the time I was very familiar with the ecosystem. Additionally I knew I could easily set up the scripts and automation without having to download too many external libraries.

I chose python because it perfectly fit my use case:

  1. It could interface with the sensor via I2C.
  2. Could do the file I/O.
  3. Could do the networking I needed.

I chose to output to a CSV because I had planned to use other python libraries to do more in depth graphing and data analysis. It was also what I had the most experience in. This logic is also why I limited the HTML graph to 3 days worth of data.

I made the decision early on to only record the temperature every 10 minutes. This is because I didn't need precise to the second measurements. I also didn't want to burn out an SD card doing file I/O every second.

Future Work

I would like to add a current reading field for ease of use and readability.

At some point I would like to move to a BME680 for the air quality reading.

I would like to move to a different BME280 library as this one hasn't been updated since 2020. Not that BMEs are getting wild updates I just like being up to date.

This project has been a great gateway into HomeLabs and networking. I'm considering setup Home Assistant at some point to handle this a lot more nicely.

About

A python reader, logger and web view for a BME280 Sensor.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors