kdsoo
Posts: 8
Joined: Fri Aug 30, 2013 8:30 am

Bosch barometer series accuracy

Wed Sep 23, 2015 4:04 am

Hi,

I suppose the most famous barometer sensor affordable on the market is barometer sensor series from Bosch.

I bought tens of BMP085, BMP180 breakout board from Adafruit and found something weird. The value of temperature and pressure coming from each BMP180 are so different.

for instance sensor A is giving

Code: Select all

Temperature = 27.90 *C
Pressure = 100274 Pa
Altitude = 87.70 meters
Pressure at sealevel (calculated) = 100276 Pa
Real altitude = 101.90 meters
but sensor B is giving

Code: Select all

Temperature = 27.30 *C
Pressure = 100317 Pa
Altitude = 84.60 meters
Pressure at sealevel (calculated) = 100312 Pa
Real altitude = 99.04 meters
sensed at the same time in same place on the same breadboard.

I used Adafruit bmp library which is apparently compensating sensed value with calibration table in EEPROM.

Is it normal?

No way to make it accurate in absolute representation? I'm planning to use Bosch barometer sensor to localize statically deployed Rpi but if fetching accurate value from the sensor is impossible, I need to find out my plan B.
FYI, the relative pressure variation is ok when I mobilize the sensor like moving between floors. It senses the floor change.
The only problem is the variation of sensed value among sensors in the same place and condition.

User avatar
DougieLawson
Posts: 42481
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Bosch barometer series accuracy

Wed Sep 23, 2015 5:05 pm

Each genuine Bosch BMP180 sensor is supposed to have it's own calibration data. You read that and use the returned values in some complex maths to get the temp and pressure.

Try using
https://github.com/keiichishima/RPiSens ... /bmp180.py
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

kdsoo
Posts: 8
Joined: Fri Aug 30, 2013 8:30 am

Re: Bosch barometer series accuracy

Thu Sep 24, 2015 4:20 am

Hi,

Thank you for your pointer. I tried the python code and faced same problem. ;-(
Going through the code, the baseline seems to be the same as the Adafruit library.
According to the library, it does like follows

Code: Select all

boolean Adafruit_BMP085::begin(uint8_t mode) {
  if (mode > BMP085_ULTRAHIGHRES) 
    mode = BMP085_ULTRAHIGHRES;
  oversampling = mode;

  Wire.begin();

  if (read8(0xD0) != 0x55) return false;

  /* read calibration data */
  ac1 = read16(BMP085_CAL_AC1);
  ac2 = read16(BMP085_CAL_AC2);
  ac3 = read16(BMP085_CAL_AC3);
  ac4 = read16(BMP085_CAL_AC4);
  ac5 = read16(BMP085_CAL_AC5);
  ac6 = read16(BMP085_CAL_AC6);

  b1 = read16(BMP085_CAL_B1);
  b2 = read16(BMP085_CAL_B2);

  mb = read16(BMP085_CAL_MB);
  mc = read16(BMP085_CAL_MC);
  md = read16(BMP085_CAL_MD);
.....
As the datasheet says bmp085 and bmp180 register addresses are compatible so the code works right away on bmp180 as well.

I'll dig more but I'm afraid that Bosch's barometer is not proper device to measure "absolute" value. Anyway for relative air pressure change measurement works fine but just that doesn't meet my purpose.



DougieLawson wrote:Each genuine Bosch BMP180 sensor is supposed to have it's own calibration data. You read that and use the returned values in some complex maths to get the temp and pressure.

Try using
https://github.com/keiichishima/RPiSens ... /bmp180.py

User avatar
DougieLawson
Posts: 42481
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: Bosch barometer series accuracy

Thu Sep 24, 2015 7:40 pm

You can't get an absolute value unless you are at mean sea level (MSL) or adjust for your altitude above MSL.

If you know the current pressure at MSL you can use a barometer reading to get your altitude.

Pick one or the other
1. Known altitude and measured pressure
2. Known pressure and measured altitude
You can't measure both simultaneously.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “Advanced users”