Nikhil Mishra
Member
- Joined
- Mar 16, 2019
- Messages
- 11
- Reaction score
- 0
Hello!
I am building an Arduino Altimeter with BMP280. Fortunately for BMP280, it has an in Built IIR Filter. But the problem is am not sure how to change the settings for rocket specific application.
The Parameters are:
This article was very helpful in decoding the datasheet. There are some examples too.
The article also states that IIR filter makes BMP280 less sensitive to changes, which obviously is good for apogee detection right? Please clarify
Lastly,
I am aware Kalman Filter is a better alternative. But I wanted to keep my code light. So are there any appropriate alternatives (Filters) for BMP280?
I am new to building Model Rockets, it's challenging. But that's what I love about it!
Thanks a lot for helping!
I am building an Arduino Altimeter with BMP280. Fortunately for BMP280, it has an in Built IIR Filter. But the problem is am not sure how to change the settings for rocket specific application.
The Parameters are:
- Oversampling Setting
- IIR Filter (Ratio)
- set standby time
- Sensitive enough for Apogge Detection
- what else?
Code:
bmp280.setPressureOversampleRatio(2);
bmp280.setTemperatureOversampleRatio(1);
bmp280.setFilterRatio(4);
bmp280.setStandby(0);
This article was very helpful in decoding the datasheet. There are some examples too.
The article also states that IIR filter makes BMP280 less sensitive to changes, which obviously is good for apogee detection right? Please clarify
Lastly,
I am aware Kalman Filter is a better alternative. But I wanted to keep my code light. So are there any appropriate alternatives (Filters) for BMP280?
I am new to building Model Rockets, it's challenging. But that's what I love about it!
Thanks a lot for helping!
Code:
#include <Wire.h>
#include "i2c.h"
#include "i2c_BMP280.h"
BMP280 bmp280;
void setup()
{
Serial.begin(115200);
Serial.print("Probe BMP280: ");
if (bmp280.initialize()) Serial.println("Sensor found");
else
{
Serial.println("Sensor missing");
while (1) {}
}
//Calibration Settings
bmp280.setPressureOversampleRatio(2);
bmp280.setTemperatureOversampleRatio(1);
bmp280.setFilterRatio(4);
bmp280.setStandby(0);
// onetime-measure:
bmp280.setEnabled(0);
bmp280.triggerMeasurement();
}
void loop()
{
bmp280.awaitMeasurement();
float temperature;
bmp280.getTemperature(temperature);
float pascal;
bmp280.getPressure(pascal);
static float meters, metersold;
bmp280.getAltitude(meters);
metersold = (metersold * 10 + meters)/11;
bmp280.triggerMeasurement();
Serial.print(" HeightPT1: ");
Serial.print(metersold);
Serial.print(" m; Height: ");
Serial.print(meters);
Serial.print(" Pressure: ");
Serial.print(pascal);
Serial.print(" Pa; T: ");
Serial.print(temperature);
Serial.println(" C");
}