GithubHelp home page GithubHelp logo

Comments (22)

fboehle avatar fboehle commented on August 17, 2024 1

You might not have a faulty device. A research paper concluded that the Sensirion Sps30 is not able to detect particles above ~2 um:

https://www.researchgate.net/publication/337852062_Laboratory_evaluation_of_particle_size-selectivity_of_optical_low-cost_particulate_matter_sensors

Oh I totally forgot this issue.
But I still have problems to read different values for the particle sizes. No matter what I do they are always the same. At new years eve I had a slightly larger PM10 spike compared to the PM2.5. But it really was negliable (1607.44 µg/m³ and 1608.86 µg/m³).
I think that I got sensors from a faulty batch. Especially because in Narins diagram there are different values for the different particle sizes.

from sps30.

paulvha avatar paulvha commented on August 17, 2024

Thanks for nice remark. I have added in the SPS30.odt (you can read this with MS-word or OpenOffice or Libreoffice) in de Appendix B sample output from different sketches for reference. I also use the ESP32 (among others) but make sure to power the SPS30 with the VUSB (5 V) as pointed out in the top of the different sketches. That said.. yes I do see the same (I have 2 SPS30 and both have the same behavior). Actually in chapter 7.4 of the same document I make the (personal) conclusion, after a number of test and compare to other sensors, that I wonder about the ability to detect /report correctly above 2.5um. I have reported that to Sensirion but no reaction. If you use example 9, it will display with higher precision and then it shows some differences.

regards,
Paul

from sps30.

jhinderer avatar jhinderer commented on August 17, 2024

Thank you for the quick response.
I tried different power sources (usb, batteries with voltage regulator and power supply) but the behaviour is identical. I will try your example 9. Maybe it will help. Otherwise the ability of the sensor is questionable. I am using a SDS011 for a year now and come to a similar conclusion as in your document. the PM2.5 values of the SDS011 and SPS30 are pretty similiar but PM10 is way off.
Is your report to Sensirion public? I would like to follow it (if their is any reaction in the future).

from sps30.

paulvha avatar paulvha commented on August 17, 2024

hi
I had just dropped a mail to the help-desk of Sensirion. I had good contact before with them about some SCD30 issues. They did not have a proper library for the SPS30 (just a bunch of pieces of starting code to connect, which I felt was over-engineered and not providing a solution). Actually many people from around the world are using my library for the same reason. Some good working happening here : https://community.particle.io/t/dust-sensor-pms-5003-6003-7003/24221/102

from sps30.

sgmeligmeyling avatar sgmeligmeyling commented on August 17, 2024
21:00:52.970 -> -------------Mass -----------    ------------- Number --------------   -Average-
21:00:52.970 ->      Concentration [μg/m3]             Concentration [#/cm3]             [μm]
21:00:52.970 -> P1.0	P2.5	P4.0	P10	P0.5	P1.0	P2.5	P4.0	P10	PartSize
21:00:52.970 -> 
21:00:52.970 -> 0.66	0.68	0.68	0.68	0.00	0.00	0.00	0.00	0.00	0.00
21:00:56.160 -> 1.55	3.10	4.30	4.63	0.00	0.00	0.00	0.00	0.00	0.00
21:00:59.347 -> 1.48	2.89	3.98	4.29	0.00	0.00	0.00	0.00	0.00	0.00
21:01:02.582 -> 1.36	2.59	3.53	3.80	0.00	0.00	0.00	0.00	0.00	0.00
21:01:05.769 -> 1.12	1.16	1.16	1.16	0.00	0.00	0.00	0.00	0.00	0.00
21:01:08.957 -> 1.17	1.66	2.01	2.11	0.00	0.00	0.00	0.00	0.00	0.00
21:01:12.191 -> 1.24	1.62	1.88	1.95	0.00	0.00	0.00	0.00	0.00	0.00
21:01:15.378 -> 1.45	1.77	1.98	2.04	0.00	0.00	0.00	0.00	0.00	0.00
21:01:18.566 -> 1.59	1.94	2.17	2.23	0.00	0.00	0.00	0.00	0.00	0.00
21:01:21.789 -> 1.64	1.98	2.21	2.27	0.00	0.00	0.00	0.00	0.00	0.00
21:01:24.977 -> 1.60	1.93	2.16	2.22	0.00	0.00	0.00	0.00	0.00	0.00
21:01:28.211 -> 1.53	1.85	2.05	2.11	0.00	0.00	0.00	0.00	0.00	0.00
21:01:31.399 -> 1.44	1.70	1.86	1.91	0.00	0.00	0.00	0.00	0.00	0.00
21:01:34.586 -> 1.47	1.72	1.88	1.93	0.00	0.00	0.00	0.00	0.00	0.00
21:01:37.821 -> 1.52	1.76	1.91	1.95	0.00	0.00	0.00	0.00	0.00	0.00
21:01:41.008 -> 1.50	1.72	1.85	1.89	0.00	0.00	0.00	0.00	0.00	0.00
21:01:44.196 -> 1.46	1.68	1.81	1.85	0.00	0.00	0.00	0.00	0.00	0.00
21:01:47.430 -> 1.39	1.59	1.71	1.74	0.00	0.00	0.00	0.00	0.00	0.00
21:01:50.618 -> 1.34	1.52	1.62	1.65	0.00	0.00	0.00	0.00	0.00	0.00
21:01:53.805 -> 1.25	1.43	1.53	1.56	0.00	0.00	0.00	0.00	0.00	0.00
21:01:56.992 -> 1.18	1.35	1.46	1.49	0.00	0.00	0.00	0.00	0.00	0.00
21:02:00.227 -> 1.16	1.33	1.44	1.47	0.00	0.00	0.00	0.00	0.00	0.00
21:02:03.414 -> 1.10	1.25	1.34	1.37	0.00	0.00	0.00	0.00	0.00	0.00
21:02:06.649 -> 1.11	1.25	1.32	1.35	0.00	0.00	0.00	0.00	0.00	0.00
21:02:09.836 -> 1.14	1.30	1.38	1.41	0.00	0.00	0.00	0.00	0.00	0.00
21:02:13.024 -> 1.20	1.36	1.44	1.47	0.00	0.00	0.00	0.00	0.00	0.00
21:02:16.258 -> 1.25	1.40	1.49	1.52	0.00	0.00	0.00	0.00	0.00	0.00
21:02:19.430 -> 1.25	1.41	1.51	1.53	0.00	0.00	0.00	0.00	0.00	0.00
21:02:22.618 -> 1.20	1.35	1.43	1.46	0.00	0.00	0.00	0.00	0.00	0.00
21:02:25.852 -> 1.16	1.30	1.38	1.41	0.00	0.00	0.00	0.00	0.00	0.00
21:02:29.039 -> 501.07	537.22	550.88	554.75	0.00	0.00	0.00	0.00	0.00	0.00
21:02:32.274 -> 160.71	169.65	171.90	172.53	0.00	0.00	0.00	0.00	0.00	0.00
21:02:35.461 -> 33.95	35.55	35.79	35.86	0.00	0.00	0.00	0.00	0.00	0.00
21:02:38.649 -> 5.24	5.48	5.52	5.53	0.00	0.00	0.00	0.00	0.00	0.00
21:02:41.883 -> 2.11	2.21	2.23	2.23	0.00	0.00	0.00	0.00	0.00	0.00
21:02:45.071 -> 1.29	1.35	1.36	1.37	0.00	0.00	0.00	0.00	0.00	0.00
21:02:48.258 -> 1.75	1.83	1.84	1.85	0.00	0.00	0.00	0.00	0.00	0.00
21:02:51.492 -> 1.78	1.87	1.88	1.88	0.00	0.00	0.00	0.00	0.00	0.00
21:02:54.680 -> 2.20	2.31	2.33	2.33	0.00	0.00	0.00	0.00	0.00	0.00
21:02:57.867 -> 1.06	1.11	1.12	1.12	0.00	0.00	0.00	0.00	0.00	0.00
21:03:01.055 -> 1.31	1.37	1.38	1.39	0.00	0.00	0.00	0.00	0.00	0.00
21:03:04.289 -> 1.34	1.40	1.41	1.41	0.00	0.00	0.00	0.00	0.00	0.00
21:03:07.524 -> 1.40	1.46	1.46	1.46	0.00	0.00	0.00	0.00	0.00	0.00
21:03:10.711 -> 1.48	1.54	1.54	1.54	0.00	0.00	0.00	0.00	0.00	0.00
21:03:13.899 -> 1.48	1.54	1.54	1.54	0.00	0.00	0.00	0.00	0.00	0.00
21:03:17.086 -> 1.50	1.56	1.57	1.57	0.00	0.00	0.00	0.00	0.00	0.00
21:03:20.296 -> 1.60	1.67	1.67	1.68	0.00	0.00	0.00	0.00	0.00	0.00
21:03:23.530 -> 1.83	1.91	1.91	1.91	0.00	0.00	0.00	0.00	0.00	0.00
21:03:26.718 -> 2.01	2.09	2.09	2.09	0.00	0.00	0.00	0.00	0.00	0.00
21:03:29.905 -> 2.18	2.27	2.27	2.27	0.00	0.00	0.00	0.00	0.00	0.00

I'm actually seeing a similar pattern. The spike in the values is from lighting a match. I'm using UART. Have you been able to find out what causes the identical values already?

from sps30.

winkj avatar winkj commented on August 17, 2024

Regarding the identical values: From a cursory look over the code, I believe the values printed out are the values received from the sensor. The datasheet definition of PMx outputs as "particles with a size smaller than “x” micrometers (e.g., PM2.5 = particles smaller than 2.5 μm)"; as such, for example PM4 also includes particles that are PM2.5 and PM1.0.

If you're interested in a histogram like data - i.e. minimal measured particle up to PM1, >PM1 to PM2.5, >PM2.5 to PM4 etc. - you will have to subtract the smaller concentrations. For the last line of the output above 21:03:29.905 -> 2.18 2.27 2.27 2.27 that would mean that the up_to_PM1 mass concentration is 2.18, the PM1_up_to_PM2.5 is 0.09 (2.27-2.18), and PM2.5_up_to_PM4 and PM4_up_to_PM10 are 0 respectively.

from sps30.

paulvha avatar paulvha commented on August 17, 2024

@sranjha : looking at your print-out I am surprised to see zeros in number when connecting with UART. (I would have expected that in case of I2C with small receive buffer) That said: NO I don't know what it is nearly the same. The numbers are coming directly from the SPS30. I can only expect that the sensor is actually working better on 2.5um and I doubt the larger um values. If you use example9 it will display more number behind decimal point and see some (very small) differences.

@jhinderer : yes you are right about the histogram. used that approach in example9 but with more numbers after the decimal point.

from sps30.

NarinLab avatar NarinLab commented on August 17, 2024

Hello, first i want to say thanks for the author, this library is far much better than the official SPS30 that keep showing probe failed.

But i want to share my problem regarding weird read result. After doing data reading for about ten minutes, my SPS30 just sending me the same value like i show on the picture below:
Image of Yaktocat

any ideas why this happend? FYI, i'm using basic reading example 1

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

NarinLab avatar NarinLab commented on August 17, 2024

Do you power the SPS30 with 5V ?
5Volt and stable power confirmed using Fluke multitester

Is the fan turning ?
Fan is running about 2 second while measuring and data is visible from serial.print

Do you connect UART or I2C ?
By UART

If I2C did you apply pull-resistors ?
No I2C

What is the board you connected the SP30 to and how ?
Arduino Mega2560

What happens if you blow some air into the fan when the output is flat. Does the value change ? Still experimenting to reproduce the weird constant result...

FYI, my code

/* 
 *  @brief: Fungsi untuk get data SPS30
 *  @param: Struct references from DATA_SPS30 (modified)
 *  @return: Bool, true OK | false Err
 */
bool sensory_get_sps30(DATA_SPS30& data){
  SPS30 sps30;
  if (sps30.begin(SP30_COMMS) == false) {
    Log.fatal(F("SPS30 tidak dapat membaca sensor via Serial!" CR));
    return false;
  }
  if (sps30.reset() == false) {
    Log.error(F("SPS30 tidak dapat mereset!" CR));
    return false;
  }
  if (sps30.start() == true) {
    Log.notice(F("SPS30 pengukuran dimulai!" CR));
  }
  else {
    Log.error(F("SPS30 tidak dapat memulai pengukuran!" CR));
    return false;
  }

 
  uint8_t ret, error_cnt = 0;
  struct sps_values val;

  // loop to get data
  do {

    ret = sps30.GetValues(&val);

    // data might not have been ready
    if (ret == ERR_DATALENGTH){

        if (error_cnt++ > 3) {
          Log.error(F("Error during reading values: %d" CR), (int)ret);
          return(false);
        }
        delay(1000);
    }
    // if other error
    else if(ret != ERR_OK) {
      Log.error(F("Error during reading values: %d" CR), (int)ret);
      return(false);
    }

  } while (ret != ERR_OK);
  data.massPM1 = val.MassPM1;
  data.massPM2 = val.MassPM2;
  data.massPM4 = val.MassPM4;
  data.massPM10 = val.MassPM10;
  data.numPM0 = val.NumPM0;
  data.numPM1 = val.NumPM1;
  data.numPM2 = val.NumPM2;
  data.numPM4 = val.NumPM4;
  data.numPM10 = val.NumPM10;
  data.tps = val.PartSize;

  if (sps30.stop() == true) {
    Log.notice(F("SPS30 pengukuran selesai!" CR));
  }
  return true;
}

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

NarinLab avatar NarinLab commented on August 17, 2024

Yes, the fan is running for two second, because I put sps30.stop() right after getting the sensor value. Is that a problem? Or can you give me some good pseudo code on the best method to doing measurement, most safe and most efficient.
Thankyou

Btw, now i just move my device to my living room, before (when the weird value incident happened) I put it outside, in front of my shop near the street. I got very fluctuative result in indoor living room:
Capture
I'm just little bit frustrated, because when I put it back outside, after a while, it will do the weird constant reading again.

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

NarinLab avatar NarinLab commented on August 17, 2024

After doing more deep experiment, the code: without delay and without stop and doing measurement every 3 second; I checked the serial log and there is error message that state Could NOT start measurement. So, I can confirm this is the cause of weird constant value. The measurement is failed to start. When the device is outside, I unable to check ti serial log, now I see it, and still applying your suggestion regarding delay, hope this will resolve the proble.

Regards,
Narin

from sps30.

jwgmeligmeyling avatar jwgmeligmeyling commented on August 17, 2024

Maybe worthwhile to check out Sensirions own drivers:

I2C: https://github.com/Sensirion/embedded-sps
UART: https://github.com/Sensirion/embedded-uart-sps

Curious to try out on my own SPS30 sensors, after I had kind of abandoned them after just reading false values..

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

jhinderer avatar jhinderer commented on August 17, 2024

Oh I totally forgot this issue.
But I still have problems to read different values for the particle sizes. No matter what I do they are always the same. At new years eve I had a slightly larger PM10 spike compared to the PM2.5. But it really was negliable (1607.44 µg/m³ and 1608.86 µg/m³).
I think that I got sensors from a faulty batch. Especially because in Narins diagram there are different values for the different particle sizes.

from sps30.

NarinLab avatar NarinLab commented on August 17, 2024

Hi,

My sensor still stuck, and displaying a same value over and over. When i'm reset the Mega 2560, the sensor is updating new value... but after some minutes, then again... just repeating same value.

After checking log carefuly (appended it to my web interface via ESP32 Serialcomm, because physical Serial cable not possible for me in the ourdoor location), i just found the step by step why the sensor stuck at the same value:
My Web log:

25/Mar/20 05:31 -
25/Mar/20 05:32 -
25/Mar/20 05:36 -
25/Mar/20 05:40 - Failed to start
25/Mar/20 05:46 - Other error in reading: 81
25/Mar/20 05:50 - Failed to start
25/Mar/20 05:54 - Not found
25/Mar/20 05:59 - Other error in reading: 81
25/Mar/20 06:03 - Not found

My Code after some experiment with reset and close on error:

/* 
 *  @brief: Fungsi untuk get data SPS30
 *  @param: Struct references from DATA_SPS30 (modified)
 *  @return: Bool, true OK | false Err
 */
bool sensory_get_sps30(DATA_SPS30& data){
  SPS30 sps30;
  if (sps30.begin(SP30_COMMS) == false) {
    Log.fatal(F("SPS30 tidak dapat membaca sensor via Serial!" CR));
    data.logs = String(F("Serial failed"));
    return false;
  }
  if (sps30.probe() == false) {
    Log.fatal(F("SPS30 tidak ditemukan!" CR));
    data.logs = String(F("Not found"));
    return false;
  }
  if (sps30.reset() == false) {
    Log.error(F("SPS30 tidak dapat mereset!" CR));
    data.logs = String(F("Failed to reset"));
    return false;
  }
  if (sps30.start() == true) {
    Log.notice(F("SPS30 pengukuran dimulai!" CR));
  }
  else {
    Log.error(F("SPS30 tidak dapat memulai pengukuran!" CR));
    data.logs = String(F("Failed to start"));
    sps30.stop();
    sps30.reset();
    return false;
  }

  delay(30000);
 
  uint8_t ret, error_cnt = 0;
  struct sps_values val;

  // loop to get data
  do {

    ret = sps30.GetValues(&val);

    // data might not have been ready
    if (ret == ERR_DATALENGTH || val.MassPM1 == 0){

        if (error_cnt++ > 3) {
          Log.error(F("Error during reading values: %d" CR), (int)ret);
          data.logs = String(F("Error in reading: ")) + String(ret);
          sps30.stop();
          sps30.reset();
          return(false);
        }
        delay(1000);
    }
    // if other error
    else if(ret != ERR_OK) {
      Log.error(F("Error during reading values: %d" CR), (int)ret);
      data.logs = String(F("Other error in reading: ")) + String(ret);
      sps30.stop();
      sps30.reset();
      return(false);
    }

  } while (ret != ERR_OK);
  data.massPM1 = val.MassPM1;
  data.massPM2 = val.MassPM2;
  data.massPM4 = val.MassPM4;
  data.massPM10 = val.MassPM10;
  data.numPM0 = val.NumPM0;
  data.numPM1 = val.NumPM1;
  data.numPM2 = val.NumPM2;
  data.numPM4 = val.NumPM4;
  data.numPM10 = val.NumPM10;
  data.tps = val.PartSize;

  //delay(2000);
  if (sps30.stop() == true) {
    Log.notice(F("SPS30 pengukuran selesai!" CR));
  }
  return true;
}

Screenshot of the weird constant value after some interval (marked in red circle):
SPS30 Constant Value
SPS30 Constant Value
SPS30 Constant Value

Any help would much appreciated!

from sps30.

paulvha avatar paulvha commented on August 17, 2024

from sps30.

abrauchli avatar abrauchli commented on August 17, 2024

@firefly-serenity I think our engineers added footnote 4 on page 2 of the datasheet

https://www.sensirion.com/file/datasheet_sps30

PM4 and PM10 output values are calculated based on distribution profile of all measured particles.

from sps30.

jhinderer avatar jhinderer commented on August 17, 2024

@fboehle Interesting read, thank you!

@abrauchli Thanks, I guess this explains the behaviour pretty good.

I will close this issue now.

from sps30.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.