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?
#include <DFRobot_BMP3XX.h>
/* If using Gravity products, choose these two interfaces and comment subsequent interfaces. */
// DFRobot_BMP388_I2C sensor;
// DFRobot_BMP390L_I2C sensor;
/**
* Select the chip version BMP388/BMP390L
* Select communication interface I2C, please comment out SPI interface.
* I2C communication address settings: eSDOGND: connect SDO pin to GND, I2C address is 0×76 now.
* eSDOVDD: Connect SDO pin to VDDIO (3v3), I2C address is 0×77 now
*/
// DFRobot_BMP388_I2C sensor(&Wire, sensor.eSDOVDD);
DFRobot_BMP390L_I2C sensor(&Wire, sensor.eSDOVDD);
/**
* Select chip version BMP388/BMP390L
* Select communication port SPI, please comment out I2C port
* Set up digital pin according to the on-board pin connected with SPI chip-select pin.
* Notice: csPin used here is D3 digital pin on ESP32, other non-conflicting pins can also be selected as external interrupt pins.
*/
// uint8_t csPin = D3;
// DFRobot_BMP388_SPI sensor(&SPI, csPin);
// DFRobot_BMP390L_SPI sensor(&SPI, csPin);
#define CALIBRATE_ABSOLUTE_DIFFERENCE
void setup(void)
{
Serial.begin(115200);
int rslt;
while( ERR_OK != (rslt = sensor.begin()) ){
if(ERR_DATA_BUS == rslt){
Serial.println("Data bus error!!!");
}else if(ERR_IC_VERSION == rslt){
Serial.println("Chip versions do not match!!!");
}
delay(3000);
}
Serial.println("Begin ok!");
while( !sensor.setSamplingMode(sensor.eUltraPrecision) ){
Serial.println("Set samping mode fail, retrying....");
delay(3000);
}
delay(100);
#ifdef CALIBRATE_ABSOLUTE_DIFFERENCE
if( sensor.calibratedAbsoluteDifference(540.0) ){
Serial.println("Absolute difference base value set successfully!");
}
#endif
float sampingPeriodus = sensor.getSamplingPeriodUS();
Serial.print("samping period : ");
Serial.print(sampingPeriodus);
Serial.println(" us");
float sampingFrequencyHz = 1000000 / sampingPeriodus;
Serial.print("samping frequency : ");
Serial.print(sampingFrequencyHz);
Serial.println(" Hz");
Serial.println();
delay(1000);
}
void loop()
{
float temperature = sensor.readTempC();
Serial.print("temperature : ");
Serial.print(temperature);
Serial.println(" C");
float Pressure = sensor.readPressPa();
Serial.print("Pressure : ");
Serial.print(Pressure);
Serial.println(" Pa");
float altitude = sensor.readAltitudeM();
Serial.print("Altitude : ");
Serial.print(altitude);
Serial.println(" m");
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.