Raspberry Pi Air Monitor System

 Air Pollution Measurement

Man made air pollution is a major cause of diseases such as lung cancer, stroke, heart disease, asthma, resulting in around 30,000 premature deaths each year in the UK alone.

The Covid episode has highlighted how susceptible our lungs are to invasion by a virus. It would seem we need to take far more precautions over what we breath in, both viral and dust particles.

Air pollution causes can be broken down into

- sulphur dioxide

- carbon monoxide

- ozone

- nitrogen dioxide

- particle pollution

This blog is about the last type, the particles are generally broken down into 3 sizes

- 1 micrometer size, refered to as PM1

- 2.5 um, PM2.5

- 10 um, PM10

It seems reasonable to know what levels we are subjected to. Some pollution is beyond our control as individuals – traffic, industrial. But some is self inflicted – barbecues, wood burning stoves, coal fires. garden fires, cooking – and therefore controllable. But how much pollution do these activities really produce. The simple answer is – measure it!

So the idea of a Raspberry Pi based particle monitor was born. Raspberry Pi was my first choice as a have a few left over from my beekeeping days when I monitored the hives for a variety of reasons. And I'm familiar with programming them and with making the data visible real-time on the web.

My objective is  to try to measure particle levels from as wide a range of particle generators as possible.  As problem areas are highlighted, consideration can be given to finding a way of improving things.

Monitor Hardware

This is quite a simple project in terms of hardware, just a Raspberry Pi and an SDS011 particle density measurement device that plugs straight into the Pi's USB port. Plus a power supply from a standard USB charging lead and then some sort of enclosure.

The SDS011 is available on eBay from around £25, the Pi cost depends on which type you buy but expect £10 upward. The SDS011 incorporates a fan to draw in air which then passes through a laser beam and reflected light is measured to give particle density. The electronics is able to measure two particle densities, PM2.5 and PM10, these being the standard particle sizes specified in all the literature on pollution levels.

PM2.5 is considered far more hazardous to human health as this smaller size can get into the body. 

The Raspberry Pi's job is to run software to

    - get the particle data off the SDS011

    - record the data at regular intervals and pass it onto some sort of web based graphical display. This requires a WiFi connection.

Two methods of displaying the data are possible

   - using an online data logging and display site called ThingSpeak

   - using a personal web page running Javascript display software

The ThingSpeak route is by far the easiest but is less flexible. Both require a reasonable knowledge of programming a Raspberry Pi using Python language.

Early Observations

These relate to the Javascript weatherstation web page. The Thingspeak approach was useful to get something working but I soon realised I wanted a lot more control over the display format.

So everything here relates to the web page, which is at www.mecol.co.uk/weather/logplotter.html.

Just visit and scan the logs. Best with a laptop as the phone version doesn't have all the touch controls functional as yet. 

It's basically a weather station - with an extra page added to show particle density The weather station has been there for several years in various forms and it was fairly easy to build on this. It's also useful to be able to compare weather against particle density at the touch of a key, or for phones by tapping on selected areas of the screen.

I displayed both PM2.5 and PM10 particle sizes initially but the two curves were much the same with PM10 being somewhat higher values. The screen was too cluttered however so I've made the PM10 an optional display using a screen option to toggle between the two. And I'll get a monthly display working at some stage – work in progress!

Units are microgrames per cubic meter – ug/m3. For the EU there is the somewhat optimistic statement that

From 01 January 2020, the PM2. 5 annual mean values will no longer be allowed to exceed a value of 20 µg/m3.

The WHO recommended maximum figure is 15 ug/m3, not so different.

The UK has similar 'ambitions' enshrined in legislation. At least these bits on unenforceable legislation give a feel for what should be acceptable. There is nothing magical about 20 ug/m3 – nothing particularly terrible will suddenly happen once it is exceeded. A more sensible approach is simply to try to eliminate all preventable pollution. Which is the point of this monitor exercise – know your enemy!

----------------

From 10th May the monitor was left outside by the doorstep as that was convenient for plugging into an outside mains socket. I covered it with a piece of old lino to keep the rain off and put a brick on it all to prevent wind problems. All a bit rough and ready but the first objective was to get some logs and iron out any software problems.

Here are a few interesting screengrabs from the display of the PM2.5 logs. Note that the particle size is in yellow at the bottom of the graph. The hourly markers are at the top. Particle density is shown on the left hand side in units of ug/m3.  Bear in mind the WHO recommendation of 15 ug/m3 

