Jump to content

Jeremy Harris

Recommended Posts

With the recent interest in air quality hitting the news, plus the TV programme earlier this week on an experiment to reduce the particulates and NOx for one day in the Kings Heath area of Birmingham. (it's still here on iPlayer: https://www.bbc.co.uk/iplayer/episode/b09m2djj/fighting-for-air ) I've decided to see if there's a way to make an affordable air quality monitor/data logger that I can fit outside and see what the air quality is like around here, and what impact things like diesel cars driving past, wood burning stoves, weather conditions etc have on it, from day to day.

 

What's interesting is that there are now some pretty affordable particulate monitoring sensors available, certainly good enough for hobby use.  Looking around I've found two or three for around £15 to £25 each, that output serial data in the form of a count of each size of particle, over a time bin.  From what I've read so far, it looks pretty easy to just  sample the air periodically and plot the concentration of particulates within the size bins over time.

 

As an example of the sensors available, here's a link to one that currently sells on Ebay for less than £17 delivered: http://www.aqmd.gov/docs/default-source/aq-spec/resources-page/plantower-pms5003-manual_v2-3.pdf?sfvrsn=2

 

Not sure when I'll get the time to build and test a unit, but it would be interesting, both to see how the air quality changes in a fixed location, and, perhaps, to fit one to the car so that I can correlate air quality with GPS position and time as I drive around.

 

I''m off now to see if I can find some equally affordable NOx sensors.

  • Like 1
Link to comment
Share on other sites

21 minutes ago, PeterW said:

https://www.mouser.co.uk/ProductDetail/MikroElektronika/MIKROE-1630/?qs=QhAb4EtQfbUP1yCGjXhiRA%3D%3D

 

I’m sure I’ve seen one of these as a home brew air quality sensor - just looking for the link. 

 

 

 

 

Unfortunately, that sensor is very non-specific, and gives an output when it senses NH3, CO2, NO2, benzene, smoke or several other substances, with no way of differentiating between any of them.

 

I already have some NDIR CO2 sensors, so can specifically measure CO2 levels, what I'm hunting around for is a specific NO2 sensor, that doesn't respond to anything but NO2

 

25 minutes ago, SteamyTea said:

What a good idea.

I would be quite interested in making a couple of them too.  One for home and one for the car.

Maybe the home one should be an inside and outside one.

 

Given that the sensors aren't that expensive, then it should be easy enough to log data from inside and outside.  I like the idea of driving around with one, logging GPS position and time along with the particulate data.  I think you'd probably get a pretty interesting data set after a while. There were soem complaints about the granularity of data on the BBC pollution check tool : http://www.bbc.co.uk/news/science-environment-42566393 most probably because I think they averaged post code areas, so localised pollution hot spot data was diluted a fair bit.

 

I'm really curious to see what our "rural" air quality is like, particularly when there are localised "smoke events" such as wood burning stoves running, or even just the bus sat running at the bus stop for ten minutes, next to the school.

Link to comment
Share on other sites

Following this topic........air pollution is of huge importance to me.

 

I have recorded the BBC programme but not had chance to watch yet.

 

I have a Dyson air purifier in my sitting room. The room is carpeted and has an open fireplace (we have sealed with tape and plastic as best we can). It affects me badly I cannot spend time in the room without the air purifier running.  I have the air purifier set to automatic and high air quality so it runs 24/7 according to the air quality it detects.

 

Amazing machine, not cheap but made this rented house bearable for the duration. It has particulate monitors built in and I can see via an app on my phone what the air quality is/was at any given period in the last 7 days.

 

Will watch with interest any more affordable options on monitoring as hopefully at new house MVHR will do the air cleaning side of it.

 

 

Link to comment
Share on other sites

I'm  still digging out information.  I've found a fairly specific NO2 sensor, that had a bi of hydrogen sensitivity, but should be OK for outside NO2 measurements: https://sgx.cdistore.com/datasheets/sgx/1107-Datasheet-MiCS-2714.pdf

 

The bare sensor NO2 is around $9, so pretty cheap, I just need to find a source to buy one or two, preferably from a supplier that sells it at a reasonable price already on a breakout board.

 

Using sensors like this together with any cheap flavour of microcomputer (I tend to use PICs, but you could splash out and use a Raspberry Pi) looks to be very easy indeed.  It needs a real time clock, and I'm coming around to the idea that a single unit that includes a particulate sensor, NO2 sensor, perhaps a CO2 sensor, a relative humidity sensor and a temperature sensor, together with a small GPS module to provide time and position data for each sample, might be the best way to go.  Adding a display, as I did on the temperature/humidity/CO2 air quality logger that a few here have borrowed, might be useful, too, as it's handy to see real time data as well as just recording it for later analysis.

  • Like 2
Link to comment
Share on other sites

1 hour ago, Alphonsox said:

 

Looks interesting, but doesn't separately bin the PM2.5s and PM10s, it just allows operation as either a PM2.5 counter or and PM10 counter, not both at the same time.

 

I've found a couple of others, including one that seems to have four bins, 0.1µ to 2.5µ, 2.5µ to 5µ, 5µ to 10µ and over 10µ as far as I can tell.  I'm not sure if there's any merit in making measurements that fine, as the standard seems to be to go from around 0.1µ to 2.5µ in the PM2.5 bin and put anything from 2.5µ to 10µ in the PM10 bin.  I need to do a bit more reading up on the comparative methods of measurement used for simulating the standard BAM method ( https://en.wikipedia.org/wiki/Beta_attenuation_monitoring).

Link to comment
Share on other sites

OK, I've spent a few hours today sorting out the basics, and looking for sensors. 

 

So far I've ordered one of these: http://www.aqmd.gov/docs/default-source/aq-spec/resources-page/plantower-pms5003-manual_v2-3.pdf?sfvrsn=2  particulate sensors, as it seem to be the best compromise between cost and performance.  It automatically bins particulates into up to 2.5µ and 2.5µ to 10µ bins and outputs the data in an easily read binary form, that pretty much any microcontroller or single board computer could use.  These are also readily available on Ebay for around £16 to £17, so I've ordered one to try.

 

There's a slight problem with laser particulate sensors like this being spoofed by water clinging to tiny particles, which means they tend to under read PM2.5s when the humidity is high, or more specifically when the particles may be at around dew point for the air humidity.  So this means measuring humidity and temperature.  I've opted to go for the BME280 combined temperature, humidity and barometric air pressure sensor, as it's cheap, accurate and linear: https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BME280_DS001-12.pdf I've found plenty of suppliers for this as a module, already fitted to a breakout board, for just over £1 each, so have 5 on their way.

 

The easy way to get both accurate time and position data is a cheap GPS module.  I have one of these running as the master clock in the new house, and it's like having your own atomic time reference at home, it's that accurate, plus it never needs setting.  The price of these modules has come down, so I've managed to get a small (roughly 20mm square) one for less than £6.  The one I've opted for uses the Ublox chipset, and I know from past experience that these are dead easy to use.

 

The remaining problem is to measure NOx, but I've found a sensor that seems to do the job OK, the MICS-2714: https://sgx.cdistore.com/datasheets/sgx/1107-Datasheet-MiCS-2714.pdf It's not ideal in terms of the package, but there are a few suppliers that sell it on a break out board, that should make it easier to use.  I'm just digging out the best one at the moment.

 

I think I've sorted the NOx sensor problem.  I found an updated version of the one I'd found earlier, that includes CO sensing, plus I can buy it from Bangood.com for around £22 mounted on a breakout board.  The sensor is the MICS-4514 : https://sgx.cdistore.com/datasheets/sgx/1107-Datasheet-MiCS-2714.pdf

 

I'm looking at two display options, either a display directly on the measurement box, or a remote display with a wireless link.  The latter might be more useful for a sensor unit that's to be permanently located, the former maybe more useful for a portable unit, perhaps one run from a car power supply.

 

So, the basic box at the moment should be able to measure and record  time, position, PM2.5 concentration, PM10 concentration, air temperature, relative humidity, air pressure and NOx concentration, which is probably good enough.  I still need to make a few decisions on things like power supply, frequency of taking measurements etc, as some of the sensors are quite power-hungry, so won't run for long on a battery supply.

 

When I've worked out the full power budget, and worked through how long it takes each sensor to warm up and be ready to take a reading, I should be in a better position to see what options there are for powering the unit.  My preference for a fixed unit, would be to have it sheltered under a solar panel that charges a battery to operate it and radios data back to an indoor display that can both show the data and log it to a USB stick.  I could make it so that it connects to the LAN etc, but frankly I'm averse to connecting anything home brew to a WLAN, just on privacy and security grounds.  It would be easy enough to get these sensors to work on something like an ESP8266 I think, if anyone wants to go down the route of integrating sensing into their WLAN.

 

My solution may not suit everyone, as I'll undoubtedly use a couple of PICs to do the hardware stuff, drive displays etc, on the ground that they are dirt cheap, very lower power and I can write code for them in my sleep.  Any microcontroller system or SBC could be used, albeit with greater cost  and code complexity, it's really just personal choice.  I'll try and stick to the basic building blocks of code, how to read the sensors, how to do the arithmetic to get the results into a meaningful form, ways to display and log the data, etc, rather than go for a full blown set of instructions on how to build a specific unit.  If I get it going, then I may find time to publish details of exactly what I've done and the code I've used, but that may not suit everyone.

 

 

 

 

Edited by JSHarris
Edited to change NOx sensor
Link to comment
Share on other sites

Dug out my BME280 sensors and fixed them up to my RPi

Trouble is I am not getting a humidity reading.

It would also be nice if it was easy to use the SPI bus rather than the i2c one.  I have the RTC on that and one BME280.  If I plug in another BME280, it gives gibberish readings for the air pressure.

 

How easy is it to make something that can cycle though the sensors, maybe just by switching the Vcc in and out.

 

 

BME280image.jpg

Edited by SteamyTea
Link to comment
Share on other sites

Not sure why you're not seeing the data from all three registers in the BME280.  By default it uses all three when taking a reading, so it comes down to your code.  I've never used high level stuff to do this, I've always used the raw I2C commands to just read the registers, then done some bit manipulation to get meaningful values.  There are several modes in which the BME280 can be operated in at the basic level, which each being best suited to a particular application.  The native resolution is high, but it includes the ability to oversample to reduce noise, and also includes an IIR filter to smooth the data if a fast response time isn't required.

 

I think you probably need to look at the I2C write commands that are being sent to the BME280, both to set the initial operating mode and to ensure the data is in the registers, ready to be read using the I2C read commands.  All three sensors in the BME280 can be configured to be enabled or skipped during initialisation, and it seems like that the I2C write commands you're sending at initialisation may be disabling the humidity sensor.  That may well cause the humidity register to be empty when you try and read it.

 

Within the BME 280 there are several uniquely addressable registers, that are best burst read, starting at address 0xF7 and ending at address 0xFE (to read temperature, pressure and humidity).  The data are read out in unsigned 20 bit format for temperature and pressure and 16 bit format for humidity, hence the need for bit manipulation after a data read to reconstitute the data into meaningful bytes an words.  You also have to take account of the calibration constants that the device also puts out and use these to correct the raw data (each device has it's own calibration constants hard stored internally and read out with every full register read).


Cycling though I2C sensors is dead easy, no need to mess about with turning them on and off.  Each sensor has a unique address on the I2C bus, so will only accept write or read commands when they are preceded by that sensors address.  As such you can select a sensor on the bus to read, send it a write command (if it needs it) to tell it to make a measurement, then read the data, when it's ready, using a read command. 

 

The same applies to one-wire devices, with the address being the hard-coded serial number of a particular device in that case.  Some conventional serial data connected sensors can be uniquely addressed and accessed like this, some can't.  The particle detector I've opted to use can't be uniquely addressed, so is going to use two data lines that are dedicated solely to sending and receiving it's data.

Edited by JSHarris
Link to comment
Share on other sites

I have just ordered a new RPi3 with wireless as I thought it may be down to using the original RPi1b.  I am using the code written my Matt Hawkins, bme280.py.

I have similar issues with the GPS module.  It 'sees' it but can't get any data from it, just says it has 'no fix', which may or may no the the case.

Shall give it a day or two break until I get the new 3.

 

Link to comment
Share on other sites

It'll be a code problem, not a hardware problem, for sure.  Even a 50p PIC can read the data from a BME280 and stick it up on a display, having corrected the data using the calibration factors that are built in.

 

I suspect the code you have is not initialising the BME280 to enable all three sensors, or may not be reading the full register range from OxF7 to 0xFE in burst mode.  It may well be just using the cut-down burst read mode from 0xF7 to 0xFC, which will only output data and correction factors for the temperature and pressure sensors.  It may not even be reading the registers in burst mode at all, and according to the data sheet this is not recommended, because it may cause bytes to get mixed up if the registers are read one by one.

Link to comment
Share on other sites

Depends.  Using WiFi can be done, but it takes up a lot of processor overhead, so isn't ideal.  If you want to use things on a WiFi LAN then you'd be better using something like a cheap ESP8266 and coding it using something like Node Red.

 

If you're happy to use a non-WiFi wireless solution using a licence exempt system, then it's dead easy to use these with a PIC.  If you opt to use a PICaxe, which is a PIC pre-loaded with a pretty good BASIC-like interpreter, then coding for hardware stuff becomes pretty easy.  The sticking point with it is that the PICaxe is designed for education, so is pretty cheap and easy to use for STEM type projects, but it lacks native floating point math support and that may or may not be an issue.  Driving things like serial data over wireless links is dead easy though.  Our PV diverter works like this, as do other monitors around the place.  It's just a matter of sending serial data to a cheap wireless transceiver, and getting it back again via a serial input.

 

Having no floating point math, and only a restricted numerical capability (positive integers only up to 216) seems limiting, but in reality it's not really.  There are pretty easy techniques to get around these, like using twos-complement to express negative numbers and adjusting the way data is handled internally to remain within the integer size limit.  The lack of floating point is really just a display issue, as you don't need to think in decimal at all when doing all the math in the processing.

 

There are various PIC compilers around for other languages, some free, some paid for, and some include floating point math and a larger integer range, I believe.  I grew up using 8 bit microcontrollers to build instrumentation with, so my view is heavily influenced by that, mind.  After 30 odd years or more of working within 8 bit limitations you tend to develop a library of techniques to overcome some of the limitations.

 

The ESP8266 scene is probably worth a look, though, as it's all open source and no where near as messy as the world of Arduino has become.  The Arduino concept was great, but there is now so much SOUP** around that frankly I wouldn't trust anything made with one.  I've had far too much experience of the way SOUP causes unsuspected problems, because the person who used it in their code didn't fully understand either the competence (or lack of) or what was going on in the head of the person that originally wrote the SOUP (and which made have been modified by person or persons unknown since, anyway).

 

** Software Of Unknown Provenance, in this case Arduino C libraries written by unknown people and often used blindly by people who haven't a clue as to what their source code looked  like, or wouldn't understand it if they saw it.

Link to comment
Share on other sites

  • 3 weeks later...

All the bits have arrived whilst I've been laid up, so all I need now is some spare time to put everything together and start writing some code to get it working.  One of the main issues will be power consumption, as some of the sensors use a fair bit of current.  This makes a battery powered version a bit challenging to design, especially as some of the sensors aren't going to be that easy to just power on and off whenever a sample needs to be taken.

 

Right now I'm behind with preparation for tree planting at the front of the house, so will have to get that sorted first.

Link to comment
Share on other sites

I was surprised how small the Plantower particulate monitor is.  Looks easy enough to interface too, though, just a matter of reading serial data.  I went for the PMS5003, not sure whether it's significantly better/worse than the PMS3003, I just went on a review comparing the three main models that Plantower produce.

Link to comment
Share on other sites

 

Will Air-Quality Monitoring Be The Next Health Tracking Craze?

The startup Plume Labs gives everyday citizens the tools to measure the pollution levels around them–and hopes they’ll use them to advocate for better environmental policies.

 

https://www.fastcompany.com/40526325/will-air-quality-monitoring-be-the-next-health-tracking-craze?utm_content=buffer3ed40&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

Link to comment
Share on other sites

Have you seen PurpleAir? USA based and a bit pricey to import, but ready made internet linked sensors. They list some of the parts used here - PMS5003 Laser Particle Counter (same as you picked!) and an ESP8266 chip programmed from an Arduino: https://www.purpleair.com/technology

Edited by DenkiJidousha
typo
Link to comment
Share on other sites

I bought a purple air monitor a few months ago. I doubt that JSH would be interested; apart from the cost it's very much an IOT device. It demands an internet connection so has probably got lots of security holes and it uses Google maps. They're system isn't setup to let you store data locally easily, which rather surprised me. I scrape data from the devices web-server and store it locally, but, for some bizarre reason, the data gets flaky if the internet connection goes down.

 

Having said that, it does give quite interesting results and useful comparisons to other sensors; there are about 10 in the UK now.

 

The main reason that I bought it was to check pollution from wood burning; our house is heated with a log boiler. Apart from lighting and refuelling there is no measurable increase in particulate levels over the very low background. The peaks when starting are usually less than the particulates I get when roasting coffee, and they are over much more quickly! IOW, burning wood doesn't have to be a source of pollution.

 

Another thing that I've noticed is that sometimes you get an increase in particulate levels over a wide area (most of southern England) which has no obvious cause, but stops quickly if you have an air cleaning event like rain. I guess that this could be pollution imported from abroad.

 

This shows most of the English sensors.

 

https://www.purpleair.com/map?&zoom=8&lat=51.98340589327153&lng=-2.0000451278685887&clustersize=30&orderby=L&latr=3.271820379132471&lngr=6.2567138671875

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...