danwahl / adanet-co2-monitor

Adanet CO₂ Monitor
5 stars 1 forks source link

What would cause an erroneous reading? #19

Closed stevevance closed 1 year ago

stevevance commented 1 year ago

Today I saw an error message for the first time.

“Invalid sample detected”. I checked the code: it looks like the error is thrown if the reading is zero.

check out the photo 13EE3B6E-6F35-4D68-A82E-157153383544

danwahl commented 1 year ago

Looks like you already found this, but for reference, it comes from here in the code: the SCD4x (CO2 sensor) reading did not return an error, but the reported CO2 value was 0 ppm (which is an invalid response).

I've seen this happen a few times, typically when I was handling the Adanet device during a measurement. I think it's related to the way photoacoustic NDIR sensors work, but can't remember where I read that.

Did it go back to normal operation on the next update?

stevevance commented 1 year ago

It went back to normal operation on the next update.

I wonder if the shopping cart caused an issue: The cart's wheels or axle had flat spots and the car was making the Adanet bounce on that rack.

Why is 0 an invalid response? Couldn't the device plausibly detect the absence of CO2? Or is it not sensitive enough to confidently measure that?

danwahl commented 1 year ago

Agreed, that's probably it re: the shopping cart. Good question re: why 0 is an invalid response. The data sheet even says that 0 is within the valid range.

An uninformed guess: part of the sensor's measurement cycle is probably some sort of calibration of the microphone part of the photoacoustic assembly relative to the current ambient noise. If it got a particularly large reading due to a disturbance during this step, it might set its baseline noise level too high, and be unable to detect any CO2 signal on top of it, causing it to report 0.

If that's correct, it would be able accurately detect the absence of CO2, at least in a relatively quiet environment...

stevevance commented 1 year ago

thanks for the discussion! I'm gonna close this since I'm satisfied with the answer and I don't think it's worth refactoring the error message/detection.