07-27-2021 11:18 PM
I am working with BME280 temp, pressure, and humidity sensor. I verified temperature readings and they seems to be within .5 deg C as adverticed. I have a custom board where BME280 mounted and it heats up to ~3 deg C above ambient. Since heating up is gradual I do see pressure measurements change with temperature. It is almost linear change, but not quite. I can come up with compensation formula but though I will check with a community first if this is something that needs to be done. I use refernce driver from Bosch which does read calibraion parameters. My undestanding that calibration parameters are set at the factory only once those do not account for environmental conditions. Is this true? Did anyone observe the same issue with pressure drift due to temperature? Do you have compensation equation? How does that effect humidity measurments? I haven't verified those yet.
07-27-2021 11:22 PM
something to note, the magic temperature that gives me accurate pressure reading is 26.65 deg C which seems to be a little too hot for a factory floor temp at which sensor presumably was calibrated
07-28-2021 04:50 AM
Hello innovaAlex,
Could we know your detailed test environment, test data, test result?
08-02-2021 04:39 PM
After taking a closer look at my code I found an issue and no longer see such a drammatic impact of temperature on pressure readings. However, temperature does affect pressure readings (see plots below) just not by a lot to worry about. I am testing in a home environment so temperature fluctuations are based on temperature in the room. Pressure is basically a sea level pressure. ~1012 mbar. What I find interesting now is that pressure has a huge offset ~340 mbars! I read some other posts on this forum and see that others found similar issues but no one has such a huge offset. Users typically reported ~50mbar offset. My humididy readings look offset too by 9-10%. What do you think can cause such an offset? Do you think sensor on my board was demaged during manufacturing? Is it tipical to calibrate these sensors? one time calibration or do they need to be recalibrated? Please note temperature readings are correct, measuring board temperature which is ~3 deg C above ambient and has an error of +/-0.5 deg C (I verified it with thermocouple attached to sensor enclosure).
08-25-2021 11:19 AM
Hello innovaAlex,
Do you fully refer to the BME280 driver code in github? https://github.com/BoschSensortec/BME280_driver
Driver code included data compensation.
/*!
* @brief This API reads the pressure, temperature and humidity data from the
* sensor, compensates the data and store it in the bme280_data structure
* instance passed by the user.
*/
int8_t bme280_get_sensor_data(uint8_t sensor_comp, struct bme280_data *comp_data, struct bme280_dev *dev)
{
int8_t rslt;
/* Array to store the pressure, temperature and humidity data read from
* the sensor
*/
uint8_t reg_data[BME280_P_T_H_DATA_LEN] = { 0 };
struct bme280_uncomp_data uncomp_data = { 0 };
/* Check for null pointer in the device structure*/
rslt = null_ptr_check(dev);
if ((rslt == BME280_OK) && (comp_data != NULL))
{
/* Read the pressure and temperature data from the sensor */
rslt = bme280_get_regs(BME280_DATA_ADDR, reg_data, BME280_P_T_H_DATA_LEN, dev);
if (rslt == BME280_OK)
{
/* Parse the read data from the sensor */
bme280_parse_sensor_data(reg_data, &uncomp_data);
/* Compensate the pressure and/or temperature and/or
* humidity data from the sensor
*/
rslt = bme280_compensate_data(sensor_comp, &uncomp_data, comp_data, &dev->calib_data);
}
}
else
{
rslt = BME280_E_NULL_PTR;
}
return rslt;
}