LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to convert MPX pressure sensor voltage to PSI

I’m somewhat new to Labview and totally new to the Arduino Board.  I currently have Labview 2013 and the Arduino R3 board.  I have three MPX 0-5V output pressure sensor hooked up to the analog inputs and can get them to read the voltage but cannot figure out how to convert that voltage into an actual PSI reading.  I have used Labview hardware in the past and always used the DAQ assistant for these sorts of conversions which made it easy.  Now I’m learning with the Arduino interface I can no longer use the DAQ assistant.  Any tips, links or info on how to perform this conversion would be greatly appreciated. The Output of the sensor is linear to the 0 to 5V so I imagine it would be fairly easy if I could just figure out the correct way to do the conversion.

0 Kudos
Message 1 of 9
(11,351 Views)

You simply need to determine the formula to convert from voltage to pressure.  If the sensor is linear, the formula will be of the forum of "y = mx + b" where x will be the voltage and y is the pressure.  The slope, m, should be the sensitivity in units of pressure per voltage and the offset, b, is the offset.  Some datasheets may provide formulas that look different but should reduce to the linear one (assuming it is linear).

0 Kudos
Message 2 of 9
(8,062 Views)

Thank you Nathan,  I can get those values from the sensor data sheet I just can't figure out where or what type of block in LV to enter the data.  Is this a  formula that gets entered into some Arduino code or is there a block VI I can use? I appreciate the help thanks again.

0 Kudos
Message 3 of 9
(8,062 Views)

You need to write the formula in LabVIEW code.  Preferrably, you want to make it into a subVI.  You can even make a custom LIFA-based VI that will be essentially be a replacement for the Analog Read VI that will output pressure instead of volts (this uses the conversion VI).  I have attached an example of both VIs (the LIFA one uses the other).  Put your formula in the "MPX Volts to Pressure.vi".

Download All
0 Kudos
Message 4 of 9
(8,062 Views)

Thank you, the VI’s are very helpful now I’m just trying to populate the M and B fields with the correct values to get the correct output.  You mentioned in the previous post that M = sensitivity in units of pressure per voltage, B = Is the Offset.  Here is the link to the Sensor Specification the pressure value is in Kpa but I can convert that to PSI by multiplying the output 1.0 kPa = 0.145 PSI

http://roscansat.com/wp-content/uploads/2012/12/MPX5100.pdf

Here is some of the Specs from the link above.

Nominal Transfer Value: VOUT = VS (P x 0.009 + 0.04)

± (Pressure Error x Temp. Mult. x 0.009 x VS)

VS = 5.0 V ± 0.25 V

MPXV5100GC6U.jpg

MPX Sensor.jpg

0 Kudos
Message 5 of 9
(8,062 Views)

Like I said in the voltage to pressure conversion VI, you don't have to use the "mx+b" format if you don't want to.  You should be able to use the Vout equation (after you solve for P).  It seems to be a little off of the typical curve but it should work.  You may consider calibrating it if you have something to do that with.

0 Kudos
Message 6 of 9
(8,062 Views)

Not sure why I’m having so much trouble getting this formula thing figured out and working.  I have tried all sorts of different combination of numbers and formulas and can’t get anything to come close.  In the VI you attached “MPX Volts to Pressure” in the pressure box what scale should that be reading kPa, Psi? Then where you mention “Solve for P” I think that’s where I’m getting stuck trying to find the correct value. If P= P1 > P2 than it seems as if that value would 0 when I plug that into the formula I come up with .049.  Once I get that value do I enter that in box M or B in the VI?  Thank you for taking the time to walk me through this. 

0 Kudos
Message 7 of 9
(8,062 Views)

Solving the equation for P gives the following result:

eqn_soln.gif

So, if you are supplying 5V to the sensor, Vs is 5.  The units of P are kPa.  So, if you wire this formula directly to the output of the conversion VI then the output will be in kPa.  You can convert it to PSI before wiring it to the output of the VI if you want PSI as the final result.

If you have issues converting this equation to LabVIEW, I highly recommend that you take some time to learn the basics of LabVIEW programming.  One place to start is here.

0 Kudos
Message 8 of 9
(8,062 Views)

Thank you for all the help. I’m going to be doing some more reading and studying to try and get better understanding of all of this.  

0 Kudos
Message 9 of 9
(8,062 Views)