Go Down

### Topic: Help in Pressure transducer coding... (Read 1 time)previous topic - next topic

#### vareun

##### Feb 07, 2014, 07:00 am
For my air pressure pump project i'm trying to attach a positive pressure transducer to the system.one of my pal gave me a link and code for the listed sensor below. please help me as I'm trying to learn
http://www.farnell.com/datasheets/8723.pdf
the sensor he mentioned was a Free Scale MPX4115 .
I could not understand the code below even after referring  to the transfer function.

/* get the pressure */
pkPa = ((float)val/(float)1023+0.095)/0.009;
pAtm = kpa2atm*pkPa;

the whole code can be see in:
https://gist.github.com/csete/813836

and also is it possible for me to use the MPX4250 Sensor in the same code. if not what are the differences should be made???
http://www.farnell.com/datasheets/9703.pdf

#1
##### Feb 15, 2014, 04:16 am
You may get better answers if the post is moved to Science and Measurements

#### robtillaart

#2
##### Feb 15, 2014, 10:03 am

I could not understand the code below even after referring  to the transfer function.
/* get the pressure */
2  pkPa = ((float)val/(float)1023+0.095)/0.009;
3  pAtm = kpa2atm*pkPa;

line 1: reads the value the sensor returns 0..5V mapped upon a value of 0..1023
line 2: converts this value of 0..1023 to a KiloPascal - a unit of pressure
line 3: converts the KiloPascals to atmosphree by multiplying with a constant.

What part do you not understand.?

Quote

and also is it possible for me to use the MPX4250 Sensor in the same code.
if not what are the differences should be made???
http://www.farnell.com/datasheets/9703.pdf

If the sensor has the same pressure to voltage transfer function => yes
else => no

2 answers in the gigs forum, please donate \$2 to charity of choice
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### knut_ny

#3
##### Feb 16, 2014, 07:54 pm
Select a sensor which has the connection u need.
(some measure relative P, others abs P)
The datasheet will give you the trsnsfer funtion needed to report correct P
Ny

Go Up