Multiple bme280 sensors

Hi,
That’s something that i have played with a while ago and failed. So did anybody succeeded in connecting more than 2 bme280 sensors to one esphome node? From the hardware perspective it is doable as i have currently my Nodemcu reading values from 4 bme280 sensors. But how to have them reporting through esphome?

1 Like

There is only one address jumper, so only two individual I2C addresses. So you would need an ESP32 which can support two separate I2C buses.

You can use a TCA9548A I²C multiplexer.

3 Likes

I2C is obvious that in case of using esp8266 based board is not possible to be done. But in the non-esphome solution with this board i am using SPI bus which gives me all the readings from 4 sensors. I tried to have the same way of connection coded in esp home but no success. So i am looking more for somebody being able to provide a way how to code the node to use SPI bus properly with Adafruit_bme280 and 4 sensors attached

It was already raised by me to ESPHome via GitHub (https://github.com/esphome/feature-requests/issues/1436) but no response so far, that’s why i am searching for a help here

I wonder, why it wouldn’t be possible, if guys manage to connect multiple MCP23017, each one on separate I2C? You just define multiple I2C’s and assign different ID’s. Wouldn’t that work for BME’s, too? (t didn’t try, though…)

i2c:
  - id: bus_a
    sda: GPIO1
    scl: GPIO2
    scan: True

  - id: bus_b
    sda: GPIO3
    scl: GPIO4
    scan: True

then:

#first BME
  - platform: bme280
    i2c_id: bus_a
    address: 0x77
    update_interval: 10s

#second BME
  - platform: bme280
    i2c_id: bus_b
    address: 0x77
    update_interval: 10s

Only for ESP32.

Screenshot 2022-02-06 at 11-18-30 I²C Bus

And…

Really, SPI support would be ideal. The multiplexer suggested by Jos would be the only way to use an ESP8266 at the moment.

Oh…thanks for info. I thought that I’ve read somewhere that I2C is software based (like PWM if i understand correctly). In this case mux is only solution, as you say.

Yeah, I had to check before posting earlier. It is only PWM that can be software based. The ESPHome I2C component needs the internal hardware.

1 Like

Tom, original lib adafruit for bme280 contains support for SPI, while in ESPHome there is only I2C in a code (or i am missing something). Would it be hard to modify it to work with SPI?

No you are not. I saw your feature request for it, that’s all.

I have no idea.

Currently there are 890 open feature requests and personally I don’t see your wish as a ‘general wanted’ feature. There already are working alternatives so I expect the feature request will be open for a very very long time. If you really want to use this with ESPHome there are 4 options:

  • Use a ESP32
  • Use the multiplexor in combination with a ESP8266
  • Find someone to write the PR for this feature
  • Write the PR yourself

The first two options are working right out of the box :slight_smile:

Here’s what i use to read multiple BME280 from a i2c multiplexor