Dear Jet, Thanks for the explanation! I ran with the following code sample to see how the sensor behaves, I just added it here so that hopefully someone else can benefit from it. I got the output as below (below the code sample). (Note that the Quality column is useless because I do not update the iaq value). I guess this all works as expected, I did change the environmental conditions to (perhaps) speed up the calibration process so it took about 1 hour 45 minutes to get quality 3. Hopefully it will do so quicker when the saved state is loaded upon boot. I still have some questions about operating the sensor but this is very helpfull for now at least, we just have to see how it behaves in the operational environment. Thanks for the explanations! Goof #include "bsec.h"
#include "Adafruit_Sensor.h"
const uint8_t bsec_config_iaq[] = {
#include "config/generic_33v_300s_28d/bsec_iaq.txt"
};
Bsec iaqSensor;
void setup(void)
{
Serial.begin(9600);
while(!Serial);
Wire.begin();
iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire);
iaqSensor.setConfig(bsec_config_iaq);
bsec_virtual_sensor_t sensorList[5] = {
BSEC_OUTPUT_RAW_GAS,
BSEC_OUTPUT_CO2_EQUIVALENT,
BSEC_OUTPUT_BREATH_VOC_EQUIVALENT,
BSEC_OUTPUT_STABILIZATION_STATUS,
BSEC_OUTPUT_RUN_IN_STATUS
};
iaqSensor.updateSubscription(sensorList, 5, BSEC_SAMPLE_RATE_ULP);
Serial.println("GasResistance, ECO2, ECO2Quality, TVOC, TVOCQuality, StabilizationStatus, RunInStatatus, Quality, SensorStatus");
}
unsigned long int nextCallTime = 0;
const unsigned long int millisSecondsToNextCall = 297 * 1000;
void loop(void)
{
if(millis() < nextCallTime) return;
if (iaqSensor.run()) {
nextCallTime = millis() + millisSecondsToNextCall;
Serial.print(iaqSensor.gasResistance); Serial.print(", ");
Serial.print(iaqSensor.co2Equivalent); Serial.print(", ");
Serial.print(iaqSensor.co2Accuracy); Serial.print(", ");
Serial.print(iaqSensor.breathVocEquivalent); Serial.print(", ");
Serial.print(iaqSensor.breathVocAccuracy); Serial.print(", ");
Serial.print(iaqSensor.stabStatus); Serial.print(", ");
Serial.print(iaqSensor.runInStatus); Serial.print(", ");
Serial.print(iaqSensor.iaqAccuracy); Serial.print(", ");
Serial.println(iaqSensor.status);
// Normally, code would "freeze" here for 5 minutes untill woken up
}
} Output: GasResistance, ECO2, ECO2Quality, TVOC, TVOCQuality, StabilizationStatus, RunInStatatus, Quality, SensorStatus
240996.00, 500.00, 0, 0.50, 0, 1.00, 0.00, 0, 0
228775.00, 500.00, 0, 0.50, 0, 1.00, 0.00, 0, 0
231672.00, 500.00, 0, 0.50, 0, 1.00, 0.00, 0, 0
231184.00, 500.00, 0, 0.50, 0, 1.00, 0.00, 0, 0
231346.00, 500.00, 1, 0.50, 1, 1.00, 1.00, 0, 0
230860.00, 510.24, 1, 0.52, 1, 1.00, 1.00, 0, 0
238725.00, 508.77, 1, 0.52, 1, 1.00, 1.00, 0, 0
244575.00, 500.00, 1, 0.50, 1, 1.00, 1.00, 0, 0
253615.00, 500.00, 1, 0.50, 1, 1.00, 1.00, 0, 0
265045.00, 500.00, 1, 0.50, 1, 1.00, 1.00, 0, 0
342853.00, 400.00, 1, 0.34, 1, 1.00, 1.00, 0, 0
321124.00, 457.23, 1, 0.43, 1, 1.00, 1.00, 0, 0
300332.00, 605.58, 1, 0.75, 1, 1.00, 1.00, 0, 0
283527.00, 870.41, 1, 1.28, 1, 1.00, 1.00, 0, 0
268065.00, 1127.44, 1, 1.88, 1, 1.00, 1.00, 0, 0
260228.00, 1427.71, 1, 2.97, 1, 1.00, 1.00, 0, 0
253225.00, 1641.61, 2, 4.10, 2, 1.00, 1.00, 0, 0
247888.00, 1800.83, 2, 5.21, 2, 1.00, 1.00, 0, 0
246774.00, 1860.58, 2, 5.71, 2, 1.00, 1.00, 0, 0
252255.00, 1878.02, 2, 5.86, 2, 1.00, 1.00, 0, 0
272501.00, 1594.83, 2, 3.82, 2, 1.00, 1.00, 0, 0
287989.00, 1176.15, 3, 2.03, 3, 1.00, 1.00, 0, 0
300607.00, 785.58, 3, 1.12, 3, 1.00, 1.00, 0, 0
... View more