Measuring room temperature with raspberry pi
Measuring room temperature with raspberry pi
Author
Discussion

MrCheese

Original Poster:

363 posts

214 months

Monday 2nd April 2018
quotequote all
I store wine under the stairs and would like to continuously monitor and log the room temperature, saving the history across an entire year. It seems to me this is an ideal task for as raspberry pi. Any pointers on where to start? I can see thermostat projects but it isn’t clear to me whether they record historical temperatures in a way that can be accessed easily....

dmsims

7,526 posts

298 months

Glade

4,520 posts

254 months

Monday 2nd April 2018
quotequote all

alorotom

12,800 posts

218 months

Tuesday 3rd April 2018
quotequote all
Glade said:
This ... much easier solution

TonyRPH

13,559 posts

199 months

Tuesday 3rd April 2018
quotequote all
I do this with a Raspberry Pi to monitor server room temperature - I use one of these

With this code - it's easy to compile on the Pi.

A word of caution - you do need to calibrate the sensor by placing a known good thermometer next to it - and then either adjust the code for the error correction, or use a shell script to do the error correction maths for you.

There are several versions of the code - see here for more detail.

Finally, these sensors are also prone to returning no reading and dropping off the USB bus - I resolved this by writing a shell script that checked for an erroneous or no reading, and then said script rebooted the Pi. Fortunately, these errors are quite rare (approx once every 2 months or so for me).

I also graph my temperatures, however it's just as easy to add an email alert to the script if the temperature goes out of bounds. With the Pi + a small speaker, one could also create an audible alert.

I can provide the scripts on request.