Bosch Sensortec Community

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

    BME280 Incompatible Arduino Drivers?

    BME280 Incompatible Arduino Drivers?

    DCubeMiner
    New Poster

    I have made my own custom Arduino compatible boards, and I have tested them using drivers from Adafruit.

    Unfortunately, the Adafruit drivers does not detect the BME280 drivers, but drivers from Seeed can see it.

    Can anybody tell me why the Adafruit drivers won't work, but the Grove driver does?

    Thanks!

    3 REPLIES 3

    Jet
    Occasional Contributor

    Because I have only STM32 platform and only use C API code. I didn't verify these reference codes you offered, and only offer some simple sugguestions based on our sensor configuration and offical API code of C.

    From the Adafruit drivers,it uses force mode, but it doesn't setup some parametes.

    void Adafruit_BME280::setSampling(sensor_mode mode,
    sensor_sampling tempSampling,
    sensor_sampling pressSampling,
    sensor_sampling humSampling,
    sensor_filter filter,
    standby_duration duration) {
    _measReg.mode = mode;
    _measReg.osrs_t = tempSampling;
    _measReg.osrs_p = pressSampling;

    _humReg.osrs_h = humSampling;
    _configReg.filter = filter;
    _configReg.t_sb = duration;

    // making sure sensor is in sleep mode before setting configuration
    // as it otherwise may be ignored
    write8(BME280_REGISTER_CONTROL, MODE_SLEEP);

    // you must make sure to also set REGISTER_CONTROL after setting the
    // CONTROLHUMID register, otherwise the values won't be applied (see
    // DS 5.4.3)
    write8(BME280_REGISTER_CONTROLHUMID, _humReg.get());
    write8(BME280_REGISTER_CONFIG, _configReg.get());
    write8(BME280_REGISTER_CONTROL, _measReg.get());
    }

    This function need setup parameters , but in this drivers, only call this function without parametes.

     setSampling(); // use defaults call this function

     

    From the Grove driver, it setups parameters directly, ans use normal mode.

    writeRegister(BME280_REG_CONTROLHUMID, 0x05); //Choose 16X oversampling
    writeRegister(BME280_REG_CONTROL, 0xB7); //Choose 16X oversampling

    Expect your verification and answer.

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    If the issue is resolved, please click "Accept as Solution" button.

    Thanks.

    I know it's been 5 months since I posted this question.

    I tried commenting off the setSampling function on the Adafruit drivers, but they still won't detect my device.

    Anyway, I gave up and used the Grove drivers instead.

    Thanks!

    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