book collections email follower instructable user
Picture of My Backyard Weather - Beta 2

While building a weather station has been a "back of the head" interest for me since I was a kid, it wasn't until a few years ago when I started thinking seriously about practical home automation that I revisited the idea. If you want to automate common tasks that are easily forgotten, tedious, or need to happen when no one is home, you need data. A weather station can give you loads of useful data about the outside environment that can drive decisions in your system like "should I water the lawn?" or "someone should shut the kitchen window, it just started raining."

This project is one in a series of Home Automation projects I have in the works and unlike many of the gazillion other weather stations you'll find online, this project is meant to be chatty. It talks to other systems via a local database and a MQTT broker. It also talks to you the user via a web interface.

As the title suggests, this project is in "beta" state. In other words, it isn't finished. It does work as is, though and you can build and use this station to help control things in your home, now.

Step 1: Overview

Picture of Overview
storm 8-31-17 pm to 9-1-17 am.JPG
Annotation 2019-05-17 001424.png
Annotation 2019-05-17 001452.png

What data does it provide?

This station collects most of the basic data you would expect from a typical station:

  • Temperature - What is the current temperature?
  • Humidity - What is relative humidity?
  • Dew Point - How saturated is the air?
  • "Feels Like" - A combination of wind chill and heat index, what temperature does it feel like outside?
  • Barometric Pressure - What is the current pressure in kPa?
  • Wind Speed / Direction - How fast is the wind blowing in mph and from what direction(deg)?
  • Rainfall (inches per interval) - How much has it rained in the last two minutes?
  • Rainfall (Is it raining) - Is it raining or not right now?
  • Lightning (counts per interval) - Is there lightning in the area and how intense is it?
  • LUX - How bright is it outside? Why reinvent the wheel?
  • UV - What is the current levels of Ultraviolet Radiation outside?
    • UVA - How much Tanning / Damaging energy is there?
    • UVB - How much burning energy is there?
    • UV Index - What is the overall UV Index now?

In addition to the weather data above, I am also collecting data about the station itself for diagnostic use if there is an issue and to help improve the design. This data is stored in a separate table in the database.

  • Internal Temperature - How hot is it getting in the station enclosure?
  • Internal Humidity - How much humidity is in the enclosure?
  • Internal Dew Point - Is moisture about to condense on the electronics in the enclosure?
  • Lightning Disturbers - How much noise is the lightning detector having to filter? Could these be actual strikes?
  • DB Retries - Has the database failed to connect on the most recent attempt before succeeding?
  • DB Errors - How many errors were there since the system as started?
  • MQTT Errors - How many times was there an error attempting to publish station data?
  • DHT Sensor - Did the sensor start up properly?
  • THP Sensor - Did the sensor start up properly?
  • LightningSensor - Did the sensor start up properly?
  • LUXSensor - Did the sensor start up properly?
  • UVSensor - Did the sensor start up properly?
  • RTC - Did the Real Time Clock start up properly?
  • MINRAM - How low did the available RAM dip to?
  • AVGRAM - What is the average RAM value over an interval?
  • User Count - How many times did someone look at the station webpage over an interval?
  • Startup Timestamp - How long has the station been running?

Why reinvent the wheel? What did I gain?

There are hundreds of home brewed weather stations outlined on the Internet and dozens of well-made commercial stations available so why build one? There are two specific reasons - 1) to learn and 2) to get the data I needed and in a format I could control.

I learn best by doing. Since I don't have a background in weather science, I really had no idea where to begin and frankly, that's the best place to start. It makes you pay attention. For example, before I started researching this project, I thought that I had a grasp of what the "weather" was. However, I realized this was not the case. My awareness changed - rather than just listening to the weather channel waiting for the punchline (will it rain this afternoon), I now have a better understanding when they talk about topics like high and low pressure areas and what Dew Point represents. Learning this way makes you more aware, making the world both smaller and larger at the same time.

Additionally, none of the existing stations gave me control of the data in a way that I could depend on. I don't want to have to hack the equipment (if I have to hack it, then I might as well learn by building) and I didn't want to pull data off the cloud. This station reliably provides a data-set on a useful interval that is stored in a local database. I was able to choose what I wanted to measure against and while this station wasn't cheap, this system does have more options than most commercial systems of the same cost. Since this station doesn't rely on batteries, and is wired directly to my home network, I have been able to operate this station for more than two years uninterrupted without dropped packets or missing data.

Since the data is stored in a database, any number of scripts and applications can poke and prod the information for everything from "it's dark outside" to "based on the current conditions, the crawl vents should be closed." This data can also be used to find trends in energy consumption, irrigation patterns, and behavior to make decisions that can lower costs or improve the overall automation experience.

