

The BME280 Breakout (Manufacturer Part ID: SEN-13676) by SparkFun Electronics is a versatile sensor module designed for environmental sensing. It combines three key sensing capabilities—temperature, humidity, and barometric pressure—into a single compact device. This makes it an ideal choice for weather monitoring, indoor climate control, and IoT applications.








The BME280 Breakout is built around Bosch's BME280 sensor and offers high precision and low power consumption. Below are the key technical details:
| Parameter | Value |
|---|---|
| Supply Voltage | 1.8V to 3.6V |
| Operating Current | 2.7 µA (in sleep mode) |
| Communication Protocols | I2C (default) or SPI |
| Temperature Range | -40°C to +85°C |
| Humidity Range | 0% to 100% RH |
| Pressure Range | 300 hPa to 1100 hPa |
| Dimensions | 0.6" x 0.6" (15.24mm x 15.24mm) |
The BME280 Breakout has a total of 6 pins. Below is the pinout and description:
| Pin Name | Pin Number | Description |
|---|---|---|
| VIN | 1 | Power supply input (1.8V to 3.6V). Connect to 3.3V for most applications. |
| GND | 2 | Ground connection. |
| SCL | 3 | Serial Clock Line for I2C communication. |
| SDA | 4 | Serial Data Line for I2C communication. |
| CS | 5 | Chip Select for SPI communication. Pull HIGH for I2C mode (default). |
| SDO | 6 | Serial Data Output for SPI communication. Can also set I2C address. |
The BME280 Breakout is easy to integrate into your projects using either I2C or SPI communication. Below are the steps to use the sensor in a circuit and some best practices.
Wiring: Connect the BME280 Breakout to the Arduino UNO as follows:
VIN → 3.3V on ArduinoGND → GND on ArduinoSCL → A5 (I2C Clock Line on Arduino UNO)SDA → A4 (I2C Data Line on Arduino UNO)CS → Leave unconnected or pull HIGHSDO → Leave unconnected or pull LOW for default I2C address (0x76)Install Required Libraries:
Example Code: Use the following code to read temperature, humidity, and pressure data from the BME280:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
// Create an instance of the BME280 sensor
Adafruit_BME280 bme;
// Define I2C address (default is 0x76, or 0x77 if SDO is HIGH)
#define BME280_I2C_ADDRESS 0x76
void setup() {
Serial.begin(9600);
while (!Serial); // Wait for serial monitor to open
// Initialize the BME280 sensor
if (!bme.begin(BME280_I2C_ADDRESS)) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
Serial.println("BME280 sensor initialized successfully!");
}
void loop() {
// Read and print temperature, humidity, and pressure
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); // Convert Pa to hPa
Serial.println(" hPa");
Serial.println(); // Add a blank line for readability
delay(2000); // Wait 2 seconds before the next reading
}
0x76. To change it to 0x77, connect the SDO pin to VIN.CS pin to a GPIO pin on your microcontroller and configure it in your code.Sensor Not Detected:
SDO pin is configured correctly for the desired I2C address.Incorrect Readings:
Communication Errors:
Q1: Can the BME280 Breakout measure altitude?
Yes, the BME280 can calculate altitude based on barometric pressure readings. Use the formula provided in the Adafruit BME280 library for altitude calculation.
Q2: Can I use the BME280 with a 5V microcontroller?
Yes, but you must use a logic level shifter to step down the 5V signals to 3.3V for the BME280.
Q3: How do I switch between I2C and SPI modes?
The BME280 operates in I2C mode by default. To use SPI mode, connect the CS pin to a GPIO pin and configure it in your code. Ensure the SDO pin is connected as required for SPI communication.
By following this documentation, you can effectively integrate the BME280 Breakout into your projects and troubleshoot common issues with ease.