Cheap environmental monitoring with Raspberry Pi/Grafana/InfluxDB

I’ve been working on practicing my Python skills by working on getting various temperature statistics from my home server room into Influxdb, Then charting them with Grafana. It’s pretty amazing what you can do with a minimal investment of parts, and a little time. It’s also a chance to get down and dirty on some basic hardware circuit design. Here’s a little overview of a simple project I did to create a very cheap Server Room Temperature Monitor.

Raspberry Pi Based Server Room Monitor –

This project was pretty straight forward. Using a spare Raspberry Pi 2 unit I simply followed this guide and built a simple circuit based around the DS18B20+ Temperature Sensor. Then, we can use this basic python library to manipulate data coming from the sensor, and spit that into our database of choice. Putting data into InfluxDB is simple, as it accepts JSON objects with a very simple structure.

Find this script on my github

This creates data that looks like this in your influxdb measurement –

Finally, Using that data we can generate a pretty graph with Grafana-

Grafana Alerting also allows us to easily create rules to generate alerts based on conditions within this graph. This means you can monitor your server room temperatures, and get a notification in your slack channel when it reaches a certain level. In my next few posts I’ll show how I further extend this functionality with more data points, and some integration into an HVAC system.

Leave a Comment

Your email address will not be published. Required fields are marked *