Most graphs are of the PM2.5 particle size as this the most hazardous. Generally the less dangerous PM10 particle graph looks much the same but is some 30% higher in scale.. 



Typical quiet day, early morning rise with local traffic and a few evening spikes - possibly someone's barbecue although it could be passing cars. 


A lot of early morning pollution for some reason, and late evening spikes which have to be late night traffic. Boy racers no doubt.


This is two days worth joined together to show what appears to be a cloud of pollution drifting in, lingering all night and clearing down to normal low level by mid morning. No idea what this was caused by but it's not trivial. 


Garden Shredder

I've long suspected my garden shredder of being a source of air pollution and this measurement confirmed it. The sensor was about 2m away from the shredder and the 20mg/m3 spike coincided with the operating time. I now wear a quality mask as well as ear defenders when using this fearsome device! 

Bonfire Night

As would be expected Bonfire Night brings considerable air pollution. The above plot spans Saturday 4th November and the following Sunday morning. The graph goes off the scale, it actually  peaks at 124ug/m3 for PM2.5 and the corresponding peak for PM10 was 264 ug/m3. It is noticeable how long the particles take to clear, about 2am. I went out at 10pm to check the air and could smell nothing, and there was no sign of it being bonfire night. The pollution had obviously drifted in from some distance. The wind was very light and from the NE. 

A Second Monitor

I decided that a portable monitor would be of value, something I could leave somewhere for a few hours, or carry around with me as I walked or cycled. So it had to run off a small battery. I homed in on a different sensor, a PMS 7003. And I thought I'd try the much smaller and lower power Raspberry Pi called a Pico. Developing the software for the Pico meant starting from scratch and a long learning curve. The Pico is totally different from the more conventional Pi's. But it has turned out to be time well spent as the Pico + PMS7003 combination works very well indeed, and is a fraction the size of the original sensor. In fact it fits into a old hearing aid box I happened to have lying around.



Raspberry Pi 3 with SDS sensor on left, Raspberry Pi Pico with PMS sensor  on right together with a  rechargeable lithium battery which will power it for about 3 hours.

This new unit, and the previous SDS unit, work on the principle of logging results in local memory and then if there is a wifi connection FTP upload the accumulated results to web space every 5 minutes. From there the data can be displayed as an extension page on the Blakedown Weatherstation web site at

http://www.mecol.co.uk/weather/logplotter.html

So for the portable Pico unit it can accumulate results at some remote location, possibly running on a small battery, and then it will automatically upload the data when it's back home within wifi range. 

The Python software for this build is freely available as a zip download from  http://www.mecol.co.uk/public/picoPMS.zip

An interesting exercise was to compare the two units to see if they produced similar results. To this end, both units were placed in a large shoe box, a short burst of particles from a smoke detector test aerosol was injected and the box closed leaving just a few small holes for the smoke to slowly escape. After a few hours the logged results were compared by copying both log files into a spreadsheet in order to graph the two sets of readings together.


As can be seen, for levels below 800ug/m3 there is very good agreement. At the higher level of particle density (ie immediately after injecting the smoke) the PM7003 reacted far quicker and gave somewhat higher readings.  Basically, at expected working concentrations the agreement is very reassuring.


Early results off the Pico monitor were copied into a spreadsheet, which was a quick way to generate graphs. This explains why the Pico results look very different. Shortly I'll update the javascript weatherstation display software so that the Pico data can be displayed in the same format as for the rest of the weatherstation data including the earlier air pollution monitor. This may be done by the time you read this. Check out the weatherstation web site.

Wood Burner Pollution

There have been several newspaper articles highlighting the pollution problems surrounding wood burning stoves so I was looking forward to lighting my first fire of the year so I could carry out some tests of my own. I've had a woodburner for some 20 years and it's made a huge difference to our winter nights. Not only is it a phycological boost having a fire in the living room but it has drastically reduced our heating costs. Especially useful over the last few years with gas prices rising so sharply. So it was with some trepidation that I started doing my tests.

What has come out of this exercise is that the pollution level, in the living room, is very much dependent on how the fire is managed. Early results were quite alarming. But a change to how we managed the fire has brought the levels down considerably. Whether they are low enough to live with is a matter of opinion and gets down to the issue of 'what is a safe level?' and indeed, is there any safe level at all? This topic will be picked up at the end of the blog, for now here are some results.

