Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Bme680 gas resistance value does not change

    Bme680 gas resistance value does not change

    Kefocuk
    New Poster

    Bme680 gas resistance value does not change i always get the result of 806516. I am working with nrf5dk and i dont know what am i doing wrong but temp,hum,press are all correct but when i read ( data.gas_resistance) the value is stuck to 806516 .

    this is my code to read data can someone please help me ?

    Best regards 

    Efe


    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;

     

    temp= data.temperature ;
    NRF_LOG_INFO("TEMP value = %d ", temp);

    pres= data.pressure ;
    NRF_LOG_INFO("PRES value = %d ", pres);

    hum= data.humidity ;
    NRF_LOG_INFO("HUM value = %d ", hum);

    air= data.gas_resistance ;
    NRF_LOG_INFO("AIR value = %d ", air);


    temp_value= temp/100;
    pres_value= pres;
    hum_value= hum/1000;
    air_value= air/10000;

    ble_cus_temp_level_update(&m_cus,temp_value);
    ble_cus_pres_level_update(&m_cus,pres_value);
    ble_cus_hum_level_update(&m_cus,hum_value);
    ble_cus_air_level_update(&m_cus,air_value);
    ble_cus_fall_level_update(&m_cus,Falll);


    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);

    }

    1 REPLY 1

    BSTRobin
    Community Moderator
    Community Moderator

    Hello Kefocuk,

    Please refer these attachment example code on my side.

     

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist