Important Cookie Information

This website uses absolutely necessary cookies. If you consent to the use of convenience cookies, please click “Yes, I agree.” By clicking on “Privacy Settings.” you can change this setting at any time and withdraw your given consent. Icon down see more You can find detailled information in our Privacy Policy Icon forward-right
Icon up see less

Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BME280 series humidity sensor design guide

     Introduction

    This document is meant as a reference guide on how to design using Bosch Sensortec’s BME280 series of humidity sensor.

    Selecting the right part

    The BME280 series of humidity sensor contains 1 products: BME280. Table 1 shows an overview of the features.12.png

                                                                   Table 1: Overview of the products in this family

     Common characteristics

    The main characteristics of this product family are:

     Key features

    The BME280 is an integrated environmental sensor developed specifically for mobile applications where size and low power consumption are key design constraints. The unit combines individual high linearity, high accuracy sensors for pressure, humidity and temperature in an 8-pin metal-lid 2.5 x 2.5 x 0.93 mm³ LGA package, designed for low current consumption (3.6 μA @1Hz), long term stability and high EMC robustness.

    The humidity sensor features an extremely fast response time which supports performance requirements for emerging applications such as context awareness, and high accuracy over a wide temperature range. The pressure sensor is an absolute barometric pressure sensor with features exceptionally high accuracy and resolution at very low noise. The integrated temperature sensor has been optimized for very low noise and high resolution. It is primarily used for temperature compensation of the pressure and humidity sensors, and can also be used for estimating ambient temperature.

    The BME280 supports a full suite of operating modes which provide the flexibility to optimize the device for power consumption, resolution and filter performance.

     Available evaluation tools and software

    To best to evaluate the products from the BME280 family, we recommend the following combination of evaluation tools:

     Reference design

    See Figure 1 for a complete schematic of a typical BME280 use-case.13.png                                                        Fig. 1: Mockup Reference design

       Bill of materials

    14.png                                             Table 3: Bill of materials

     Layout recommendations

    Because the BME280 sensor family contains tiny mechanical structure inside the package, care must be taken during the layout phase to ensure the best performance. The complete handling and soldering guide can be found on the Bosch Sensortec’s website.

    In addition to the attached guidelines, see below for the typical manufacturing procedure for the BME280 humidity sensor.    

      Landing Pattern 

    19.png

     

                                                                  Fig. 2: Recommended landing pattern

    Note: red areas demark exposed PCB metal pads.

    In case of a solder mask defined (SMD) PCB process, the land dimensions should be defined by solder mask openings. The underlying metal pads are larger than these openings.

    In case of a non solder mask defined (NSMD) PCB process, the land dimensions should be defined in the metal layer. The mask openings are larger than these metal pads.

     Typical Layout

    16.png

                                                                                 Figure 3: Typical layout

    Manufacturing notes

    17.png

                                                                Table 4: Manufacture recommendation

      First power-on

    After powering the sensor for the first time, the initial specs would be to test for communication with the device. This can be done simply by reading the chip identification code in the register 0xD0. See below for the expected values

    18.png

                                                            Table 5: Chip IDs of the BME280 product family

    Here is some sample code on how to perform this test, using the COINES software as the host.

     

    /*!
     * @brief This internal API is used to initializes the bme280 sensor with default
     * settings like power mode and OSRS settings
     *
     * @param[in] void
     *
     * @return void
     *
     */
    static void init_bme280(void)
    {
        int8_t rslt;
        rslt = bme280_init(&bme280Dev);
        if (rslt == BME280_OK)
        {
            printf("BME280 Initialization Success!\n");
            printf("Chip ID 0x%x\n", bme280Dev.chip_id);
        }
        else
        {
            printf("Chip Initialization failure !\n");
            exit(COINES_E_FAILURE);
        }
        coines_delay_msec(100);
        
        bme280_set_sensor_mode(BME280_NORMAL_MODE, &bme280Dev);
    }
    

    How to read sensor data 

    Here is some sample code on how to read sensor data, using the COINES software as the host.

           

    /*!
     * @brief This internal API is used to read the streaming data in a while loop and
     * print in console.
     *
     *  @param[in] void
     *
     *  @return void
     */
    static void read_sensor_data(void)
    {
        int times_to_read = 0;
    
        while (times_to_read < 200)
        {
    
            bme280_get_sensor_data(BME280_ALL, &bme280_comp_data, &bme280Dev);
    
            printf("T: %.2f, H: %.2f, P: %.2f \n", (bme280_comp_data.temperature / 100.), (bme280_comp_data.humidity / 1000.), (bme280_comp_data.pressure / 100.));
            fflush(stdout);
    
            coines_delay_msec(10);
    
            times_to_read = times_to_read + 1;
        }
    }
    

     Sample code

    The complete sample code shown above can be compiled and executed from the COINES installation directory (by default, C:/COINES under Windows), from the following subfolder: \examples\c\bme280

    Usage

    The COINES installation provides sample code on how to turn on the sensor, configure it and read

    out data.

    COINES\v1.0\ examples\c\bme280

    Sample code

    /*!
     *  @brief Main Function where the execution getting started to test the code.
     *
     *  @param[in] argc
     *  @param[in] argv
     *
     *  @return status
     *
     */
    int main(int argc, char *argv[])
    {
        int16_t rslt;
        struct coines_board_info board_info;
    
        init_bme280_sensor_driver_interface();
    
        rslt = coines_open_comm_intf(COINES_COMM_INTF_USB);
    
        if (rslt < 0)
        {
            printf("\n Unable to connect with Application Board ! \n"
                   " 1. Check if the board is connected and powered on. \n"
                   " 2. Check if Application Board USB driver is installed. \n"
                   " 3. Check if board is in use by another application. (Insufficient permissions to access USB) \n");
            exit(rslt);
        }
    
        rslt = coines_get_board_info(&board_info);
    
        if (rslt == COINES_SUCCESS)
        {
            if (board_info.shuttle_id != BME280_SHUTTLE_ID)
            {
    
                printf("! Warning invalid sensor shuttle. This application will not support this sensor \r\n"
                       "1.Check the sensor shuttle \r\n"
                       "2.Reset the board  \r\n");
                exit(COINES_E_FAILURE);
            }
        }
    
        init_sensor_interface();
    
        /* after sensor init introduce 200 msec sleep */
        coines_delay_msec(200);
    
        init_bme280();
    
        read_sensor_data();
    
        coines_close_comm_intf(COINES_COMM_INTF_USB);
        return EXIT_SUCCESS;
    }
    

    Further reads

    Datasheets:

    Handling, soldering  and mounting instructions:

     

          

                                    

    Version history
    Revision #:
    2 of 2
    Last update:
    ‎04-24-2019 04:55 AM
    Updated by:
     
    Contributors
    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