Read out BME680 and BME280 simultaneously

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
GaunerBerlin
 
Posts: 2
Joined: Sun Apr 03, 2022 4:49 am

Read out BME680 and BME280 simultaneously

Post by GaunerBerlin »

Hey,
I want to read out the BME280 and BME680 Temp/Hum-Sensors on the same I2C interface of a ESP8266.
I have connected both in parallel to VCC, GND, SCL, SDA. Now, if I unplug any of the sensors and reset the µC, the other one works and gives out plausible values. So, the adresses are right (also cross checked with I2CScanner).
But if both are plugged in, both read "0" as temperature. What am i doing wrong?
This is my test code:

Code: Select all

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME680.h>
#include <Adafruit_BME280.h>

Adafruit_BME680 bme680;
Adafruit_BME280 bme280;

void setup()
{
  Serial.begin(115200);
  Serial.println("Setup...");

  bme680.begin(0x77);
  bme280.begin(0x76);

}

void loop()
{
  bme680.performReading();
  Serial.println(bme680.temperature);
  delay(500);
  Serial.println(bme280.readTemperature());
  delay(500);
}

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: Read out BME680 and BME280 simultaneously

Post by dastels »

I am assuming that one of the boards has SDO connected to ground to change its address to 0x76.

Dave

User avatar
GaunerBerlin
 
Posts: 2
Joined: Sun Apr 03, 2022 4:49 am

Re: Read out BME680 and BME280 simultaneously

Post by GaunerBerlin »

Yes, stupid me, I connected all pins of the sensor boards to each other, thus both SDOs had same level, whichever it was.
So, new setup, conforming to the data sheets of the two BMEs: connecting both CS to VCC, pulling SDO_680 up and SDO_280 down, everything works as expected.

Side note: introducing

Code: Select all

Wire.begin(SDA, SCL);
before the bme.begin commands works too, setting the I²C pins to different than default. I searched for that solution a while and had a lot of trial and error, so it might be worth mentioning it here too.

Thanks for this help!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”