I've got a MPX4250DP that I'm attempting to monitor the low pressure line on a keg. It will be roughly 5 to 12 PSI. I've configured a test sketch but I feel like it might be a bit off.
This is what I have now, but I don't think it's correct....with both ports in open air (no pressure difference) I'm getting readings of
-1.24kPA
-0.18psi
does that seem right? Theres probably some room for calibration in the offset as it can be a fairly wide range...
See code below.
void setup() {
Serial.begin(9600);
}
void loop() {
get_pressure();
delay(100);
}
void get_pressure() {
// 5v/1024step == 0.0048828v/step
// ((ADC Val * Step) - Expected offset from datasheet) / mv per kPa
float pressure_0 = ((analogRead(0)*0.0048828)-.204)/.01882;
Serial.print("sensor = ");
Serial.print(pressure_0);
Serial.println(" kPa");
float press_psi = pressure_0 * 0.14504;
Serial.print("sensor = ");
Serial.print(press_psi);
Serial.println(" psi");
}