I have been using the BME-280 and DS18B20 in the same system and found temperature differences of as much as 3 degrees.
Since the BME-280 only has 2 possible addresses, I cannot use more than 2 on the same bus.
Looking for the best way to monitor a dozen or so at the same time.
My intended application is a garden sensor, with the ESP chip for the Wifi. to use 3.3 volts.
Those "dozen or so" will probably not be located in a 30cm circle, will they?
I2C is terrible with distances (not designed for it). So best approach would be to:
a) Use a I2C range extender. But this will not fix the address problem
b) Give every sensor a uC as well and send it over somthing like RS485. This makes them all nodes and you can use longer wires (or make it RF if you want) and the address problem is gone.
septillion:
Those "dozen or so" will probably not be located in a 30cm circle, will they?
actually,in a box or enclosure or something to test these on the bench
the hope is to create a calibration value for each sensor before putting them in the field. (well field, garden...)
I would investigate it a bit more then just giving it an offset. The BME280 is speced to be pretty accurate (+-0,5C @ 25C).
And if you want to test a bunch in a box the datasheet has a clue:
The 7-bit device address is 111011x. The 6 MSB bits are fixed. The last bit is changeable by SDO value and can be changed during operation.
Aka, if you connect every SDO pin to a digital pin of the Arduino you can change the address on the fly. Just make SDO of the sensor you want to read HIGH and the rest LOW and only use address 1110111 to read.
septillion:
[...] you can change the address on the fly. [...]
That is cool.
Is it common for i2c slave devices to allow this, or is the BME280 special in this regard?
I'm not sure if it's common. But the BME280 explicitly tells you. Never tried it with other modules (or saw it in there datasheets...)
This trick can be used with all chips that have I2C address selection pins. And which allow for dynamic change of the address, not only at power up.
In other words it is common for I2C chips that set their address with a simple logic level. Other later chips allow you to set the address by a high or low or a connection to the Data line or clock line Thus getting 4 possible addresses from one input bit.