This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BME680 Air quality Values

I am trying to work with Bme680 with I2C communication i can read every value but i cant read air quality value its  always at 806516 value and does not change . I thing configirations are wrong but i got them from bosch site so i dont know what to do if anyone can help i would be glad .

these are my settings

{
uint8_t set_required_settings;
/* Set the temperature, pressure and humidity settings */
gas_sensor.tph_sett.os_hum = BME680_OS_2X;
gas_sensor.tph_sett.os_pres = BME680_OS_4X;
gas_sensor.tph_sett.os_temp = BME680_OS_8X;
gas_sensor.tph_sett.filter = BME680_FILTER_SIZE_3;
/* Set the remaining gas sensor settings and link the heating profile */
gas_sensor.gas_sett.run_gas = BME680_ENABLE_GAS_MEAS;
/* Create a ramp heat waveform in 3 steps */
gas_sensor.gas_sett.heatr_temp = 320; /* degree Celsius */
gas_sensor.gas_sett.heatr_dur = 150; /* milliseconds */
/* Select the power mode */
/* Must be set before writing the sensor configuration */
gas_sensor.power_mode = BME680_FORCED_MODE;
/* Set the required sensor settings needed */
set_required_settings = BME680_OST_SEL | BME680_OSP_SEL | BME680_OSH_SEL | BME680_FILTER_SEL
| BME680_GAS_SENSOR_SEL;
/* Set the desired sensor configuration */
rslt = bme680_set_sensor_settings(set_required_settings,&gas_sensor);
/* Set the power mode */
rslt = bme680_set_sensor_mode(&gas_sensor);
}

this s the code that i use to get data 

nrf_delay_ms(meas_period);
rslt = bme680_get_sensor_data(&data, &gas_sensor);



if (gas_sensor.power_mode == BME680_FORCED_MODE)
{
rslt = bme680_set_sensor_mode(&gas_sensor);

}

Best Regards 

Efe

Parents Reply
  • thanks for your fast answers it means a lot to me. I want to ask if you know the reason might be this ?

    i am writing 140 data to temp , hum and press registers and they work but i am not writing and additional data to gas_resistance part ( i cant find that register in datasheet ) i belive the reason is my code but i will also try to clean the sensor too.

    uint8_t data[1]={140};
    uint8_t reg[1]={0x74};
    uint8_t rega[1]={0x72};
    uint8_t regs[1]={0x73};
    //uint8_t regg[1]={0x75};
    bme680_set_regs(reg, data, 1, &gas_sensor);
    bme680_set_regs(rega, data, 1, &gas_sensor);
    bme680_set_regs(regs, data, 1, &gas_sensor);
    //bme680_set_regs(regg, data, 1, &gas_sensor);
    nrf_delay_ms(500);
    
    while (1)
    {
    uint16_t meas_period;
    bme680_get_profile_dur(&meas_period, &gas_sensor);
    
    struct bme680_field_data data;

    after writing to these registers i just write 

    if(data.status & BME680_GASM_VALID_MSK)
                printf(", G: %d ohms", data.gas_resistance);
    if (gas_sensor.power_mode == BME680_FORCED_MODE)
    {
    rslt = bme680_set_sensor_mode(&gas_sensor);
    
    }

    this to the end of the code for gas_resistance

    Best regards Thanks 

    Efe

Children
Related