Bosch Sensortec Community

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

    BME688 BSEC What values should be assigned to sensor input ID 22, 23, 24 ?

    BME688 BSEC What values should be assigned to sensor input ID 22, 23, 24 ?

    vic
    Member

    I am using the BSEC Library v2.4.0.0 Generic Release 23012023 and trying to use the library to get IAQ data.

     

    I read the API docs and the examples to build my own application. I am calling bsec_update_subscription  with these parameters

    bsec_sensor_configuration_t requested_virtual_sensor = { .sensor_id = BSEC_OUTPUT_IAQ, .sample_rate= BSEC_SAMPLE_RATE_LP};
    const uint8_t n_requested_virtual_sensors = 1;
    bsec_sensor_configuration_t required_sensor_settings[BSEC_MAX_PHYSICAL_SENSOR];
    uint8_t n_required_sensor_settings = BSEC_MAX_PHYSICAL_SENSOR;

    bsec_update_subscription(requested_virtual_sensor,
                                                             n_requested_virtual_sensors,
                                                             required_sensor_settings,
                                                             &n_required_sensor_settings);

     

    These parameters should give me as output the sensors required to get the IAQ output. After executing the function I get the following sensors IDs in the array required_sensor_settings with a sample rate of 0.3333 (i.e. BSEC_SAMPLE_RATE_LP)

    2,3,4,22,23,24

    According to the header bsec_datatypes.h enum bsec_physical_sensor_t, sensor IDs 2,3,4 are humidity, temperature, gasresistor respectively. What I do not know is what is the meaning of sensor ID 22,23,24.

    ID 22 is not specified and I do not find an example on what value should be assigned to the signal data member of struct bsec_input_t. In addition, could you explain what values should I assign to sensor IDs 22 (undefined), 23  (BSEC_INPUT_DISABLE_BASELINE_TRACKER) and 24 (BSEC_INPUT_PROFILE_PART).

    From my attempts at understanding the sample code, sensor ID 23 (BSEC_INPUT_DISABLE_BASELINE_TRACKER) should be assigned to gas index if the operation mode of the BME688 is not FORCED_MODE (line 380 file bsec_integration.c). But sensor ID 22 and 24 (BSEC_INPUT_PROFILE_PART) are not used in the samples.

    Is it safe and valid to use bme68x_bsec_process_data for my use case (IAQ virtual sensor) ignoring input ID 22 and 24  (i.e., sample rate = BSEC_SAMPLE_RATE_DISABLED) ?

    If not could this be added to the docs or answered in this question?

    Thanks in advanced and if I am missing something please let me know as I am new to the BSEC library.

    As further information I am calling as per documentation first bsec_init and then  bsec_set_configuration with config from folder bme688_sel_18v_3s_4d  file bsec_selectivity.c.

     

     

     

     

     

     

    6 REPLIES 6

    BSTRobin
    Community Moderator
    Community Moderator

    Hi vic,

    Could we know some information first from you:
    1.What is about your host platform?
    2.Which program language you used?
    3.What outputs do you need to use from BSEC?

    Hello @BSTRobin ,

    1.What is about your host platform?

    - Windows 11,  compiling for the Zephyr OS. I.e. I am using the Zephyr arm Toolchain variant for a cortex-M33 CPU. In specific a NRF5340 MCU

    2. Which program language you used?

    - Language C 17

    3.What outputs do you need to use from BSEC?

    - As mentioned in the post I want to get the IAQ data output, which in the BSEC source code library header file is defined as "BSEC_OUTPUT_IAQ" and corresponds to sensor ID number one and named as "Indoor-air-quality estimate".

     

     

    BSTRobin
    Community Moderator
    Community Moderator

    Hi vic,

    I used Keil MDK-ARM which supported C language. I upload BSEC2.4.0.0 example code on STM32F401 for your reference.
    Enable macro definitions in user_define.h file.
    //#define BME68X_OUTPUT_GAS_ESTIMATE
    #define BME68X_OUTPUT_GAS_IAQ

    Thanks for the sample program.I checked further the library and it seems that it does not really matter what the function bsec_update_subscription  gives as output for required sensors. What really matters is to call bsec_sensor_control and retrieve the sensor settings, in specific the values from data member process_data. Based on the bit flags then you should populate the output data to be process by the BSEC library through bme68x_bsec_process_data.

    Summary:
    I wanted to know what does sensor ID 22 and 24 mean. By reading the sample I found out it does not matter, just use bsec_sensor_control  afterwards to get the real sensor settings that are required in your user specific sampling loop. This is important for my use case as I am not using the sample at all, I am working with Zephyr OS and wanted to know how to use the library to work with the Zephyr driver version and use BSEC only for its custom AI algorithm.


     

    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