BME280 sensors

I need to attach 4 BME280 sensors to A4 and A5. There seems to only 2 address avalaible. Is that correct?

You can use I2C Multiplexer to operate more than one sensors having same address.

Thankyou for that. Have been doing a bit of reading and SPI might be a better solution for me

If you have a BME280 sensor of I2C version, go with it and learn the I2C Protocol. It is interesting compare to SPI in respect of Library Functions.

You might not need an I2C multiplexer if the module you have has a chip select or address pin exposed.
That pin can be used to de-activate the modules, except for the one you're talking to.
Tell us which Arduino, and post a link to the module you're using.
Leo..

hortplus:
Thankyou for that. Have been doing a bit of reading and SPI might be a better solution for me

That is correct.

Don

That is a 3.3V sensor. You need a 3.3V Arduino board to be able to connect all the SPI wires.

Since you say that A4 and A5 is the I2C bus, it must be a Arduino Uno, Nano, Pro Mini or something like that.
Most of them are 5V board, only the 8 MHz Pro Mini is a 3.3V board.

I suggest to buy a 3.3V Arduino board with the SAMD21 M0+ processor.

Can you tell what your project is ? Why do you need four BME280 ? For baromic pressure or humidity ? Did you know that the I2C bus can only be 0.5 meters (sometimes 2 meters is possible) and the SPI bus should be even shorter ?

The BME280 of the following Model has built-in 5V/3.3V regulator and level sifter; it works well with 5V Arduino UNO (tested).

I got my BME280 sensors here

To run as SPI Devices i presume it is

VCC=5v
GND=GND
SCL=SCK
SDA=SDI
CSB=CS
SDO=SDO

Correct?

@hortplus, you will blow the BME280 when you connect the BME280 sensor itself to 5V or apply a signal of 5V to it.

The small modules with voltage regulator and level shifters that @GolamMostafa mentioned are very nice modules. They work with 3.3V and 5V arduino boards. However, when the trick is used that @Wawa mentioned, then a digital output must be connected to SDO to change its I2C address. That digital output from a 5V board will again blow the BME280. With four of those modules, there is also four level shifters needed for the SDO signals.

For SPI, there are more signals that require level shifting. With four sensors, the level shifter for MISO must also be able to disable the signal from a Slave when it is not selected, or the MISO signal gets locked.

Buy a 3.3V Arduino board, and all these problems are gone.

No voltage regulator or level shifters on that version, so 3.3volt only.

If you want to use them with a 5volt Arduino, then you need 3.3volt power, I/O, and level shifting.
A TCA9548A (link in post#1) has buildin level shifters, but you still need the pull up resistors on the module side.

As Koepel said, maybe better/cheaper to use a 3.3volt Arduino.
Leo..

Koepel:
That digital output from a 5V board will again blow the BME280. With four of those modules, there is also four level shifters needed for the SDO signals.

Exactly that happened to my BME280 with SDO signal -- it burnt out. After that, I collected that cute BME280 Module having explicit marks for I2C Bus operation and unambiguous schematic.