The Adafruit BMP280 breakout board is a compact and versatile sensor module that features the BMP280 sensor. This sensor is capable of measuring barometric pressure and temperature with high accuracy, which makes it suitable for a wide range of applications including weather monitoring, altitude sensing, and environmental data logging.
Pin Number | Pin Name | Description |
---|---|---|
1 | VIN | Supply voltage (1.71V to 3.6V) |
2 | GND | Ground |
3 | SCK | Serial Clock (also used for SPI) |
4 | SDI | Serial Data In (also MOSI for SPI) |
5 | SDO | Serial Data Out (also MISO for SPI) |
6 | CS | Chip Select (active low, used for SPI) |
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp; // I2C Interface
void setup() {
Serial.begin(9600);
if (!bmp.begin(0x76)) { // Change to 0x77 depending on your wiring
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while (1);
}
}
void loop() {
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");
Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1013.25)); // Standard atmospheric pressure
Serial.println(" m");
delay(2000);
}
Q: Can the BMP280 measure humidity? A: No, the BMP280 is designed to measure pressure and temperature only.
Q: What is the default I2C address of the BMP280? A: The default I2C address is 0x77, but it can be changed to 0x76 by connecting the SDO pin to ground.
Q: How can I calibrate the altitude reading? A: Use a known reference sea-level pressure in your location to calibrate the altitude reading.
Q: Is the BMP280 waterproof? A: No, the BMP280 is not waterproof and should be protected from moisture and water exposure.
For further assistance, consult the Adafruit BMP280 datasheet and the community forums for additional support and resources.