BMP388 Breakout Digital Pressure Sensor Module Wiki - DFRobot

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℃.

warning_yellow.png NOTE: The sensor is very sensitive to outside environment, please try not to touch it with your finger.

Application

Specification

Dimension

Board Overview

Board overview

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

Connection Diagram

Connect this module with UNO board via I2C port.

Connection Diagram

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.

Result

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get BMP388 Digital Pressure Sensor Module from DFRobot Store or DFRobot Distributor.

Turn to the Top