Busy, multi-voltage I2C bus

I don't really have a specific question - I think I've solved my issues already,

I'm working on a design for a rather complex (in that it integrates a bazillion different disparate pieces - in terms of design it's mostly just cribbed off breakout boards and datasheets) shield that needs to integrate with a whole load of sensors in a modular fashion. Fortunately, most of these sensors support I2C.

Difficulty 1: They can't be located on the shield itself. They have to be up to 20ft away.
I solved (I think) this one by just taking an RJ45 port, labeling it "I2C Bus" and dropping a bunch of RJ45s onto each sensor's breakout board. All of this is tied together by another board with a 4x2 stack of RJ45's such as you'd find in an ethernet hub (in fact, that's where I'm stealing my prototype part from when the time comes).

Difficulty 2: Not all the sensors support the same logic voltages.
I've already got 3.3v and 5v running through the RJ45's, along with GND, SDA and SCL.

At first I was going to just build logic level converters on all the 5v boards (because they're the minority and have lower component counts anyway) - but then I realized that the Arduino itself is 5v. Oops. So I'd need a level shifter on almost every sensor board OR on the shield itself AND the 5v boards.

That's nasty, so I did a little additional thinking. I still have 3 unused pins on the RJ45 - why don't I put the level shifter on the shield only and run 3.3v, 5v, GND, SDA3, SCL3, SDA5 and SCL5 through the RJ45? This is the strategy I've settled on for now.

Also, does anyone have any thoughts on just using cheap MOSFETs versus a MAX3370-family (I'm specifically looking at the 3373EEKA+T) for I2C?

I2C is not for long-haul networking. The name is "inter-IC communication" - it's designed for chips on a board to talk to each other. If your cables aren't on the order of inches, you're asking for trouble.

Someone (Philips/NXI?) has an IC that can be used in pairs to extend it over longer distances.

Philips/NXI also make I2C bus muxes that can do voltage level translation. This is handy if you have multiple devices with the same address and have that pesky 5V/3.3V problem. The muxes are addressed over I2C, so there aren't even extra wires needed (although the code gets a bit more complicated).

-j

Can't you power everything with 3V3, including the Arduino? (In this case, the safer frequency would be 8MHz.) So you can get rid of the level shifters.

20 feet is too far for reliable I2C although I know people do it.

Someone (Philips/NXI?) has an IC that can be used in pairs to extend it over longer distances.

Search for P82B715 and PCA9600 for a start.

These chips can also level shift IIRC.


Rob

florinc:
Can't you power everything with 3V3, including the Arduino? (In this case, the safer frequency would be 8MHz.) So you can get rid of the level shifters.

Impractical in this case - there are some irreplaceable components that require 5v - there are even some 12v signal levels flying around. I'm also using almost every single pin on a Mega2650 - so there are speed concerns. Thanks for reminding me to redo the power systems, though - I've got truckloads too much current on the internal voltage regulators.

Graynomad:
20 feet is too far for reliable I2C although I know people do it.

Search for P82B715 and PCA9600 for a start.

Thanks for the tip. Phillips says on the datasheets that the standard bus is good for "a few meters" so I think I'm probably covered on distance. 20ft is the pathological worst case - the 5-10ft range is far more likely. I should also get some more range out by using the twisted-pair cabling effectively.

I've dropped a P82B715 onto the schematic as an add-on option - I'm hesitant to jump straight into it because you need one at both ends, and they're a bit expensive for what I'd like on the sensor boards. I'll test reliability-over-distance when I get to the breadboarding stage and make sure.

check out the PCA9517 for I2C with 3.3 and 5 volt devices.