This document is meant as a reference guide on how to design using Bosch Sensortec’s BME280 series of humidity sensor.
The BME280 series of humidity sensor contains 1 products: BME280. Table 1 shows an overview of the features.
Table 1: Overview of the products in this family
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.
To best to evaluate the products from the BME280 family, we recommend the following combination of evaluation tools:
See Figure 1 for a complete schematic of a typical BME280 use-case. Fig. 1: Mockup Reference design
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
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.
Figure 3: Typical layout
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
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
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
/*!
* @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;
}
Datasheets:
Handling, soldering and mounting instructions:
Source document:
BME280 Data sheet
Revision 1.6
Document release date Sept 2018
Document Number BST-BME280-DS002-15
Technical reference code 0 273 141 185
Section:
Chapter 4.2.3 Compensation Formulas
Request:
Are those code segments available in another format (i.e., text)? I am unable to copy the code directly out of the pdf and want to avoid any translation errors by my retyping the content into a source code editor.
Hello Bosch Sensortec,
We use your BME280 in one of our electronic devices. I would like to inquire whether this component appears on any embargo list or whether it is qualified as 'dual-use' in the sense of being used both for peaceful or military aims.
I would greatly appreciate a prompt reply, thanks in advance!
All Best, Simo
Hi simodium,
none of Bosch Sensortec sensors are allowed to be used in military applications. Please refer to the legal disclaimer text at the end of the BME280 datasheet for specific exclusions.
Hello,
I have an application to use the BME280 humidity sensor where it may be expose to low concentrations of ammonia (<1000ppm). The BME 280 handling instructions state it is forbiden to expose the sensor to such chemicals. Do you have any test data on the effects of exposure of the sensor to ammonia?
Thank you
Has anyone ported the Bosch supplied driver on githup to MPLABX XC16? It looks like it was written on a linux system. So many non-standard integer types used.
My porting trouble in this area-
The link to the linux installer,
https://ae-bst.resource.bosch.com/media/_tech/media/coines/COINES_Installers_v1.1_Linux.zip, is broken. Is there an updated link?
some reference designs (Dev kits, breakout boards, end product, open source software etc) with BME280:
https://www.onsemi.com/PowerSolutions/evalBoard.do?id=RSL10-SOLARSENS-GEVK&utm_source=pr&utm_medium=...
https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATULPC-DEMO#additional-summary
https://www.seeedstudio.com/Grove-BME280-Environmental-Sensor-Temperature-Humidity-Barometer.html
https://www.sparkfun.com/search/results?term=bosch
https://www.adafruit.com/?q=Bosch
https://github.com/apache/mynewt-core/tree/master/hw/drivers/sensors
https://github.com/zephyrproject-rtos/zephyr/tree/master/drivers/sensor
All the links in this article seem to be broken
Board Mount Humidity Sensors The BME280 is an integrated environmental sensor developed specifically for mobile applications where size and low power consumption are key design constraints. The BME280 is a great new chip that was originally designed for the next generation of smartphones.You can find the best quality sensor at Robu.