Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMP280 Reading data using I2C from address 0x76

    Member

    BMP280 Reading data using I2C from address 0x76

    Hi all,

     

    Had a look on the forums and could not find a similar problem that I am experiencing. 

     

    I have designed a board using the BMP280, where I'd like to read off temperature, pressure and altitude using I2C. To do this, I pulled pin CSB high (+3.3V) to activate I2C as per datasheet recomendation and SDO was pulled low to use the address 0x76. 

    I am using an Atmega2560 (using arduino bootloader but on a standalone board) to attempt to read the I2C. I added the libraries needed and changed the access address to 0x76 instead of the default 0x77. However, when reading the BMP280, I get a constant temperature of 136.1C with very large pressure and altitude (do not remember exact values). The values do not change if I apply external pressure or temperature to the sensor. 

     

    Is there an another register besides the ID address I also have to set as I am using the 0x76 address? I cannot change the position of the SDO pin now due to the PCB already being made... Attached schematic if that helps. 

     

    NOTE: I also have an RTC and another sensor (MPU6050) on the same I2C lines. They both work. However, initially the MPU6050 also did not work with similar behaviour as the BMP280. Here the ID address had to be changed fromt the default 0x68 to 0x69. There are no ID address collisions between the I2C devices. 

     

    Any input that may give a direction will be greatly appreaciated! 🙂 

    EDIT: Pull up resistors have been added to the SCL and SDA lines!

    4 REPLIES 4
    Established Member

    Re: BMP280 Reading data using I2C from address 0x76

    Hi,

    Try to run an I2C scanner program to verify the addresses and sensor connection.

    Michael

    Highlighted
    Member

    Re: BMP280 Reading data using I2C from address 0x76


    @micha_pr wrote:

    Hi,

    Try to run an I2C scanner program to verify the addresses and sensor connection.

    Michael


    Thank you, however this has already been done! The device can be found on address 0x76 as expected.  It is just the returned values that do not make sense. 

     

     

    Established Member

    Re: BMP280 Reading data using I2C from address 0x76

    Can you publish the used program / library?

    It must work 🙂  ...

    Member

    Re: BMP280 Reading data using I2C from address 0x76


    @micha_pr wrote:

    Can you publish the used program / library?

    It must work 🙂  ...



    A bit slow of a response...

    Of course! I believe this is the arduino code that was used.

    *********************************************************************

    /***************************************************************************
    This is a library for the BMP280 humidity, temperature & pressure sensor

    Designed specifically to work with the Adafruit BMEP280 Breakout
    ----> http://www.adafruit.com/products/2651

    These sensors use I2C or SPI to communicate, 2 or 4 pins are required
    to interface.

    Adafruit invests time and resources providing this open source code,
    please support Adafruit andopen-source hardware by purchasing products
    from Adafruit!

    Written by Limor Fried & Kevin Townsend for Adafruit Industries.
    BSD license, all text above must be included in any redistribution
    ***************************************************************************/

    #include <Wire.h>
    //#include <SPI.h>
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BMP280.h>


    Adafruit_BMP280 bmp; // I2C
    //Adafruit_BMP280 bme(BMP_CS); // hardware SPI
    //Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

    void setup() {
    Serial.begin(9600);
    Serial.println(F("BMP280 test"));

    if (!bmp.begin()) {
    Serial.println("Could not find a valid BMP280 sensor, check wiring!");
    while (1);
    }
    }

    void loop() {
    Serial.print("Temperature = ");
    Serial.print(bmp.readTemperature());
    Serial.println(" *C");

    Serial.print("Pressure = ");
    Serial.print(bmp.readPressure());
    Serial.println(" Pa");

    Serial.print("Approx altitude = ");
    Serial.print(bmp.readAltitude(1013.25)); // this should be adjusted to your local forcase
    Serial.println(" m");

    Serial.println();
    delay(1000);
    }

    *********************************************************************

     

    And the Adafruit_BMP280.h header file had this section changed (0x77 to 0x76).

    /*=========================================================================
    I2C ADDRESS/BITS
    -----------------------------------------------------------------------*/
    #define BMP280_ADDRESS 0x76
    /*=========================================================================*/
     
    The  Adafruit_Sensor.h was left unchanged as its just declaring cosntants. The Adafruit_BMP280.cpp file was also left unchanged, and I had a peak inside and could not find anything that could relate to this issue. However, I added the files bellow if they can be of any help. 
     
    I used a reflow oven to mount the BMP280 to the PCB, could this have an effect on the sensors themselves? As I am able to get a response from the sensor, just no meaningfull sensor values. 
    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