Introduction
This is a breakout version of BMP280 Barometric Pressure Sensor from DFRobot with temperature and pressure measurement functions, supporting Arduino code control.
Housed in a extremely compact package, the BMP280 is based on Bosch’s proven Piezo-resistive pressure sensor technology featuring high EMO robustness, high accuracy and linearity and long term stability. Numerous device operation options offer highest flexibility to optimize the device regarding power consumption, resolution and filter performance.
Barometric sensors are usually used to measure barometric pressure and temperature. But besides that, they can also measure altitude and relative floor height due to the fact that there is a certain relationship between altitude and barometric pressure. As for navigation, the barometric pressure sensor can be used to enhance GPS positioning or realize 3D indoor navigation with IMU sensor.
Application
- Temperature Detection
- Pressure Measurement
- Altitude Measurement
- Indoor Navigation (floor detection, elevator detection)
- Outdoor Navigation, Leisure and Sports Applications
- Vertical Velocity Indication (e.g rise/sink speed)
Specification
- Operating Voltage: 3.3V-5.5V
- Pressure Measuring Range: 300~1100hPa
- Relative Accuracy: ±0.12hPa(±1m)
- Absolute Accuracy: ±1hPa(±8.33m)
- Temperature Measuring Range: 0℃~65℃
- Temperature Measuring Accuracy: 0.01℃
- Outline Dimension: 16.5×12.5mm/0.65×0.49”
More information, please refer to BMP280 Datasheet in More Documents.
Board Overview
Silkscreen | Function Description |
---|---|
VCC | + |
GND | - |
SCL | I2C Clock |
SDA | I2C Data |
ADDR | I2C Address Select |
Tutorial
Detect the barometric pressure and temperature of the current environment and calculate the altitude of the environment in which the module is located.
Requirements
- Hardware
- DFRduino UNO R3 (or similar) x 1
- BMP280 Digital pressure sensor module(V1.0) x1
- Jumper wires
- Software
Connection Diagram
Connect this module with UNO board via I2C port.
Sample Code
Download BMP280 Library. About how to install a library?
/*!
* read_data.ino
*
* Download this demo to test simple read from bmp280, connect sensor through IIC interface
* Data will print on your serial monitor
*
* Copyright [DFRobot](http://www.dfrobot.com), 2016
* Copyright GNU Lesser General Public License
*
* version V1.0
* date 12/03/2019
*/
#include "DFRobot_BMP280.h"
#include "Wire.h"
typedef DFRobot_BMP280_IIC BMP; // ******** use abbreviations instead of full names ********
BMP bmp(&Wire, BMP::eSdo_low);
#define SEA_LEVEL_PRESSURE 1015.0f // sea level pressure
// show last sensor operate status
void printLastOperateStatus(BMP::eStatus_t eStatus)
{
switch(eStatus) {
case BMP::eStatusOK: Serial.println("everything ok"); break;
case BMP::eStatusErr: Serial.println("unknow error"); break;
case BMP::eStatusErrDeviceNotDetected: Serial.println("device not detected"); break;
case BMP::eStatusErrParameter: Serial.println("parameter error"); break;
default: Serial.println("unknow status"); break;
}
}
void setup()
{
Serial.begin(115200);
bmp.reset();
Serial.println("bmp read data test");
while(bmp.begin() != BMP::eStatusOK) {
Serial.println("bmp begin faild");
printLastOperateStatus(bmp.lastOperateStatus);
delay(2000);
}
Serial.println("bmp begin success");
delay(100);
}
void loop()
{
float temp = bmp.getTemperature();
uint32_t press = bmp.getPressure();
float alti = bmp.calAltitude(SEA_LEVEL_PRESSURE, press);
Serial.println();
Serial.println("======== start print ========");
Serial.print("temperature (unit Celsius): "); Serial.println(temp);
Serial.print("pressure (unit pa): "); Serial.println(press);
Serial.print("altitude (unit meter): "); Serial.println(alti);
Serial.println("======== end print ========");
delay(1000);
}
Expected Results
Read the values of the temperature, barometric pressure and altitude the BMP280 sensor module collected, and print out over the serial port. Their measurement units are ℃, pa and m. The altitude is calculated from the temperature and pressure BMP280 detected, which may lead to a certain amount of error.
- Check the information on the serial monitor.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.