I don’t know if it’s that I work in an office full of civil engineers or this is just a part of becoming an adult, but it seems like about 75% of the conversations I have center around the weather. And can I just say, that I love that, because I love weather. After a particularly heavy rain storm, I not only know but am prepared to discuss at length the rainfall totals across the region, if the levels in the surrounding lakes rose, which creeks reached flood stage, and all the associated hydraulic and hydrologic minutiae. So when I got interested in web-enabled electronics, the internet of things so they say, I knew immediately that my first project be related to the first thing I do when I log onto my computer at work each day: check the weather.
This is not necessarily a how-to video, but of course I’ll show you how I did it. Just keep in mind, if you’re taking advice about meteorology or web development from a civil engineer, you might as well be asking an accountant to flush your radiator. The brains of the project is the Particle Photon which is pretty much a tiny Arduino with a wifi chip. But your $20 buys more than the hardware, because the photon has its own online IDE and uses a cloud-based service from particle to interact with the web.
And getting this to work isn’t that straight forward. Particle is a startup company, so they haven’t quite got all the creature comforts and layers of abstraction that we beginner electronics hobbyists have grown to expect. To get the right files uploaded to the “cloud”, you have to install about 10 gigabytes of additional development tools, just so you can use the command prompt as an interface. And I have to admit that I came very close to giving up all together and just loading The Oregon Trail since I was already stepping back to 1993.
But I finally got everything working, and when you actually take a step back from this, the code is really straightforward. The actual weather station is made of a scrap of walnut. I put a chamfer around the edges and a few coats of tung oil as a finish. The panel meters have custom faces that I designed in DraftSight, which is a free cad program. I just cut these out by hand and glued them on to the meters with spray adhesive. I have a meter for air temperature, relative humidity, barometric pressure, precipitation chance, and wind speed. I also have a couple of LEDs which light up if there’s any kind of alert: (thunderstorm watch, wind chill advisory, nerd alert, etc).
There’s really no circuitry here. The panel meters use one milliamp at full scale, so they can be connected directly to the signal pins on the dev board, and I used trim pots as current limiting resistors to get them perfectly calibrated. Everything fit together really nicely on a piece of perf board, and I just hot glued this to the back of the station.
Here’s the gist of this works:
- The photon publishes an event when it would like to know the current weather conditions.
- This triggers a webhook which is stored on the cloud to make an API call to forecast.io.
- The API returns data in JSON format
- The webhook contains a template to parse the JSON data using mustache then sends it to the photon
- Finally, the photon deconstructs this data into the individual values, and then converts them into pulse-width modulated signals for the five panel meters and the alert LED.
This is all true; I didn’t make any of those words up. And think this project turned out pretty slick. But honestly, unless your current pastime is getting kicked by strangers or something equally as demoralizing, I can’t recommend web-development as a hobby at all. If you do decide to take on a project like this, I hope at least this video gives you hope that there’s light at the end of the tunnel, even its warning of you of a tornado. Thanks for watching, and let me know what you think.
Errata: The barometer meter face shown in the video has a mistake. I accidentally shifted it up by 100 millibar. The scale should actually read 960-1060 millibar, which will cover normal atmospheric pressure in most places.