Particle Powered Air Quality Sensor Logging to Google Docs
-
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
I followed your lead on the Grafana + InfluxDB stuff. It was dead simple to setup.
Yes, really simple. I use docker for grafana and influxdb.
Your SGP30 CO2 ppm graph looks like mine... :(
I just want to get HTTPS/SSL working.
I use an nginx-setup here for https.
Pretty nifty little piece of software.
Yepp! They are real software gems.
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
Your SGP30 CO2 ppm graph looks like mine...
Also, Is your SGP30 plot the dark red one? Definitely not what I'd expect from this sensor. At first I thought it was the CCS811 as that one appears to be less reactive (at least in my testing)
-
@fotofieber also, I compiled my conclusions about some of the smaller form factor TVOC/C02 sensors. It was inspired by everything we talked about here. Our back and forth conversation has been awesome. So I wanted to say thanks for the inspiration :)

The above is a screenshot from the side-by-side data of the BME680, CCS811 and SGP30.
The BME680 seemed impressive at first but I'm seeing a big difference in temperature and humidity. My thinking it's likely due to the heating elements inside keeping it a little less humid and a little more hot. (These are the compensated values by the way. The non-compensated values are even lower humidity and a hotter.)
The SGP30 is a bit of a power hog but the TVOC readings seemed to align well with the response from the BME680.
The CCS811, like we've seen throughout this thread, had some wacky responses using the 1.0.0 firmware. I haven't seen that since all of my CCS811 are up to date.
It's a toss up between all three but I'd shy away from the CCS811. If anyone here plans on building a production device, the stock is not reliable enough. (Digikey and Mouser have been out of stock lately) I'm not sure if you'd have the same problem in the EU or how things are in Asia.
Anyway my TLDR conclusions are here if anyone is interested. They include software implementation factors, hardware factors, availability factors and data output factors all rolled into one.
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
The BME680 seemed impressive at first but I'm seeing a big difference in temperature and humidity. My thinking it's likely due to the heating elements inside keeping it a little less humid and a little more hot. (These are the compensated values by the way. The non-compensated values are even lower humidity and a hotter.)
I have tested several temperature sensors in the same setup and will use seperate HTU21D in my production devices anyway. So temperature and humidity would be no problem for me.
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
Also, Is your SGP30 plot the dark red one? Definitely not what I'd expect from this sensor. At first I thought it was the CCS811 as that one appears to be less reactive (at least in my testing)
Yes, it's is the dark red one. :(
Yesterday another CCS811 arrived. I will add it to my setup.My final setup drifts to:
- HTU21D temp/hum
- MHZ19B CO2
- HC-SR501 (modified for 3.3V) motion
- WS 2812B led stripes
-
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
The BME680 seemed impressive at first but I'm seeing a big difference in temperature and humidity. My thinking it's likely due to the heating elements inside keeping it a little less humid and a little more hot. (These are the compensated values by the way. The non-compensated values are even lower humidity and a hotter.)
I have tested several temperature sensors in the same setup and will use seperate HTU21D in my production devices anyway. So temperature and humidity would be no problem for me.
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
Also, Is your SGP30 plot the dark red one? Definitely not what I'd expect from this sensor. At first I thought it was the CCS811 as that one appears to be less reactive (at least in my testing)
Yes, it's is the dark red one. :(
Yesterday another CCS811 arrived. I will add it to my setup.My final setup drifts to:
- HTU21D temp/hum
- MHZ19B CO2
- HC-SR501 (modified for 3.3V) motion
- WS 2812B led stripes
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
I have tested several temperature sensors in the same setup and will use seperate HTU21D in my production devices anyway. So temperature and humidity would be no problem for me.
After someone on a different forum suggested, I actually switched it from continuous to low power mode and the temperature and humidity readings look better.

(Red line is in the middle between before and after the change.)
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
Yesterday another CCS811 arrived. I will add it to my setup.
Nice, curious to see your results!
-
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
I have tested several temperature sensors in the same setup and will use seperate HTU21D in my production devices anyway. So temperature and humidity would be no problem for me.
After someone on a different forum suggested, I actually switched it from continuous to low power mode and the temperature and humidity readings look better.

