Outdoor Temperature and humidity reading correction

Thanks @kpfleming

I just put the old algorithm into my branch yesterday along with a workaround for the negative temp issue. Using what you posted along with that, I’m now in the process of updating to this:

    temperature:
      name: "Temperature"
      id: temp
      filters:
          # https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
        - lambda: !lambda |-
            // Remove line with (x > 6000) once the negative number issue fix is merged in https://github.com/esphome/issues/issues/3814
            if (x > 6000) return ((x - 6553.6) * 1.327) - 6.738;
            if (x < 10.0) return (x * 1.327) - 6.738;
            return (x * 1.181) - 5.113;
2 Likes

Looks nice! There won’t be any rush to remove the x > 6000 line, since there won’t be any legitimate readings that high :slight_smile:

Alright, I did something a little different. I found the Arduino-NG git and as I like tinkering/testing stuff out. Seeing as I have the 1.3 board that it targets I went ahead and copied the example code for the O-1PP and applied the formulas to this version. So far the temperature are reporting close to what is expected (External sources reporting 41F(5C) while the outdoor sensor is reporting 42.8 (6c)). I’ll keep an eye on this and report back any issues.

I’ll wait for the next release and some parts that I ordered from the AirGradent Store before doing any more tinkering.

Great that you already found the Arduino NG repo. This is a complete rewrite of the Arduino library but is still in developing and testing and still contains a few bugs that we currently eliminate.

Alright, got the parts in and turned my O-1PP into a O-1PST! I have part for a second one but I am waiting on some screws for the 3D printed case. (Side note: M1.8x11 Torx T6 screw are hard to source so i ended up ordering M1.7x10 Phillips head screws). Anyway I used the latest Arduino-NG code and waiting to see how it hold up before trying to apply any corrections.

Do I need to update my firmware to apply these two formulas? (Has it been updated with them yet?)

Which firmware are you running? It’s already implemented in MallocArray’s ESPHome integration but not yet in our Arduino code base.

You show it’s a curve and then give two linear formulas. Wouldn’t fitting to the curve and giving a non-linear formula be more accurate?

It is not a curve because the bigger temperature measurements that are more off are due to direct sun exposure which should not be part of the algorithm.

I’d be curious if there are any standards or best practices to ensure mounting in shade, but also not restricting airflow or being influenced by the surrounding objects?

Here are some general guidelines:

  • Height: Please do not place the sensor below 150cm as dust from the ground could influence the readings
  • Walls: Please ensure that the walls are not too hot (or cold) due to exposure from the inside as this might negatively influence the temperature sensor.
  • Sunlight: In order to get accurate temperature readings, please ensure that the sensor unit is not exposed to direct sunlight at any time of the day.
  • Doors/Windows: In order to have stable readings, we recommend not to put the sensor unit close to doors or windows.
  • Air Conditioner / Ventilation Outlet: Please do not place the sensors closer than 2 meters to any HVACsystem or ventilation outlet
2 Likes

I’m running the stock firmware. I’m not sure which version, as the dashboard doesn’t have anything in that column.

If you haven’t updated in the last 2 weeks or so, then I would install the firmware again to ensure you are on the latest

There’s not any way to do this remotely, is there? I can’t say I like the idea of going out with a laptop in freezing temperatures every time there’s a firmware update…

We are working on OTA functionality for the firmware.

I just installed the firmware again, but I’m not seeing any temperature correction (or firmware version listed in the dashboard).

Has the stock firmware been updated with the temperature correction yet?

It has been corrected for the open air PST version (the one with CO2). It seems you have the older version with the two pm modules. Your version will be supported in the next update that we currently work on.

I recently updated my Outdoor sensor to MallocArray’s ESPHome firmware that includes the corrections for humidity and temperature, but as far as I can tell my device should not be using this calculation.

The device is currently reading 84% when it should be around 60% based on local weather service and a couple other devices I have. Reversing the math for the corrected formula gets ~61% which suggests that at least my particular unit should not be using the x * 1.259 + 7.34 compensation. I’ve watched this over the last day or so and both sensors in the AirGradient are consistently too high by the amount of the compensation formula.

The one thing I can think of is that I’m using the “extended life” configuration for the particle sensor that only checks every 2 minutes. Is it possible that the other configs that leave the PMS5003T constantly create a less humid environment so the sensor requires the compensation?

I just switched my device over to the more frequent PM reading config and the recorded humidity levels have dropped from ~85% to ~68% in 20 minutes and it still seems to be slowly dropping. I haven’t checked with my Aranet, but Weather-dot-com says the nearby levels are 66%, which suggests that the air movement (and heat?) from the PM sensor definitely contributes to the difference in readings.

1 Like

I just received a O-1PST and the temperature is off by quite a bit from my Netatmo (colocated) and my Zehnder ERV outside air sensor. Has the correction been implemented in the stock 3.1.4 firmware or only the MallocArray firmware?
The temperature reading from my Zehnder ERV seems quite accurate and reacts very quickly as the air is sucked over the sensor at 200 m3/h.