Git Product home page Git Product logo

Comments (8)

coelner avatar coelner commented on July 21, 2024 1

@finitespace I think we need a deep dive into the code and fix rare cases. Maybe some things could be fixed by integrate the pending pull requests.

from bme280.

finitespace avatar finitespace commented on July 21, 2024

The datasheet is a little ambiguous, but it sounds like we could do a measurement without filtering and this will cause the filter buffer to be initialized with values. Is that your interpretation as well? See the section under Table 6.

from bme280.

coelner avatar coelner commented on July 21, 2024

Yes, I see it in the same way. I'm not sure why we get no valid values for the first time. They should be copied directly like it is done for the following measurements.

from bme280.

finitespace avatar finitespace commented on July 21, 2024

Alright, I have added a routine to initialize the filter buffer. Could you pull down the filtering branch and check if it fixes the problem?

from bme280.

coelner avatar coelner commented on July 21, 2024

Yes, it does work for me. I used your BME_280_I2C_Test sketch.

Found BME280 sensor! Success.
Temp: 22.42°C		Humidity: 44.26% RH		Pressure: 97900.85Pa
Temp: 22.33°C		Humidity: 44.31% RH		Pressure: 97908.03Pa
Temp: 22.32°C		Humidity: 44.28% RH		Pressure: 97907.81Pa
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
Temp: 23.53°C		Humidity: 63.39% RH		Pressure: 69626.69Pa
Temp: 24.06°C		Humidity: 40.52% RH		Pressure: 97906.53Pa
Temp: 24.07°C		Humidity: 40.53% RH		Pressure: 97906.59Pa
Temp: 24.07°C		Humidity: 40.51% RH		Pressure: 97906.31Pa

I disconnect the BME from 3.3V (nan values) and reattach it.

from bme280.

AndreKR avatar AndreKR commented on July 21, 2024

@coelner In your output the first read after your disconnect is still way off, especially the pressure. Is this still to be expected?

from bme280.

coelner avatar coelner commented on July 21, 2024

@AndreKR

1)
Could not find BME280 sensor!
Could not find BME280 sensor!
Could not find BME280 sensor!
2)
Found BME280 sensor! Success.
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 26.73°C		Humidity: 66.95% RH		Pressure: 101237.52Pa
Temp: 26.70°C		Humidity: 48.61% RH		Pressure: 101237.36Pa
Temp: 26.66°C		Humidity: 41.93% RH		Pressure: 101237.63Pa
Temp: 26.62°C		Humidity: 38.96% RH		Pressure: 101237.44Pa
Temp: 26.57°C		Humidity: 37.40% RH		Pressure: 101237.91Pa
Temp: 26.51°C		Humidity: 36.45% RH		Pressure: 101237.97Pa
Temp: 26.46°C		Humidity: 35.89% RH		Pressure: 101237.78Pa
Temp: 26.40°C		Humidity: 35.58% RH		Pressure: 101237.60Pa
Temp: 26.34°C		Humidity: 35.41% RH		Pressure: 101237.97Pa
Temp: 26.28°C		Humidity: 35.18% RH		Pressure: 101238.09Pa
Temp: 25.36°C		Humidity: 33.31% RH		Pressure: 101231.35Pa
Temp: 25.36°C		Humidity: 33.13% RH		Pressure: 101231.18Pa
Temp: 25.36°C		Humidity: 36.83% RH		Pressure: 101231.12Pa
3)
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
Temp: nan°C		Humidity: nan% RH		Pressure: nanPa
4)
Temp: 25.37°C		Humidity: 38.29% RH		Pressure: 101230.91Pa
Temp: 25.39°C		Humidity: 47.79% RH		Pressure: 101231.15Pa
Temp: 25.42°C		Humidity: 45.15% RH		Pressure: 101231.32Pa
Temp: 25.44°C		Humidity: 39.14% RH		Pressure: 101231.70Pa
Temp: 25.65°C		Humidity: 33.12% RH		Pressure: 101230.97Pa
5)
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
Temp: 22.18°C		Humidity: 68.12% RH		Pressure: 73302.31Pa
6)
Temp: 26.85°C		Humidity: 47.34% RH		Pressure: 101235.56Pa
Temp: 26.85°C		Humidity: 48.57% RH		Pressure: 101235.53Pa

To sum it up:

  1. No connection over i2c but power
  2. Connection over i2c
  3. No connection over i2c but power
  4. reattached i2c
  5. removed GND
  6. reattached GND

the current i2c example was used

from bme280.

AndreKR avatar AndreKR commented on July 21, 2024

So in your case at least the first value is off, too.

Here are 25 pressure measurements (in hPa) I took right after switching on the sensor:

705.31
705.31
705.31
1027.43
1027.43
1027.43
1027.47
1027.47
1027.47
1027.47
1027.50
1027.50
1027.50
1027.46
1027.46
1027.46
1027.50
1027.50
1027.43
1027.43
1027.43
1027.41
1027.41
1027.41
1027.41

It puzzles me why there are 3 wrong values and then they start to be plausible. Is it possible that in addition to the first value being wrong, I'm also reading the same value multiple times? I'm in forced mode (default), so each bme.read() should trigger one measurement and wait for its completion, right?

from bme280.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.