Quantcast
Channel: Sensors - Arduino Forum
Viewing all articles
Browse latest Browse all 1071

Fall/Collapse Detection Problem - BME280

$
0
0

As a former software developer, I am newly interested in arduino, my goal is to get the information about whether my tree has fallen over or not. I don't want to do it using IMU (I found and used similar codes for IMU), I bought BME280 and I want to do it with it.

If you ask why I don't use lidar sensors, my tree can be 5 meters or 50 meters or 50cm, so I didn't want to use it or I didn't want to use it because I don't know which direction the tree will fall when it falls.

I wanted to calculate using BME280, I can pull the data from the meteorological center in my country every minute, I use the pressure information reduced to sea level from the data I pull (I use it instead of 1013.25 value. ) My problem is that as I threw in my codes, the incoming data is constantly moving +-2 meters in meters (I didn't take a long test, I'm sure it will be more mobile), which causes errors, now the sensor is just standing on my desk, I don't touch it in any way. According to the datasheet, it says that there may be +-7cm drift, but it upsets and surprises me that there is so much drift.

I don't understand if I'm making a mistake somewhere, in fact, all I want is for the sensor to take a fixed position, for example at 20 meters, and I want to be able to get how many cm it moves up and down, I don't care about values such as pressure, temperature, humidity, I just want information about the change of the position of the device. I have MPU6050, MPU6500 and 9DoF sensor but I want to do this with BME280 if possible, please help me, sorry for my English.

bme.setSampling(Adafruit_BME280::MODE_NORMAL,
                Adafruit_BME280::SAMPLING_X16,   // temperature
                Adafruit_BME280::SAMPLING_X16,   // pressure
                Adafruit_BME280::SAMPLING_X16,   // humidity
                Adafruit_BME280::FILTER_X16,
                Adafruit_BME280::STANDBY_MS_500);

void getPressure() {
  pressure = bme.readPressure();
  pressure = bme.seaLevelForAltitude(ALTITUDE, pressure); // ALTITUDE is coming on https://whatismyelevation.com my location
  pressure = pressure / 3386.39;  // Convert hPa to in/Hg
  Serial.print("Pressure: ");
  String pressureString = String(pressure, 2);
  Serial.print(pressureString);
  Serial.println("");
}

void getAltitude() {
  altitude = bme.readAltitude(SEA_LEVEL_PRESSURE); // this data is coming on local
  Serial.print("Altitude: ");
  String altitudeString = String(altitude, 5);
  Serial.print(altitudeString);
  Serial.println(" m");
}

12 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 1071

Trending Articles