Weatherometer

Greg Abbas

I used to sometimes leave the house in the morning without remembering to check what the weather would be like that day. The climate is pretty forgiving because I live on the San Francisco peninsula, not up in the infamously-foggy San Francisco itself. But sometimes I would find myself dressed too warmly, not warmly enough, or without an umbrella. I wanted something that would make it easy to notice what the weather would be like as I was getting ready in the morning, without being intrusive.

What I came up with was a vaguely Victorian-looking lamp-like appliance, that glows various colors:

Red Warmer than yesterday
WhiteAbout the same temperature
BlueCooler than yesterday
GreenMight rain

Now I know at a glance whether to grab an umbrella, a jacket, or a short-sleeved shirt. It brings the weather forecast "into my world" without me having to think about remembering to check the forecast.

How It Works

I first made the Weatherometer (pronounced weather-ROM-eter, not weather-O-meeter) 9 years ago, with an Arduino and custom shield on top of it with NPN transistors to make the GPIO pins drive a set of 4 RGB LEDs. The first version had an Arduino Ethernet shield, and had to be wired into a network.

Now, it's simpler. The current version has a Raspberry Pi Zero W and APA102 "Dotstar" LEDs from Adafruit. Simpler design, and uses WiFi so the ethernet cable is no longer required.

Design & Construction

I like making technology look non-technological, and this project was no exception. Instead of something sleek and modern-looking, I wanted an old-fashioned design. So I went on Craigslist and Ebay to get an antique coffee grinder and an antique frosted glass lampshade. I bought some brass lamp hardware for the neck - it's amazing the variety of hardware you can find out there. The coffee grinder is big enough to hold the microcontroller, and I drilled out a hole in the back for the power cord. The lamp neck is hollow and holds the wires that connect to the LEDs.

Software

I didn't make my own outdoor sensor to measure current weather conditions. Instead, Dark Sky generously provides a nice JSON API for getting current local conditions and forecasts. So I wrote a Python script that downloads new data once an hour, remembers the current conditions for the last 24 hours, and compares the forecast to the recent conditions to see if today's high temperature is forecast to be significantly above or below yesterday's high temperature. Based on that and the probability of precipitation in the next 24 hours, the script picks a color. If it's likely to be rainy and warm (or rainy and cold) then it displays two colors: green+red or green+blue.

There are 8 LEDs and they don't all glow the same color. The software chooses a "temperature color" on a blue-white-red gradient, maybe green for rain, and the rest are left dark. Then, those two or three colors are slowly cycled through all 8 LEDs, providing a gentle animation that confirms that the device is operating properly.

Troubleshooting

One glitch that I had to work around is flakiness of Raspberry Pi. Sometimes the WiFi connection would go down, or the whole Pi would wedge. So I wrote a watchdog mechanism on another computer that checks to see if the Weatherometer is still healthy, and if not then it powercycles it using a Sonoff S31 switch. Not elegant, but in practice it works fine.

Questions or comments? Email me at .

2022 June 13