Lastly, I control the code of the station which, allows me to adapt to changes in my home automation system and add new features as needed. For example, I recently settled on an open home automation platform called Home Assistant. This software is a topic all it's own but for brevity, HA allows a myriad of inputs to control thousands of devices. One supported communication type is MQTT which is a fast publisher/subscriber system for managing messages. I added MQTT publishing of my data to the posting code of the weather station in an afternoon and had all of my weather data available to HA in minutes.

Sounds great, what's the downside?

Going this way isn't cheap. If you decide to build this project as I've described, it will set you back around $200 - $250 depending on how good you are at finding deals.

You're in for some headaches. Unlike buying a really good commercial weather station of comparable price, you aren't getting a meticulously tested and fool-proof system. This thing will make you upset till you get it right. After that, it works pretty well and will give you more data than you know what to do with.

That brings me to a third downside, manipulating the data is all on you. For some this is not a downside. For me it is a mixed bag. I'd like some help from time to time but overall, what I've learned is priceless.

Lastly, you need to be patient with a home built system as your time frame for testing is a full year. What I mean is, say you decide to change out a sensor for another one that appears to be a good fit and cheaper but will it stand up through different seasons. Unless you're able to build a simulation chamber, you'll just have to wait.

gulliverrr3 months ago
Finally a weather station that requires no 3rd party server, internet or a paid service.
We've been working on a Smart Home Thermostat (HestiaPi) with these features in mind and fully MQTT compatible so your data can plug directly into it to control climate (heating, ventilation and AC) and react to weather with shutters, curtains, vents or simply notifications on your phone! So many new scenarios can now unlock!
Awesome work and amazing documentation which most of the times it saves like 80% of the time required.
AndrewHoover (author)  gulliverrr3 months ago
I'm a big fan of your project! I love what you have built there - looks commercial ready! :D
I've been working with an HVAC engineer for a few months on a thermostat myself but from a different point of view. My long term goal is to use some learning algorithms and data from this weather station, air quality data from another station I'm building, indoor room sensors, and online forecast data to have the system figure out how to be as efficient as possible within the current environment. The thermostat I'm building isn't much different than a lot of dumb thermostats but can be controlled by these algorithms. The goal for me is to keep the thermostat as simple as possible and add the complicated parts as software on a more powerful system. That way, if the complicated stuff stops working, the thermostat still works as a thermostat.
Manual override is surely very important. With HestiaPi being a few years old we've solved all these issues but you never know.
Give us a shout when you setup a repo or a website so that I can keep checking on your progress.
Coming from the weird place where open-source meets commercial, I can tell you there is a space for your project to become a product. PM me if you want me to share my experiences.
Well done!
AndrewHoover (author)  gulliverrr3 months ago
I sincerely appreciate that especially since we appear to share some common goals (locally processed, private, etc).

I haven't decided yet what I fully plan to do long term with regard to product creation. Some I would like to create products for and others I may just release for the maker community. For now my principle goal is to build out a list of projects for a locally processed smart home. That will keep me busy for quite some time.

Most of my progress with this and other projects can be found on my blog as listed at the bottom of this article.
My personal experience is that many makers around the world do not have the skills in all the parts a project may needs. Some are into electronics but hate handling mains or know nothing on programming/Linux/XYZ. Having something more "consumer-ready" may get more people on the boat. I followed your Github. Will keep an eye on you. One day we may integrate parts of our projects together :)
AndrewHoover (author)  gulliverrr3 months ago
I look forward to that day. For now, I still have a lot of work to do.

Thanks again for your comments and I will keep in touch. I look forward to seeing your projects progress and congratulations on achieving your funding goal! Well done and well earned.

JJ Slabbert3 months ago
Hi Andrew,

Nice project complete project

The RG 11 rain sensor is in my mind for a long time.
AndrewHoover (author)  JJ Slabbert3 months ago
Thank you.
The RG-11 is a unique device. So far, I've never had a false positive from it that wasn't related to the power issue I mentioned in the article. It is also very sensitive - I've had it detect mist before I felt it myself. No maintenance to speak of. I've only cleaned it once and it just keeps working. It really is a brilliant piece of technology.
jessyratfink3 months ago
Holy cow, this is fantastic! What a great resource you've compiled. A weather station has been something I've wanted to do for a while. Now that I live somewhere no news station covers, it's feeling much more important :)
AndrewHoover (author)  jessyratfink3 months ago
Thank you very much!
That means a lot coming from someone with your cred! I really appreciate it.

Weather stations are almost one of those "default builds" in the maker community. You can't swing an anemometer without hitting a weather station build article, it seems. I just hope this one touches on a few points that others haven't.

The best of luck with your build if you decide to take it up. They are a lot of fun but likewise a real pain in the neck. Any outdoor project with electronics is.