airgradienthq / arduino

Firmware of open-source hardware air quality monitors AirGradient ONE (indoor) and AirGradient Open Air (outdoor).
https://www.airgradient.com/documentation/
Other
220 stars 114 forks source link

Ignore parameter values out of range #190

Closed airgradienthq closed 3 months ago

airgradienthq commented 5 months ago

It seems the PMS5003T seldomly sends extremely low values.

See: https://github.com/home-assistant/core/issues/120586

I would suggest when reading values from sensor we accept only the following ranges:

Temperature: -40°C to 125°C Relative Humidity: 0% - 100% CO2: 0-10.000ppm PM1, 2.5, 10: 0 - 1000 ug/m3

Byter09 commented 5 months ago

There seems to be a pattern to this though. Every time my temperature goes to -1000.99, the PM sensors also go to -1 µg/m³ or particles/dL for the 0.3 PM sensor. The humidity sensor also goes to -1%.

I do not observe this behaviour with the CO2 value, however I'm sure it can't hurt to limit it to sane values as well :)

What I'm trying to say is that maybe there's something that triggers these values to happen at the same time. Let me know if there's anything I can do to help diagnose this.

airgradienthq commented 4 months ago

@Byter09 Yes that makes sense. The temperature/humidity in the outdoor monitor comes from the PM sensor. So that PM/temperature/humidity fails at the same time indicates a com problem.

Byter09 commented 4 months ago

Here's one more weird quirk I noticed. My internet was off over the night (maintenance by my ISP) until a few minutes ago.

In that whole time, instead of spiking once per day, it spiked several times. I have the feeling this might somehow be related to it not being able to reach the server? Maybe it restarts and the initial value is weird? I don't know. Just leaving this here in the hope that it helps

Screenshot_2024-07-01-08-32-49-80_c3a231c25ed346e59462e84656a70e50

mhlas7 commented 4 months ago

Adding another data point here, I turned off "Post Data to AirGradient" two days in Home Assistant (my sensor is set to local control, not cloud) and I now see the temp read -840 F for a two hour period at least once per day. Before I turned it off, I was getting one off spikes down to -840 F similar to other users in this thread. This makes me think the post data to AirGradient function has some sort of impact on the temp reading.

image

gslender commented 4 months ago

Yep, from looking at the data I have, it looks to occur during period of when the sensor is updating to AirGradient in the cloud. Is it possible the internal serial read from the sensor is failing to occur when it should, and bad values are being read instead??

michaelpeterswa commented 4 months ago

Seeing a similar pattern, posting to AirGradient is enabled, and all data collection for this graph is happening via the local API. image

If there's anything I can do to assist just let me know.

pnt325 commented 3 months ago

The issue is fixed by #197. Please open issue again if still problem.

dfsmith commented 2 months ago

My (new) outdoor Airgradient went funny when I moved it from inside to outside. I suspect this might be a power issue, and will play with capacitors. image

Byter09 commented 2 months ago

@dfsmith I had something similar happen when the wire wasn't completely attached. Maybe give that a try? Though in my case the sensor reported other values fine, so maybe figure out which of the sensors are behaving weird. If it's all one specific sensor then it's likely the cable (as in, the internal ones, not the power supply).

dfsmith commented 2 months ago

@Byter09 FYI: 10uF of capacitance on the 3.3V line cleared it right up. I conjecture that WiFi was stealing too much instantaneous power in the new location, though I didn't collect any hard data to confirm it. Edit: wrote too soon: got a bad reading drastically below 0 Kelvin.

BkSouX commented 2 months ago

Hi, still had the issue with the air gradient outdoor Firmware: 3.1.4

image