<blockquote>
<p>I'll update my code to ignore the sensor readings that fall outside the calibrated range.</p>
</blockquote>
<p>Do not do that. Instead flag them as off-scale low or off-scale high. Those off-scale low / off-scale high values might mean that the sensor is failing, or that the battery is about to die.</p>
<p>Or it could just mean that the sensor gave a one-off glitchy measurement. Sensors do do this, with great regularity. It is a good idea with regard to sensor processing to have a quality flag associated with the sensor. An occasional glitchy measurement is something one should expect. Rare glitchy measurements are best ignored, but still should be tracked. An excess of isolated glitchy measurements is an indicator of sensor / battery health.</p>
<p>On the other hand, an off-scale reading could well mean your house is about to burst into flames. Simply ignoring those off-scale readings is a bad idea.</p>

CC BY-SA 4.0
2022-03-12T18:31:20.837Z
Thank you, David. I'll store the values when it's off-scale low or high and figure out how to visualize it so I can see how often the readings are off scale.


Also, I'm using a 5V 10A power supply, so it won't be an issue with low power.
Benjamin Afrasyab Farahmand
CC BY-SA 4.0
2022-03-11T07:48:30.207Z
2022-03-11T07:48:30.207Z
David Hammen
<p>I'm using a few gas sensors (MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, and MQ135) to measure the air quality inside my home. These sensors have been calibrated to work within a specific concentration range (i.e. 200 - 10000ppm). Here's an example model from one of the datasheets:
<a href="https://i.sstatic.net/2tCP2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2tCP2.png" alt="MQ2 Sensitivity Characteristics" /></a></p>
<p>Rs = Resistance of the Sensor</p>
<p>Ro = Resistance of the Sensor in Clean Air</p>
<p>An Arduino reads the values from the sensor. I then convert the Rs/Ro value to PPM using y = mx + b, where y = Log(Rs/Ro) and x = Log(PPM).</p>
<p>When concentrations are too low (&lt;200ppm) or too high (&gt;10000ppm), the Rs/Ro value falls outside the model. What should I do with the values that fall outside the model's range?</p>

CC BY-SA 4.0
2022-03-10T15:52:03.200Z
As you state the senors are calibrated to operate for a specific range of values. Any value outside that range is unreliable/anomalous and should be ignored.
Fred
CC BY-SA 4.0
2022-03-10T16:28:13.000Z
I agree, you can't rely on the sensor outside the published range of calibration. For non-critical uses you might choose to estimate slightly outside that range assuming the model would still be valid, or you could conduct your own calibration experiments at higher or lower concentrations.
Andy M
CC BY-SA 4.0
2022-03-11T00:04:11.787Z
Thank you for replying to my question. I'll update my code to ignore the sensor readings that fall outside the calibrated range.
Benjamin Afrasyab Farahmand
CC BY-SA 4.0
2022-03-11T07:33:59.940Z
Don't just ignore them. I'll add details in an answer.
David Hammen
<models><environmental-sensors>
What to do with a gas sensor's values that fall outside of a model's range?
Benjamin Afrasyab Farahmand
# What to do with a gas sensor's values that fall outside of a model's range?

(Asked by: username_0 on 2022-03-10)

I'm using a few gas sensors (MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, and MQ135) to measure the air quality inside my home. These sensors have been calibrated to work within a specific concentration range (i.e. 200 - 10000ppm). Here's an example model from one of the datasheets:
[![MQ2 Sensitivity Characteristics](https://i.sstatic.net/2tCP2.png)](https://i.sstatic.net/2tCP2.png)

Rs = Resistance of the Sensor

Ro = Resistance of the Sensor in Clean Air

An Arduino reads the values from the sensor. I then convert the Rs/Ro value to PPM using y = mx + b, where y = Log(Rs/Ro) and x = Log(PPM).

When concentrations are too low (<200ppm) or too high (>10000ppm), the Rs/Ro value falls outside the model. What should I do with the values that fall outside the model's range?

**Tags:** models, environmental-sensors

> **Comments:**
> **username_1**: As you state the senors are calibrated to operate for a specific range of values. Any value outside that range is unreliable/anomalous and should be ignored.  
> **username_2**: I agree, you can't rely on the sensor outside the published range of calibration. For non-critical uses you might choose to estimate slightly outside that range assuming the model would still be valid, or you could conduct your own calibration experiments at higher or lower concentrations.  
> **username_0**: Thank you for replying to my question. I'll update my code to ignore the sensor readings that fall outside the calibrated range.  
> **username_3**: Don't just ignore them. I'll add details in an answer.  

---

## 1 answers

### Answer by username_3 on 2022-03-11. Score: 1 | Accepted answer

> I'll update my code to ignore the sensor readings that fall outside the calibrated range.

Do not do that. Instead flag them as off-scale low or off-scale high. Those off-scale low / off-scale high values might mean that the sensor is failing, or that the battery is about to die.

Or it could just mean that the sensor gave a one-off glitchy measurement. Sensors do do this, with great regularity. It is a good idea with regard to sensor processing to have a quality flag associated with the sensor. An occasional glitchy measurement is something one should expect. Rare glitchy measurements are best ignored, but still should be tracked. An excess of isolated glitchy measurements is an indicator of sensor / battery health.

On the other hand, an off-scale reading could well mean your house is about to burst into flames. Simply ignoring those off-scale readings is a bad idea.

> **Comments:**
> **username_0**: Thank you, username_3. I'll store the values when it's off-scale low or high and figure out how to visualize it so I can see how often the readings are off scale.   Also, I'm using a 5V 10A power supply, so it won't be an issue with low power.  

---

