05-12-2020 01:59 PM
I use a bme680 for my project, but the temperature value from `read_field_data()` is always 0 .
I printed the following debug data for this code part https://github.com/BoschSensortec/BME680_driver/blob/master/bme680.c#L1223-L1239
buf[5-7] is 129 105 96
adc_temp is 530070, adc_pres is 393660, adc_hum is 14457, adc_gas_res is 304 and adc_gas range is 5
data->temperature = 0.000 data->humidity = 20.270 data->pressure =95598.000 data->gas_resistance = 294021.0
buf[5-7] is 130 140 32
adc_temp is 534722, adc_pres is 414452, adc_hum is 13726, adc_gas_res is 377 and adc_gas range is 5
data->temperature = 0.000 data->humidity = 16.673 data->pressure = 92113.000 data->gas_resistance = 276157.0
Can somebody help me?
Solved! Go to Solution.
05-12-2020 04:10 PM
Unfortunately the ADC value alone is not sufficient to verify your output, please also share the relevant "calib" parameters and confirm your current sensor configuration and which implementation of the compensation formula is used (floating-point version is recommended). Feel free to share a code snippet of the BME680 initialization, configuration and data read-out.
05-13-2020 07:02 PM
thanks for quick replay. I called get_calib_data() and always get 0 as return value.
my init function looks like this:
b->bme680_driver.chip_id = 0;
b->bme680_driver.dev_id = i2cGetAdd(i2c);
b->bme680_driver.intf = BME680_I2C_INTF;
b->bme680_driver.mem_page = 0;
b->bme680_driver.amb_temp = 25;
b->bme680_driver.power_mode = BME680_SLEEP_MODE;
b->bme680_driver.read = BME680X_driver_read;
b->bme680_driver.write = BME680X_driver_write;
b->bme680_driver.delay_ms = BME680X_driver_delay;
com_rslt = bme680_init(&b->bme680_driver);
/* Select sensor configuration parameters */
b->bme680_driver.power_mode = BME680_FORCED_MODE;
b->bme680_driver.tph_sett.os_hum = BME680_OS_2X;
b->bme680_driver.tph_sett.os_pres = BME680_OS_4X;
b->bme680_driver.tph_sett.os_temp = BME680_OS_8X;
settings_sel = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL
b->bme680_driver.gas_sett.run_gas = BME680_ENABLE_GAS_MEAS;
b->bme680_driver.gas_sett.heatr_dur = b->HEAT_TIME;
b->bme680_driver.gas_sett.heatr_temp = b->HPTEMP;
com_rslt = bme680_set_sensor_settings(settings_sel, &b->bme680_driver);
And I also tried with floating-point version, then the temperature values are very instable and changed between 0 to 200.
05-13-2020 11:36 PM
API return 0 means the calibration read out value is successful.
Here we need all the calibration register content read from sensor. Or you can dump the current BME680 register map then shared to us.
Please also share the code you read the sensor data not only the initial part
05-18-2020 02:42 PM
Is there a function to dump all current BME680 register map? I will be in vocation next two month. I will give you more information in juni.