Hey guys,
I am using a differential pressure sensor to measure air pressure coming from a pneumatic press Device, and I keep getting multiple values read / fluctuations even when the Pressure is constant, and even when the pressure is Zero. I changed the code and tried using another sensors of the same kind but nothing changed, I however used the circuit meant for decoupling and filtering (the one made up of 3 capacitors and is found in the Datasheet) and still nothing changed as well, I also tried different Arduinos but it was not the problem, any OP AMP suggestion ? Can someone please help, it is critical for my project.
Datasheet : 965149514005333mpx5050 (2).pdf (461.7 KB)
Code :
Code.ino (854 Bytes)
Output e.g :
I get 12,662mmHg/12,255mmHg/13,069mmHg/13,477mmHg/14,229mmHg
for a constant Pressure of 30 mmHg
I will so thankfull if someone could help me with it
I wired the sensor as recommended in the Datasheet which means pin 1 is no connection, Pin 2 goes to 5V and pin 3 to ground and pin 4 to A2, and all other pins are no connections.
Output when no pressure is applied : 
Output at 50 mmHg pressure Applied :
Are you supplying it with a clean 5V?
Do you have a 1uF and 0.01uF bypass connected to Vs.
Do you have a 470pF capacitor connected to Vout
Which pinout are you using?
Hey Jim,
thank you for replying
I am using the following pinout as recommended in the datasheet:
pin 1 : N/C (no connection)
pin 2 : 5V
pin 3 : Gnd
pin 4 : A2
Pins 5,6,7,8 are no connections (acc. to the Datasheet)
what do you mean with clean 5 v ? I have my Arduino connected to my Laptop via USB, I also tried a battery as supply and it did not work
Since the sensor output is ratiometric with the supply
voltage, any variation in supply voltage will also proportionally
appear at the output of the sensor.
The actual voltage measured by the arduino ADC will also vary with the ADC Vref
The offset voltage will also vary
The overall accuracy is only +/-2.5% of full scale or +/- 1.25kPa or +/- 9mmhg
So there a quite a few things to consider when using that sensor.
If you’re using an external reference on the AREF pin, you must set the analog reference to EXTERNAL before calling analogRead()Otherwise, you will short together the active reference voltage (internally generated) and the AREF pin, possibly damaging the microcontroller on your Arduino board.
The A/D of an Uno (assuming you use an Uno R3) doesn't jump more than one A/D value with a pot or pressure sensor powered from the 5volt pin. Using an external supply and reference will only complicate things. I expect there is something else going on, like soldering.
Would like to see real pictures of the setup.
Wishful thinking. You only have about 900 usable A/D values, which is not enough to display 50,000 values. One stable decimal places is all you get. Oversampling could increase that to two decimal places, but not three.
Try this, with only the sensor directly connected to 5volt/A2/GND of the Uno R3.
If it isn't stable, then I expect hardware problems.
Leo..
const byte sensorPin = A2;
float sensorRating = 50.0; // 50kPa sensor
int offset = 41; // zero pressure adjust
int fullScale = 962; // max pressure (span) adjust
float pressure; // final pressure
void setup() {
Serial.begin(9600);
}
void loop() {
pressure = (analogRead(sensorPin) - offset) * sensorRating / (fullScale - offset);
Serial.print("Pressure: ");
Serial.print(pressure, 1); // one stable decimal place is all you get
Serial.println(" kPa");
delay(500);
}