Maker of open-source software and hardware.

Building an air quality monitor

A while back I became interested in air quality data after noticing that our local city council installed sensors next to busy roads, and that the data is available online.

When I saw that Pimoroni had a new environmental sensor add-on for the Raspberry Pi, I started thinking about building my own monitor to get more local, finer-grained data than provided by the city's open data. The Enviro+ from Pimoroni does it all, but is a bit expensive at £45. I would also need to pay extra for the particulate sensor (£25), and get a Raspberry Pi Zero W (£13) to attach everything to. That's a setup cost of £83!

I then came across an article in Hackspace Magazine Issue 21, where they described making an air quality monitor using just an SDS011 particulate sensor and a Raspberry Pi. In their example they upload their data to the Adafruit IO service. I wanted to use a CHIP I had lying around instead, but could not get the Adafruit IO library to work on it. The CHIP is still running Debian Jessie, and getting it to work with Python 3 and the newer OpenSSL libraries is just more trouble than it's worth.

The Pimoroni website mentioned Luftdaten, an open data project for contributing real-time air quality data, and I was pleased to discover that Luftdaten has instructions for building your own air quality monitor using an inexpensive ESP8266 and the SDS011 sensor.

I ordered an SDS011 sensor from AliExpress for £14.69 (inc. P&P) and it only took a couple of weeks to arrive. I also got a DHT22 temperature & humidity sensor for £3.99 on eBay (incl. P&P).

I also discovered a design for a 3D-printed enclosure via the Luftdaten website, which was much easier to make than trying to get the sewage piping suggested in their assembly manual (as the pipe sizing is not readily available in the UK).

Air quality monitor with particulate sensor and humidity/temperature sensor

After printing the enclosure, I realised I needed a new ESP8266 board. The NodeMCU v2 I have was thinner than the NodeMCU v3 the 3D-printed enclosure was designed for. I got the NodeMCU v3 on eBay for £3.89 (incl. P&P). That makes a total cost of £22.57 for the electronics, excluding the cost of printing the enclosure.

Fitting everything inside the enclosure was quite challenging, as it's a very tight fit. Maybe I'll design my own enclosure one day (with better waterproofing), but this will do for now. I used copious amounts of hot glue to keep everything in place, and could definitely have done a better job at keeping it neat. Oh well, it works and that's what is important.

You can have a look at the sensor data on the Luftdaten website.