BME280 library? temp/humidity/pressure sensor accuracy?

I have a brace of Bosch BME280 sensors breakouts i bought on Aliexpress to use to monitor my house and surrounds and trying to work out if i have the right library for them?

i have tried the finitespace one:

and the Embeded Adventures one:

buti seem to be under-reading the humidity?

my Sensirion SHT25 handheld is my go-to device - and it has served well in looking at DHT22 readings, but these BME280 readings seem very low for humidity?

temperature is OK, compares fine with the BMP180, SHT21 readings on the same concurrent I2C conns. to my WeMos D1 (ESP8266-12F) all around 25'C ish, but the BME280 reads around 50% for humidity, whereas every other sensor (including the SHT-25) is around 60-70ish.

i paid a premium for these BME280s (have only tested two) and was hoping they could be more reliable than my DHT22's that i have been using... but not sure if the humidity is accurate?

does anyone have any suggestions?

this is the sensor:

I have used the same devices and had readings of 45% which I thought was too low. Perhaps it would be better to use this device to look at change rather than actual value. To use like this it would help to have a reference to work against.
The device is supposed to be accurate to +/- 3% with +/- 1% hysteresis but I remain sceptical that these accuracy figures were being achieved.
Changes in filtering and a slower read rate may improve my results but I haven't tried this yet.

G

Wareemba:
my Sensirion SHT25 handheld is my go-to device - and it has served well in looking at DHT22 readings, but these BME280 readings seem very low for humidity?

How can you be certain the Sensirion is accurate?

I have several of these BME280 modules that I bought from Mouser and mounted on little adapter boards. They agree with one another. Are they accurate? I tried to test one with a DIY wet/dry bulb setup one time, using a glass lab thermometer (stated accuracy ±1°F), a wick and cup of water and a little fan.

dry bulb temp: 70.8°F
wet bulb temp: 61.0°F
relative humidity: 57%

One of my BME280 modules read 69.0°F and 60.0% relative humidity.

For what it's worth.

Zardof:
Changes in filtering and a slower read rate may improve my results but I haven't tried this yet.

The filter doesn't affect the humidity measurement in the BME280, only the pressure.

jboyton:
How can you be certain the Sensirion is accurate?

well, for one, it concurs closely with how it "feels".

but more precisely the SHT25 concurs closely with the six DHT22's i have been using, and also the two BMP180's i have tried. i did have a batch of DHT22's that read WAY high for humidity, and i have ditched these as they never had believable humidity outputs.

I have several of these BME280 modules that I bought from Mouser and mounted on little adapter boards. They agree with one another. Are they accurate? I tried to test one with a DIY wet/dry bulb setup one time, using a glass lab thermometer (stated accuracy ±1°F), a wick and cup of water and a little fan.

dry bulb temp: 70.8°F
wet bulb temp: 61.0°F
relative humidity: 57%

One of my BME280 modules read 69.0°F and 60.0% relative humidity.

For what it's worth.

i will do a lab test, but it sure seems that they read low for humidity...

for instance, the "breath test" on the BME280 maxes it out at 83% humidity - every other sensor i have tried hits 100% when breathed upon - do your BME280's ever hit 100%???

but i was mostly asking in case it could be a wrong library thing?

what library are you using?

I have filtering on and a high data rate. The data sheet suggests filtering off and a low data rate. I do not know if one, both or none of these would have an impact on my values. How humidity is derived should not be effected by filtering, but the data sheet suggests having the filtering off.

G

Zardof:
I have filtering on and a high data rate. The data sheet suggests filtering off and a low data rate. I do not know if one, both or none of these would have an impact on my values. How humidity is derived should not be effected by filtering, but the data sheet suggests having the filtering off.

G

which BME280 library are you using?

is it simple to switch the filtering settings? did you notice any differences?

if you breath on the sensor - does it go to 100%

Zardof:
I have filtering on and a high data rate. The data sheet suggests filtering off and a low data rate.

Where does it suggest that? The filtering, oversampling and sample rate should be chosen as per the application. The data sheet provides several example applications with suggested settings.

Anyway, the filter is only implemented for pressure. There’s no reason to have one for humidity. Upping the oversampling for humidity will reduce noise, but if it’s reading 25% low it’s not going to fix that.

Wareemba:
well, for one, it concurs closely with how it "feels".

Are you sure you can tell the difference between 50% and 70% relative humidity? I can't. It varies by that much every day here and I never notice. Temperature changes the relative humidity even if the absolute humidity stays the same.

Wareemba:
but more precisely the SHT25 concurs closely with the six DHT22's i have been using, and also the two BMP180's i have tried. i did have a batch of DHT22's that read WAY high for humidity, and i have ditched these as they never had believable humidity outputs.

The BMP180 doesn't measure humidity. The thing is, either you have a reliable reference or you're just comparing unreliable references with each other.

Wareemba:
i will do a lab test, but it sure seems that they read low for humidity...

I don't know how accurate my home made hygrometer was. But the only other reference I have is weather station data and those vary significantly from stations even within a few miles of each other. In other words, I'm not certain how accurate my BME280 modules are.

Wareemba:
for instance, the "breath test" on the BME280 maxes it out at 83% humidity - every other sensor i have tried hits 100% when breathed upon - do your BME280's ever hit 100%???

but i was mostly asking in case it could be a wrong library thing?

what library are you using?

If I breath on one of mine for ten seconds or so it goes to 100%.

It seems unlikely that it would be library thing if all of them agreed with each other. But I can't say for sure.

I took the compensation code from the datasheet and wrote my own bare bones library. You can have it if you want but it's written to use an SPI interface; you'd have to modify for I2C.

thank you :slight_smile:

jboyton:
Are you sure you can tell the difference between 50% and 70% relative humidity?

definitely.

The BMP180 doesn't measure humidity.

no, but it concurred with the SHT25 temperature.

I'm not certain how accurate my BME280 modules are.

if yours goes to 100% then my sensors are not working correctly, either hardware or software...

could you please share your code?

Wareemba:
definitely.

Maybe you really can feel it, but I’m skeptical. Here’s the thing. With the same moisture content in the air the relative humidity will drop as the day warms up. For example, at a nearby weather station this morning the r.h. was 87%; this afternoon it is 57%. The air has actually become a little bit moister (the dew point went up a few degrees) but the r.h. is lower simply because it’s warmer in the afternoon than in the morning. How you could feel this I’m not sure. This morning I just felt colder than I do now.

Wareemba:
could you please share your code?

Attached.

BME280.cpp (11 KB)

BME280.h (5.63 KB)

jboyton:
Maybe you really can feel it, but I’m skeptical. Here’s the thing. With the same moisture content in the air the relative humidity will drop as the day warms up.

you didn’t mention it warming up!

in this scenario: 50% RH @ 20’C ambient versus 70% RH @ 20’C ambient - i can definitely feel it.

For example, at a nearby weather station this morning the r.h. was 87%; this afternoon it is 57%. The air has actually become a little bit moisture (the dew point went up a few degrees) but the r.h. is lower simply because it’s warmer in the afternoon than in the morning. How you could feel this I’m not sure. This morning I just felt colder than I do now.

my ventilation system is based on dew point comparisons, so i am a keen observer of temp & dew points :wink:

Attached.

thanks, i hope it will help a bit…

jboyton,

Page 17 of the 280 data sheet.

3.5.2 Humidity sensing
Description: A low data rate is needed. Power consumption is minimal. Forced mode is used to minimize power consumption and to synchronize readout, but using normal mode would also be possible.
Table 8: Settings and performance for humidity sensing
Suggested settings for weather monitoring
Sensor mode
forced mode, 1 sample / second
Oversampling settings
pressure ×0, temperature ×1, humidity ×1
IIR filter settings
filter off
Performance for suggested settings
Current consumption
2.9 μA
RMS Noise
0.07 %RH
Data output rate
1 Hz

This is where the suggestion for filter off and low data rate comes from. Yes they are suggested modes of operation and the filtering is for the faster responding parts of the sensor.
As there are registers that can be changed to alter how this sensor operates the values I have shown comes from my settings and not necessarily the default chip values.

G

I used two web sites.

The first has a library:-

The second has an arduino example:-
http://www.winddeal.net/image/tools/40073%20GY-BME280.rar

Here are some results.
The sensor was placed in a cupped hand and breathed on repeatedly.

Sparkfun library
Filter off, normal mode, Oversample 1

Temperature: 31.78 degrees C
Temperature: 89.20 degrees F
Pressure: 100469.00 Pa
Altitude: 72.99m
Altitude: 239.47ft
%RH: 97.00 %

Filter On, normal mode, Oversample 1

Temperature: 32.80 degrees C
Temperature: 91.04 degrees F
Pressure: 100474.00 Pa
Altitude: 73.51m
Altitude: 240.05ft
%RH: 97.00 %

No library, using software from second link.

Filter off, normal mode, Oversample 1

TEMP : 32.46 DegC PRESS : 1004.52 hPa HUM : 96.00 %
TEMP : 31.85 DegC PRESS : 1004.61 hPa HUM : 95.67 %

Filter on, normal mode, Oversample 1

TEMP : 32.43 DegC PRESS : 1004.39 hPa HUM : 97.54 %
TEMP : 32.64 DegC PRESS : 1004.05 hPa HUM : 97.40 %

Both sites examples are well commented, making it easy to change register values.

G

Zardof:
Page 17 of the 280 data sheet....

I think you have misunderstood what Bosch means by "A low data rate is needed". They mean that a low data rate is sufficient. A higher data rate will only reduce noise. The trueness of the value isn't affected by changing the data rate. Since the humidity sensor doesn't respond all that fast and typically the humidity itself doesn't vary that quickly it would be a waste of electrical current to increase the data rate, at least in the example application in the Bosch datasheet.

I did a quick google on hygrometer calibration. I ran across a description for a very accurate wet/dry bulb design called the "Assmann" hygrometer. I'm not a teenager but that still made me laugh.

Anyway, there is another way to test a hygrometer that should be pretty easy to do. It turns out that the relative humidity above various saturated salt solutions is not a very strong function of temperature. For example, at 20°C, a slurry of normal table salt will result in an r.h. of 75%. It's supposed to take quite a while, depending on size of container and the surface of the slurry I suppose. I just stuck my BME280 in a glass jar with a container of NaCl slurry. We'll see....

jboyton:
I just stuck my BME280 in a glass jar with a container of NaCl slurry. We'll see....

I'll do the same when I get home from work in 9hrs... See how we go...

Mine kind of settled in around 70%. I tried it more than once.

So is my BME280 a little out of spec (±3%) or did I do the test incorrectly? How can I know? Ha ha.