The SparkFun Atmospheric Sensor Breakout - BME280 is a high-precision sensor module that can measure temperature, humidity, and barometric pressure. This breakout board is based on the Bosch BME280 sensor and is ideal for environmental sensing in weather stations, home automation systems, and IoT applications. Its small form factor and low power consumption make it suitable for portable and battery-powered devices.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Supply voltage (1.71 V to 3.6 V) |
3 | SDA | I2C Data / SPI Data Input (MOSI) |
4 | SCL | I2C Clock / SPI Clock Input |
5 | CSB | SPI Chip Select (active low) |
6 | SDO | SPI Data Output (MISO) / I2C Address Select |
To use the BME280 sensor with an Arduino UNO, follow these steps:
Below is an example of how to read data from the BME280 sensor using the I2C interface with an Arduino UNO. This code assumes the use of the Adafruit BME280 library.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
Adafruit_BME280 bme; // I2C
void setup() {
Serial.begin(9600);
if (!bme.begin(0x76)) { // Address 0x76 can be changed by connecting SDO to GND
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("Pressure = ");
Serial.print(bme.readPressure() / 100.0F);
Serial.println(" hPa");
Serial.print("Humidity = ");
Serial.print(bme.readHumidity());
Serial.println(" %");
delay(2000); // Delay between measurements
}
Q: Can the BME280 sensor measure altitude? A: Yes, the sensor can estimate altitude based on the barometric pressure reading.
Q: How do I change the I2C address of the sensor? A: The I2C address can be changed by connecting the SDO pin to GND or VCC. The default is 0x77, and connecting SDO to GND changes it to 0x76.
Q: Is the sensor waterproof? A: No, the BME280 sensor is not waterproof and should be protected from moisture and condensation.
For further assistance, consult the manufacturer's datasheet and the community forums dedicated to the SparkFun Atmospheric Sensor Breakout - BME280.