212,11 → 212,34 |
/* |
* Air pressure. |
* The sensor has a sensitivity of 45 mV/kPa. |
* An approximate p(h) formula is = p(h[m])[Pa] = p_0 - 11.95 * 10^-3 * h |
* That is: dV = 45 mV * 11.95 * 10^-3 dh = 0.53775 mV / m. |
* That is, with 1.024 / 3 steps per mV: 0.183552 steps / m |
*/ |
#define AIRPRESSURE_SUMMATION_FACTOR 54 |
* An approximate p(h) formula is = p(h[m])[kPa] = p_0 - 11.95 * 10^-3 * h |
* p(h[m])[kPa] = 101.3 - 11.95 * 10^-3 * h |
* 11.95 * 10^-3 * h = 101.3 - p[kPa] |
* h = (101.3 - p[kPa])/0.01195 |
* That is: dV = -45 mV * 11.95 * 10^-3 dh = -0.53775 mV / m. |
* That is, with 38.02 * 1.024 / 3 steps per mV: -7 steps / m |
|
Display pressures |
4165 mV-->1084.7 |
4090 mV-->1602.4 517.7 |
3877 mV-->3107.8 1503.4 |
|
4165 mV-->1419.1 |
3503 mV-->208.1 |
Diff.: 1211.0 |
|
Calculated Vout = 5V(.009P-0.095) --> 5V .009P = Vout + 5V 0.095 --> P = (Vout + 5V 0.095)/(5V 0.009) |
4165 mV = 5V(0.009P-0.095) P = 103.11 kPa h = -151.4m |
4090 mV = 5V(0.009P-0.095) P = 101.44 kPa h = -11.7m 139.7m |
3877 mV = 5V(0.009P-0.095) P = 96.7 kPa h = 385m 396.7m |
|
4165 mV = 5V(0.009P-0.095) P = 103.11 kPa h = -151.4m |
3503 mV = 5V(0.009P-0.095) P = 88.4 kPa h = 384m Diff: 1079.5m |
Pressure at sea level: 101.3 kPa. voltage: 5V * (0.009P-0.095) = 4.0835V |
This is OCR2 = 143.15 at 1.5V in --> simple pressure = |
*/ |
|
#define AIRPRESSURE_SUMMATION_FACTOR 14 |
#define AIRPRESSURE_FILTER 8 |
// Minimum A/D value before a range change is performed. |
#define MIN_RAWPRESSURE (200 * 2) |
229,6 → 252,8 |
#define PRESSURE_EXTRAPOLATION_COEFF 25L |
#define AUTORANGE_WAIT_FACTOR 1 |
|
#define ABS_ALTITUDE_OFFSET 108205 |
|
extern volatile uint16_t simpleAirPressure; |
/* |
* At saturation, the filteredAirPressure may actually be (simulated) negative. |