Generally particle density was measured close to the fire itself, on shelf some 4ft above the fire door. And again on the opposite side of the room where we sit. Some 12ft away from the fire, about 3ft high.


This is a particularly bad example of firing up the woodburner. It didn't burn well and we had to open the door to add kindling. Then when it was burning fairly well the door was opened to add some larger pieces of wood and a lot of smoke came out - the big jump in the graph.

And below is a particularly bad set of results for the opposite side of the room.


The graph shows the various times when the door was opened to feed in more fuel. The graph covers the time roughly from 18.00 to 21.00, with samples every minute on the Pico monitor. I don't know why this was so bad, the stove seemed to light easily enough. What is apparent is that once particles are in the air they stay there for quite some time, around an hour. 

Following on from these worrying results we have put in place a set of rules for dealing with the fire.

1. Lay the fire with plenty of paper, quality kindling, then larger pieces of wood at the top, build it as high as physically possible. The objective is to get to a high burning temperature  without having to open the door.

2. Have wood ready to put on when the door is open so as to minimise open time.

3  Open the door slowly to avoid sucking out smoke.

4. Ensure good ventilation, leave the room door slightly ajar.

5. Keep the fire burning bright - don't let it cool down. Don't use new/damp wood, obviously.

6. When closing down, don't damp down, burn off any remaining wood rapidly.

And check the seals regularly. Check the asbestos rope door seal and the glass to door seal. As it happens I replaced both seals last year, and was surprised how bad they were. Regular replacement every few years is probably wise. And wear a good mask to avoid the fine dust..   

Having learnt from the above, curves for the woodburner are now much more 'acceptable'. 

The plots below are for a fire on 10th Nov, using both sensors.

Particle density near woodburner  - SDS sensor


For both graphs above the density is comfortable below the 15ug/m3 level. What is noticeable for the second graph is that once particles are in the air they stay there for a long time after the fire dies.. 

How Dangerous is Particle Pollution?

According to the World Health Organisation,  between 28,000 - 36,000 early deaths each year are caused by air pollution in the UK. Globally, the combined effects of outdoor air pollution and household air pollution are reputedly associated with 6.7 million premature deaths annually.

Air pollution is one of the greatest environmental risk to health. By reducing air pollution levels, countries can reduce the burden of disease from stroke, heart disease, lung cancer, and both chronic and acute respiratory diseases, including asthma.

In 2019, 99% of the world’s population was living in places where the WHO air quality guidelines levels were not met.

In 2010, the UK Environment Audit Committee estimated the cost of health impacts of air pollution was between £8billion  & £20billion. 

Particle pollution is just one of several components responsible for what is generally termed air pollution. This Blog obviously only covers particle pollution. For which, currently, there seems to be no clear evidence of a safe level of exposure (ie a level below which there is no risk of adverse health effects.)

The Cancer Link

"Traditionally, it was thought that chemicals in the environment caused cancer by mutating DNA. It turns out the air pollution doesn’t mutate DNA directly. Instead, it creates an inflammatory response in a white cell called a macrophage. This cell releases an inflammatory mediator that can turn certain cells (those with a particular cancer-causing mutation) in the breathing apparatus of the lung into a cancer stem cell. "

So the cancer-causing mutation and the air pollution work together in the right cell at the wrong time to initiate a cancer. It would seem it all down to chance. 


Antibiotic Resistance & Air Pollution

Reduced antibiotic resistance is one of the fastest-growing threats to global health. Estimates are that it is already the cause of 1.3 million deaths a year. 

Data from more than 100 countries spanning nearly two decades, indicates that increased air pollution is linked to rising antibiotic resistance  Without changes to current policies on air pollution, by 2050 the level of antibiotic resistance worldwide is predicted to increase by 17%.

And PM2.5 particles are seen as being the biggest factor. 

ABR bacteria are developed in humans and spread via the food chain. Like everything else, antibiotic resistant bacteria evolve naturally though mutations and natural selection. It is possible that the PM increases mutation rates of the bacteria thereby effectively speeding up the evolutionary process.  


WHO Recommendations

The WHO recommends that no one is exposed to more than 15 micrograms of PM2.5 per cubic metres of air (15ug/m3) on average over a 24-hour period. 

