Gravity_I2C_MPX5700AP_Air_Pressure_Sensor_15_700KPa_SKU_SEN0456-DFRobot

Introduction

This is a Arduino compatible pressure sensor module with a measuring range of 15-700kPa, which supports I2C digital output and can be calibrated according to known pressure values and allows fast and accurate measurement of pressure values in pipelines or other environments. It is suitable for pipeline air pressure detection, natural science experiments and other scenarios.

Features

Specification

Board Overview

Number Name Function description
1 D I2C data line SDA
2 C I2C clock line SCL
3 - GND
4 + Vcc

Tutorials for Arduino

Download the program to the UNO, and open Serial Port Monitor to view the air pressure values.

Hardware and software preparation

Read the sensor data via I2C

Connection

Steps

/*!
  * @file  getPressureValue.ino
    @n i2c Address select, default I2C address to 0x16, the A1 and A0 combines 4 IIC addresses. 
                | A1 | A0 |
                | 0  | 0  |    0x16
                | 0  | 1  |    0x17
                | 1  | 0  |    0x18
                | 1  | 1  |    0x19   default i2c address  
  * @n Phenomenon: serial print all data 
*/
#include "DFRobot_MPX5700.h"
#define I2C_ADDRESS 0x16
DFRobot_MPX5700  mpx5700(&Wire, I2C_ADDRESS);
void setup()
{
  Serial.begin(115200);
  while (false == mpx5700.begin())
  {
    Serial.println("i2c begin fail,please chack connect!");
    delay(1000);
  }
  Serial.println("i2c begin success");

/*
 *For smoothing data, it is necessary to set to obtain the average value of xx(quantity)data abc.  
 *If it is not set, the system will automatically get the average value of 5 samples. 
 */
  mpx5700.setMeanSampleSize(/*Sample Quantity*/5);
}

void loop()
{
  Serial.print("Pressure Value: ");
/*
 *Get the ambient air pressure. Can set whether to enable calibration.
 *1:Enable calibration 
 *0:Not 
 */
  Serial.print(mpx5700.getPressureValue_kpa(1));
  Serial.println(" kpa");
  delay(1000);
}

Result

Open the serial port monitor to get the final data.

Calibrate the sensor

Connection

Sample code

#include "DFRobot_MPX5700.h"
#define I2C_ADDRESS    0x16
DFRobot_MPX5700 mpx5700(&Wire ,I2C_ADDRESS);
void setup() {
  Serial.begin(115200);
  while(false==mpx5700.begin())
  {
    Serial.println("i2c begin fail,please chack connect!");
    delay(1000);
  }
  Serial.println("i2c begin success");


  mpx5700.calibration_kpa(110.0);
  Serial.println("Calibration_kpa success");
}

void loop() {
}

Result

Open the serial port monitor to get the final data.

FAQ

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

More Documents

SEN0456 Schematic

SEN0456 Dimensions

MPX5700 datasheet