Not a good idea to see a pressure sensor as a voltmeter.
Your code assumes a 5.000volt supply, but a Nano on USB power is more like 4.6volt.
Sensors like this are ratiometric, and you should convert directly from A/D value to pressure.
Try this example.
I already calculated the offset and span for this MPX5700, but it might need finetuning.
Don't expect that a pressure sensor and 10-bit A/D (1024 values) can display 700 with two decimal places precision.
Leo..
// MPX5700 pressure sensor (700kPa)
int rawValue; // A/D readings
int offset = 41; // zero pressure adjust
int fullScale = 963; // max pressure (span) adjust
float pressure; // final pressure
void setup() {
Serial.begin(9600);
}
void loop() {
rawValue = analogRead(A0);
pressure = (rawValue - offset) * 700.0 / (fullScale - offset); // pressure conversion
Serial.print("Raw A/D is ");
Serial.print(rawValue);
Serial.print(" Pressure is ");
Serial.print(pressure, 1); // one decimal places
Serial.println(" kPa");
delay(500);
}
Or, with a bit of averaging for a more stable readout and better offset adjustment.
// MPX5700 pressure sensor (700kPa)
int rawValue; // A/D readings
int offset = 410; // zero pressure adjust
int fullScale = 9630; // max pressure (span) adjust
float pressure; // final pressure
void setup() {
Serial.begin(9600);
}
void loop() {
rawValue = 0;
for (int x = 0; x < 10; x++) rawValue = rawValue + analogRead(A0);
pressure = (rawValue - offset) * 700.0 / (fullScale - offset); // pressure conversion
Serial.print("Raw A/D is ");
Serial.print(rawValue);
Serial.print(" Pressure is ");
Serial.print(pressure, 1); // one decimal places
Serial.println(" kPa");
delay(500);
}