Building a Weather Station with Raspberry Pi and Sense Hat: A Weekend Project
I closed the lid on my first weather station and watched the temperature climb.
Nothing outside had changed. The sun hadn't moved. What had changed was airflow — a Raspberry Pi sealed in a plastic box heats its own sensors, and the Sense HAT's thermometer sits a few millimetres from the CPU. My station wasn't measuring the weather. It was measuring itself.
That one lesson is why this project exists. Horus started as a copy of a well-known Sense HAT build and ended up with a waterproof case, a fan, a CPU-corrected temperature, joystick-driven displays, dew point calculation, exception logging and a feed into Weather Underground's public network.
It's a weekend build. It also teaches more about sensors than most textbooks. π¦️
The Short Version
- What you need: a Raspberry Pi (a 2 with a Wi-Fi dongle, a 3, or a Zero W), an Astro Pi Sense HAT, a microSD card, a power supply and a waterproof enclosure.
- What the HAT gives you: temperature, humidity and pressure sensors, an accelerometer, gyroscope and magnetometer, an 8×8 RGB LED matrix and a five-button joystick — all stacked straight onto the GPIO header. No wiring.
- What the software does: reads the sensors every 60 seconds, uploads to Weather Underground every 10 minutes, shows readings on the LED matrix in three visual styles, logs exceptions and starts itself on boot.
- The mental model: the Pi is a heater. Every raw temperature reading is ambient plus the Pi's own warmth, and the whole build is about subtracting the second part honestly.
Weather Underground: Your Station on the Public Map
Weather Underground runs a Personal Weather Station network, and joining it is free. You register, create a station, and get back two values — a station ID and an access key. Those go into the project's config.py, and from then on your readings become part of the public weather map. You and your neighbours can pull up your station on its own page.
Two settings decide how the station behaves. UPDATE_INTERVAL is how often the Pi reads the HAT — 60 seconds by default. UPLOAD_INTERVAL is how often it sends to Weather Underground — 600 seconds. Sampling often and uploading rarely is deliberate: the ambient temperature calculation needs a steady stream of readings, while WU needs nothing more than a value every ten minutes.
While you're testing, flip WEATHER_UPLOAD to False and nothing leaves the Pi.
The Sensor That Measures the Wrong Thing
The Sense HAT has a design flaw that every owner runs into: its humidity and pressure sensors both report temperature, and neither is thermally isolated from the Pi's processor underneath. On a Raspberry Pi 3, which runs hotter than the older boards, the raw reading can be several degrees above the room.
The Pi community worked out a fix. Read the CPU temperature, then use it to correct the HAT's reading — and the estimate lands within about 1 °C of true ambient. That correction is built into Horus, so the numbers going to Weather Underground are close to honest even with the board doing real work.
For honest rather than close, add a standalone sensor on the GPIO pins, away from the heat.
A Joystick, Three Styles, One Matrix
Most Sense HAT weather stations ignore the joystick. Horus makes it the interface. Push up or down and the LED matrix switches between temperature, humidity and pressure, each in its own colour. Push left or right and the visual style changes: an arrow showing whether the reading rose or fell since the last sample, plain digits, or a filled square.
It's a tiny thing, and it turns a headless box into something you can read from across the garden.
Taking It Outdoors — Briefly
The enclosure is a cheap waterproof electronics case from eBay that fits a Pi almost perfectly. The trouble started with the transparent lid. Closed, the case trapped the Pi's heat and the uploads to Weather Underground drifted wrong within minutes.
The fix cost almost nothing: holes drilled in the bottom of the case and a small 5 V fan blowing the warm air out. Holes and fan both face down, so rain can't get in. Either way, mount the station out of direct sunlight — a Pi in a plastic box in full sun will report a heatwave every afternoon.
π‘ Final Thought
Every sensor measures its own environment before it measures yours. The Sense HAT's thermometer is doing its job perfectly — it's reporting the temperature exactly where it sits. The problem is where it sits.
That's the real lesson of a weekend weather station, and it scales to every IoT deployment I've written about since: the reading is only as good as the placement, the airflow and the correction you apply on the way out. The hardware was never the hard part.
A sensor tells you the truth about where it is. Your job is to put it somewhere the truth is useful. π¦️
→ Full build guide: the Raspbian and SSH setup, the Python install, config.py line by line, autostart on boot, and photos of every stage of the enclosure: Read the full build guide
Follow for more IoT maker builds — part of my ongoing 101-story series. π¬
Comments
Post a Comment