Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. BME 280 how to use it?

BME 280 how to use it?

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 4 Posters 5.3k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wardur
    wrote on last edited by
    #1

    I bought a BME 280 and don´t know how to wire it, because the sensor is different to the normal ones.
    0_1504641730954_11.jpg

    mfalkviddM YveauxY 2 Replies Last reply
    0
    • W wardur

      I bought a BME 280 and don´t know how to wire it, because the sensor is different to the normal ones.
      0_1504641730954_11.jpg

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @wardur looks to be the same as https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout/pinouts I think?

      For i2c, you only connect Vcc, Gnd, Scl and Sda.

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wardur
        wrote on last edited by gohan
        #3
        /***************************************************************************
          This is a library for the BME280 humidity, temperature & pressure sensor
          Designed specifically to work with the BME280 Breakout board
          ----> http://www.adafruit.com/products/2650
          This sketch only supports the I2C bus for connection.
         ***************************************************************************/
        
        #include <Wire.h>
        #include "cactus_io_BME280_I2C.h"
        
        // Create the BME280 object
        BME280_I2C bme;          
        // I2C using default 0x77 
        // or
        //BME280_I2C bme(0x76);  // I2C using address 0x76
        
        void setup() {
          Serial.begin(9600);
          Serial.println("Bosch BME280 Barometric Pressure - Humidity - Temp Sensor | cactus.io"); 
        
          if (!bme.begin()&&!bmee.begin()) {
            Serial.println("Could not find a valid BME280 sensor, check wiring!");
            while (1);
          }
        
          bme.setTempCal(-1);
          
          Serial.println("Pressure\tHumdity\t\tTemp\t\tTemp");
          
        }
        
        void loop() {
        
            bme.readSensor(); 
          
            Serial.print(bme.getPressure_MB()); Serial.print("\t\t");    // Pressure in millibars
            Serial.print(bme.getHumidity()); Serial.print("\t\t");
            Serial.print(bme.getTemperature_C()); Serial.print(" *C\t");
            Serial.print(bme.getTemperature_F()); Serial.println(" *F\t");
        
            // add a 2 second delay to slow down the output
            delay(2000);
        }
        

        i use this code and he can´t find a device:/

        gohanG 1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #4

          Try to run an I2C scanner, it could be the sensor has a different address

          1 Reply Last reply
          0
          • W wardur

            I bought a BME 280 and don´t know how to wire it, because the sensor is different to the normal ones.
            0_1504641730954_11.jpg

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @wardur make sure you power it at the correct level (see the breakout's specs) and use the same power level in communication to the arduino. Either use the same level for bme and arduino, or use a level shifter.

            http://yveaux.blogspot.nl

            1 Reply Last reply
            1
            • W wardur
              /***************************************************************************
                This is a library for the BME280 humidity, temperature & pressure sensor
                Designed specifically to work with the BME280 Breakout board
                ----> http://www.adafruit.com/products/2650
                This sketch only supports the I2C bus for connection.
               ***************************************************************************/
              
              #include <Wire.h>
              #include "cactus_io_BME280_I2C.h"
              
              // Create the BME280 object
              BME280_I2C bme;          
              // I2C using default 0x77 
              // or
              //BME280_I2C bme(0x76);  // I2C using address 0x76
              
              void setup() {
                Serial.begin(9600);
                Serial.println("Bosch BME280 Barometric Pressure - Humidity - Temp Sensor | cactus.io"); 
              
                if (!bme.begin()&&!bmee.begin()) {
                  Serial.println("Could not find a valid BME280 sensor, check wiring!");
                  while (1);
                }
              
                bme.setTempCal(-1);
                
                Serial.println("Pressure\tHumdity\t\tTemp\t\tTemp");
                
              }
              
              void loop() {
              
                  bme.readSensor(); 
                
                  Serial.print(bme.getPressure_MB()); Serial.print("\t\t");    // Pressure in millibars
                  Serial.print(bme.getHumidity()); Serial.print("\t\t");
                  Serial.print(bme.getTemperature_C()); Serial.print(" *C\t");
                  Serial.print(bme.getTemperature_F()); Serial.println(" *F\t");
              
                  // add a 2 second delay to slow down the output
                  delay(2000);
              }
              

              i use this code and he can´t find a device:/

              gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #6

              @wardur this is my stripped down code I use to read data from the BME280

              Adafruit_BME280 bme; // I2C
              uint8_t BME280_i2caddr = 0x76;
              ..
              MyMessage msgHum(CHILD_ID_HUM, V_HUM);
              MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
              MyMessage msgPress(CHILD_ID_BARO, V_PRESSURE);
              ..
              void setup()
              {
              	Serial.begin(MY_BAUD_RATE);
              	metric = getControllerConfig().isMetric;  // was getConfig().isMetric; before MySensors v2.1.1
              	Wire.begin(); // Wire.begin(sda, scl)
              	if (!bme.begin(BME280_i2caddr)) {
              		Serial.println("Could not find a valid BME280 sensor, check wiring!");
              		while (1);
              	}
              	// weather monitoring
              	Serial.println("-- Weather Station Scenario --");
              	Serial.println("forced mode, 1x temperature / 1x humidity / 1x pressure oversampling,");
              	Serial.println("filter off");
              	bme.setSampling(Adafruit_BME280::MODE_FORCED,
              		Adafruit_BME280::SAMPLING_X1, // temperature
              		Adafruit_BME280::SAMPLING_X1, // pressure
              		Adafruit_BME280::SAMPLING_X1, // humidity
              		Adafruit_BME280::FILTER_OFF,
              		Adafruit_BME280::STANDBY_MS_1000);
              	// suggested rate is 1/60Hz (1m)
              
              	
              }
              void loop()
              {
              	bme.takeForcedMeasurement();
              	float HUM = bme.readHumidity();
              	float TEMP = bme.readTemperature();
              	float BARO = bme.readPressure() / 100;
              	send(msgHum.set(HUM, 2));
              	send(msgTemp.set(TEMP, 2));
              	send(msgPress.set(BARO, 1));
              
              }
              
              1 Reply Last reply
              2
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              20

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular