Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BME688 Nicla Sense me, how to access the data ?

    BME688 Nicla Sense me, how to access the data ?

    FaresElAbed
    Member

    Hello,

    After receiving the Nicla Sense me arduino card, we've been trying to figure out how to access the data returned from the BME688 gas sensor using arduino IDE.
    We are connecting the card through a regular USB cable. 
    So far, we've been using these lines of code:
    Sensor gas(BHY2_SENSOR_ID_GAS);    // Declaring the sensor as a global variable.
    BHY2.update();
    gas_value=gas.value(); // To access the data returned from the BME688 gas sensor

    But, upon println(gas_value); we have been only seeing an integer number. So our question is basically, what are the functions/variables to use in order to see the full potentiel of BME688 and the data that it captures.

    4 REPLIES 4

    zgg
    Long-established Member

    Hello

    The current example sketch Standalone.ino and the Arduino_BHY2 library supports parsing of the raw gas sensor (gas resistance, sensor ID:131) , the gas resistance value is integer type.

    To make sense of the gas resistance for something more useful and intutitive, the BSEC  1.x software has been integrated on the BHI260 chip of the board.

    The BSEC output is also put in the FIFO with a sensor ID 171 (for older legacy BHI260 FW) or sensor ID 115 (for newer BHI260 FW).

    To make it easier for you to use the BSEC output, please use this newer version of the Arduino_BHY2 library and bhy controller tools here:

    https://drive.google.com/file/d/14lGLrQ0YODEpC_QlA6-fJDugv3lTTEYL/view?usp=sharing

     

    In future, we would expect to see those updated software to be on github with more examples and features to make things easier on your side.

     

    Hello,

    Thanks for your answer!

    MS89
    Occasional Visitor

    Hello,

    i'm trying to geht the IAQ value with the shared code.
    could you please help me with the code:

     

    SensorBSEC bsec(uint8_t(171));

    bsec.begin();

    Serial.println(String(bsec.toString()

     

    but I only get the temperature:

    BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 26.53 comp_h: 39.05 comp_g: 0

    Could you help me. 

    zgg
    Long-established Member

    Hello 

    This is because most sensor frame size is less than 10 (and to save space), SENSOR_DATA_FIXED_LENGTH is defined as 10. 

    you could change the definition of SENSOR_DATA_FIXED_LENGTH (in libraries/Arduino_BHY2/src/sensors/SensorTypes.h) to a larger value such as 30 (which is greater than the frame size of 29 for sensor id 171), and you should be able to see the actual IAQ values rather than 0.

     

    BTW, the similar code (you are using from the google drive) is actually publically available on github.

    again, you need to change the definition of SENSOR_DATA_FIXED_LENGTH to a larger value. 

    we will see in future, a more flexbile solution could be provided to accomodate for both large frames and small frames, right now, only few sensors have frame size larger than 10 that's why Arduino has implemented it this way.

     

     

     

     

    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