Since purchasing a Raspberry Pi in 2012 I've been playing around with DIY weather loggers and data servers that provide a page of weather data on our home network from a garden shed situated about 19 metres from our house. A couple years ago I switched over to using a Lemaker Banana Pro primarily because I could install my system to a 2.5" hdd or sdd as well as install a stock Slackwarearm system on it and run it the same way I run Slackware on my desktop and netbook.
Arduino and weather sensor breakout boards now available make putting together a weather logger fairly painless. My current setup comprises a Banana Pro interfacing with an Arduino compatable Freetonics LeoStck, a Freetronics Barometric Sensor Module and an Adafuit HTU21D-F Temperature & Humidity Sensor Breakout Board. The LeoStick is small and can easily be breadboarded or soldered into a circuit using 0.9mm PCB Pins. In addition to I2C comms there are plenty of pins available if I want to add another sensor to the circuit and the arduino sketch and the C programs and Bash scripts that follow can easily be modified to accommodate additions to the circuit.
This article is about my Weather Logger Mark III. It is breadboarded and sitting in a window of my shop logging data to a file named weather-data.csv as I write.
Weather Logger Mark II is out in the garden shed and soon will be retired. Maybe this time around I'll solder up a proper circuit instead of being lazy and running off a breadboard for a couple years. While I use Slackwarearm and a Banana Pro, I imagine my setup could easily be adapted to other Linux arm distros, SBC's and Arduino compatible devices. Consider what follows below as more of a 'How I did it' than a 'How to do it' and feel free to do what you like with what is to follow.
- circuit and connections
- poll-weather-data.ino; the LeoStick sketch
- get_w_data; a C program to poll the LeoStick
- wl_jobs; a C program to run the weather logger
- weather-logger.conf; keep track of variables
- weather-logger.sh; process, format and log data
- scripts I haven't mentioned yet but should
- putting it all together