I2C off board distances

Has anyone any experience of running an I2C bus from a PCB to a remote I2C device ? I am thinking of connecting a remote Dallas Semiconductor I2C temperature sensor IC to a micro over a length of 4 or 5 metres of wire. The temp sensor would be fixed to the ceiling to measure room temperature and the micro would be in a monitoring / control box on the wall.

Could I run this at the typical 400 KHz clock speed with a decent bit of screened cable ?

Colin

Reply to
Colin MacDougall
Loading thread data ...

IMHO, no.

The I2C bus is an open-drain/collector -bus. The cable capacitance will kill your rise times. Also the system is too fragile for real world use - think about all noise and possible ESD.

Tauno Voipio tauno voipio (at) iki fi

Reply to
Tauno Voipio

The ACCESS bus is/was based on I2C and designed to work off-board, hoewever it operates at 100KHz.

formatting link

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

Look at the Philips web, they have i2c info and also do i2c expanders/buffers for this type of application.

Since this is room temperature, I would drop the 400KHz spec, and as you are reading slow data fields, you can use 'reality check' software to improve noise tolerance.

-ie run as slow as you can tolerate, and design to tolerate disturbances.

-jg

Reply to
Jim Granville

Not sure about that speed, but a data point - I have an HVAC controller I built using two Dallas DS1621s. One segment of the I2C bus is 23 feet, and the other is 43 feet. I'm bit banging I2C on an 8051's port. I think the overall speed is around 10-20Khz (can't remember - it has been a while since I wrote the code and don't exactly remember the speed).

I don't know about 400KHz, but you can run it quite a bit slower. Also, why do you need a 400Khz clock speed to a temperature sensor, which takes in the mid millisecond range to do conversions? Are you expecting temperature changes in the sub 1 second range at all? Even at 10Khz, I could reread the temperature off each sensor around 400 times a second if I'm doing autoconversion, so unless you need that resolution, you won't have to run the bus that fast.

-->Neil

Reply to
Neil Bradley

No experience, but a caveat: that's not at all the kind of operation I2C is designed for. It may work, sure, but you should be aware you're stretching a design quite a bit beyond its intentions. Problems are almost guaranteed.

Their "1-wire" technology might be preferrable for that usage.

Even if you could, why would you want to? I would think ambient temperatures in a room change at speeds on the order of at most 1 degree/minute, so anything faster than one reading per second per sensor would be complete overkill, and one reading every minute might still be perfectly enough. You don't need anything as fast as 400 kHz for that.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

I don't need the temperature measurements that fast ( 1 per minute would do ) but I intended the I2C bus to also connect an eeprom device to record those measurements. When the measurements have to be retrieved then the full bus speed would be desirable. A fast/slow clock select would of course be the solution but also mean more software overhead.

Colin

Reply to
Colin MacDougall

In that case, I would think twice whether it's really a good idea to connect two devices with such rather incommensurable requirements regarding data rates, distance and EMI behaviour as an EEPROM right there on the board, and temperature sensor elsewhere in the room to the same data line. If ever there was a reason to have multiple data ports on a single CPU/controller, I would think you've just about given a textbook example for it.

Questions to check:

*) can you really afford having communication with that EEPROM disturbed by EMI effects collected by 5 meters of cabling?

*) is it even remotely convenient to have to stop access to the EEPROM in order to access the temperature sensor?

Unless you're absolutely starved out of free pins and/or free space on the board to use for a line protocol converter between I2C and whatever you'll use to driver that temperature sensor, I would think keeping these two device on separate busses would get you rid of quite a number of worries, for acceptable cost.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Colin, Hans is offering some very, very good advice, here. I'm certain you've got a couple of I/O pins to spare - definitely do what he says.

In my HVAC controller, I get several glitches on the I2C bus a day. I'm controlling a 12 amp @ 240 volt heat pump, a 9 amp furnace, 20 amp resisitve heating, and a backup generator, and when the heat pump shuts down, the collapse of the inductive field does generate a spike on the I2C bus, which causes the DS1621s to get scrambled (requiring them to be reset). I'm not sure if your environment is as noisy, but I would *NEVER* trust an E^2 write on the same set of lines as the temperature sensors.

Here's a photo of that HVAC controller:

formatting link

Yes, I'm aware that the power supply is a big ugly hack. ;-) It has since been replaced with a switcher...

-->Neil

Reply to
Neil Bradley

Hi Neil, I think the link you meant was:

formatting link
(lower case "c") The Fry's receipt makes it look so much more real ;-)

PS: several of your stinky pics don't show up... is the images directory in the right place?

Bob

Reply to
Bob

No! I meant:

formatting link

That whole directory is a cobwebsite ....

-->Neil

Reply to
Neil Bradley

Colin MacDougall wrote: : Has anyone any experience of running an I2C bus from : a PCB to a remote I2C device ? I am thinking of : connecting a remote Dallas Semiconductor I2C temperature : sensor IC to a micro over a length of 4 or 5 metres of : wire. The temp sensor would be fixed to the ceiling to : measure room temperature and the micro would be in a : monitoring / control box on the wall.

: Could I run this at the typical 400 KHz clock speed with : a decent bit of screened cable ?

The Dallas/Maxium 1 wire interface is more suited for this. You can use a i2c to 1wire interface that Maxium just released and use a 18S20 1 wire temp sensor. They make a RS232 to 1 wire interface also.

1 wire info:
formatting link
and
formatting link

I have a 60' or so cable run to several of my weather sensors at home that uses the 1 wire interface.

See:

formatting link

--
Greg Holdren
greg (dot) holdren (at)  (dot) com
Reply to
Greg Holdren

Look at the USB specs (USB.org) the USB protocol is built on top of I2C. By the way SM Bus is too, but I don not think that is designed to go off board very far.

Reply to
Neil Kurzman
[...]
[...]

... and has a maximum allowed cable length of 5 meters between active components. Which likely means that it's unsuitable for the case at hand.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

USB is not based on I2C. USB has unique electrical and protocol characteristics invented for USB.

Reply to
TC

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.