bmp 280 false sensing result

asad

Active member
why the bmp 280 altimeter showing false result and whay it varies continuously after each disconnecting and connecting
 
Can you show us what your results actually are?
When I look at this Adafruit guide, I see varying results as well when taking a sample every 2 seconds:

1704183042081.png


Paul
 
why the bmp 280 altimeter showing false result and whay it varies continuously after each disconnecting and connecting
Did you buy your BMP280 from a reputable supplier? Is it supplied with a stable 3.3V? Which oversampling setting are you using?
 
Would help dramatically if you identified the BMP280 you are using - ie. link, What Teensy, what sketch and library. Not really sure what you mean by false readings. Also what @MarkT and @PaulS are also germane
 
thanks for replaying.
the result is. the altitude now is 41 but in morning was 32 and befor 2 days it was 45.
the pressure was Adjusted to local forecast!
Serial.print(bmp.readAltitude(1019)); /*
 

Attachments

  • Capture.JPG
    Capture.JPG
    64.2 KB · Views: 58
@asad
Sorry really can not help you - you have not answered any questions that we asked so have no idea what you are doing.
 
dears @mjs513 and @KurtE and @MarkT
- I'm using bmp280 with teensy4.1. in rocket flight computer. the flight computer code is as below. the bmp is supplied by 3.3volt.
bmp280showed different altitude result for same place as it appears in photo the altitude now is 41.3 meter but in morning it was 32 m and before 2 days it was 45.
Note: the pressure was Adjusted to local forecast!>>>>>Serial.print(bmp.readAltitude(1019)); /*


[/U] #include <Wire.h> #include <SPI.h> #include <Adafruit_BMP280.h> #define BMP_SCK (13) #define BMP_MISO (12) #define BMP_MOSI (11) #define BMP_CS (10) Adafruit_BMP280 bmp(&Wire2); // I2C //Adafruit_BMP280 bmp(BMP_CS); // hardware SPI //Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK); void setup() { Serial.begin(9600); while ( !Serial ) delay(100); // wait for native usb Serial.println(F("BMP280 test")); unsigned status; //status = bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID); status = bmp.begin(); if (!status) { Serial.println(F("Could not find a valid BMP280 sensor, check wiring or " "try a different address!")); Serial.print("SensorID was: 0x"); Serial.println(bmp.sensorID(),16); Serial.print(" ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n"); Serial.print(" ID of 0x56-0x58 represents a BMP 280,\n"); Serial.print(" ID of 0x60 represents a BME 280.\n"); Serial.print(" ID of 0x61 represents a BME 680.\n"); while (1) delay(10); } /* Default settings from datasheet. */ bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */ Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */ Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */ Adafruit_BMP280::FILTER_X16, /* Filtering. */ Adafruit_BMP280::STANDBY_MS_1); /* Standby time. */ } void loop() { Serial.print(F("Temperature = ")); Serial.print(bmp.readTemperature()); Serial.println(" *C"); Serial.print(F("Pressure = ")); Serial.print(bmp.readPressure()); Serial.println(" Pa"); Serial.print(F("Approx altitude = ")); Serial.print(bmp.readAltitude(1019)); /* Adjusted to local forecast! */ Serial.println(" m"); Serial.println(); delay(1); } [U]
 

Attachments

  • Capture.JPG
    Capture.JPG
    89 KB · Views: 49
The serial monitor dump you show is not from the code you included in above message.
I see Pitch Error and Roll Error and several lines with 12 datapoints.
Did you also run the exact sketch that you included above? I guess you took the sketch from here and changed the last line to delay(1); from delay(2000);.

Paul
 
Very confused on what you mean by false result - if you mean that your reading will be different from day to day or hour to hour. Yes it will be if you don't update your sea level pressure for the area close to.... Note the sea level reading will also be varying just as a note but it looks like you have sea level pressure fix at 1019mb.

