Monday, July 25, 2016

Raspberry Pi Weather Station - part 1

My latest Raspberry Pi project is a home weather station.  My original goal was a have a useful set of sensors connected to the Pi, and to make the results accessible over the Internet.  That said, this process took several twists and turns along the way, probably because there are fewer people out there doing this type of project than say my previous projects of a homemade DVR or home theater.  This project, unlike my previous Pi projects, is less a step-by-step guide.  This is for several reasons.  First, this project morphed and changed several times so it was harder for me to document as I went.  And secondly, I had less free time to work on it, so I gave up on documenting while I worked.

When I decided to make a homemade weather station, I wanted to do as much "homemade" as possible.  So all my sensors are connected to the Raspberry Pi's GPIO pins.  The more common solution for people is to buy an off-the-shelf weather station and connect that to the Raspberry Pi's USB port.  I purchased all the hardware necessary for this project (more on that later) before I even knew how it would fit together.  I just had faith it was possible to do what I wanted to do.  The major missing link was the software.  I did not know how to read the sensors and display it meaningfully.  And it was researching the software solutions available is where this project deviated from my initial thoughts.  But I'll get into all that in a future post.  First let's look at the hardware I used.

Raspberry Pi Zero:
For this project I went with the new Raspberry Pi Zero.  Any Pi would do, but I chose the Pi Zero for several reasons.
  1. The smaller size, so the weatherproof enclosure doesn't need to be as large.
  2. The extremely low-power consumption.  As a weather station this won't need the processing power of the Pi 2/3, so save on electricity use.
  3. It's new and cool.  I've worked with the original Pi and the Pi 2, so this was something new to try.
However, working with the Pi Zero did have several drawbacks.  First and foremost was obtaining the Pi itself.  Pi Zero's are in VERY short supply and hard to get.  It took 2 weeks of waiting for Adafruit to get a shipment in before I could order one.  And even then, they only sold the Pi Zero in a "kit" with other things I didn't need like power supply, memory card, USB adapters, etc.  Another issue with the Pi Zero is you have to manually solder the header connector onto the Pi.  I like soldering so this was no problem for me, but others might find the regular Pi models more appealing since the GPIO pin headers are soldered on at the factory.

Temperature / Humidity / Pressure
For basic atmospheric measurements I went with the Adafruit BME280.  This sensor measures temperature, humidity, and pressure.

Wind / Rain
For the final set of sensors I went with the SparkFun weather sensors.  These sensors measure wind speed, wind direction, and rainfall.  But at $77 they are by far the most expensive item in this build.

Miscellaneous
To complete the project I needed a bunch of smaller items.  I bought a Samsung Pro micro SD card because it's one the fastest cards available and I've had good luck with them in the past.  For wireless I went with the Rosewill RNX-N180UBE.  For power I selected an Anker wall charger (I selected a dual-port model because this single charger will power a couple of my Raspberry Pi's) as well as a 10' long Anker power cord.  Lastly I purchased a waterproof electrical case at Home Depot originally designed for running conduit outside, but houses the Pi nicely and has openings on the bottom where I can run wires into the housing.

No comments:

Post a Comment