Measuring pressure of suction cup with MPXV6115V

I'm working on a project and need to measure the internal pressure of an industrial rubber suction cup. I've bought a MPXV6115V after doing some research as this can support the -60 KPa the suction cup can produce.

I've drilled a hole in the rubber cup and inserted a silicon hose into it and sealed it and connected the other end to the sensor and zip-tied that off. I've connected the sensor to my uno on analog pin 0 using a 51K resistor as recommended in the data sheet here but I'm getting strange readings.

float sensorValue = (analogRead(A0));

Using the above code I initially get an output of 950, but I'm not sure what unit this is in. When I pump the vacuum to stick the rubber cup to my desk the reading steadily decreases with each pump and when the cup is firmly stuck to my desk the output prints 820. Again, no idea what unit this is but it looks like the sensor is working somewhat.

The problem is, as soon as I max out the suction the output will then go back up to 950 as if the rubber pad is losing suction, when it is still firmly attached to my desk. I need to continuously monitor the vacuum inside the pad. My other issue is I need to get the output to read in KPa and I don't know how to do that.

I would really appreciate some help!

What is the point of storing the return value in a float when the return value is ALWAYS an integer?

Because I want the return value to 2 decimal places?

The actual return value will always be a number between 0 and 1023. No decimal place will evere be other than .00000000

If you want to display pressure in kPa,
then you can have one decimal place with this -115 to 0kPa sensor and a 10bit A/D.

The datasheet tells me that the sensor outputs about 4.6volt 92% of VCC (942) at 0kPa,
and about 0.4volt 8% of VCC (82) at -115kPa.
Try this. Not sure to use the 51k/47p load or not.
Leo..

const byte sensorPin = A0;
float sensorRating = 115; // -115kPa sensor
int vCal = 82; // vacuum cal
int zCal = 942; // zero cal
float pressure; // final pressure

void setup() {
  Serial.begin(9600);
}

void loop() {
  pressure = (analogRead(sensorPin) - zCal) * sensorRating / (zCal - vCal);

  Serial.print("Pressure: ");
  Serial.print(pressure, 1); // one decimal place
  Serial.println(" kPa");
  delay(500); // dirty delay
}
1 Like

Hi,
If you read the datasheet, it gives you a graph and equations to calculate the vacuum level.
MPXV6115V.pdf (183.2 KB)


Also a suggested connection diagram.

Tom... :grinning: :+1: :coffee: :australia:
PS, Do you have a gauge to calibrate your project?
Why put a hole in the suction cup, I would have though to keep the cups integrity, putting the hole in the baseplate you are clamping it to, would have been better.
Or even easier, putting the sensor in the vacuum line going to the cup.

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