Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    What is the maximum humidity the BME280 can report?

    New Poster

    What is the maximum humidity the BME280 can report?

    The provided driver has built-in maximum values such that if the sensor reports above 100% or 102.4% (depending on precision setting), the maximum value is reported, rather than what the ADC is reading. However, given the stated accuracy from the data sheet, its possible to be in a state where the BME280 functions correctly, and still reports that value. That is, 99.4% relative humidity, +/- 3% humidity, includes 102.4%
    Are those limits built into the hardware?

    I removed the min/max values from the driver to see if I could characterize the accuracy in the top 5% of the sensor's stated range. However, the readings still maxed out at 102.4%. If that limit is built into the hardware, the range should more correctly be stated as (accuracy at min) to (100 - accuracy at max).

    Tags (1)
    1 REPLY 1
    Highlighted
    New Poster

    Re: What is the maximum humidity the BME280 can report?

    The value returned is in 22.10 fixed point format. This means that the result must be shifted right 10 bits to get the integer part (not divded by 1000).
     
     

    All  compensate functions (double and fixed point), when out of range , MUST NOT report xxx_MAX ( or xxx_MIN),
    rather they MUST report xxx_ERR.

    It appears that recent changes to BME280_driver/bme290.c ignored the statments 

    var5 = (var5 < 0 ? 0 : var5);
    var5 = (var5 > 419430400 ? 419430400 : var5);  
    // 419430400 is 0x19000 which is decimal 100<<12 in 22.10 format

    Which (INCORRECTLY) set the return value to 100.00 when the value is greater than 100.00 (format 22.10)

    +++++

    Current coding practices suggest that these should be constants in the bme280.h file

    For example something similar to:

    #ifdef BME280_FLOAT_ENABLE
    #define TEMPERATURE_MIN     -40.00
    #define TEMPERATURE_MAX      85.000
    #define TEMPERATURE_ERR  88.000
    #define HUMIDITY_MIN  0.000
    #define HUMIDITY_MAX.  100.00
    #define HUMIDITY_ERR 200.000

    ...

    #ifdef BME280_64BIT_ENABLE

    #define HUMIDITY_MIN   0
    #define HUMIDITY_MAX 100<<10
    #define HUMIDITY_ERR 200<<10

    ...

     And the code something like:

    if ( (humidity < HUMIDITY_MIN) || (humidity > HUMIDITY_MAX ) ) return HUMIDITY_ERR;

     

     

    It seems nearly impossible to correctly provide a code segment containing a hash symbol here as the web page insists on doing a search  when one is entered.
    I give up trying to make this a correct code segment.

    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