Building an Airspeed Sensor with the mpxv7002dp for my rc Jet was quite successful. the speed range goes up to about 220km/h. this is a little bit to low and i changed to an MPXV5010DP Sensor which has more differential pressure output (10kpa against 2kpa) at 5V. the 5010dp works also with the old code on a pro mini with 5V/16MHZ but no surprise with values which do not match with 7002dp or the speedometer from my car.So my question is what values to change in the code to get this accurate.
Pressure.h - Library for pressure sensor.
Created by johnlenfr, May 15, 2014.
SOURCE CODE .CPP
_pin = pin;
ref_pressure = analogRead(_pin);
for (int i=1;i<=200;i++)
ref_pressure = (analogRead(_pin))0.25 + ref_pressure0.75;
int air_pressure = 0;
for (int i = 0; i < 8; i++)
air_pressure += analogRead (_pin);
air_pressure >>= 3;
if (air_pressure < ref_pressure)
air_pressure = ref_pressure;
pitotpressure = 5000.0f * ((air_pressure - ref_pressure) / 1024.0f) + PRESSURE_SEA_LEVEL; // differential pressure in Pa, 1 V/kPa, max 3920 Pa
ambientpressure = PRESSURE_SEA_LEVEL;
temperature = 20.0f + ABSOLUTE_0_KELVIN;
density = (ambientpressure * DRY_AIR_MOLAR_MASS) / (temperature * UNIVERSAL_GAS_CONSTANT);
airspeed_ms = sqrt ((2 * (pitotpressure - ambientpressure)) / density);
airspeed_kmh = airspeed_ms * 3.600; // speed in km/h
SpeedPressure.cpp (1.17 KB)