Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME680 gives random value and not able to measure temperature, humidity or the air quality

    BME680 gives random value and not able to measure temperature, humidity or the air quality

    dhari
    New Poster

    Hi,

    I am interfacing the BME680 with an ESP32 using ESP-IDF.  I am not able to read temperature or humidity or gas resistance from BME680. I am only able to read random adc values from the sensor for temperature, pressure, humidity and 0 as my gas resistance. And am not using BSEC to read data from BME680. I have written the sensor driver and I am pretty sure that whatever configurations I am doing initially is properly reflected on the sensor side too as I have verified the I2C signal for each configuration I am doing individually using a scope and rad back the value written to the registers after it is set.

    I am doing the initial configuration for the sensor in the following order:
    1. Reset the sensor
    2. Reading chip ID and its matching with the one mentioned in the datasheet
    3. Reading the calibration data 
    4. Setting the oversamping rate for temperature(4X), pressure(2X) and humidity(1X).
    5. Setting IIR filter to 7
    6. Enabling gas measurement by setting run_gas bit to 1
    7. Setting index to 0
    8. Setting heater duration to 200ms
    9. Setting heater temperature to 320
    10. Putting sensor in forced mode
    11. I wait for 3 seconds each time to read data from sensor and put it again to forced mode.
    12. Once 3 seconds has elapsed, I wait until any current ongoing measuremnt to be finished by checking the status register.
    13. Then, I check if the data available is a new data or not by reading the status register. 
    14. If the data is new, I proceed with calculating temperature, pressure and air quality. 

    Any insight as to where I am wrong or if I missed anything would be really helpful.

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hi dhari,

    If you would like to read BME680 sensor data with ESP32 under Arduino software environment, there was Arduino example code on github for your reference: https://github.com/boschsensortec/BSEC-Arduino-library/tree/master/examples

    Am using Espressif IDE to develop our application using ESP32. Any tutorial on how to link bsec static library into my project in espressif IDE  will be really helpful

    BSTRobin
    Community Moderator
    Community Moderator

    Hi dhari,

    Espressif IDE was not in BSEC supported list, you have to refer guide to migrate BSEC to your software platform from espressif guide.

    BSEC supported device and compiler.png

    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