The 1019mb is the standard sea level pressure but you need to use the one for your area. For instance I have a major airport (LGA) near me so I use METAR data (https://aviationweather-bldr.ncep.noaa.gov/metar) from the airport. For me right now sea level pressure is 1013.4mb not the standard 1019.

Other note is that the higher the oversampling rate is for pressure and temperature the more accuarate the altitude so you need to make adjust accordingly. Even with that you altitude will not be absolute - may vary by as much as 0.3meters or more depending on your settings.

I don;t have a bmp280 but I do have a bme280 - settings that I am using now are:
Code:
    bme.setSampling(Adafruit_BME280::MODE_NORMAL,
                    Adafruit_BME280::SAMPLING_X8,  // temperature
                    Adafruit_BME280::SAMPLING_X16, // pressure
                    Adafruit_BME280::SAMPLING_X1,  // humidity
                    Adafruit_BME280::FILTER_X16,
                    Adafruit_BME280::STANDBY_MS_0_5 );


Hope this helps - may want to read the data sheet as well for the BMP280
 

Attachments

  • Screenshot 2024-01-04 144941.png
    Screenshot 2024-01-04 144941.png
    71.3 KB · Views: 55
Are we sure elevations will be the same even if in the same location? I'm pretty sure these units compute elevation from pressure. The constant passed into readAltitude() simply compensates for atmospheric pressure at sea level. The problem with these units is using pressure to compute altitude--namely because pressure changes frequently--especially from changing weather.

Here are results from my BME-280 sitting on my desk for 60 minutes. Notice the 7 feet of elevation difference even though the unit is in a static location. I've even tried other sensors such as the MS583702BA01-50 (13cm altitude resolution), but the same issue. I've had to add "zeroing" code to get a reliable starting point.
 

Attachments

  • BME-280.png
    BME-280.png
    49.8 KB · Views: 52
Hi Kris. Yep that’s another issue. Most of these sensors have calibration curves built in based on temp and press but just from temp changes alone you are going to se variations as you pointed out. Think tomorrow will do some testing on the sensors will be interesting to see the results. And pull out the data sheets.
 
Are we sure elevations will be the same even if in the same location? I'm pretty sure these units compute elevation from pressure. The constant passed into readAltitude() simply compensates for atmospheric pressure at sea level. The problem with these units is using pressure to compute altitude--namely because pressure changes frequently--especially from changing weather.

Here are results from my BME-280 sitting on my desk for 60 minutes. Notice the 7 feet of elevation difference even though the unit is in a static location. I've even tried other sensors such as the MS583702BA01-50 (13cm altitude resolution), but the same issue. I've had to add "zeroing" code to get a reliable starting point.
You need to measure outside because buildings can be subject to wind-induced and/or A/C pressure noise I think.
 
The serial monitor dump you show is not from the code you included in above message.
I see Pitch Error and Roll Error and several lines with 12 datapoints.
Did you also run the exact sketch that you included above? I guess you took the sketch from here and changed the last line to delay(1); from delay(2000);.

Paul
yes the atached result photo was for the my flight computer code which includes bmp280 also. here in this atached file i gave a result from i2c example of the adafruit bmp280 library and as it aoears the altitude is 49 meter while it was 41.3 in past photo.
 

Attachments

  • Capture01.JPG
    Capture01.JPG
    62.7 KB · Views: 49
Very confused on what you mean by false result - if you mean that your reading will be different from day to day or hour to hour. Yes it will be if you don't update your sea level pressure for the area close to.... Note the sea level reading will also be varying just as a note but it looks like you have sea level pressure fix at 1019mb.

The 1019mb is the standard sea level pressure but you need to use the one for your area. For instance I have a major airport (LGA) near me so I use METAR data (https://aviationweather-bldr.ncep.noaa.gov/metar) from the airport. For me right now sea level pressure is 1013.4mb not the standard 1019.

Other note is that the higher the oversampling rate is for pressure and temperature the more accuarate the altitude so you need to make adjust accordingly. Even with that you altitude will not be absolute - may vary by as much as 0.3meters or more depending on your settings.

I don;t have a bmp280 but I do have a bme280 - settings that I am using now are:
Code:
    bme.setSampling(Adafruit_BME280::MODE_NORMAL,
                    Adafruit_BME280::SAMPLING_X8,  // temperature
                    Adafruit_BME280::SAMPLING_X16, // pressure
                    Adafruit_BME280::SAMPLING_X1,  // humidity
                    Adafruit_BME280::FILTER_X16,
                    Adafruit_BME280::STANDBY_MS_0_5 );


Hope this helps - may want to read the data sheet as well for the BMP280
thanks for your widly explantation. the sea level pressure on my place was 1019 as i saw it on weather website and today it is 1018 in some websites and 1020 in others. the problem is even i put 1018 in the code the result still varying but in small range(2 or 3 meter). so the question is, how i can control my rocket in the air and make it stable if there are 2 or 3 meter varies in altitude detection? and there is a way to make the sensing more precise?
 
Are we sure elevations will be the same even if in the same location? I'm pretty sure these units compute elevation from pressure. The constant passed into readAltitude() simply compensates for atmospheric pressure at sea level. The problem with these units is using pressure to compute altitude--namely because pressure changes frequently--especially from changing weather.

Here are results from my BME-280 sitting on my desk for 60 minutes. Notice the 7 feet of elevation difference even though the unit is in a static location. I've even tried other sensors such as the MS583702BA01-50 (13cm altitude resolution), but the same issue. I've had to add "zeroing" code to get a reliable starting point.
ok thanks
so there is Noway to specified the elevation by sensors precisely?
 
You could consider using something like this, a Radio Altimeter intended for use by modelers that compete in international rocketry competitions.
EDIT:
Oops Wrong, this uses Barometric Pressure as well, Sorry.
 
Last edited:
Back
Top