The BME/BMP280 sensor is a precision sensor from Bosch that is designed to measure barometric pressure, temperature, and in the case of the BME280, humidity. These sensors are widely used in environmental monitoring, weather stations, indoor navigation, fitness trackers, and various IoT applications due to their small form factor, low power consumption, and excellent accuracy.
Pin Number | Name | Description |
---|---|---|
1 | VDD | Power supply voltage |
2 | GND | Ground |
3 | SDO | Serial Data Out for SPI, MSB for I²C address |
4 | SDI | Serial Data In for SPI, I²C data |
5 | SCK | Serial Clock for SPI, I²C clock |
6 | CSB | Chip Select for SPI, active low |
7 | SDO | Serial Data Out for SPI, LSB for I²C address |
8 | VDDIO | Interface voltage |
To use the BME/BMP280 sensor in a circuit:
Below is an example of how to read data from the BME/BMP280 sensor using an Arduino UNO with the I²C interface.
#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 or 0x77 (SDO pin low or high)
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); // Wait for 2 seconds between measurements
}
Ensure that the BME/BMP280 library is installed in the Arduino IDE before uploading this code to the Arduino UNO.
Q: Can I use multiple BME/BMP280 sensors on the same I²C bus? A: Yes, you can use two sensors on the same I²C bus by using different I²C addresses (0x76 and 0x77).
Q: How can I calibrate the sensor? A: The BME/BMP280 sensors are factory-calibrated, but for critical applications, you can perform additional calibration using known reference values.
Q: What is the power consumption of the sensor? A: The BME/BMP280 sensors have very low power consumption, typically less than 1 µA in sleep mode.
For further assistance, consult the manufacturer's datasheet and application notes.