The SparkFun BME280 Atmospheric Sensor (Qwiic) is a high-precision environmental sensor manufactured by SparkFun Electronics. It is designed to measure temperature, humidity, and barometric pressure with exceptional accuracy. The sensor communicates via the I2C protocol, making it easy to integrate into a wide range of projects. Its compact design and compatibility with the Qwiic ecosystem make it ideal for applications such as weather stations, indoor air quality monitoring, and altitude measurement.
The following table outlines the key technical details of the SparkFun BME280 Atmospheric Sensor:
Parameter | Value |
---|---|
Manufacturer | SparkFun Electronics |
Part Number | BME280 |
Supply Voltage (VDD) | 1.8V to 3.6V |
Operating Current | 2.7 µA (typical in sleep mode) |
Communication Interface | I2C (Qwiic-compatible) |
I2C Address | 0x76 (default) or 0x77 (configurable) |
Temperature Range | -40°C to +85°C |
Temperature Accuracy | ±1.0°C |
Humidity Range | 0% to 100% RH |
Humidity Accuracy | ±3% RH |
Pressure Range | 300 hPa to 1100 hPa |
Pressure Accuracy | ±1 hPa |
Dimensions | 1.0" x 0.5" (25.4mm x 12.7mm) |
The SparkFun BME280 Atmospheric Sensor features a Qwiic connector for easy I2C communication. For users not using the Qwiic system, the breakout board also provides solderable pins. The pin configuration is as follows:
Pin Name | Description |
---|---|
VIN | Power supply input (1.8V to 3.6V) |
GND | Ground |
SDA | I2C data line |
SCL | I2C clock line |
CS | Chip select (used for SPI, not applicable for Qwiic/I2C) |
SDI | Data input for SPI (not used in I2C mode) |
SDO | Data output for SPI (not used in I2C mode) |
Below is an example of how to use the SparkFun BME280 Atmospheric Sensor with an Arduino UNO. This code reads temperature, humidity, and pressure data and prints it to the Serial Monitor.
#include <Wire.h>
#include <SparkFunBME280.h> // Include the SparkFun BME280 library
BME280 mySensor; // Create an instance of the BME280 class
void setup() {
Serial.begin(9600); // Initialize Serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the BME280 sensor
if (mySensor.beginI2C() == false) {
Serial.println("BME280 not detected. Check connections.");
while (1); // Halt the program if the sensor is not detected
}
Serial.println("BME280 initialized successfully!");
}
void loop() {
// Read temperature, humidity, and pressure from the sensor
float temperature = mySensor.readTempC(); // Temperature in Celsius
float humidity = mySensor.readFloatHumidity(); // Relative Humidity in %
float pressure = mySensor.readFloatPressure() / 100.0; // Pressure in hPa
// Print the sensor readings to the Serial Monitor
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" hPa");
delay(1000); // Wait for 1 second before the next reading
}
Sensor Not Detected:
Incorrect Readings:
Communication Errors:
Q: Can I use the BME280 with a 5V microcontroller?
A: Yes, but you must use a logic level shifter to convert the 5V logic levels to 3.3V to avoid damaging the sensor.
Q: How do I change the I2C address?
A: To change the I2C address from 0x76 to 0x77, solder the jumper on the back of the breakout board.
Q: Can the BME280 measure altitude?
A: Yes, altitude can be calculated using the pressure readings and a reference sea-level pressure value. The SparkFun library includes functions for altitude calculation.
Q: Is the sensor waterproof?
A: No, the BME280 is not waterproof. Avoid exposing it to water or high humidity for extended periods.