Skip to content

Monitoring air temperature via web interface using Raspberry Pi; data logging and plotting using RRDtool.

License

Notifications You must be signed in to change notification settings

gzachos/rpi-airtemp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rpi-temperature

About

This repository contains the scripts required to:

  • Measure air temperature using a Raspberry Pi
  • Store the measurements taken in a Round-Robin Database
  • Create a graphical representation of the data stored
  • Create an ultra simple webpage to display the graphs

Specifications

Raspberry Pi model: B+
Sensor model: DS18B20 (waterproof)
Kernel release: 4.1.19+ (Raspbian)
RRDtool version: 1.4.7
The graphs will be of PNG file format

Installation

Install RRDtool and a web server (i.e. Apache):

apt-get install rrdtool apache2

Download and save temp-sensor.sh and temp-graph.sh in /root/bin/ for example.

Edit the following line found in function read_raw_data (temp-sensor.sh)

RAW_DATA=$(cat /sys/bus/w1/devices/28-04146dd116ff/w1_slave)

replacing 28-04146dd116ff with the number corresponding to your device. Then add the two shell scripts as cron jobs by executing:

crontab -e

and adding the following two lines:

@reboot /root/bin/temp-sensor.sh
* * * * * /root/bin/temp-graph.sh > /dev/null 2>&1

Save and exit!

Images


Webpage
Webpage


Sample graph (2 Hour Temperature Log)
Sample Graph


Sample graph (4 Hour Temperature Log)
Sample Graph


Sample graph (12 Hour Temperature Log)
Sample Graph

Developer

George Z. Zachos

Licence

GNU GENERAL PUBLIC LICENSE Version 2, June 1991