BME280 Temperature, Humidity & Pressure Sensor
The BME280 is a digital environmental sensor from Bosch Sensortec that combines temperature, relative humidity, and barometric pressure measurement with I²C and SPI communication, making it suitable for weather stations, IoT devices, and embedded systems.
Specifications
| Measurements | Temperature, relative humidity, and pressure |
|---|---|
| Temperature Range | -40°C to +85°C |
| Humidity Range | 0 to 100% relative humidity |
| Humidity Accuracy | ±3% relative humidity |
| Pressure Range | 300 to 1100 hPa |
| Interface | I²C and SPI |
| I²C Address | 0x76 or 0x77 |
| VDD Supply Voltage | 1.71V to 3.6V |
| VDDIO Supply Voltage | 1.2V to 3.6V |
| Package | 2.5 × 2.5 × 0.93 mm LGA |
Some links on this page are affiliate links. If you purchase through them, Embedded Nerd may earn a small commission at no additional cost to you. This helps support the website and allows us to continue creating free tutorials and guides. Thank you for your support!
Resources
The BME280 is a digital environmental sensor from Bosch Sensortec that measures temperature, relative humidity, and atmospheric pressure.
It is designed for low-power applications and supports both I²C and SPI, making it a practical sensor for Arduino, ESP32, Raspberry Pi, and other embedded systems when used with a suitable breakout board.
The BME280 is particularly useful when a project needs several environmental measurements from a single sensor.
Key Features
- Temperature measurement
- Relative humidity measurement
- Barometric pressure measurement
- I²C communication
- SPI communication
- Two selectable I²C addresses
- Low-power operation
- Compact sensor package
- Suitable for environmental monitoring and IoT applications
Applications
The BME280 can be used in a wide range of embedded projects, including:
- Weather stations
- Indoor environmental monitors
- IoT sensors
- Home automation
- Data logging
- Altitude estimation
- Barometric monitoring
- Environmental sensing
- Portable electronics
- Arduino projects
- ESP32 projects
- Raspberry Pi projects
- Educational electronics
Pinout
The BME280 sensor itself uses different pins depending on whether it is connected through I²C or SPI. Breakout boards may expose the connections using different labels.
I²C
| Pin | Function |
|---|---|
| VDD | Main sensor supply |
| GND | Ground |
| SCK / SCL | I²C clock |
| SDI / SDA | I²C data |
| SDO | I²C address selection |
For I²C, the SDO connection determines the sensor address:
| SDO Connection | I²C Address |
|---|---|
| GND | 0x76 |
| VDDIO | 0x77 |
SPI
For SPI communication, the relevant connections are:
| Pin | Function |
|---|---|
| SCK | SPI clock |
| SDI | MOSI |
| SDO | MISO |
| CSB | Chip select |
The exact pin labels and available power connections depend on the BME280 breakout board being used.
How It Works
The BME280 integrates three sensing functions in one device.
The temperature sensor measures the surrounding temperature. The humidity sensor measures relative humidity, while the pressure sensor measures absolute atmospheric pressure.
The sensor processes these measurements internally and makes the results available through its digital communication interface.
The BME280 can communicate using either I²C or SPI. I²C is generally the simplest option for typical Arduino and ESP32 projects because it requires only two communication lines.
Pressure readings can also be used to estimate altitude. However, altitude calculations depend on the reference sea-level pressure and atmospheric conditions, so the calculated altitude should be treated as an estimate rather than an absolute measurement.
Compatible Boards
The BME280 is commonly used with development boards that provide a compatible I²C or SPI interface and suitable electrical levels.
Common platforms include:
- Arduino boards
- ESP32 development boards
- Raspberry Pi
- STM32 development boards
The BME280 sensor itself requires low-voltage power, with VDD specified from 1.71V to 3.6V and VDDIO from 1.2V to 3.6V.
Important: These specifications apply to the BME280 sensor itself. Breakout boards may include voltage regulators and level shifting. Always check the specifications of the specific module before connecting it to a development board.
Technical Details
Temperature
The BME280 operates over a temperature range of -40°C to +85°C.
The integrated temperature sensor is also used internally for compensation of the pressure and humidity measurements.
Humidity
The relative humidity measurement range is 0 to 100% RH.
The humidity sensor has a typical accuracy tolerance of ±3% RH and a response time of approximately 1 second under the conditions specified by Bosch Sensortec.
Pressure
The pressure measurement range is 300 to 1100 hPa.
The pressure sensor provides low-noise measurements and can be used for barometric monitoring and altitude estimation.
Communication
The BME280 supports:
- I²C
- 3-wire SPI
- 4-wire SPI
According to the Bosch Sensortec datasheet, I²C supports speeds up to 3.4 MHz, while SPI supports speeds up to 10 MHz.
Power Consumption
Typical current consumption at a 1 Hz data refresh rate is:
- 1.8 µA for humidity and temperature
- 2.8 µA for pressure and temperature
- 3.6 µA for humidity, pressure, and temperature
Sleep mode current is approximately 0.1 µA.
BME280 I²C Address
The BME280 supports two I²C addresses:
0x760x77
This makes it possible to use two BME280 sensors on the same I²C bus when they are configured with different addresses.
If a BME280 is not detected at 0x76, checking 0x77 is one of the first troubleshooting steps to perform.
The Embedded Nerd I2C Address Lookup & Compatibility Checker can also be used to check I²C addresses and possible conflicts between devices.
BME280 with Arduino
The BME280 can be used with Arduino through the Adafruit BME280 Library.
The library is available through the Arduino Library Manager and provides functions for reading temperature, pressure, humidity, and estimated altitude.
The official library also supports both I²C and SPI communication.
A typical initialization using I²C is:
#include <Wire.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme;
void setup() {
Serial.begin(115200);
if (!bme.begin(0x76)) {
Serial.println("BME280 not found");
while (1);
}
}
void loop() {
Serial.print("Temperature: ");
Serial.print(bme.readTemperature());
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(bme.readHumidity());
Serial.println(" %");
Serial.print("Pressure: ");
Serial.print(bme.readPressure() / 100.0F);
Serial.println(" hPa");
delay(2000);
}
If the sensor uses address 0x77, initialize it with:
bme.begin(0x77);
BME280 with ESP32
The BME280 works well with the ESP32 through I²C or SPI.
I²C is generally the simplest choice for a first ESP32 project because the BME280 can share the bus with other compatible I²C devices.
For example, an ESP32 project can combine the BME280 with an SSD1306 OLED Display to show temperature, humidity, and pressure readings.
The BME280 can also be combined with the MPU6050 Accelerometer & Gyroscope in projects that require both environmental and motion measurements.
BME280 vs. BMP280
The BME280 and BMP280 are closely related Bosch Sensortec sensors.
| Feature | BME280 | BMP280 |
|---|---|---|
| Temperature | Yes | Yes |
| Pressure | Yes | Yes |
| Humidity | Yes | No |
| I²C | Yes | Yes |
| SPI | Yes | Yes |
The main difference is the humidity measurement.
If a project needs temperature, pressure, and humidity from the same sensor, the BME280 is the appropriate choice.
Why Choose BME280?
The BME280 is useful when a project needs several environmental measurements without requiring separate sensors.
Its main practical advantages include:
- Three environmental measurements in one sensor
- I²C and SPI support
- Two selectable I²C addresses
- Low power consumption
- Wide temperature and pressure operating ranges
- Good support in the Arduino ecosystem
- Suitable for ESP32 and Raspberry Pi projects
- Compact sensor package
It is particularly attractive for battery-powered environmental monitoring and compact embedded projects.
Project Ideas
The BME280 can be used as the basis for several Embedded Nerd projects:
ESP32 Weather Station
Use an ESP32 and BME280 to measure temperature, humidity, and atmospheric pressure and display the results locally or through a web interface.
OLED Environmental Monitor
Combine the BME280 with an SSD1306 OLED display to create a small desktop environmental monitor.
IoT Environmental Sensor
Use an ESP32 to collect BME280 measurements and transmit environmental data over Wi-Fi.
Altitude Monitor
Use pressure measurements from the BME280 to estimate changes in altitude.
Data Logger
Record temperature, humidity, and pressure measurements over time for later analysis.
Documentation
The BME280 is supported by official Bosch Sensortec documentation, including the datasheet and technical product information.
For Arduino projects, the Adafruit BME280 Library provides a ready-to-use interface for reading the sensor.
The library can be installed through the Arduino IDE Library Manager by searching for:
Adafruit BME280
The library also requires the Adafruit Unified Sensor dependency.
For the most accurate electrical and sensor specifications, refer to the official Bosch Sensortec datasheet.
Related Products
The BME280 can be combined with other Embedded Nerd hardware for complete embedded projects.
- MPU6050 Accelerometer & Gyroscope — motion sensing through I²C.
- SSD1306 OLED Display — display BME280 measurements locally.
Related Tutorials
The following existing Embedded Nerd resources are relevant when building projects around the BME280:
- I2C Scanner Tutorial: Find Any I2C Device Address (Arduino & ESP32) — useful for detecting the BME280 and checking its I²C address.
- ESP32 OLED Tutorial: Wiring, Code & Display Guide — useful for displaying BME280 measurements on an SSD1306 OLED.
Frequently Asked Questions
What is the BME280?
The BME280 is a digital environmental sensor that measures temperature, relative humidity, and atmospheric pressure.
What is the BME280 used for?
It is commonly used for weather stations, environmental monitoring, IoT devices, home automation, data logging, and embedded projects.
Does the BME280 work with Arduino?
Yes. The BME280 can be used with Arduino through I²C or SPI, and libraries such as the Adafruit BME280 Library provide a convenient programming interface.
Does the BME280 work with ESP32?
Yes. The BME280 can communicate with an ESP32 using I²C or SPI. I²C is generally the simplest option for typical projects.
What is the BME280 I²C address?
The BME280 supports two I²C addresses: 0x76 and 0x77. The address is selected through the SDO connection.
Can the BME280 measure altitude?
The BME280 does not directly measure altitude. Altitude can be estimated from atmospheric pressure, but the result depends on the reference sea-level pressure and atmospheric conditions.
Does the BME280 measure humidity?
Yes. Relative humidity is one of the three measurements provided by the BME280, together with temperature and pressure.
What is the difference between BME280 and BMP280?
The BME280 measures temperature, pressure, and humidity. The BMP280 measures temperature and pressure but does not include humidity sensing.
Summary
The BME280 is a versatile digital environmental sensor that combines temperature, relative humidity, and atmospheric pressure measurement in a compact device.
With I²C and SPI support, two selectable I²C addresses, low power consumption, and broad support in embedded development environments, it is a strong choice for weather stations, IoT devices, environmental monitors, and Arduino or ESP32 projects.