Bosch Sensortec Community

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

    BME280 pressure reading wrong

    BME280 pressure reading wrong

    jlehman
    Member

    I am using the BME280 to get temp, pressure and humidity in demand mode 1/sec. I have over sampling for each parameter set to 1. Temp and humidity  work. The pressure should be around 1020 but comes back around 630. Sometimes I get the correct value but most of the  time it is stuck in the 630s. Any idea what I am doing wrong? I am using the 64 bit compensation functions from the data sheet.

    Thanks

    6 REPLIES 6

    handytech
    Community Moderator
    Community Moderator

    Could please confirm whether you are using our recommend sensor API (available here) to communicate with the BME280, and if so, could you share a short snippet of the sensor's configuration and data readout?

    Could you also confirm that by 'demand mode' you mean really mean 'forced mode' of the sensor? If so, are you waiting for a sufficient period between the measurement is triggered and the data readout? If not, are you reading data in a single burst-read transaction?

    I am using forced once every 5 minuetes.

    I am using the code as presented in the BME280 datasheet. See attached source file

    #define CTRL_HUM_VAL    0x01                  // 1x samples of humidity
    #define CTRL_MEAS_VAL  0b00100101 // 1x samples of temp and pressure in force mode
    #define CONFIG_VAL          0x00                 // no filter and forced trigger

    The read is a one block read of 8 bytes at address 0xF7

    #define DATA_BLK_ADR 0xF7
    #define DATA_BLK_LEN 8

    I have attached the code and a 14hr run where you can see the pressure going in and out of the correct value.

    try again on the source file

    handytech
    Community Moderator
    Community Moderator

    Thank-you for the details about your implementation.

    Would you be able to share the raw registers values of the trimming parameters (i.e. registers 0x88 to 0xA1 and 0xE1 to 0xE7) as well as the raw values from data readouts (i.e. registers 0xF7 to 0xFE) of both expected and unexpected outputs?

    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