MXP 5100AP (Absolute Pressure Sensor) UPDATE/EDIT

The MXP is an analog Sensor, rather than a "smart" sensor with a complicated communications scheme. So it doesn't really need a library.
You'd want code like:

void logPressure() {
  int rawPressure = analogRead(MXPPin);
  float realPressure = ((rawPressure/1024.0) - 0.04) / 0.009;  // Datasheet + algebra
  logfile.print(",");
  logfile.print(rawPressure);
  logfile.print(",");
  logfile.print(realPressure,2);
  Serial.print(",");
  Serial.print(rawPressure);
  Serial.print(",");
  Serial.print(realPressure,2);
}

Presumably, call that just before the println() in your program.

that doesn't include temperature compensation (which shouldn't be needed over the 0-80C range.) And it hasn't been tested (I don't have an MXP 5100AP, or a vacuum chamber.) Note that the "raw" value might be better post-processed on whatever is reading your log file, or it can be plotted directly.

It assumes that the 10bit ADC of the Arduino provides sufficient resolution with the default 5V reference voltage (which would normally cover the full range of the pressure sensor.


That took about a hour of figuring out what you were asking for, reading datasheets, and typing. It seems pretty trivial to pay for, but if you're so inclined, feel free to donate ~$100 to your local zoo, aquarium, https://wikimediafoundation.org/, or Become a Snopes Supporter | Snopes.com

2 Likes