Introduction
The upgraded Pressure & Altitude Sensor Gravity BMP280 by DFRobot has the functions both on detecting temperature and air pressure. It can be connected to Arduino, and controlled by Arduino code. Compared to the old edition BMP180, BMP280 has lower power consumption, more precise measurement, lower noise and higher sampling frequency. Normally, pressure sensors measure the air pressure and the temperature. Because of the relation between the air pressure and the altitude, we can use the air pressure sensor to measure the altitude and the building height. BMP280 is also suitable for navigation, by the use of Inertia Measurement Unit (IMU), BMP280 can be used in GPS refinement, 3D in-door navigation and floor detection. The BMP280 is based on Bosch’s proven Piezo-resistive pressure sensor technology featuring high EMC robustness, high accuracy and linearity and long term stability. The relative accuracy is ±0.12 hPa, which is equivalent to ±1 m difference in altitude. The operating temperature range for long tern stability is 0 ~65 ℃. Attention: because the sensor is very sensitive to the environment, please don’t touch it.
Applications
- Enhancement of GPS navigation (e.g. time-to-first-fix improvement, dead-reckoning, slope detection)
- Indoor navigation (floor detection, elevator detection)
- Outdoor navigation, leisure and sports applications
- Weather forecast
- Health care applications (e.g. spirometry)
- Vertical velocity indication (e.g. rise/sink speed)
Specification
- Operating Voltage: 3.3V/5V
- Operating Current: 2.7µA @ 1 Hz sampling frequency
- Pressure Measurement Range: 300 ~ 1100 hPa (equivalent to 9000…-500 m above/below sea level)
- Relative Accuracy: ±0.12 hPa, equiv. to ±1 m (@25℃)
- Temperature Measurement Range: 0 ~65 ℃
- Temperature Accuracy: 0.01℃
- Operating Temperature range: :-40℃~ 85℃
- Dimension: 30mm*22mm
- Interface: Gravity-I2C 4pin
- Weight: 12g
Board Overview
Label | Description |
---|---|
SDA | I2C Data |
SCL | I2C Clock |
GND | GND |
VCC | 3.3/5V |
Tutorial
To measure the air pressure and temperature of the local environment, and calculate the altitude of the sensor.
Requirements
- Hardware
- DFRduino UNO (or similar) x 1
- Gravity: I2C BMP280 Barometer Sensor x1
- M-M/F-M/F-F Jumper wires
- Software
- Arduino IDE Click to Download Arduino IDE from Arduino®
Connection Diagram
Sample Code
- Download BMP280 library. How to install Libraries in Arduino IDE
- Copy the following code to Arduino IDE and upload to your Arduino
/*!
* @file bmp280test.ino
* @brief DFRobot's Temperature & Barometer.
* @n This example read the Temperature, Barometer and Altitude from BMP280, and then print them
*
* @copyright [DFRobot](https://www.dfrobot.com), 2016
* @copyright GNU Lesser General Public License
*
* @version V1.0
* @date 2016-12-06
*/
#include <Wire.h>
#include "DFRobot_BMP280.h"
DFRobot_BMP280 bmp280;
void setup() {
Serial.begin(9600);
Serial.println("BMP280 demo");
if (!bmp280.begin()) {
Serial.println("Could not find a valid BMP280 sensor!");
while (1);
}
}
void loop() {
Serial.print("Temperature = ");
Serial.print(bmp280.readTemperatureValue());
Serial.println(" *C");
Serial.print("Pressure = ");
Serial.print(bmp280.readPressureValue());
Serial.println(" Pa");
Serial.print("Altitude = ");
Serial.print(bmp280.readAltitudeValue(1013.25)); // this should be adjusted to your local forcase
Serial.println(" m");
Serial.println();
delay(2000);
}
Expected Results
FAQ
Q1. Did I get the right value? It is always changing. |
---|
A1. You can visit the local weather forecast to confirm the data. |
For any questions, advice or cool ideas to share, please visit the DFRobot Forum. |
---|
More Documentation
- [BMP280 Datasheet](https://github.com/Arduinolibrary/DFRobot_I2C_BMP280_Barometer_Sensor/raw/master/BOSCH BMP280 Datasheet.pdf)
- [Gravity: I2C BMP280 Barometer Sensor Layout](https://github.com/Arduinolibrary/DFRobot_I2C_BMP280_Barometer_Sensor/raw/master/Gravity I2C BMP280 Barometer Sensor Layout.pdf)
- [Gravity: I2C BMP280 Barometer Sensor Schematic](https://github.com/Arduinolibrary/DFRobot_I2C_BMP280_Barometer_Sensor/raw/master/Gravity I2C BMP280 Barometer Sensor Schematic.pdf)