Raspberry Pi 2 Weatherstation

10 Jul

I got a Raspberry Pi 2 for my birthday and, as a small evening project, ported my Arduino Weatherstation project to this new platform.

IMAG0268

The setup is relatively simple: I used the Adafruit Python DHT Sensor Library to read the sensor values from the GPIO, logging the resulting values with a timestamp to a CSV file. Another python script then reads this files and creates a graph using the Matplotlib library (which can be installed easily on the RPi with sudo apt-get install python-matplotlib).

log

Both scripts are called every five minutes  by crontab, and the resulting image is displayed on a webserver (I used nginx, which is also quite easy to install).

Next steps would be to log to a database instead of a file, and implement different visualizations over different time intervals.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: