I have a design where I can plug either BME280 or BME680. I am using BME280 driver version 3.4.2 and BSEC driver (full one not lite) version 3.5.10 for BME680 driver and version 126.96.36.199 for BSEC. Software is running on ESP8266. I am using float calculation for both.
I am seeing differences in humidity measured by BME280 and BME680 (and temperature also)
I have tested different devices and here what I see:
Same board, same place, same time, just replaced the sensor:
Two different boards, same place, same time:
Could it be that the humidity offset is linked to the temperature offset? And if not what could be the cause of this offset
Normally I am adding an offset to temperature after measurement so that sensors indicate right and same temperature. But I just realize that there is an offset between these 2 type of devices for temperature.
Pressure measurement are almost identical between type of devices.
I have also tried integer calculation (both 32b and 64b) on BME280 but the measurements where the same as when using float.
Any idea where I could look for?
NB: I don't have a reference for humidity so I don't know which sensor is right, even I would think that BME680 is closer to real value.
Relative humidity (RH) output is by definition temperature dependant. The RH can typ. be influence by ~2.5%RH per degree change and as high as 5%RH/°C in corner conditions. If you can estimate your local temperature error/offset, it is possible to estimate the RH at the new/compensated temperature using physics formulas and assuming constant local humidity. BSEC supports this feature by default (the BSEC_INPUT_HEATSOURCE can be used to indicate the estimated temperature offset to the library which will automatically apply the correction to the compensated T/RH outputs). For the BME280 you would need to implement the compensation in your own code. Of course best integration and handling practices are still very important.
Thanks for the reply.
I will try to do the calculation and see if I can get a correct humidity.
I have a reference for temperature so I can tune temperature correctly. And by the way, from your answer I realized I did not compensate temperature correctly on BME680 as I am not using BSEC_INPUT_HEATSOURCE.
But then what I don't understand is why I have some much differences in temperature. Same board, some place, same time and the I can have 4 degree difference between BME280 and BME680. The accuracy is given for +/-1d in normal temp range for both sensors. So in worst case I should expect 2d difference.
What can I do to improve accuracy? Are there some cases which could degrade accuracy?
Not sure exactly what is happening on your PCB, most common causes could be hardware integration variables (position, materials, other components in the vicinity of the sensor, different processes running, etc.), potentially from self-heating or different sensor settings too.
I found the issue and it was on my side. Following your first answer, I tried to use the field BSEC_INPUT_HEATSOURCE and discovered that I once used it in the past and left a hardcoded value of 3d in my call to bsec_iot_init().
Once fixed, temperature difference between sensors is less than 1d and humidity difference is in range of the +/- 3 % accuracy. Problem solved. Thanks for your support.
But as I am using BME280 and need to add an offset to temperature (to report a correct temperature), what I still need to do is to estimate the RH with this offset temperature. I understood that for BME680, this is already supported with BSEC driver, but what about BME280 driver? I did not find anything for this. Would you have the formula to calculate this new RH? I found some on internet, but not sure they are valid....