From 23ade6ee70c7af202ab0e348a0c35a49364a7ddc Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 13 Aug 2019 20:35:26 +0200 Subject: [PATCH] pressure correction for individual sensors --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 645845c..8f1699c 100644 --- a/src/main.cpp +++ b/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 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);