Weather monitor
FEATHER-LIGHT WEATHER MONITOR
Jonni Bidwell doesn’t fake it till he makes it. Makes a Pi-powered environment monitor, that is…
Northern hemisphere summer may be over, but no more heatwaves doesn’t mean the weather shouldn’t be monitored. In fact, we should probably pay yet more attention to it. To that end we present here instructions for perhaps the world’s most over-engineered thermometer, humidity meter, moisture sensor and air-quality meter.
Inspired by this month’s coding cover feature, we thought that we’d continue our voyage of programmatic discovery. But this time we’re wanted to get physical. Physical computing, that is. We’re going to be reading environmental sensors and displaying data on a small TFT screen, all through the magic of a Raspberry Pi. We’ll be using Python again, but also the venerable Gnuplot (for drawing graphs), Cron as well as a smidgeon of shell scripting to automate the data gathering.
As we’ll soon discover, sometimes code can appear unwieldy. However, by seeing through boilerplate code and concentrating only on the lines that matter, we’ll hopefully help you to leverage the incredible power of Python. In addition, you’ll find all of the code (thoroughly tested, of course) on our lovely new Gitlab repo at: https://gitlab.com/lxfjb/pydisplay.
This month’s coding cover feature inspired us to continue our voyage of programmatic discovery. This time we’re dabbling with physical computing, in particular reading environmental sensors and displaying data on a small TFT screen, all through the magic of Raspberry Pi. We’ll be using Python again, but also the venerable Gnuplot (for drawing graphs) as well as a smidgeon of shell scripting to automate the data gathering.
We used a Raspberry Pi 3 model A with an Adafruit 1.3-inch PiTFT bonnet (like a HAT, but smaller). That bonnet packs a 240x240 IPS display controlled over SPI (Serial Peripheral Interface), as well as a joystick and two buttons (which we won’t use). The display is powered by the ST7789 chipset, which is used in lots of other Adafruit TFTs, and the code here should work with all of them. There are, of course, plenty of other Pi displays you could use instead, but you’d need to adapt the code given here to use them.