Weather HAT + Weather Sensors Kit

Come rain or shine, you’ll know all the details with this fully-fledged weather station. By Phil King

We’ve seen various Raspberry Pi DIY weather station projects and commercial kits before, but the Weather HAT makes setup a whole lot easier. For starters, the board features standard telecoms-style RJ11 ports that enable you to just plug in the connectors from the wind speed, wind direction (vane), and rainfall sensors. Similar to the ones formerly available from Maplin stores, these three plastic sensors are provided in the full Weather HAT kit – or, if you already have some, you can buy the Weather HAT on its own for £36 / $41. Secondly, the Weather HAT has an on-board Nuvoton microcontroller with a 12-bit ADC to read analogue signals from the sensors reliably. A nice bonus is that four extra analogue input channels are broken out in an unpopulated header on the bottom edge of the board (along with 3V and GND), so you could add extra sensors. Not only that, but there’s an I2C header on the underside of the board.

Whether you’ll need extra sensors is a moot point: the HAT already incorporates a standard BME280 temperature, pressure, humidity sensor and an LTR-559 light sensor – as featured on Pimoroni’s earlier Enviro boards. A 1.54-inch colour LCD screen completes the package, with four tiny push-buttons around it.

Station setup Assembling the weather station takes only around 15 to 20 minutes. The wind direction and speed sensors are screwed onto either end of a sturdy plastic arm that fits into the top of a two-section hollow metal mast. A shorter arm is clamped to the mast and holds the rain sensor. We then planted the metal mast into some garden soil, but clamps are also supplied in case you want to secure it to a drainpipe or something similar. As mentioned, the sensors’ RJ11 connectors simply plug into the labelled sockets on the Weather HAT. If you’re wondering why there are only two sockets, this is because the wind speed sensor’s connector fits into a socket on the wind vane, and then wires from both are routed to one RJ11 connector into the HAT.

The cables are approximately 3 m long, so unless you use extenders, your Raspberry Pi needs to be located fairly close by. Naturally, if this is outside, you should place it in a weatherproof box (not supplied). You may also need a mains power extension. Alternatively, you could place your Raspberry Pi indoors, although you then wouldn’t get accurate outdoor temperature and humidity readings.

The sensors’ RJ11 connectors simply plug into the labelled sockets on the Weather HAT

Software library As usual from Pimoroni, there’s a fully-fledged Python library for the Weather HAT, complete with code examples. The main weather.py example shows readings from the sensors on the mini LCD, with push-buttons used to switch between individual sensor readings and between a digital readout or bar graph. We particularly liked the wind display, with an arrow rotating to show the direction, its size indicating the speed. Note that you may well need to use a compass and rotate the metal mast so that the wind vane is oriented to obtain accurate direction readings.

In the long term, you will want to keep a log of your data and view it on a web dashboard, which is where the Adafruit IO code example comes in. Just sign up for a free account at adafruit.com and you can build your own custom dashboard from preset blocks such as line graphs and gauges, linking them to the already created feeds coming from the Weather HAT. Within minutes we had our own weather web dashboard set up.