(Red line is in the middle between before and after the change.)
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
Yesterday another CCS811 arrived. I will add it to my setup.
Nice, curious to see your results!
BME680 sensor mith MCU arrived. Hope I can read the chinese specification of the module.... :) (What stand PS for?)
-
BME680 sensor mith MCU arrived. Hope I can read the chinese specification of the module.... :) (What stand PS for?)
@fotofieber hmm I'm not sure. Can you send me more info about the board you got?
-
@fotofieber hmm I'm not sure. Can you send me more info about the board you got?
@jaredwolff
Found something on https://de.aliexpress.com/item/GY-MCU680V1-BME680-Sensor-Module-Temperature-and-Humidity-Air-Pressure-Air-Quality-IAQ-MCU680-Module/32902672818.html?spm=a2g0x.10010108.1000016.1.3bc92080ZxA8fs&isOrigTitle=trueWhen soldering the PS solder joint, the module is in the chip's own IIC mode, at which point the MCU does not participate in the operation and does not consume current. Can be used as a simple BME680 module.
And in serial mode:
https://playground.cmmakerclub.com/2018/12/esp32/วิธีการใช้งาน-gy-mcu680-กับ-esp32/I will try the I2C mode first.
-
@jaredwolff
Found something on https://de.aliexpress.com/item/GY-MCU680V1-BME680-Sensor-Module-Temperature-and-Humidity-Air-Pressure-Air-Quality-IAQ-MCU680-Module/32902672818.html?spm=a2g0x.10010108.1000016.1.3bc92080ZxA8fs&isOrigTitle=trueWhen soldering the PS solder joint, the module is in the chip's own IIC mode, at which point the MCU does not participate in the operation and does not consume current. Can be used as a simple BME680 module.
And in serial mode:
https://playground.cmmakerclub.com/2018/12/esp32/วิธีการใช้งาน-gy-mcu680-กับ-esp32/I will try the I2C mode first.
@fotofieber I'm using I2C over here with great success. Let me know how it goes!
-
@fotofieber I'm using I2C over here with great success. Let me know how it goes!
@jaredwolff
Seems like I only get an IAQ value for the BME680 and no (e)CO2. Is this correct? -
@jaredwolff
Seems like I only get an IAQ value for the BME680 and no (e)CO2. Is this correct?@fotofieber correct! No C02. There's also temp, humidity and pressure. Here's a little code to get up and running with their C++ library.
-
@fotofieber correct! No C02. There's also temp, humidity and pressure. Here's a little code to get up and running with their C++ library.
@jaredwolff
Managed to compile Bosch arduino demo code on ESP32 on platformio after 3 hours. :sunglasses:But then....
BSEC library version 1.4.7.3 Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent BSEC error code : -2Maybe I give up here, as I really don't like to use binary code in my sensors....
-
@jaredwolff
Managed to compile Bosch arduino demo code on ESP32 on platformio after 3 hours. :sunglasses:But then....
BSEC library version 1.4.7.3 Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent BSEC error code : -2Maybe I give up here, as I really don't like to use binary code in my sensors....
@fotofieber integrating their static library is a PITA.
What processor are you using exactly? That wold dictate which version of the BSEC you'd integrate.
For Arduino, the library should handle the import of the
.afile. If you're in any other environment you'll have to add a few lines:LIB_DEPS += $(USER_LIB_DIR)/libalgobsec.a LDFLAGS += -Wl,--whole-archive $(USER_LIB_DIR)/libalgobsec.a -Wl,--no-whole-archiveI had to add these to the makefile in
.particle/toolchains/deviceOS/1.2.0-beta.1/firmware-1.2.0-beta.1/modules/xenon/user-partfor the Particle stuff to work. -
@fotofieber integrating their static library is a PITA.
What processor are you using exactly? That wold dictate which version of the BSEC you'd integrate.
For Arduino, the library should handle the import of the
.afile. If you're in any other environment you'll have to add a few lines:LIB_DEPS += $(USER_LIB_DIR)/libalgobsec.a LDFLAGS += -Wl,--whole-archive $(USER_LIB_DIR)/libalgobsec.a -Wl,--no-whole-archiveI had to add these to the makefile in
.particle/toolchains/deviceOS/1.2.0-beta.1/firmware-1.2.0-beta.1/modules/xenon/user-partfor the Particle stuff to work.@jaredwolff
ESP32 is the platform I use.Linking is no problem (after trial and error of two hours :) ).
I seem to have made a call to the lib:
BSEC library version 1.4.7.3Now adding DEBUG-Messages to the BSEC arduino library.
-
@jaredwolff
ESP32 is the platform I use.Linking is no problem (after trial and error of two hours :) ).
I seem to have made a call to the lib:
BSEC library version 1.4.7.3Now adding DEBUG-Messages to the BSEC arduino library.
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
Linking is no problem (after trial and error of two hours ).
Yea it took me a bit to figure that out too. :grimacing:
Have you fired up the standard I2C library to see if you can talk to the BME680? Or maybe throw a logic analyzer on it to maker sure it's communicating? I'd imaging the compiler would barf if you used the wrong static library. Bosch does have an ESP32 specific one.
Unfortunately, I don't have any way of testing that here. Keep me posted, I'm curious as to why it's not working.
-
@fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:
Linking is no problem (after trial and error of two hours ).
Yea it took me a bit to figure that out too. :grimacing:
Have you fired up the standard I2C library to see if you can talk to the BME680? Or maybe throw a logic analyzer on it to maker sure it's communicating? I'd imaging the compiler would barf if you used the wrong static library. Bosch does have an ESP32 specific one.
Unfortunately, I don't have any way of testing that here. Keep me posted, I'm curious as to why it's not working.
@jaredwolff
The data is read correctly:temp 1883 hum 54739 press 94317 gas resistance 118267 call bsec_do_steps(.. return of bsec_do_steps -2And -2 means:
BSEC_E_DOSTEPS_VALUELIMITS = -2, /*!< Value of input (physical) sensor signal passed to bsec_do_steps() is not in the valid range */I wish I had the source code of the lib....
-
@jaredwolff
The data is read correctly:temp 1883 hum 54739 press 94317 gas resistance 118267 call bsec_do_steps(.. return of bsec_do_steps -2And -2 means:
BSEC_E_DOSTEPS_VALUELIMITS = -2, /*!< Value of input (physical) sensor signal passed to bsec_do_steps() is not in the valid range */I wish I had the source code of the lib....
@fotofieber the library does have an error I found earlier. Divide
_data.temperatureby100.0fand_data.humidityby1000.0f. This is inBSEC.cppSee below:
/** * @brief Read data from the BME680 and process it */ bool Bsec::readProcessData(int64_t currTimeNs, bsec_bme_settings_t bme680Settings) { bme680Status = bme680_get_sensor_data(&_data, &_bme680); if (bme680Status != BME680_OK) { return false; } bsec_input_t inputs[BSEC_MAX_PHYSICAL_SENSOR]; // Temp, Pres, Hum & Gas uint8_t nInputs = 0, nOutputs = 0; if (_data.status & BME680_NEW_DATA_MSK) { if (bme680Settings.process_data & BSEC_PROCESS_TEMPERATURE) { inputs[nInputs].sensor_id = BSEC_INPUT_TEMPERATURE; inputs[nInputs].signal = _data.temperature/100.0f; // Need to divide by 100 for fp inputs[nInputs].time_stamp = currTimeNs; nInputs++; /* Temperature offset from the real temperature due to external heat sources */ inputs[nInputs].sensor_id = BSEC_INPUT_HEATSOURCE; inputs[nInputs].signal = _tempOffset; inputs[nInputs].time_stamp = currTimeNs; nInputs++; } if (bme680Settings.process_data & BSEC_PROCESS_HUMIDITY) { inputs[nInputs].sensor_id = BSEC_INPUT_HUMIDITY; inputs[nInputs].signal = _data.humidity/1000.0f; // Need to divide by 1000 for fp; inputs[nInputs].time_stamp = currTimeNs; nInputs++; } if (bme680Settings.process_data & BSEC_PROCESS_PRESSURE) { inputs[nInputs].sensor_id = BSEC_INPUT_PRESSURE; inputs[nInputs].signal = _data.pressure; inputs[nInputs].time_stamp = currTimeNs; nInputs++; } if (bme680Settings.process_data & BSEC_PROCESS_GAS) { inputs[nInputs].sensor_id = BSEC_INPUT_GASRESISTOR; inputs[nInputs].signal = _data.gas_resistance; inputs[nInputs].time_stamp = currTimeNs; nInputs++; } } -
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
...
inputs[nInputs].signal = _data.humidity/1000.0f; // Need to divide by 1000 for fp;
...WTF, they have a known bug in the library and we all have to discover it by ourselves?....
How cool is that, you seem to have solved the problem I had.... :)
BSEC library version 1.4.7.3 Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent End setup() 279, 21.37, 94698.00, 57.66, 80982.00, 25.00, 0, 21.37, 57.66, 25.00, 500.00, 0.50 3278, 21.21, 94700.00, 57.42, 111997.00, 25.00, 0, 21.15, 58.10, 25.00, 500.00, 0.50 6278, 21.22, 94700.00, 57.25, 127972.00, 25.00, 0, 21.16, 57.80, 25.00, 500.00, 0.50 9278, 21.22, 94702.00, 57.10, 135341.00, 25.00, 0, 21.16, 57.58, 25.00, 500.00, 0.50I hope I will have a graph in two days and I can compare the Bosch sensor to the NIDIR-Sensors...
-
@jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:
...
inputs[nInputs].signal = _data.humidity/1000.0f; // Need to divide by 1000 for fp;
...WTF, they have a known bug in the library and we all have to discover it by ourselves?....
How cool is that, you seem to have solved the problem I had.... :)
BSEC library version 1.4.7.3 Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent End setup() 279, 21.37, 94698.00, 57.66, 80982.00, 25.00, 0, 21.37, 57.66, 25.00, 500.00, 0.50 3278, 21.21, 94700.00, 57.42, 111997.00, 25.00, 0, 21.15, 58.10, 25.00, 500.00, 0.50 6278, 21.22, 94700.00, 57.25, 127972.00, 25.00, 0, 21.16, 57.80, 25.00, 500.00, 0.50 9278, 21.22, 94702.00, 57.10, 135341.00, 25.00, 0, 21.16, 57.58, 25.00, 500.00, 0.50I hope I will have a graph in two days and I can compare the Bosch sensor to the NIDIR-Sensors...
@fotofieber I'm not sure they know.. haha I should tell them.
Good luck and let me know how it goes!
-
They know about it. They keep their library up to date on Github:
Here's the diff:
Here's the library link:
https://github.com/BoschSensortec/BSEC-Arduino-library
You probably downloaded it from the website just like I did.
I'll have to update my repo and point it to this as a submodule.
-
They know about it. They keep their library up to date on Github:
Here's the diff:
Here's the library link:
https://github.com/BoschSensortec/BSEC-Arduino-library
You probably downloaded it from the website just like I did.
I'll have to update my repo and point it to this as a submodule.
@jaredwolff
I downloaded the binaries from the Bosch site and the source library from the github repo.In the binaries archive is an arduino library with an example with the error, you found.... The github repo has no binaries and I couldn't get it up with the binary.
The binary distribution of essential code makes it more complicated than it could be...
The integration in platformio is not to complicated in my code. I only had to add (after investigating for some hours)
build_flags = -Llib/BSEC/src/esp32/ -lalgobsec -
@FotoFieber how goes the testing?
The BME680 and the SGP30 both correlate in their readings with temperature. This means when the temperature goes up and down, i've seen the TVOC reading go up and down as well. Hardly useful for a sensor that is supposed to tell you if your air is bad or not.
Take a look at the screenshot below:

You can see that both sensors react wildly to temperature. Whereas the CCS811 has a bump but not significantly. If I go by the scales in the data sheets for the BME680 and SGP30, the room that these sensors are in require immediate venting.
Even right now, the SGP30 sensor is half way to the danger zone. 😵
Danger zone!

While testing that, I also threw everything together into an enclosure. Even added GPS:

So it sits up in the kitchen and chirps at me when I burn my food. I switch on my air purifier and the particulate level goes down pretty quick!
