A Banana Pro Weather Logger

with help from a LeoStick and some weather sensor breakout boards.


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 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, C programs and BASH script I've put together 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.

snippit of data from weather-logger.csv

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.



Contents

  1. circuit and connections
  2. poll-weather-data.ino; the LeoStick sketch
  3. get_w_data; a C program to poll the LeoStick
  4. wl_jobs; a C program to run the weather logger
  5. weather-logger.conf; keep track of variables
  6. weather-logger.sh; process, format and log data
  7. scripts I haven't mentioned yet but should
  8. putting it all together

What's up?