Introduction
This is a newly-introduced Breakout version of BMP388 Sensor from DFRobot with pressure and temperature measurement. It supports Arduino code control, and the BMP388 offers lower power consumption, smaller size, higher resolution and sampling rate compared with the its predecessors BMP180, BMP280.
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. Moreover, BMP388 enables accurate altitude tracking and is specifically suited for drone applications.
Based on Bosch’s proven piezo-resistive pressure sensor technology, BMP388 features high EMC robustness, high accuracy and low power. It offers an accuracy of ±8Pa, which is equivalent to about ±0.66m difference in altitude, and an absolute accuracy temperature of ±0.5℃ for a temperature range between 0℃ and 65℃.
NOTE: The sensor is very sensitive to outside environment, please try not to touch it with your finger.
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
- Operating Current: 0.5mA
- Communication Interface: I2C (Support 5V) or SPI(other non-I2C ports only supports 3.3V)
- Measuring Range: 300-1250 hPa
- Relative Pressure Accuracy: ±0.08 hPa(±0.66m @700-900hPa,25℃-40℃)
- Absolute Pressure Accuracy: ±0.5 hPa(0℃-65℃@300-1100hPa)
- Offset Temperature Coefficient: ±0.75 Pa/K(-20℃-65℃@700-1100hPa)
- Absolute Temperature Accuracy: ±0.5℃(@0℃-65℃)
- Operating Temperature: -40℃~80℃(More accurate in 0℃-65℃)
- Outline Dimension: 22mm x 30mm
- Mounting Hole Position: 15mm
- Mounting Hole Size: inner diameter 3mm/outer 6mm
- Default I2C Address: 0X76
Board Overview
Silkscreen | Function Description |
---|---|
SDA | I2C Data |
SCL | I2C Clock |
INT | Interrupt Output Pin |
SCK | SPI-CLK |
SDI | SPI-MOSI |
CSB | SPI-CS |
SDO | SPI-MISO/I2C Address Select |
GND | - |
VCC | + |
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
- BMP388 Digital Pressure Sensor Module x1
- Jumper wires
- Software
Connection Diagram
Connect this module with UNO board via I2C port.
Sample Code
Download BMP388 Library. About how to install a library?
/*!
* file bmp388test.ino
*
* Connect BMP388 to I2C interface of Arduino, download the program.
* Altitude is calculated based on temperature and sea level pressure.
* The example can count an approximate altitude.
*
* @n Open the serial monitor, check the altitude.
* @n Open serial monitor, the temperature could be checked.
* @n Open serial monitor, the atmospheric pressure could be checked.
*
* Copyright [DFRobot](http://www.dfrobot.com), 2016
* Copyright GNU Lesser General Public License
*
* version V0.1
* date 2018-5-29
*/
#include "DFRobot_BMP388.h"
#include "DFRobot_BMP388_I2C.h"
#include "Wire.h"
#include "SPI.h"
#include "math.h"
#include "bmp3_defs.h"
/*If there is no need to calibrate altitude, comment this line*/
#define CALIBRATE_Altitude
/*Create a bmp388 object to communicate with I2C.*/
DFRobot_BMP388_I2C bmp388;
float seaLevel;
void setup(){
/* Initialize the serial port*/
Serial.begin(9600);
/*
* @brief Set bmp388 I2C address
* @param BMP3_I2C_ADDR_PRIM: pin SDO is low
* BMP3_I2C_ADDR_SEC: pin SDO is high(default)
*/
bmp388.set_iic_addr(BMP3_I2C_ADDR_PRIM);
/* Initialize bmp388*/
while(bmp388.begin()){
Serial.println("Initialize error!");
delay(1000);
}
/*You can use an accurate altitude to calibrate sea level air pressure.
*And then use this calibrated sea level pressure as a reference to obtain the calibrated altitude.
*In this case,525.0m is chendu accurate altitude.
*/
delay(100);
seaLevel = bmp388.readSeaLevel(525.0);
Serial.print("seaLevel : ");
Serial.print(seaLevel);
Serial.println(" Pa");
}
void loop(){
#ifdef CALIBRATE_Altitude
/* Read the calibrated altitude */
float altitude = bmp388.readCalibratedAltitude(seaLevel);
Serial.print("calibrate Altitude : ");
Serial.print(altitude);
Serial.println(" m");
#else
/* Read the altitude */
float altitude = bmp388.readAltitude();
Serial.print("Altitude : ");
Serial.print(altitude);
Serial.println(" m");
#endif
delay(100);
/* Read the atmospheric pressure, print data via serial port.*/
float Pressure = bmp388.readPressure();
Serial.print("Pressure : ");
Serial.print(Pressure);
Serial.println(" Pa");
delay(100);
/* Read the temperature, print data via serial port.*/
float Temperature = bmp388.readTemperature();
Serial.print("Temperature : ");
Serial.print(Temperature);
Serial.println(" C");
Serial.println();
delay(1000);
}
Expected Results
Check the value on the serial monitor.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.
More Documents
Get BMP388 Digital Pressure Sensor Module from DFRobot Store or DFRobot Distributor.