// untested code// The offset voltage is 1.0V when there is no pressure difference.const float offset = 1.0;// The sensitivity is 1.0V per kPa for the sensor.const float sensitivity = 1.0;// assume the analog pressure sensor is connected to A0.const int pinSensor = A0;...int rawADC = analogRead (pinSensor);float voltage = (float) rawADC / 1023.0 * 5.0; // voltage at Arduino pin. Range is 5V, 10 bits.float pressure = (voltage - offset) / sensitivity; // differential pressure in kPa// Some magical calcuation for the windspeed (just as an example)float windspeed = sqrt ( 2.0 * pressure / 1.2 );
float IN = analogRead(A0); float pressure = ((IN/1023.0 - .2) / .2); //transfer function from manufacturer float windspeed = sqrt ( (2.0 * (pressure-0.14) * 1000)/1.2); float windspeedcorrected = 2*sqrt ( (2.0 * (pressure-0.14)*2000)/1.2);
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16