Air pressure sensor (mpx5700dp) with arduino mega

Hai, i’m doing my using air pressure sensor (mpx5700dp) with arduino mega but i dont really understand how does the sensor works and how to determine that the sensor works correctly? Can anyone help me to verify my coding whether it correct or wrong. thanks in advance :slight_smile:

int rawADC; 
float sensorValue;
float pressureValue;


void setup ()
{
 Serial.begin(9600);
}

void loop()
{
 rawADC = analogRead(A0); // raw data
 sensorValue = (float) rawADC * 5.0 / 1024.0; // raw data convert to volt
 pressureValue = (sensorValue - 0.2) / 4.5 * 700.0; // sensor-offset = 0.2V, voltage range = 4.5V, pressure range = 700kPa, pressure = mV/kPa
 
 
  // print out the value you read:
  Serial.print("Raw value:");
  Serial.println(rawADC);

  Serial.print("Sensor value:");
  Serial.print(sensorValue);
  Serial.println ("V");
  
  Serial.print("Air pressure: ");  
  Serial.print(pressureValue);
  Serial.println(" kPa");
  

  delay (1000);
}

i attach datasheet for the sensor.

mpx5700.pdf (121 KB)

i dont really understand how does the sensor works

It measures the pressure difference between the ports and provides an output voltage you can read with an ADC or meter.

how to determine that the sensor works

power it up (0v and +5) and connect a meter to the output.
blow into the + port. does the output voltage change?

how to determine that the sensor works correctly?

Apply a series of calibrated pressure differences to the ports, measure the voltage outputs and plot

or just accept the manufacturers know how to build them.

Be aware this is a DIFFERENTIAL pressure sensor, not absolute.

Hi,
What pressure difference are you aiming for?
What is the application?

Thanks.. Tom.. :slight_smile: