

The BMP280 is a high-precision barometric pressure sensor capable of measuring atmospheric pressure and temperature. Designed by Bosch Sensortec, it is widely used in weather stations, altitude measurement systems, and Internet of Things (IoT) applications. Its compact size, low power consumption, and high accuracy make it an ideal choice for portable and battery-powered devices. Additionally, the BMP280 supports both I2C and SPI communication protocols, making it versatile and easy to integrate into various microcontroller platforms.








The BMP280 sensor offers excellent performance and flexibility. Below are its key technical details:
The BMP280 module typically comes with a breakout board that includes the following pins:
| Pin Name | Description |
|---|---|
| VCC | Power supply pin. Connect to 3.3V (or 5V if the breakout board has a regulator). |
| GND | Ground pin. Connect to the ground of the circuit. |
| SCL | Serial Clock Line for I2C communication. |
| SDA | Serial Data Line for I2C communication. |
| CS | Chip Select for SPI communication. Pull low to enable SPI mode. |
| SDO | Serial Data Out for SPI communication. |
Note: For I2C communication, the CS pin should be pulled high or left unconnected.
The BMP280 can be easily integrated into a circuit using either I2C or SPI communication. Below are the steps to use the BMP280 with an Arduino UNO via I2C:
Below is an example Arduino sketch to read pressure and temperature data from the BMP280 using the Adafruit BMP280 library:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
// Create an instance of the BMP280 sensor
Adafruit_BMP280 bmp;
// Define constants for sea level pressure (in hPa)
#define SEALEVELPRESSURE_HPA (1013.25)
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
if (!bmp.begin(0x76)) { // Initialize BMP280 with I2C address 0x76
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
while (1); // Halt execution if sensor initialization fails
}
}
void loop() {
// Read and print temperature in Celsius
Serial.print("Temperature = ");
Serial.print(bmp.readTemperature());
Serial.println(" °C");
// Read and print pressure in hPa
Serial.print("Pressure = ");
Serial.print(bmp.readPressure() / 100.0F); // Convert Pa to hPa
Serial.println(" hPa");
// Calculate and print altitude based on sea level pressure
Serial.print("Approx. Altitude = ");
Serial.print(bmp.readAltitude(SEALEVELPRESSURE_HPA));
Serial.println(" m");
delay(2000); // Wait for 2 seconds before the next reading
}
0x76, but it may be 0x77 depending on the module configuration.The sensor is not detected by the Arduino.
Incorrect or fluctuating readings.
Altitude readings are inaccurate.
SEALEVELPRESSURE_HPA) used in the code. Adjust it to match the current atmospheric pressure at sea level in your location.Can the BMP280 measure humidity?
What is the maximum altitude the BMP280 can measure?
Can I use the BMP280 with a 5V microcontroller?
By following this documentation, you can effectively integrate and utilize the BMP280 sensor in your projects.