Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BME680 CO2 in ULP not changing

    BME680 CO2 in ULP not changing

    goof
    Member

    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:  

    • bsec_config_iaq -> generic_33v_300s_28d
    • sensorList({
            BSEC_OUTPUT_RAW_GAS,
            BSEC_OUTPUT_CO2_EQUIVALENT,
            BSEC_OUTPUT_BREATH_VOC_EQUIVALENT        
        })
    • I am ussing a Feather M0

    The sequence of the program is as follows: 

    Initialization:
    • iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire);
    • iaqSensor.setConfig(bsec_config_iaq);
    • iaqSensor.updateSubscription(sensorList, 3BSEC_SAMPLE_RATE_ULP);
    Loop:
    • iaqSensor.run(getTimeStamp()) (this returns the time in millis of an external real time clock)
    • if run returns true do read: 
      • iaqSensor.co2Equivalent;
      • iaqSensor.breathVocEquivalent;
    • When read done: device goes to sleep for 5 minutes (more precisely the interval is 5 minutes + 6 seconds
    • Wake up (go back to top of loop)

    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

     
     
     

     

    5 REPLIES 5

    Jet
    Occasional Contributor

    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.

     

    Dear Jet,

    Thanks for the quick response! That sounds reasonable, I alsof die soms additional reading. So my usecase would be:

    Brand new sensor:
    As soon as accuracy =3, store state which will happen after at least 20 min in ulp

    Or, when a state is available load it to bsec.

    Another question:
    Would it be beneficial to update the saved state every day or so when the quality = 3 or won't this have an added value?

    Final question:
    We operate in an environment where the CO2 is at varying plateaus for extended periods of time, a few days on 1000, then a few days at 8000 for example is there anything I should know when operating it in such an environment or will the above mentioned operation flow work fine for such a user case?

    Many thanks!

    Goof

    Jet
    Occasional Contributor

    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.

     

     

    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

     

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist