Bosch Sensortec Community

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

    BMP280 Low Pressure Reading

    draperworks
    New Poster

    BMP280 Low Pressure Reading

    I have an Adafruit BMP280 Sensor Module (Adafruit SKU ADA2651) connected to a Microchip controller using I2C (at 100KHz). Electronically, the module works properly, but the calculated pressure value is low. For example, at sea level, the module returns a result of 0.6 atmospheres.

    The Bosch BMP280 datasheet that I have is version 1.14, May 2015. This datasheet (page 23) contains a worked example of the calculations for temperature and pressure. I have written my own PIC code which reproduces the floating point calculations in Appendix 8.1 in the datasheet. Using the data from the datasheet example, my PIC code produces results that agree with the Bosch example to two decimal places. I assume that the Bosch example comes from an STP environment, ie. temperature = 25 Celsius, pressure = 101,325 Pascals.

    Below are the Bosch worked example (“Datasheet” heading) and the results from my module (“PIC”) compared using the terminology in the Bosch datasheet. My test was performed at sea level and the temperature was 24.4 Celsius (measured with a thermometer accurate to 0.5 Celsius).

    draperworks_1-1634209360125.png

    The calculated temperature appears to be accurate, but the calculated pressure is very wrong.

    There is generally good agreement between the compensation parameters (dig_T1 through dig_P9). The exceptions are the values of dig_P4 and dig_P5. The values of adc_P also differ to some extent. Going through the maths provided in the datasheet, it seems that these are the parameters that cause the pressure result to be low. BTW the pressure reading does vary if I change the ambient pressure, but the reading is always low.

    Can anyone suggest a way forward for me? Is it possible that some of the compensation parameters are wrong? Would a faulty pressure sensor be a likely cause? Any thoughts gratefully accepted.

     

    8 REPLIES 8
    BSTRobin
    Community Moderator

    Re: BMP280 Low Pressure Reading

    Hello draperworks,

    What's BMP280 driver code you used?
    There was BMP280 driver code and example code in github, could you run it and see the result again?
    https://github.com/BoschSensortec/BMP280_driver

    draperworks
    New Poster

    Re: BMP280 Low Pressure Reading

    Thank you for your prompt response. Very much appreciated.

    The driver code for my project was written by me in standard C. In brief, Microchip standard C code, Microchip XC8 Compiler (latest version), PIC16F1825 controller running at Fosc = 8MHz, BMP280 as a component of the Adafruit BMP280  module (SKU: ADA2651). The readings of the ADC values (adc_P and adc_T) and the compensation parameters (dig_T1 through dig_P9) are done by single burst reads in both cases.

    I will try the github driver software as you suggest and let you know how I get on. This may take a while as the XC8 Compiler is quite strict about its syntax and I would not classify myself as the world's leading C programmer.

    Thanks again. I will get back to you as soon as I can.

     

    BSTRobin
    Community Moderator

    Re: BMP280 Low Pressure Reading

    Hello draperworks,

    You are welcome.

    The sensor API in github has been validated by Bosch engineers and can accelerate your development.

    draperworks
    New Poster

    Re: BMP280 Low Pressure Reading

    Thank you again for your help so far.

    Firstly, the description of my development tools is wrong. I am using a Microchip PIC24FJ64GA002 controller and the XC16 compiler on MPLABX, v5.50. I wanted the performance of the PIC’s hardware multiplier. I apologise for the confusion.

    Next, I have rewritten my code to use the Github API. At this stage, I have only executed the “bmp2_init” function which reads the sensor ID and calibration parameters. The sensor ID returned is correct (0x58). The calibration results returned by the API are shown in the attached PDF. These results are identical to those from my original driver code.

    The I2C baud rate used to get these results is 100KHz. I have tried other baud rates with identical results.

    Do these results indicate any issue with the BMP280 sensor?

    Should I continue with the API and produce results for compensated temperature and pressure using the calibration data returned by the sensor?

     

    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