Kyneton Temperature Logger
December 2016
Learning to use my Raspberry pi to track temperature in near-real-time via API, rails and heroku.
Kyneton gets cold…very cold.
In an effort to quantify just how cold it gets, I decided to set myself a little project where I created my own weather station using:
- My new Raspberry Pi 2,
- Seeed grove pi sensor pack
- Python
- Ruby
- Rails+heroku api
- 23,000 mAh battery
- USB solar array
- Small toolbox (to hold all the sensors, battery etc)
Simply, the project does the following:
- Every five minutes, takes a temperature reading on the Raspberry pi via the attached Digital temperature and humidity sensor.
- Connect to heroku and use the Rails API to store the values to a database
- Display the latest of these values via a simple Rails app
To house the sensors, I've used a spare toolbox I had lying around. I left the Pi inside another plastic box to stop dew forming on it and shorting the electrics. To make sure that the sensor readings were as accurate as possible I drilled a few holes into the side of the case. This lets it breath but also keeps a few compartments distance between the atmosphere and the computer and battery.
Initially I intended to power this set up via solar. The solar would feed the battery, and the battery would then feed the raspberry pi, but I’m reluctant to leave the solar panels outside in the elements (ironic) so I might find a way to either move the pi into a shed (where I can connect it to mains power) or integrated it into the garden lighting system I have (although this would use significantly more electricity as the 230W transformer I have for my garden lights would need to be on the whole time.
Next up I plan to make this tweet out the temperature at it's coldest point each morning - a sort of sadistic town crier for the freezing souls getting out of bed and heading to work each morning.