Mpxv7025d sensor datasheed, understanding.

i try to work out the formula for the pressuresensor so far I came up whit this based on the data of the attached page form the data sheet :

-------------------[code]-------/

float readPressureKpa(int16_t pin){

float pressureValue ;

float Voltage = (pin * 0.1875)/1000;

pressureValue = Voltage - 2.46;

float pressure=(pressureValue+0.5)/0.018;///0.000018 tranformation from kpa to pa

//float pressure=((pressureValue/1024.0)+0.5)/0.000018;

return pressure;

}

---------------------------/

Is this code correct ?

i should mention that I attached a ads1115 adc because arduino is a bit to un precise.

then I discovered AN4325SW it has a few examples but I don't understand them:

---------------[code]-----------

//2.4635 is the voltage if nothing happens on the sensor no blowing or sucking.

float Flow = (2.4635 - Voltage)*136/10;

if (Flow > 4700){

Flowfactor = 0;

}else{

Flowfactor = ((4700-Flow)*100/2700);

// Serial.println(Flowfactor);

Flow = Flow + (Flow*Flowfactor)/100; // Instantaneous flow [l/s]

}

Volume = Volume + (Flow/100);

-----------------

where 136 came form is this the area of the mouthpice ?

what is 4700 where dose it come from?

where dose the 2700 come from ?

sorry for the eager long post but I really can't figure out and I'm kinda stuck, any help is appreciated.

im suffereing form the "I can't see the woods cuz of too many trees" syndrome.

Tanks in advanced

adrian

Hi Dario,

Well it started out because I was frustrated whit the peak flow meters that I have, the mechanicals ones.

so I thought to build my own, more precise digital one that puts data in my iPhone (building the app for it), and here we are, build a spirometer, it kinda "degenerated".

i found the PDF (that explains the spirometer)with all the formulas and what not.

but I got stuck, but getting the pressure form the sensor.

once that this is done and I think that I can go on.

so I found the demo code but this confused me more because the data is not explained is just there......

Btw I using arduino as a platform.

i hope I answered your question.

thank you in advanced,

Adrian