Help with pressure differential sensor

Hi folks,

I'm working on a project using an MPX2010DP pressure differential sensor, and just trying to wrap my head around how it works. I've hooked it up to a basic circuit - seen below - but unfortunately the serial monitor is giving me a stagnant reading. I'm new to hardware and arduino, so I'm sure I'm doing something wrong, but I have no clue what. Would really appreciate any help!

Here is the datasheet: https://www.jaycar.com.au/medias/sys_master/images/images/9497615138846/ZD1904-dataSheetMain.pdf

Here is my code:

const int sensorPin = A1;

void setup(){
pinMode(sensorPin,INPUT);
Serial.begin(9600);
}

void loop(){
analogRead(sensorPin);
Serial.println(sensorPin);
}

The data sheet says that the full scale span (output at 10kPa) is 25mV. That sensor will need to be amplified to be read by an Arduino ADC.

And the supply voltage is specified as 10VDC.

Here is a sensor that will be a better match for use with a 5V Arduino (Uno).
It is 10kPa full scale and the supply voltage is 5V. Output is 0.2V to 4.7V. No amplification needed.

2 Likes

OOPS...

void loop(){
  analogRead(sensorPin);
  Serial.println(sensorPin);
}

You missed a bit...
You need to read that analogRead into a variable then print that value, not the pin number!

2 Likes

Can't believe ground fungus didn't catch that. He must be tired tonight.

Here, looks like this..

void loop(){
  int reading;                       // Somewhere to store the reading..
  reading  = analogRead(sensorPin);  // Get the reading from the pin.
  Serial.println(reading);           // Then output the reading.
}

-jim lee

1 Like

What is your sensor hooked up to? Code errors aside, I'd expect a differential sensor to give the same value with nothing connected to it, since there would be no difference in pressure.

1 Like

Hey we all missed this one.

Loose the pinMode() for the Analog pin. Silly rabbit, pinMode() is for digital pins.

-jim lee

1 Like

To tell the truth, I did not even look at the code cause no amount of code would make that sensor work.

2 Likes

An unnecessary correction, because it doesn't help or hurt anything.

Thanks for all the help and advice guys. Going to take a look at sensor suggested and work on correcting the code issues.

@Jiggy-Ninja by what's it hooked up to, do you mean the Arduino Uno? Otherwise, it's connected to silicone tubing and a short length of pvc pipe. From the research I've done into pressure differential sensors, I gather that it should be able to detect air flow when blowing on it, or at least give a different reading when moving it between rooms/places with different air flow. Is that correct?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.