1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

I2C off board distances

Discussion in 'Embedded' started by Colin MacDougall, Sep 16, 2004.

  1. 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
     
    Colin MacDougall, Sep 16, 2004
    #1
    1. Advertisements

  2. Colin MacDougall

    Tauno Voipio Guest

    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
     
    Tauno Voipio, Sep 16, 2004
    #2
    1. Advertisements

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

    http://www.semtech.com/pdf/abusv30.pdf

    Best regards,
    Spehro Pefhany
     
    Spehro Pefhany, Sep 16, 2004
    #3
  4. 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
     
    Jim Granville, Sep 16, 2004
    #4
  5. Colin MacDougall

    Neil Bradley Guest

    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
     
    Neil Bradley, Sep 16, 2004
    #5
  6. Colin MacDougall

    Stephen Pelc Guest

    The Philips P82B96 I2C bus extender is a wonderful thing.
    We used it in an application involving thyristors and
    steam boilers. It works fine over several metres, and
    I have no reason to believe it will not work over much
    longer distances.

    There has also been some work on using the Dallas 1-wire
    bus over longer distances, but I'm not the person here
    doing that work. See the Dallas/maxim app notes.

    Stephen
    --
    Stephen Pelc,
    MicroProcessor Engineering Ltd - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
    web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads
     
    Stephen Pelc, Sep 17, 2004
    #6
  7. 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, Sep 17, 2004
    #7
  8. 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
     
    Colin MacDougall, Sep 17, 2004
    #8
  9. 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, Sep 17, 2004
    #9
  10. Colin MacDougall

    Neil Bradley Guest

    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:

    http://www.synthcom.com/~nb/Controller3.jpg

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

    -->Neil
     
    Neil Bradley, Sep 17, 2004
    #10
  11. Colin MacDougall

    Bob Guest

    Hi Neil,
    I think the link you meant was:
    http://www.synthcom.com/~nb/controller3.jpg
    (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
     
    Bob, Sep 17, 2004
    #11
  12. Colin MacDougall

    Neil Bradley Guest

    Neil Bradley, Sep 17, 2004
    #12
  13. Colin MacDougall

    Greg Holdren Guest

    : 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: http://www.1wire.org/ and http://www.maxim-ic.com/

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

    See:
    http://pages.sbcglobal.net/greghol/wx/weather.html
     
    Greg Holdren, Sep 18, 2004
    #13
  14. Colin MacDougall

    Neil Kurzman Guest

    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.
     
    Neil Kurzman, Sep 18, 2004
    #14
  15. .... 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, Sep 19, 2004
    #15
  16. Colin MacDougall

    TC Guest

    USB is not based on I2C. USB has unique electrical and protocol
    characteristics invented for USB.
     
    TC, Sep 22, 2004
    #16
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.