Help in Pressure transducer coding...

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

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 /
val = analogRead(pressurePin);
pkPa = ((float)val/(float)1023+0.095)/0.009;
pAtm = kpa2atm
pkPa;

the whole code can be see in:

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???

You may get better answers if the post is moved to Science and Measurements

vareun:
I could not understand the code below even after referring to the transfer function.
/* get the pressure /
1 val = analogRead(pressurePin);
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.?

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 :wink:

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