# Sensor reading consistency

**URL:** <https://discourse.nodered.org/t/sensor-reading-consistency/77915>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [25 April 2023 12:28 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915 "2023-04-25T12:28:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 April 2023 12:28 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/1 "2023-04-25T12:28:06Z")

</div>

Apologies, this is not really a Node-red issue except that a NR dashboard illustrates it.

I have 3 BME280s and a BME680 sitting next to each other, each connected wire-wrapped to an ESP8266 and sending sensor readings by MQTT.

As shown in the image, one of them (a 280, not the 680) has wildly different temp and humidity readings.

 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93efc25eb1bf6093237349322d3abc31489af712.jpeg)

Do people think this is likely to be a bad sensor board, or could it be dodgy wiring to the ESP?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [25 April 2023 12:35 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/2 "2023-04-25T12:35:34Z")

</div>

As the pressure is pretty consistent, I'd say a bad temp/hum sensor.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 April 2023 13:05 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/3 "2023-04-25T13:05:18Z")

</div>

I have read that some Chinese copies can be 'a bit wayward' in their specs.

It is possible to write your own calibration (in NR) for each sensor, but you would need to use/decide on a reference.

[The spec for a 'proper' device](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf) is +/- 0.5 deg C (Page 12). I also read that fixing a sensor to a hard surface can affect the calibration (Soldering process for the breakout PCB??)

EDIT: Temperature is sensed from the voltage change in a Silicon Diode.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [25 April 2023 13:31 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/4 "2023-04-25T13:31:09Z")

</div>

