-->
Page 1 of 2

Connecting multiple I2C devices

PostPosted: Wed May 20, 2015 2:44 pm
by dayzman
I'm hoping to connect several devices over I2C like the BMP180. I'm using the driver at https://github.com/reaper7/esp8266_i2c_bmp180 Typically what needs to be done to have several I2C devices hooked up? Each would have to use a unique set of pins, right?

Thanks

Re: Connecting multiple I2C devices

PostPosted: Wed May 20, 2015 2:58 pm
by martinayotte
Right ! Since this device doesn't have address pins, you can only hook 1 device per I2C bus.

Re: Connecting multiple I2C devices

PostPosted: Wed May 20, 2015 4:29 pm
by j0hncc
Then why do they call it a "bus"? What is the "device address" used for?

Re: Connecting multiple I2C devices

PostPosted: Wed May 20, 2015 5:36 pm
by martinayotte
I2C devices such EEPROM usually have 3 address pins, so 8 EEPROM can be attached on the same bus along with some others such ADC, DAC or Temp sensors, the effective addresses are those 3 pins merged with hardcoded manufacturer base address. The whole bus has 128 devices address space. But the BMP180 doesn't have those 3 pins, so it use only the hardcoded manufacturer base address which is according to specs at 0x77 (when shifted to add the R/W, it give 0xEF for read and 0xEE for write).
So, only 1 BMP180 per Bus... There is maybe some other sensors with address pins, but I didn't search ...

EDIT : in a second thought, why do you wish to have several BMP180, they will all measure the same barometric pressure ... ;)
If you means other sensors such Temp and Humidity, there won't be any problems having them on the same bus, as long as hardcoded manufacturer base addresses are not conflicting.