Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP388 API introduction

    For customer usage, you need to download the sensor driver package from the website to communicate with sensor after connecting the BMP388 chip to your developing board.  You can find the information from the following link https://github.com/BoschSensortec/BMP3-Sensor-API.

    The procedure of using BMP388 sensor API is presented in the following flow chart:

    11.png

    The detailed example code for integration of API could be found in:

    https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/README.md

    Following steps need to be considered to ensure the API/sensor configured correctly.

    For reading the data information from API, the following example can follow

    1.The following static function should be added into your own project

    static int64_t compensate_temperature
    static uint64_t compensate_pressure
    static double bmp3_pow
    static void parse_calib_data
    static double compensate_temperature_d
    static double compensate_pressure_d
    

    2.Define the main function to print the data, the structure for BMP3 and put the trimming data into the correct position as follow. One example shown below

    calib_data->reg_calib_data.par_t1 = (int16_t)27402;
    calib_data->reg_calib_data.par_t2 = (int16_t)18868;
    calib_data->reg_calib_data.par_t3 = (int8_t)-10;
    calib_data->reg_calib_data.par_p1 = (int16_t)-244; 
    calib_data->reg_calib_data.par_p2 = (int16_t)-3254;
    calib_data->reg_calib_data.par_p3 = (int8_t)35;
    calib_data->reg_calib_data.par_p4 = (int8_t)0; 
    calib_data->reg_calib_data.par_p5 = (int16_t)25879;
    calib_data->reg_calib_data.par_p6 = (int16_t)31477; 
    calib_data->reg_calib_data.par_p7 = (int8_t)-13; 
    calib_data->reg_calib_data.par_p8 = (int8_t)-10; 
    calib_data->reg_calib_data.par_p9 = (int16_t)16342;
    calib_data->reg_calib_data.par_p10 = (int8_t)29;
    calib_data->reg_calib_data.par_p11 = (int8_t)-60;
    

    3.Give the correct default value to the uncompensated temperature and pressure, define the version to temperature and pressure.

    uncomp_data->pressure = 8241776;
    uncomp_data->temperature = 8329880;
    double temp = compensate_temperature_d(uncomp_data, calib_data);
    double press = compensate_pressure_d(uncomp_data, calib_data);
    double tempurature = temp;
    double pressure = press;
    

    4.Print out the final value

    printf("Temperature\t Pressure\t\n");
    printf("%0.2f\t\t %0.2f\t\t\n", tempurature, pressure);
    system("pause");
    

    13.png

     

    Version history
    Last update:
    ‎06-15-2020 05:05 AM
    Updated by:
    Contributors
    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