# SDS011 PM2.5 / PM10 Air Quality Particulate Sensor with Emoncms / emonPi

**URL:** <https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149>\
**Category:** Applications\
**Tags:** air-quality\
**Created:** [28 January 2020 18:52 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149 "2020-01-28T18:52:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [28 January 2020 18:52 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/1 "2020-01-28T18:52:56Z")

</div>

**Edited Dec, 2020**  
SDS011 support via it’s USB adaptor is now supported through an emonHub interfacer, not a part of the standard image.  
. [emonhub/src/interfacers/EmonHubSDS011Interfacer.py at master · openenergymonitor/emonhub · GitHub](https://github.com/openenergymonitor/emonhub/blob/master/src/interfacers/EmonHubSDS011Interfacer.py)

Original post retained below.

> Building upon the work of @danbates
> 
> [Air Quality Sensing : emonCMS dashboard](https://community.openenergymonitor.org/t/air-quality-sensing-emoncms-dashboard/8334)
> 
> We’ve been testing a couple of low cost [Nova SDS011](https://cdn-reichelt.de/documents/datenblatt/X200/SDS011-DATASHEET.pdf) PM2.5 / PM10 air quality sensors logging to Emoncms
> 
> [https://www.amazon.co.uk/gp/product/B07911ZY9W](https://www.amazon.co.uk/gp/product/B07911ZY9W)
> 
> It’s quite an impressive sensor (for the cost). It’s very responsive to small changes like doing some soldering or cooking. It’s interesting to see how these actions affect air quality.
> 
> ![Selection_313](https://community.openenergymonitor.org/uploads/default/original/2X/4/4f677d227b17467afcb1bbe0c9ea64d57ee9b79f.jpeg)
> 
> If you’re interested in giving it a go we’ve got a docker container / script to make it easy to post the data to Emoncms (HTTP) or MQTT. The docker container has been tested running on emonPi (emonSD-17Oct19), Ubuntu and Synology DMS:
> 
> [usefulscripts/SDS011 at master · emoncms/usefulscripts · GitHub](https://github.com/emoncms/usefulscripts/blob/master/SDS011)
> 
> * * *
> 
> # To get started
> 
> ```auto
> git clone https://github.com/emoncms/usefulscripts/blob/master/SDS011
> cd usefulscripts/SDS011
> 
> ```
> 
> Copy the environment file:
> 
> `cp default.env env`
> 
> Edit your environment file to set your mqtt / emoncms http and ttyUSB settings, use `dmesg` to find your serial port assigned to the sensor:
> 
> `nano env`
> 
> Build and run the docker container
> 
> ```auto
> docker build -t dust .
> docker run --privileged --env-file=env dust
> 
> ```
> 
> Run in the background on boot and always restart
> 
> `docker run -d --privileged --restart=always --env-file=env dust`

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [28 January 2020 19:08 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/2 "2020-01-28T19:08:00Z")

</div>

On the Home Assistant theme, there is also an HA component for this device [Serial Particulate Matter - Home Assistant](https://www.home-assistant.io/integrations/serial_pm/).

---

<div class="post-metadata">

**Author:** ![danbates](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@danbates](https://community.openenergymonitor.org/u/danbates)\
**Post date:** [28 January 2020 20:31 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/3 "2020-01-28T20:31:41Z")

</div>

Another integration here:  
[dusty-bridge.php.zip](https://community.openenergymonitor.org/uploads/short-url/1p9jzaWpvzXA6Ed9ddp1Qh5Nhtb.zip) (1.5 KB)  
It’s been designed for LuftDaten.info project firmware, and can be places at emoncms device homepage root, along-side index.php. The luftdaten firmware I can recommend because it easily integrates with two widely accessible PM data world maps.  
At the luftdaten ESP-based firmware web-interface thing, are the fields to enter the custom API credentials.

The PHP script attached has clues on what to enter in the fields.  
The essential info is: the ‘username’ field at the ESP web-interface is the emonCMS API write key.

@glyn.hudson we could create a graphic of the interface/API options, I think we have three methods now!

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [29 January 2020 23:01 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/4 "2020-01-29T23:01:17Z")

</div>

How often are you reading the air quality?

The datasheet says these have a 8000hr service life, which is just 333 days if running full-time, although a 1Hz reading is a bit OTT so are you just spinning it up once every minute or so? I read somewhere that it needs to spin up 30secs for a good reading, so once a minute might only double the service life to less than 2years if I’m not mistaken? If so those “cheap” sensors might become quite an expensive habit, cash wise and environmentally if the sensor cannot be saved, no?

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [29 January 2020 23:15 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/5 "2020-01-29T23:15:24Z")

</div>

Some interesting reading about the SDS011 (and a few other PM sensors) and calibration.

> **[Evaluation of Low-Cost Sensors for Ambient PM2.5 Monitoring](https://www.hindawi.com/journals/js/2018/5096540/)**
>
> Low-cost sensors are an opportunity to improve the spatial and temporal resolution of particulate matter data. However, such sensors should be calibrated under conditions close to the final ones before any monitoring actions. The paper presents the...

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [29 January 2020 23:23 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/6 "2020-01-29T23:23:04Z")

</div>

> [@pb66](#):
>
> The datasheet says these have a 8000hr service life,

_up to_ 8000 hours, so maybe less. That’d be a bummer if it turned out to be significantly less. ☹  
Further driving up the cost, as you mentioned above.

 ![image](https://community.openenergymonitor.org/uploads/default/original/2X/7/7a9ff6854ee1fde86604580e0557e17944b59a2d.png)

---

<div class="post-metadata">

**Author:** ![Bramco](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@Bramco](https://community.openenergymonitor.org/u/Bramco)\
**Post date:** [30 January 2020 11:19 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/7 "2020-01-30T11:19:06Z")

</div>

To add to the sites that have code for connecting these, here’s one where the guy used an ESP32 → [Working on my IoT air quality monitoring setup - DEV Community](https://dev.to/minkovsky/working-on-my-iot-air-quality-monitoring-setup-40a5)

Given I’ve already got code for an ESP8266 for reading DS18B20 temperatures and sending them to my emoncms server and MQTT, I’ll replace the DS18B20 code with some to read from the sensor and hopefully ‘hey presto!’.

Will probably never re-light the wood burning open hearth afterwards mind you!!

Simon

---

<div class="post-metadata">

**Author:** ![danbates](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@danbates](https://community.openenergymonitor.org/u/danbates)\
**Post date:** [30 January 2020 12:51 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/8 "2020-01-30T12:51:22Z")

</div>

@Bill.Thomson that’s a good bit of research, I’ve seen it before and had forgotten about the humidity factor.  
I think the most important aspect of accuracy of these devices is to do with humidity.  
Humidity should ideally be read in parallel with PM count, and the count should be adjusted in software according to humidity.  
I don’t know if luftdaten firmware does this. Their typical setup does include a temperature/humidity sensor.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [30 January 2020 12:52 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/9 "2020-01-30T12:52:56Z")

</div>

Interesting that’s pretty low! I wasn’t aware of that. We’re currently taking a reading every 10’s but the sensor fan is running continuously. I’ll look at adapting the code to power down / spin down the sensor in between readings and maybe reduce to once per 60s? Or even slower

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [30 January 2020 13:07 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/10 "2020-01-30T13:07:06Z")

</div>

> [@glyn.hudson](#):
>
> We’re currently taking a reading every 10’s

How often does it change - is there much jitter? If you looked at the trend, it would help you assess how often to sample. Perhaps the average of a burst of 3-5 samples every 10 min would work.

---

<div class="post-metadata">

**Author:** ![Robert.Wall](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/robert.wall/32/38246_2.png) [@Robert.Wall](https://community.openenergymonitor.org/u/Robert.Wall)\
**Post date:** [30 January 2020 13:11 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/11 "2020-01-30T13:11:30Z")

</div>

A good indicator (for indoors) would be Building Regulations - how many air changes per hour for a given room and usage does that call for?

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [30 January 2020 13:28 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/12 "2020-01-30T13:28:39Z")

</div>

Yes, there’s quite a bit of jitter

 ![Screenshot 2020-01-30 at 13.26.42](https://community.openenergymonitor.org/uploads/default/original/2X/e/e0f0b6ad1ced73d73c6803fde53e22e4dfc91251.png)

However, when there is an event which significantly changes the air quality it’s nice if the sensor responds quickly allowing easy attribution to that event e.g

 ![Screenshot 2020-01-30 at 13.28.12](https://community.openenergymonitor.org/uploads/default/original/2X/7/7931c2945e86a58efe6fd8816f32d0b9b64d8d88.png)

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [30 January 2020 13:28 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/13 "2020-01-30T13:28:57Z")

</div>

> [@borpin](#):
>
> How often does it change - is there much jitter?

The paper that @Bill.Thomson linked (I’ve only skimmed it) suggests any short term readings are not reliable and that readings should be averaged over 15mins or so to remove spikes. Depending on the purpose of the reporting, perhaps a reading every 10mins and averaged over an hour would suffice to establish the general air quality, obviously this won’t work for any form of warning system etc but I don’t think this sensor could be relied upon for any crucial warning/monitoring etc.

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [30 January 2020 13:34 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/14 "2020-01-30T13:34:54Z")

</div>

> [@glyn.hudson](#):
>
> We’re currently taking a reading every 10’s but the sensor fan is running continuously.

I haven’t looked into it in depth so I don’t know exactly what “the service life” refers to precisely. If it is the laser or sensor (not the fan?) maybe reducing the sample rate alone might do? I have no idea if the laser or sensor are permanently on or just “for a reading”. 8000hrs does seem awfully short, but would actually be pretty long if it’s only a few millisecs each minute.

---

<div class="post-metadata">

**Author:** ![borpin](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/borpin/32/193_2.png) [@borpin](https://community.openenergymonitor.org/u/borpin)\
**Post date:** [30 January 2020 13:34 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/15 "2020-01-30T13:34:57Z")

</div>

> [@glyn.hudson](#):
>
> when there is an event which significantly changes the air quality

Big spike. What causes that?

---

<div class="post-metadata">

**Author:** ![Bramco](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/b/34f0e0/32.png) [@Bramco](https://community.openenergymonitor.org/u/Bramco)\
**Post date:** [30 January 2020 13:51 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/16 "2020-01-30T13:51:39Z")

</div>

> [@pb66](#):
>
> I haven’t looked into it in depth so I don’t know exactly what “the service life” refers to precisely. If it is the laser or sensor (not the fan?)

I think it was in the article I quoted but certainly somewhere in what I’ve read there is mention of dust building up in the laser (they must mean in the enclosure, not actually in the laser!). So maybe the service life is due to that buildup - in which case it would be worse in a more polluted environment.

Simon

---

<div class="post-metadata">

**Author:** ![danbates](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@danbates](https://community.openenergymonitor.org/u/danbates)\
**Post date:** [30 January 2020 19:40 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/18 "2020-01-30T19:40:53Z")

</div>

I believe luftdaten’s default post rate is every 2 minutes, the fan is span up 30 seconds before a reading.  
Is that up to 3.6 years of service life for £25?  
Bargain.

EDIT: Basically a mute point that anyway. A few days worth of data is worth that price if a community wants to get some ball park figures on PM levels.

---

<div class="post-metadata">

**Author:** ![danbates](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/ecc23a/32.png) [@danbates](https://community.openenergymonitor.org/u/danbates)\
**Post date:** [30 January 2020 19:56 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/19 "2020-01-30T19:56:18Z")

</div>

> [@glyn.hudson](#):
>
> Yes, there’s quite a bit of jitter

That doesn’t look like jitter to me. That’s the pattern of air circulation present in the room. We have two sensors side by side at the lab.  
If we really want to look at jitter, we should compare them side by side.

---

<div class="post-metadata">

**Author:** ![glyn.hudson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/glyn.hudson/32/35003_2.png) [@glyn.hudson](https://community.openenergymonitor.org/u/glyn.hudson)\
**Post date:** [31 January 2020 00:08 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/20 "2020-01-31T00:08:50Z")

</div>

> [@borpin](#):
>
> Big spike. What causes that?

Cooking

---

<div class="post-metadata">

**Author:** ![djh](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/d/e36b37/32.png) [@djh](https://community.openenergymonitor.org/u/djh)\
**Post date:** [31 January 2020 14:49 UTC](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149/21 "2020-01-31T14:49:10Z")

</div>

> [@Robert.Wall](#):
>
> A good indicator (for indoors) would be Building Regulations - how many air changes per hour for a given room and usage does that call for?

Building Regs change a bit over time, and are somewhat complicated. They used to require a purge rate of 0.44 ACH. Modern regs aren’t specified in terms of ACH. They’re in l/s/m², which if you convert to m³/hr is m³/hr/m² or m/hr which looks like an unusual unit of speed. If you said somewhere between 0.2 ACH and 0.4 ACH you’d probably catch most opinions.

[Next page](https://community.openenergymonitor.org/t/sds011-pm2-5-pm10-air-quality-particulate-sensor-with-emoncms-emonpi/13149.md?page=2)
