Does any arduino support 2 devices with 12c communication?

Hey! The title says it all... I want to revieve data from 2 different lux sensors that have 12c communication (SDA and SCL). I know I can use those resistors that change its resistance dependent of the light... But I prefer this sensors, My arudino uno R3 has SDA and SCL in pins Analog input 4 and 5 but then there's also 2 pins saying "SDA" and "SCL" after the pin "AREF" in the digital pins row. Is it possible?

They're the same pins.

I want to revieve data from 2 different lux sensors that have 12c communication

If they're different devices, it's possible they have different addresses, so no problem.

francis2: My arudino uno R3 has SDA and SCL in pins Analog input 4 and 5 but then there's also 2 pins saying "SDA" and "SCL" after the pin "AREF" in the digital pins row. Is it possible?

The SDA and SCL pins are electrically connected to the A4, A5 pins, so it doesn't make any difference which ones you are using. The addresses of the lux sensors have to be different if you want to connect them to the same I2C bus. Maybe you can select the address, or the board/chip has a CS (chip select) pin. Post a link to the lux sensor. Leo..

Wawa: The SDA and SCL pins are electrically connected to the A4, A5 pins, so it doesn't make any difference which ones you are using. The addresses of the lux sensors have to be different if you want to connect them to the same I2C bus. Maybe you can select the address, or the board/chip has a CS (chip select) pin. Post a link to the lux sensor. Leo..

Wait, so what about 3? is there any limit to 12c devices? as long as they use different adresses?

Lux sensor:https://www.adafruit.com/product/439

Up to 128 I2C devices are allowed, as long as unique. Supposedly some are Global and use would be restricted. Also if devices are not unique but have Address lines for setting their I2C address (like 3 pins that allow for a base address plus up to 7 more), then a couple of IO pins can used as an Address line to each device so that one responds to the base address, and the others look for the offset address. The code changes which device sees which address as it selects them for communications.

Hi, Nick Gammon has a great page about I2C which will help understand this.. http://gammon.com.au/i2c

From the Adafruit lux sensor tutorial page:

“The ADDR pin can be used if you have an i2c address conflict, to change the address. Connect it to ground to set the address to 0x29, connect it to 3.3V (vcc) to set the address to 0x49 or leave it floating (unconnected) to use address 0x39.”

So you can have up to three of these sensors on the same I2C pins.
Leo…

The I2C address is a 7 bit number, so there are 128 possible addresses. Many (but not all) commercial devices have a way of changing the address. Leo explained how to do it for your light sensor above. The similar TSL2591 (which I used in a light meter) cannot change the address. >:(

So I have a follow up question: Are there chips or devices that will allow I2C devices with the same address to be read as different addresses? So that more than one of them could be used on the same microcontroller?

I typically use I2C on an ATTiny 85, using the TinyWireM library, or various ATMega 328p board with the builtin Wire, or a custom device specific library. (Any updates or other suggestions are welcomed!)

From this page.

https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview

"You just found the perfect I2C sensor, and you want to wire up two or three or more of them to your Arduino when you realize "Uh oh, this chip has a fixed I2C address..." Leo..

Thanks Leo!