Browse Source

pressure correction for individual sensors

main
Hendrik Langer 5 years ago
parent
commit
23ade6ee70
  1. 11
      src/main.cpp

11
src/main.cpp

@ -323,7 +323,16 @@ void getSensorMeasurements() {
float absolute_humidity = (6.112*exp((17.67*sensor_readings.temperature)/(sensor_readings.temperature+243.5))*(sensor_readings.humidity/100)*18.02)/((273.15+sensor_readings.temperature)*1000*0.08314); float absolute_humidity = (6.112*exp((17.67*sensor_readings.temperature)/(sensor_readings.temperature+243.5))*(sensor_readings.humidity/100)*18.02)/((273.15+sensor_readings.temperature)*1000*0.08314);
float pressure_compensation_factor = exp((9.80665/(287.05*(sensor_readings.temperature+273.15+0.12*((absolute_humidity*461.5*(sensor_readings.temperature+273.15)/100)/100)+0.0065*(station_height/2))))*station_height); float pressure_compensation_factor = exp((9.80665/(287.05*(sensor_readings.temperature+273.15+0.12*((absolute_humidity*461.5*(sensor_readings.temperature+273.15)/100)/100)+0.0065*(station_height/2))))*station_height);
sensor_readings.pressure = (sensor_readings.pressure_raw / 100.0F) * pressure_compensation_factor; // individual sensor variance
int pressure_sensor_deviation = 0;
if (ota.getMAC().equals("246f28d1a080")) {
pressure_sensor_deviation = -075;
} else if (ota.getMAC().equals("246f28d1fa5c")) {
pressure_sensor_deviation = -143;
} else if (ota.getMAC().equals("a4cf1211c3e4")) {
}
sensor_readings.pressure = ((sensor_readings.pressure_raw + pressure_sensor_deviation) / 100.0F) * pressure_compensation_factor;
history_pressure.addValue(sensor_readings.pressure); history_pressure.addValue(sensor_readings.pressure);

Loading…
Cancel
Save