gkasprow / Sensor-Box

Multichannel standarized enviorement for home automation and other MQTT applications
18 stars 11 forks source link

air quality sensor #4

Open gkasprow opened 6 years ago

gkasprow commented 6 years ago

Recently I purchased a few SDS011 sensors. First one was connected to Arduino clone - Atmega wih Wiznet chip. I modified library of another sensor found on github. I equipped it with PoE injection box and placed on my terrace. The house is heated using solid state pellet stove. I can easily observe moments when the stove switches on and switches off - the pollution level exceeds the allowable value 2...3x. My neighbour has identical heating system so things gets worse twice. Luckily, since a few months a gas pipe was laid close to my property so luckily in a few weeks I will switch to much more "eco" heating system. Example one week plot. Values need to be divided by 10. obraz

Then I ported ESP8266 Cayenne wifi to ESP32. I've noticed during a few weeks of operation that ESP8266 is not very stable. It managed to hang itself. So I started with ESP32, connected SDS011 sensors and placed them side by side. 20171203_184813

The measurements are far from what I'd expect. For PM10 it's more or less within spec, but for PM2.5 the difference is higher than specification says which is 15% or +/- 10ug/m3. Values are multiplied by 10. obraz

gkasprow commented 6 years ago

Today I noticed quite strange dust level in Warsaw: obraz I didn't know that it's possible to saturate the sensor in practice... There are construction works nearby, and it seems that the developer is doing some dusty works right now. Fortunately I have particle filters installed at the air inlets, so inside of the flat don't see any changes. obraz

gkasprow commented 6 years ago

Today I built yet another version of the particle monitor. I used PMS7003 which analyses also PM1. There is ready to use Arduino library, only a few lines of code were needed to integrate it with Cayenne. I want to use it to test various filter materials in the recuperation system inlet filter. This is the code that averages 10 readouts and publishes measurements every 10 seconds

void loop()
{
  if (pms.read(data))
  {
    Cayenne.loop();
if (AV_CNT++<10)
  {
  PM1_AV_Value += data.PM_AE_UG_1_0;
  PM2_5_AV_Value += data.PM_AE_UG_2_5;
  PM10_AV_Value += data.PM_AE_UG_10_0;
  }
else
  {
    AV_CNT=0;
      Cayenne.virtualWrite(2,(float)(PM1_AV_Value/10));
      Cayenne.virtualWrite(3,(float)(PM2_5_AV_Value/10));
      Cayenne.virtualWrite(4,(float)(PM10_AV_Value/10)); 
      PM1_AV_Value = 0;
      PM2_5_AV_Value = 0;
      PM10_AV_Value = 0;
  }
  }

And the bricolage

20171210_130551

gkasprow commented 6 years ago

I designed more or less final version of the sensor. It is accessible over CAN and supports PMS7003, HDC1000YPA and SGP30 sensors thus enabling complex air quality measurements. There is cut-out made to show th box interior. obraz