But where does the 24hrs come from? The implication is that short exposure to very high pollution levels is somehow cancelled by long exposure to low levels, which, intuitively, seems unlikely. From comments on the cancer link above, it would seem it all down to chance. So anything we can do to reduce pollution will help nudge the risks in the right direction. The graphic below was taken off a government web site. While the figures can only be taken as very approximate, the interesting thing is they say every 1ug/m3 reduction counts. ie. saves about 1000 strokes/year or about 250 lung cancers a year. These are very significant benefits. 



Future Action

In the very near future |I'll be overhauling my weather station web page software to fully incorporate both sensors. And I'll be adding a page to show local pollution levels using data acquired off internet APIs.  Hopefully this will show realtime plots of sulphur dioxide,  carbon monoxide,  ozone,  nitrogen dioxide, and particle pollution, for Kidderminster. And I may relaunch the weather station as an environmental monitoring station - which is what it is gradually becoming.  

The weatherstation started out as a traditional collection of sensors measuring temperature, pressure, rain, wind, solar intensity, feeding into off-the-shelf website software. Over the years as sensors failed, I've gradually moved over to using API data. And my own display software has replaced the original web software. So I've abandoned the original hardware and software. The only sensor I now have is solar intensity (because it's the only way to measure what's actually falling in my own garden) and a recently added UV level sensor. 

And I'll be carrying out more remote monitoring. Attaching the monitor to the front of my bike and cycling through city traffic would be interesting I suspect! And monitoring suspected pollution hot spots. Plus measuring the pollution footprint of my own woodburner. Ideas for further monitoring are welcome.

Generally the SDS monitor is left at the front of the house monitoring pollution drifting in from the north, so traffic pollution only shows when there is a predominantly northerly wind. The PMS sensor is moved around the house between kitchen and lounge. A 24/7 plot of levels is available on my weatherstation web site. Only limited display controls are currently available of a phone display, best use something with a full keyboard like a laptop. The logger display software has now been updated to show both sensor results on the same screen.  Visit www.mecol.co.uk/weather/logplotter.html. If things don't seem to work properly it could be you've visited during one of my many software updates so try again later.

Related articles

https://www.wired.co.uk/article/charles-swanton-air-pollution-disease-deaths-

https://www.gov.uk/government/publicationsAs the house is on the south side of the roaD/health-matters-air-pollution/health-matters-air-pollution

https://www.exceptional.com/homes/home-improvement/cracking-down-on-wood-burning-stoves/

https://www.theguardian.com/society/2023/aug/07/air-pollution-linked-rise-antibiotic-resistance-imperils-human-health

https://www.sustrans.org.uk/our-blog/get-active/2020/in-your-community/10-things-you-can-do-to-help-reduce-air-pollution-today

https://www.theguardian.com/environment/2023/nov/17/how-ponds-tell-story-of-the-air-pollution-around-them

https://seas.harvard.edu/news/2021/02/deaths-fossil-fuel-emissions-higher-previously-thought

https://80000hours.org/podcast/episodes/santosh-harish-air-pollution/

https://www.theguardian.com/environment/2023/dec/29/lasting-legacy-of-the-six-cities-study-into-harms-of-air-pollution



Geo Meadows    last update 20 Nov 2023

Addendum 23Nov2023 - From this date, any results of particular interest will be described via an extra page of PM notes on the weatherstation website.  

Addendum 25th Nov 2023 - A startling report from the European Environment Agency claims 253,000 early deaths in 2021 were caused by concentrations of PM2.5 particulates that breached the World Health Organization’s maximum guideline limits of 5µg/m3 (a much lower limit that the 15mg/m3 previously advised). A further 52,000 deaths came from excessive levels of nitrogen dioxide and 22,000 deaths from short-term exposure to excessive levels of ozone. The breakdown of the PM2.5 related deaths is shown in the graphic below.


Tellingly, the WHO warns that no level of air pollution can be considered safe. A conclusion reached earlier in this blog.  Using the ratio of EU and UK population sizes we can estimate (all factors being equal) that the UK death rate from all air pollution would be around 75,000 - double the UK government's upper figure of 36,000 (see previous graphic).

https://www.theguardian.com/environment/2023/nov/24/toxic-air-pollution-eu-death


Addendum 13Jan 2024

The website now had a display of daily and monthly PM2.5 averages for the SDS and PMS monitors. The average values computed are very low indeed. Still a big unknown is how important peak exposure is compared to average exposure. 

http://www.mecol.co.uk/weather/monthlyPart.html






Comments