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 = kpa2atmpkPa;
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???
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 = kpa2atmpkPa;
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.
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