Bosch Sensortec Community

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

    BME680: When is it actually finished reading?

    BME680: When is it actually finished reading?

    dfrey
    New Poster

    I'm looking at the BME680 datasheet and I have some questions about the following fields:

    reg field purpose

    meas_status_0measuringReads as 1 when a TPHG conversion is active and 0 when the results are transferred to the data registers
    meas_status_0gas_measuringChanges to 1 during gas measurement phase and then changes to 0 once the gas measurement has been transferred to the data registers
    meas_status_0new_data_0Is new data available? yes (1), no (0). I believe this is set to 0 when a measurement is initiated by writing 1 to ctrl_meas.mode and thus entering "forced" mode
    gas_r_lsbheat_stab_rDid the heater reach the temperature specified? yes (1), no (0)
    gas_r_lsbgas_valid_rIs the gas data in the register real (1) or dummy (0)

     

    Is meas_status_0.measuring just an inverted version of meas_status_0.new_data_0?  If not, how are they different?

    What is the purpose of meas_status_0.gas_measuring?  Why would a driver care when the gas measurement is active?  Isn't it sufficient to just look at the measuring or new_data_0 fields to know when the whole TPHG cycle is complete?

    I believe gas_valid_r indicates whether the value in the data register is a real value or a dummy value.  If I set ctrl_gas_1.run_gas=1 before entering forced mode, then why would the value be a dummy? Are the dummy values at all meaningful or are they just garbage that should be discarded?

    1 REPLY 1

    handytech
    Community Moderator
    Community Moderator

    A lot of information about the sensor's state are available, but it doesn't mean one would want to monitor every single one of them. If you are looking for the end of the measurement sequence, you could pick your preffered source and stick with it.

    In typical applications as you described, you would not expect any dummy gas value. As described in the datasheet, dummy values may be inserted by the sensor only to keep a constant sampling rate and predictable device timing.

    It is highly recommended to use the official sensor API/drivers from Bosch Sensortec to communicate with the sensor. BME680's sensor API even provides a function called bme680_get_profile_dur(),  that can be used to predict the measurement period based on the sensor's configuration. You can find the BME680 drivers here: BME680 sensor API.

    To benefit from the IAQ output, you will also need to use the pre-compiled BSEC library available here: BSEC Software download. If you have a look at the sample code available in this package, you will find that it makes use of bme680_get_profile_dur() after triggering a measurement, then ensures the sensor successfully returned to sleep mode before the data read-out operation.

    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