Home Automation

My ongoing project to instrument and automate my home

A Weather Station (Version 1)

Last Updated: 2019-February-26

I was inspired by this online project, by Jim Kemp:

https://www.instructables.com/id/Raspberry-Pi-Internet-Weather-Station/

Although I began with Mr. Kemp’s source code, by the time I was finished, very little of the original implementation remained.

Here is the link to my code: https://github.com/Concours99/Weather-Station

Some of the changes:

Weather Station Functionality

  • I wanted to use WeatherUnderground.com rather than weather.com as I could get data from a more local weather station.
    The downside to this is that the specific weather station you specify can have trouble.  Originally, I chose a station that was within 1/2 mile of my home.  After a couple of weeks, the data stopped flowing and I had to update my code to the next closest station (about 1 mile from my home).
    I have upgraded the code to walk down a list of Personal Weather Stations (there are 11 in my list, but it can be as many as you want) and return the data when it is able to get a newer set of data than the last time it was called.
  • weather.com only updated every hour.  Using the free functionality from WeatherUnderground.com, I could query every 10 minutes and still not exceed the number of requests per day I was allowed.
    There is a rumor circulating that WeatherUnderground will be discontinuing the free functionality.  So far, my code has continued to work.  I am hoping that they just stop issuing new keys and let those of us who already have keys continue to work as before.
    Note that the WeatherUnderground code has been separated into its own module.  If it is necessary to find my data from another source, it should be a little easier to alter the code in that module with minimal changes to the other python files.
  • Temperature, humidity, and barometric pressure displays are color coded (red if the value is rising, blue if it is falling).
  • Rather than implement keystrokes to control the screen displayed, I implemented “tabs” in the unused space to the right of the display.
  • The rectangles on the bottom of the “Current Conditions” display can be used to access the textual forecast for that period.
  • I added an icon depicting the phase of the moon and added the moonrise and set times.
  • I keep track of high and low temperatures for each day as well as the amount of rainfall and can display the past 7 days.
  • The station sends my cell phone a text message whenever the National Weather Service issues a weather alert for my area.  When this happens, the frame on the display turns red and returns to white after the alert expires.
  • It logs temperature, humidity, and barometric pressure to a channel on my ThingSpeak.com account.

Other Functionality

  • Every 10 minutes it queries my thermostat (see: http://homeautomation.geiserweb.com/index.php/2018/08/11/a-new-thermostat/ for information about my new thermostat) and logs the temperature and humidity to a channel on my ThingSpeak.com account.
  • On the same 10 minute schedule and if the thermostat is in heating mode, it determines if the temperature in the basement (as logged by my Arduino temperature and humidity sensor, see: http://homeautomation.geiserweb.com/index.php/2018/08/20/temperature-and-humidity-monitor/) is three degrees higher than the thermostat.  If so, it turns on the furnace fan to blow the warmer air around the house.  When the basement temperature drops below that level, it turns the furnace fan off.
    The same calculation is done in reverse if the thermostat isn’t in heating mode.  That is, if the upstairs is three degrees warmer than the basement, the furnace fan comes on to blow the cooler air throughout the house.
    Note: if the thermostat is on “hold,” I assume that someone wants it the exact way it is and the weather station does not change any thermostat settings.
  • Since the weather station is getting the basement data for temperature and humidity from ThingSpeak anyway, it writes the data out to one of the message lines at the bottom of the thermostat.

Screens

This first screen is the main screen.  It is displayed most of the time.  If you select a different screen for display, it will return to this screen automatically after a short time.

Current Conditions Screen

The next screen is the almanac screen.  Note the small moon image on the lower right of the display (next to the WeatherUnderground.com logo.

Almanac Screen

The next screen is simply a display of the current alert that has been sent (or “No alert” if there isn’t one).

Weather Station Alert Screen

The next screen shows a week’s history of daily high and low temperatures and the daily rainfall.

History Screen

The last screen shows the forecast details.  Using the tab on the right, you will see today’s detailed forecast.  If you use a different day from the Current Conditions screen, you can see one of the next three days’ forecast.

Details Screen

Physical Construction

The weather station runs on a Raspberry Pi Zero-W.

It is housed in an acrylic box that I cut out on the laser cutter at my makerspace (MakeIt Labs, Nashua, NH).  I found some scrap acrylic that was large enough to do what I wanted but it was orange.  I spray painted it beige to fit in better on the shelf on which I intended the station to live.  The box is held together and the screen held in using silcone caulk.

I 3d-printed a small rack to hold the Raspberry Pi Zero-W.  It too was held to the acrylic case using silicone caulk.  I attached a small clip to provide some strain relief on the power cable and the connection of the “Pi Rack” to the case.

Rear view of the weather station

Leave a Reply

Your email address will not be published. Required fields are marked *