Skip to content

Commit 0b4aacc

Browse files
committed
Change humidity normalization function to something more tested
1 parent df56b48 commit 0b4aacc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/hackair.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ void hackAIR::turnOff() {
179179
}
180180
}
181181

182+
// Normalization function written by Zbyszek Kiliański, Piotr Paul
183+
// https://github.com/piotrkpaul/esp8266-sds011
182184
void humidityCompensation(hackAirData &data, float humidity) {
183-
data.pm25 = data.pm25 / (3.72f * (1 + 7 * (humidity / 100.0f)));
184-
data.pm10 = data.pm10 / (3.72f * (1 + 7 * (humidity / 100.0f)));
185+
data.pm25 = data.pm25 / (1.0 + 0.48756 * pow((humidity / 100.0), 8.60068));
186+
data.pm10 = data.pm10 / (1.0 + 0.81559 * pow((humidity / 100.0), 5.83411));
185187
}

0 commit comments

Comments
 (0)