The Flexibility Engineer

RaspberryPi3 Temperature Recorder

I wanted to share this pretty neat piece of code that turned my RaspberryPi3 into a temperature recorder. If found this tutorial especially useful to get started. An issue I had though was that the component kit did not specify the values for the thermistor I had. So I just looked up a specification online and used that instead and calibrated the values roughly against my boiler thermostat in my room. So not too scientific, need to get myself some proper thermistors for the futureā€¦

Below is the full code, I wonā€™t go into details but happy to answer any questions you might have. You can also find it in GitHub. In essence for a Python user making pretty cool Raspberry Pi3 projects is rather intuitive and the interweb is full of great projects to start with. The hardest part is really purchasing the equipment and setting it up. Naturally some skills with using command line is helpful although RaspberryPi3 does also support a user interface with a graphical user interface.

So far I have been just logging my home temperature minute by minute to get some data which I can use for my other projects. Below is a graph of a temperature profile over one day and some hours on top. The origo is not set in zero but as one can see there is clear variation within 24 hours. That first spike was just a test I did to check my LEDs were working.

Minute by minute room temperature profile.

An idea I have is to gather data over a week or two and then create a neural network predicting inside temperature based on time (and possibly the outdoor temperature if I can get some good data somewhere on that). You can find some work I am doing with neural networks from my other Medium pieces. I could then put the neural network agent into the RaspberryPi and have an ā€œonlineā€ predictor which could learn to become better as it runs and turn on and off LEDs depending on the accuracy of its predictions and the predicted and actual temperatures.

I am also working on an Ethereum implementation for controlling the system over a smart contract running in the blockchain along these lines shown in YouTube. All that is yet to come as long as I get time during the weekendsā€¦

Thanks for reading!

Eramismus

This post was originally published in Medium


I am a practical Finn with interests spanning energy, digitalisation and society. I am currently working towards a PhD in England. Among other things I try to explore the layered nature of sustainability through philosophy and technology.