The BME280 Breakout is a compact and advanced environmental sensor module that provides highly accurate measurements of temperature, humidity, and barometric pressure. This sensor is manufactured by Bosch and is widely used in weather stations, home automation systems, and for indoor climate monitoring due to its precision and low power consumption.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (1.71 V to 3.6 V) |
2 | GND | Ground connection |
3 | SDA | I2C Data line / SPI Data In |
4 | SCL | I2C Clock line / SPI Clock |
5 | CSB | SPI Chip Select (active low) |
6 | SDO | SPI Data Out / I2C Address Select |
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme; // I2C
void setup() {
Serial.begin(9600);
if (!bme.begin(0x76)) { // Change to 0x77 if needed
Serial.println("Could not find a valid BME280 sensor, check wiring!");
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); // Wait for 2 seconds between measurements
}
Q: Can the BME280 sensor measure altitude? A: Yes, the BME280 can estimate altitude based on the barometric pressure reading.
Q: How do I calibrate the sensor? A: The BME280 comes factory-calibrated. However, for precise applications, you may need to perform additional calibration using known reference values.
Q: Is the BME280 waterproof? A: No, the BME280 is not waterproof. Protect it from moisture and condensation for accurate measurements.