Go Down

Topic: Multiple I2C ICs with same address (Read 230 times) previous topic - next topic

AlexWx

Hi,

I want to connect 100s of sensor ICs via I2C with one µC. However all of those ICs have the same I2C address. An I2C multiplexing IC will not work that well due to the high amount of ICs. Therefore I thought of "multiplexing" the I2C-Bus with the 74HC595 shift register. I select the I2C IC to communicate with via the 595 which switches the SDI line to the IC via a NPN transistor.
Speed will not be an issue as the sensor ICs only need to be configured initially via I2C and then provide a digital signal on another PIN (which I will read via daisy chaining 74HC165s).

However I've read that this approach might not work. My question would be how can I connunicate to 100s ICs with the same address via I2C preferrably via daisy chaining several "controlling ICs" like the 74HC595 or I2C multiplexer?

BR,
Alex

Budvar10

#1
Sep 16, 2016, 02:12 pm Last Edit: Sep 16, 2016, 02:17 pm by Budvar10
I miss the idea of using the I2C bus if it has to be multiplexed for each device. What kind of device/sensor you are trying?
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Graynomad

There will likely be fan-out issues whereby whatever is driving the bus cannot drive 100s of receivers, but if we just look at the logic of the problem for now.

What chip are you using? If it has at least one address pin (often they have 2-3) you can (for example) drive A0 on all of them high except the one you want to talk to, this puts 99 chips at address X and 1 at address Y, then communicate to address Y.

Given that I2C is generally a local bus, one has to wonder what application requires 100s of sensors within a small area.
Rob Gray aka the GRAYnomad www.robgray.com

Arctic_Eddie

Have you considered using RS-485 devices or converters to that protocol. You will get much longer cable runs and 32 devices per bus. Four buses will cover your needs. With low baud values, you can use SoftSerial with most any Arduino.

Graynomad

Quote
32 devices per bus
256 these days.
Rob Gray aka the GRAYnomad www.robgray.com

Arctic_Eddie

I must have found some old data today. The OP can use a Pro Mini as the interface between the I2C device and the RS-485 board. Nick Gammon has libraries and example code. I found an example that does not even use the library but uses SoftwareSerial to write to the RS adapter. The adapters are on eBay for about $1 each.

AlexWx

The sensor is a proximity sensor from Vishay: www.vishay.com/docs/84274/vcnl4040.pdf
It uses I2C for the configuration of the sensitivity and has a fixed slave address (no address pins). In running mode I will read the INT pins on every sensor using 74hc165s instead of i2c.

The circuit design of my application does only allow daisy chaining the sensors (and not using multiple buses), therefore I came to the idea to use 74hc595s to enable the i2c communication of a certain slave with the uC.

if there would be a (endless) daisy chainable i2c adress multiplexer, I'd prefer that one. using the rs485 might increase the number of required components a lot.

Arctic_Eddie

Quote
using the rs485 might increase the number of required components a lot.
That's true as each sensor would need an RS485 adapter and a Pro Mini. Although the component cost is low, about $1-$2 each, it will add up. You would also need to write the code for the Pro Mini to act as an RS485/I2C converter.

I've ordered five of the RS485 adapters for my own projects. Step 1 is to create an RS485/I2C interface for general use.

Graynomad

I'm thinking that MUXing the SCL signal may be the best option, maybe using an analogue MUX like a 4067.

Another option might be the PCA9548A, that's an 8-channel I2C MUX with 3 address lines, so 8 of them would give you 64 sensors, possibly using the chip's reset pin would allow you to double this by holding one bank of 8 in a reset state.

All supposition, but might be worth looking into.
Rob Gray aka the GRAYnomad www.robgray.com

Arctic_Eddie

Both ideas sound good. It's just a question of how much wiring and coding the OP wants to do.

I'm still puzzled by what project would use 100 devices in the short wiring range of an I2C bus. Using only the Int line from each device would give you an event trigger but you still have to MUX those 100 into the Arduino.

Using a Pro Mini(or smaller) as an interface on each sensor, you could transmit a message via an IR communicator chip like the ones in a TV remote. That would eliminate the MUXing problems and need only one receiver at the master.

AlexWx

#10
Sep 19, 2016, 11:43 am Last Edit: Sep 19, 2016, 12:49 pm by AlexWx
It is a 12x24 LED matrix where every LED has a nearby proximity sensor to light up when an object is detected. The LEDs act as pixels and the LED PCBs are daisy chainable (APA102 LEDs). The number of parts per pixel should be reduced as much as possible. The I2C bus will be 20m long connecting all the pixels, planning to use I2C bus extender P82B715 therefore.


musskopf

You might want check the TMD27713, I think it's a bit cheaper. Regarding the bus I can't see an easier solution without having a MCU per sensor.

Any ATTiny + decoupling caps should be enough. They don't even need to be all interconnected if you just need to turn the corresponding led on.
http://talk2.wisen.com.au

AlexWx

Thanks I will check out the TMD27713, however on mouser this one is more expensive than the VNC. I have chosen the VNC over some normal IR phototransistors so that I do not have to use a MCU per LED.

Anybody tried using a I2C bus extender? I might be able to overcome the I2C fan-out issue with those and could maybe MUX the sensors with an 74HC595 and a NPN transistor to connect SDA to the sensors.

Arctic_Eddie

One of the ATTiny chips and a MAX485 at each sensor would eliminate the MUX wiring problem and make it a software solution. Each sensor would send an ID and status byte which the master controller would uniquely identify.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy