That’s certainly one solution - but I see that it’s GPL. What I’ve been working on is Apache licensed so it won’t contaminate your whole project as GPL would.
Edit: And yes, I’ve been working on it for a while now. What I have already works with Serial but I haven’t delved into the I2C side yet. I can post what I have to Github sometime soon if there’s interest, but it’s in flux.
Sensor is impressively sensitive from initial testing.
The Github library has been updated with the latest changes.
You just need to do the following to get it working on a Photon/Electron:
NOTE 2: SerialPort1 is only enabled in case of MEGA2560 or ESP32 (with defined RX/TX before)
On some boards/IDE (like Particle Photon) Serial1 is available as well. To force-enable from the user sketch : set TX and RX pins BOTH to 8, before calling begin().
3.3.4 Exclude Software Serial communication code
In case software serial is not available for your board / IDE (causing compile errors) OR you want to save memory in sps30.h comment out the line: #define INCLUDE_SOFTWARE_SERIAL 1.
Also mention you in the ReadMe: Tested by Ryan Brown on a Sparkfun Photon RED board and the code should also work with the Photon, P1, and Electrons
Sweet, let me know your experiences with it once you have it setup.
I should have this thing sending data to Losant later today, anxious to see how things look in a household and shop environment over the course of a full day.
Nice. I ordered one today and will hook it up on a photon next week. Will run it next the hpm dust sensor from honeywell to be able to compare the measurements.
@RWB
The SPS30 library “incorrectly” reports PM10 Number Concentration [#/cm3] as Zero (0).
I believe both the Mass and Number Concentrations should increase (or stay the same) when moving up the Particulate Matter Size Scale (from PM1 to PM10), as each larger PM classification includes the concentrations from all sizes smaller than it.
PM10 >= PM4 >= PM2.5 >= PM1.0
Other than that, my SPS30 and the library appear to be working great.
This isn’t a huge concern for me, since Air Monitoring is usually PM2.5 and PM10 Mass Concentrations [μg/m3] for my Industrial Applications, as per the EPA.
I have been testing the sensor the last few days while running a Lazer Cutting machine and a CNC Milling machine cutting G10 fiberglass sheets as you can see in the graph above.
The Mass PM10 is not returning 0 for me it looks like.
I find the MASS readings most useful and things do not get as dusty as I was thinking.
The MASS usually shows more larger particles detected than the smaller PM1 sized particles. To me it looks like it’s working perfectly.
I love having the sensor along with Voc, temp, humidity, and Co2 since High Voc does not mean there is more particulates in the air.
Do you know of a good chart or graph for what levels are safe vs unsafe?
I currently just use a rolling average calculated from my backend (ThingSpeak) and not on the Photon, but the official method is quoted from HERE
To accurately reflect the current air quality, the multi-hour average used for the AQI computation should be centered on the current time, but as concentrations of future hours are unknown and are difficult to estimate accurately, EPA uses surrogate concentrations to estimate these multi-hour averages. For reporting the PM2.5, PM10 air quality indices, this surrogate concentration is a particular type of weighted average that provides more weight to the most recent air quality data when air pollution levels are changing.
The Wikipedia link also has the actual equation to calculate AQI.
Or you could just use a Switch/Case to determine the AQI Category based on this Chart:
The Answer is the "worst" AQI Category from either PM2.5 or PM10.