Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: BME280 Teensy Library

  1. #1
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    537

    BME280 Teensy Library

    Hello all,

    I created an Arduino library for the Bosch Sensortec BME280 environmental sensor with support for all Teensy 3.x and LC devices:
    https://github.com/bolderflight/BME280

    In case you're not aware, the BME280 is an integrated environmental sensor, which combines high linearity, high accuracy sensors for pressure, temperature, and humidity in a compact LGA package.

    This library supports I2C and SPI communication with the BME280 sensor. It also enables easy setup of the BME280 oversampling, IIR filter settings, and standby time. Or if those are not explicitly set, default values are used, which should provide good performance over a variety of applications. Data is collected using multi-byte reads, eliminating potential time skew in the results, and results are converted to SI units. I think the library provides access to the most used functionality of the BME280, is easy to use, and has great performance. I hope it is of use to the community and I'd love any feedback or suggestions.

    Best!
    Brian

  2. #2
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    537
    FYI, I've updated this library to use the new SPIClass available in Teensyduino 1.37 and newer. The main difference is that SPI declaration can now indicate directly which SPI bus is used. Additionally the setMOSI, setMISO, and setSCK functions can be used to set the alternate pins.

    For example, using SPI bus 0, the default pins, and pin 10 as the chip select, the object declaration can be simplified to:
    Code:
    BME280 bme(10);
    void setup() {
      bme.begin();
    }
    Using SPI bus 1 and switching to pin 20 for SCK would be:
    Code:
    BME280 bme(10,&SPI1);
    void setup() {
      SPI1.setSCK(20);
      bme.begin();
    }
    Please note that the chip select pin can be any available digital pin.

    Best,
    Brian

  3. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    149
    Question - been using models BME280 and BMP280 for approximately 20 months in some environmental chambers. First batch lasted about 10 to 11 months, and second and third batches ok no more than 6 months. Equipment test profiles have not changed and test instrument power is clean (battery power to Teensy, and Teensy 3.3v power to sensors with LC filters). Am assuming Bosch fab issues until they answer my questions.

    Anyone else noticing reduced MTTF for these sensors?

  4. #4
    Junior Member
    Join Date
    Feb 2017
    Posts
    12
    Was it possble for water to condense onto the sensor? This would damage it and I have a sensor here that is reading ~2K high due to contact with liquid water.

    @ brtaylor:
    Why does your library have the same name as all the other librarys?
    Last edited by Eheran; 10-24-2017 at 06:28 PM.

  5. #5
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    537
    Quote Originally Posted by Eheran View Post
    Was is possble for water to condense onto the sensor? This would damage it and I have a sensor here that is reading ~2K high due to contact with liquid water.

    @ brtaylor:
    Why does your library have the same name as all the other librarys?
    I reckon I could have called it "BME280_t3"...but it also supports Teensy LC.

  6. #6
    Senior Member
    Join Date
    Jan 2014
    Posts
    149
    Condensation not likely, as same problem with sensors in all of my employer's environmental chambers at both factory and engineering sites. And my code running the chambers reads a parametric look table to avoid approaching the dew point. So now running several sensor models 'in parallel' and have changed code to use heater more often. If employer allows, will publish findings in a few months to this thread, pending any zombie apocalypse.

    Library naming -> yet another reason not to use the arduino environment. You will have to pry my cold, dead hands from cmake and SCons.

  7. #7
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    641
    Do the sensors stop working completely, or just the humidity sensing? Does temperature and pressure sensing continue to work? Am interested in what you eventually find is the problem.

    I haven't encountered any problems but I don't run them continuously.

  8. #8
    Junior Member
    Join Date
    Apr 2018
    Posts
    12

    BME280 Possible Moisture Problem

    Quote Originally Posted by linuxgeek View Post
    Do the sensors stop working completely, or just the humidity sensing? Does temperature and pressure sensing continue to work? Am interested in what you eventually find is the problem.

    I haven't encountered any problems but I don't run them continuously.
    Looks like I might be way too late to the party but I have encountered this situation before. One time our manufacturing department ran some boards with environmentally sealed LSI precision resistor networks through their aqueous cleaning system (AKA "the dishwasher"). That totally changed the resistance values with predictable results...

    I suggested that they pull a space-level vacuum on the boards in order to boil off all the moisture.

    The boards returned to their original performance.

    Hope this helps someone...

  9. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    149
    Contamination, per se, was not the problem. We had a batch of 29 sensors with deteriorating tolerances after a few months of several cycles per day (20 to 80%RH, -20 to 40C), of working 24/7. We bought another batch of sensors and life is much better: the IngSoc Emperor is happy, and the proles sing tribute to the party while working the fields.

    Immersing a BMP280 in anything is most very ungood. And a "space-level vacuum" is doubleplus ungood for these type of sensors. The Ministries of Truth and Plenty has provided:

    ae-bst.resource.bosch.com/media/_tech/media/application_notes/BST-BMP280-HS000-07.pdf

  10. #10
    Junior Member
    Join Date
    Apr 2018
    Posts
    12
    Thanks for the fast reply!

    I wasn't suggesting pulling a hard vacuum on the baro sensors, apologies if it sounded that way. I was merely telling a story about how we had dried out some environmentally (that is, non-hermetically) sealed parts. I'm glad your new batch behaved themselves...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •