mirror of
https://github.com/sigmasternchen/MH-Z-CO2-Sensors
synced 2025-03-15 06:38:55 +00:00
Correction
The datasheet clearly says that the CO2 level is 2000x(th-2ms)/(th+tl+4ms), so I think here it should say 2000 too. At least that resulted in way better results for me.
This commit is contained in:
parent
af5c565990
commit
093774f701
1 changed files with 1 additions and 1 deletions
2
MHZ.cpp
2
MHZ.cpp
|
@ -243,7 +243,7 @@ int MHZ::readCO2PWM() {
|
|||
if (debug) Serial.print(".");
|
||||
th = pulseIn(_pwmpin, HIGH, 1004000) / 1000;
|
||||
tl = 1004 - th;
|
||||
ppm_pwm = 5000 * (th - 2) / (th + tl - 4);
|
||||
ppm_pwm = 2000 * (th - 2) / (th + tl - 4);
|
||||
} while (th == 0);
|
||||
if (debug) {
|
||||
Serial.print(F("\n # PPM PWM: "));
|
||||
|
|
Loading…
Reference in a new issue