> [@jbudd](#):
>
> Do people think this is likely to be a bad sensor board

So it's not just sensors, it's sensor _ **boards** _ ?

Are they commercial boards, or home made?

If commercial, is it a reputable make from a reputable supplier?

> [@jbudd](#):
>
> could it be dodgy wiring

That would certainly be the first thing to check!

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 April 2023 14:06 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/5 "2023-04-25T14:06:03Z")

</div>

> [@awneil](#):
>
> So it's not just sensors, it's sensor _ **boards** _ ?  
> is it a reputable make from a reputable supplier?

![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc0dc08f0ba01a75ca46e7e8af0f8b62f4f9171d.jpeg)

These are the cheapest Chinese BME280 sensors, on a small board with I2C and SPI.  
Not a genuine Bosch sensor.

I tried switching the BME supply from 3.3 to 5V (supposedly they can accept 5V) which made the temperature considerably higher. I took a close look at my soldering of the header, not saying anything but it's definitely going back to the soldering iron. 😳

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 April 2023 14:14 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/6 "2023-04-25T14:14:16Z")

</div>

> [@jbudd](#):
>
> I took a close look at my soldering of the header,

Sorry, I meant the manufacture of the Breakout PCB. If the case has stress on it, the readings can change.

Personally, I would go with creating a 'Node-RED calibration'. All to do with slopes and Intercepts. I would imaging that an offset for each sensor to make then read the same temperature at some point would be a start.

To be honest, do they need to be the same calibration? Or is it just because they are next to each other and you have noticed.

I currently have four of the same type of Chinese breakout PCBs connected to ESP Wemos, they are all in different places (Lounge, Bedroom, Cloakroom and Kitchen) and as long as they are close, it is good enough for me.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 April 2023 14:31 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/7 "2023-04-25T14:31:59Z")

</div>

Initially I noticed that the pressure, where they are consistent, is different from the local weather station's reading. That's because his reading is sea level adjusted and mine are absolute pressure.

So realising that I need to apply some sort of calibration factor, and in the absense of a reliable temperature/humidity sensor, I set them up together to give average readings.

That's when I saw that one of them has temperature readings up to 15 degrees out, which is clearly unreasonable.

I agree that accuracy is not really important, it's just sloppy not to extract the best data available from the sensor.

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [25 April 2023 14:39 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/8 "2023-04-25T14:39:48Z")

</div>

Agree that particular one is really wayward, hence the big change in Humidity.

Sensors are cheap enough, I would change it. But, I bet you only have 4 and need 4!!

Murphy's Law: If n items are required, there will only be n-1 items in stock.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 April 2023 14:43 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/9 "2023-04-25T14:43:45Z")

</div>

Nah. Murphy's law of Aliexpress: Free 15 day postage for 4 boards.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [25 April 2023 17:46 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/10 "2023-04-25T17:46:26Z")

</div>

> [@mudwalker](#):
>
> Personally, I would go with creating a 'Node-RED calibration'.

It doesn't look like just a calibration issue - it definitely looks like a fault somewhere!

What happens if you actually test all the sensors over a wide temperature range - say from the fridge (near zero) up to the hottest you can get?

> [@jbudd](#):
>
> These are the cheapest Chinese BME280 sensors

If they're cheap, just replace.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [25 April 2023 18:03 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/11 "2023-04-25T18:03:45Z")

</div>

> [@awneil](#):
>
> If they're cheap, just replace.

But don't do it too often, because then they are not so cheap. 🙂

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [25 April 2023 23:36 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/12 "2023-04-25T23:36:25Z")

</div>

I have tried repeatedly to use those sensors but ultimately I never found a supplier to provide reliable parts. The specs may be good but so many copy cats selling inferior parts I gave up. I kept trying to order BMP parts and they would send BME parts claiming they were the better part. And even the parts I got would fail in a short time. And one part had a spectacular failure. Your call but I'd look for a different sensor.  
[Edit] or at least have a plan b

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [26 April 2023 00:49 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/13 "2023-04-26T00:49:44Z")

</div>

After resoldering the header pins the bad sensor is actually much better but still reading 2.5° higher than the others.

I reluctantly conclude that my soldering skills are sub-optimal and the rework is still under suspicion.

Still, a worthwhile discovery that bad connections can leave the sensor working but inaccurate.

Thanks for the advice and observations.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [26 April 2023 07:30 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/14 "2023-04-26T07:30:38Z")

</div>

> [@ghayne](#):
>
> But don't do it too often, because then they are not so cheap

Ah yes - the true cost of buying cheap stuff!

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [26 April 2023 07:33 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/15 "2023-04-26T07:33:40Z")

</div>

> [@jbudd](#):
>
> still reading 2.5° higher than the others

If it's a consistent error, then you _could_ calibrate that out...

(the graphs in the OP don't show a consistent error)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [26 April 2023 09:41 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/16 "2023-04-26T09:41:04Z")

</div>

The BME280 has problems with self heating, [google for it](https://www.google.com/search?client=firefox-b-d&q=bme280+self+heating) that's the reason the temperature and humidity changes over time.  
The easiest way to overcome this problem is changing your ESP8266 code so that the BME280 will be in deep sleep and only will be waked up for a measurement and after that going back in sleep again.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://discourse.nodered.org/u/awneil)\
**Post date:** [26 April 2023 10:27 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/17 "2023-04-26T10:27:41Z")

</div>

But why would only one of the BME280s be affected - and not the other two?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 April 2023 11:45 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/18 "2023-04-26T11:45:37Z")

</div>

I agree that 15 deg is too much. I'd expect a degree or two variance.

The problem is that there are so many variables to account for. Just resting the sensors on a different surface can have a really large impact. Or having one closer to the microprocessor than the other. I have some sensor platofrms being reworked on my desk right now and I saw that they had different temperatures - at least one of them is affected by my 32" super-wide monitor! Another by the output from my TinyPC and another by being closer to the window. Doh!

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [26 April 2023 12:33 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/19 "2023-04-26T12:33:36Z")

</div>

Which sensors are you using ?

I just swapped a bmp280 in the bathroom with a SHT30 as the 280 started giving very high humidity readings.

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [26 April 2023 13:40 UTC](https://discourse.nodered.org/t/sensor-reading-consistency/77915/20 "2023-04-26T13:40:39Z")

</div>

> [@awneil](#):
>
> But why would only one of the BME280s be affected - and not the other two?

If there's a little bit air flow over the sensor it will cool down to the surrounding temperature where you are interested in.  
Most likely your other 2 sensor's have a bit airflow.  
Read the Google topics about this problem with the BME280, it's not my invention.

[Next page](https://discourse.nodered.org/t/sensor-reading-consistency/77915.md?page=2)
