01-18-2021 06:30 PM
Hi there,
Perhaps this is a trivial question and I am just being impatient with getting data but hopefully someone can clarify.
The bottom line is that when I start the sensor the reading for CO2 en TVOC keep at 500 and 0 respecitevely (if I do not initialize the state).
Settings:
The sequence of the program is as follows:
This keeps giving the initial values of 500 and 0 for co2Equivalent and breathVocEquivalent
When I add upon initialization the setState step: iaqSensor.setState(state); then I get a Co2 value of 562 all the time which is probably the value I stored previously but this does not change.
question 1: when will the sensor (or bsec library) start to actually return out Co2 values?
question 2: how important is it to store the state and set it when the sensor is woken up?
question 3: how long is that state valid?
question 4: would it be matter to let the sensor run outside on a normal power mode for let's say 15 minutes or so? or does it not matter at all?
Many thanks for the help!
Goof
Solved! Go to Solution.
01-19-2021 09:57 AM
Hi Sir:
Please see the following comments:
1. When IAQ accuracy is 3, the sensor (or bsec library) will start to actually return out Co2 values.
2. It is important to store the state and set it when the sensor is woken up. It can improve user experience and reduce calibration time.
3. When IAQ accuracy is 3, recommend to store the state. But if the sensor is moved, the stored state will not be effective and if no state information, it only take more time to calibrate.
4. Sensor mode can't be changed during one measurement time.
Recommend the customer use one mode to achieve good performance. If the mode is changed, it needs time to get a stable performance.
Due to sensor hardware performance, after sensor power on, the sensor need a few minutes to achieve a good performance.
Hopefully, it can help you.
01-19-2021 01:25 PM
01-20-2021 07:45 AM
Hi Sir:
Please see my comments:
1. It would it be beneficial to update the saved state every day when accuracy = 3.
2. The above mentioned operation flow work is fine for such a user case. A few days in good environment, then a few days in bad environment, it make the sensor easy to know what is good and what is bad and output more correct value match the current environment change.
01-20-2021 11:17 AM
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