0

Dependence of the relative humidity (RH) with the pressure?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Dependence of the relative humidity (RH) with the pressure?

by jjusto on Mon Aug 05, 2019 9:30 am

Hi everyone,

I will try to keep my question as short as possible:
-I am using an Adafruit board with the BME280 sensor integrated. As you might now, this sensor can measure temperature, humidity and pressure.
-I am interested in getting the so called relative humidity (from now on, RH).
-In the Adafruit library: "Adafruit_BME_280.cpp", there's a function called: "readHumidity". This function returns the RH (for instance: 35.46%).

-If you dig into the aforementioned function, it is possible to see that the RH is computed from:

1) Raw humidity data (raw data from the ADC).
2) Some humidity calibration data (the calibration data are always the same, these data are stored by the manufacturer in some internal registers; i.e: calibration data do not
depend on the environment where the BME280 is placed).
3) A parameter called: "t_fine". At the beginning of the function readHumidity, it is possible to see that the function readTemperature is called. This function calculates the
parameter "t_fine" from the raw temperature data and some temperature calibration data.

You will see that the RH only depends on the 3 points just stated.

HERE IT'S WHERE MY QUESTION COMES: Why readHumidity is not using the pressure information to compute the RH? According to my understanding, the RH is related with the pressure. That's why it really surprises me that the pressure is not used for computing the RH.
NOTE: I have checked with a different sensor whether the RH provided by the BME280 makes sense, and it seems that it does. Fine...seems to be working...but once more: where's the dependency with the pressure? I can't see it in the code.

Thanks a lot!

Best regards

jjusto
 
Posts: 1
Joined: Mon Aug 05, 2019 9:11 am

Re: Dependence of the relative humidity (RH) with the pressu

by adafruit_support_mike on Mon Aug 05, 2019 4:02 pm

The BME280 does the calculation of relative humidity internally, using information from its pressure, temperature , and humidity sensors.

The math in the library applies calibration constants to the reading, and one of those constants needs to be scaled relative to the temperature. The equations are taken directly from section 4.2.3 of the BME280 datasheet:

https://cdn-shop.adafruit.com/product-f ... 2/2652.pdf

adafruit_support_mike
 
Posts: 58798
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.