finitespace / BME280

Provides an Arduino library for reading and interpreting Bosch BME280 data over I2C, SPI or Sw SPI.
GNU General Public License v3.0
210 stars 105 forks source link

Filter is only applied to temperature and pressure #113

Closed FrederikWolter closed 3 years ago

FrederikWolter commented 4 years ago

Expected behavior

filter set with BME280 :: Filter_8
So it should be filtering temp, hum and pres; right?

Actual behavior

Temp and pres seem pretty smooth: grafik

grafik

But humidity isn´t: grafik

Steps to reporduce the behavior

I used the following code with library version 2.3.0 on an Wemos D1 mini:

BME280I2C::Settings settings( BME280::OSR_X1,
BME280::OSR_X1,
BME280::OSR_X1,
BME280::Mode_Forced,
BME280::StandbyTime_1000ms, BME280::Filter_8,
BME280::SpiEnable_False ); BME280I2C bme(settings);

void setup() { Serial.begin(9600); while (!Serial) {}

// Sensors
Serial.print("Starting Sensor ..."); Wire.begin(4, 5);
while (!bme.begin()) { Serial.println("waiting Sensor ..."); delay(50); } Serial.println("Sensors_done!"); }

void loop() { float temp(NAN), hum(NAN), pres(NAN); bme.read(pres, temp, hum, BME280::TempUnit_Celsius, BME280::PresUnit_hPa);

Serial.println(temp); Serial.println(hum); Serial.println(pres); delay(250000); }

finitespace commented 3 years ago

Hello, if you would like to try and solve this and submit a pull request, that would be awesome!

finitespace commented 3 years ago

Anyone else know why this might be? I have been away from the code for a while

david-lutz commented 3 years ago

Section 3.4.4 of the Datasheet (https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf) would seem to imply that the BME280 doesn't do IIR filtering for the humidity sensor.