Go Down

Topic: setting bmp280 (Read 3169 times) previous topic - next topic

primiTest

Oct 07, 2016, 04:26 pm Last Edit: Oct 07, 2016, 04:48 pm by primiTest
hi, i buy mpu9250+  bmp280 ( here ) .
I have already tried to use to good effect the mpu sensor, however, I have trouble starting the bmp.
doing it I found these results scani2c for arduino:

I2C device found at address 0x0C  !
I2C device found at address 0x68  !
I2C device found at address 0x76  !

at 0x68 i have the mpu.. and i find that 0x76 is about BME280... 0x0c i think is for the compass(?)

i try to use the library on github of adafruit, but noway...i see that in the header file there is:
Code: [Select]

bool Adafruit_BMP280::begin(uint8_t a) {
  _i2caddr = a;

  if (_cs == -1) {
    // i2c
    Wire.begin();
  } else {
    digitalWrite(_cs, HIGH);
    pinMode(_cs, OUTPUT);

    if (_sck == -1) {
      // hardware SPI
      SPI.begin();
    } else {
      // software SPI
      pinMode(_sck, OUTPUT);
      pinMode(_mosi, OUTPUT);
      pinMode(_miso, INPUT);
    }
  }

  if (read8(BMP280_REGISTER_CHIPID) != 0x58)
    return false;

  readCoefficients();
  write8(BMP280_REGISTER_CONTROL, 0x3F);
  return true;
}


i try to modify the address but no good solution...
how to solve?

DedeHai

And why is that not a good solution?
0x76 is definitely the BME's address.

primiTest

because it doesn't work..
i try to modify 0x58 with 0x76..

primiTest

#3
Oct 07, 2016, 11:56 pm Last Edit: Oct 08, 2016, 12:05 am by primiTest
i try also with 0x0c  .
maybe i should modify the value of the register..? but i don't know which i can take, i try to see in the datasheet but i don't find any name matches.

i search better and in the ad of ebay there is also this library https://github.com/BoschSensortec/BMP280_driver , should i use init and stop with this? 

i want to use it for altitude, and maybe for temperature

floresta

When I was using the Adafruit library to deal with two BME280s I did something like this:


Code: [Select]
// Create two Adafruit_BME280 objects
Adafruit_BME280 bme01; // I2C on default hardware pins
Adafruit_BME280 bme02; // I2C on default hardware pins

. . .

  if (!bme01.begin()) // default I2C address is 0x77
  {
    Serial.println("Could not find BME280 sensor 01, check wiring and I2C address!");
 while (1); // don't bother continuing if there's no sensor
  }
 
  if (!bme02.begin(0x76)) // jumper SDO to GND to change to I2C address 0x76
  {
    Serial.println("Could not find BME280 sensor 02, check wiring and I2C address!");
 while (1); // don't bother continuing if there's no sensor
  }

. . .


Perhaps this will help you.

Don

primiTest

#5
Oct 08, 2016, 09:49 am Last Edit: Oct 08, 2016, 10:21 am by primiTest
yesss,! thanks! now it goes!
just the last question
now i can read this value at home, with the pressure at sea level of 1016.00
Temperature = 26.10 *C
Pressure = 101735.11 Pa
1017.35 Pa correct
Approx altitude = -10.99 m
Humidity = 0.00 %

do you think is it correct?  Because it isn't so hot here !!
i have also copied the function for humidity from bme280 to bmp280, because i see that the other config values are the same..

floresta

Not knowing where you live I really can't comment on the accuracy.

The temperature reading on these devices is that of its chip itself which is subject to some 'self heating'.  The reading is probably a degree or so high.

The BMP280 does not include a humidity sensor so that function will not be of much help with your device.

You have now exhausted my knowledge of these sensors, I've only had mine for a short while.

Don

outsider

#7
Oct 08, 2016, 04:27 pm Last Edit: Oct 08, 2016, 04:32 pm by outsider
If you know the current sea level pressure and your elevation above sea level in meters, multiply elevation by 0.125 and subtract that from sea level pressure, your sensor should read close to that.
Example: Elavation = 100 meters, sea level = 1015 hPa, 100 X 0.125 = 12.5 hPa so sensor should read 1015 - 12.5 = 1002.5 hPa or 100250 Pa, approximately.

primiTest

ok, i know and use the current sea level pressure  of my city...
but the elevation of my home or of my city?

in the meantime i try and i take also another negative value :  -24.48 instead of -11.92.

outsider

Your home. Which city? Do you know the elevation of your city? How did you determine the sea level pressure? Is your home elevation very different from that of the city?

floresta

#10
Oct 08, 2016, 10:13 pm Last Edit: Oct 08, 2016, 10:15 pm by floresta
Quote
... but the elevation of my home or of my city?
Use the elevation of the sensor itself (which may be higher or lower than that of the home it is in)  to correct the pressure value you read to that of sea level. 

This 'sea level' value should agree with the reading given by a nearby location such as a radio station assuming that value has also been corrected to sea level (which is typically the case).

Don


primiTest

ok.. i search in one sites my city and i bring the elevation of a common house..
i see in the meantime that the differences between values with these configuration, changing altidude, are the same!

there is a method on pc for verify if the value of -24 m is correct? i want to count the distance of my position in the house to the ground ..
for now the only idea is mesure both by ground and my house and calculate the difference

johnroland51

Are the accuracy specs for these sensors realistic?   Are they dumping out of spec sensors on ebay?  For example Ebay item 141975980328?  I have purchased 2 which are both a few degres off on temp and similar error on pressure.   Is there a better source for accurate sensors?    Thanks /John

Go Up