Shop OBEX P1 Docs P2 Docs Learn Events
Length of i2c / serial cabling run? — Parallax Forums

Length of i2c / serial cabling run?

__red____red__ Posts: 470
edited 2012-04-05 04:52 in General Discussion
Greetings!

Our hackerspace has been given a challenge to build a debate timer for a local debate. The premise is that every candidate gets five minutes of question answering time for the entire debate so they can choose how much time they want to use on each question.

As such, they'll have a small display in front of them at their podium (There are 11 candidates in this race) to show them their remaining time.

My current thought is this:

Each candidate will have a 4 digit LED segmented display and an AS1108 or equivilent in a box on their table. I'd run five wires to each box from the central control box (GND, 3.3V, CLK, DATAZ, LOAD) - Maximum length I would guess would be 15ft or so. Central control would be a prop quickstart board.

My question is - is running this data (it can be a low baud rate - only needs one clock to update per second) over this distance impractical?

Do the denizens of this forum have any additional advice?

Thanks,



Red

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-03 20:06
    I think you'll have a tough time with 3.3V logic levels going 15 ft.

    It might work with some sort of shielded wire and maybe a higher voltage logic. I know there are higher voltage I2C logic level shifters.

    If you could afford to use a QuickStart with each button, you could use cheap (<$2.50) Nordic modules and have a wireless solution. They actually plug right into the QuickStart (they can be powered from a pair of IO pins).

    attachment.php?attachmentid=83018&d=1310766180

    Of you could use these fobs from SparkFun.

    08602-3.jpg



    My favorite buttons are these things.

    BigRedButton110721a.png


    I used a combination of buttons and fobs in my panic button project.
    521 x 466 - 351K
    600 x 600 - 98K
  • T ChapT Chap Posts: 4,223
    edited 2012-04-03 20:41
    I have run several remote devices off the same I2C bus off a Prop, each using unshielded cable at 35' each, never had a problem on around 50 of these systems in the field. Eventually I did add a P82B96 just to be on the safe side. If you prefer you could daisy chain RS485 to each device, many ic's out there but I use the MAX3430, pretty simple to use, very long cable lengths.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-04 03:53
    I2C was never intended for such large distances, but miracles are known to occur. Generally, the slower your data rate, the better off you will be. But the system may become tempermental at times if there are poor connections or pull up resistors are not quite right.

    RS-485 is the better solution as it is intended for distances and only requires two wires.

    The easily way to resolve the issue is to test your I2C set up with 50' of wire and then 25' and finally 15'. Nothing is as helpful as some direct evaluation.
  • davejamesdavejames Posts: 4,047
    edited 2012-04-04 08:44
    _red_

    The full I2C spec is on this page:

    http://www.nxp.com/search?ptyp%5B%5D=PDF&rows=10&type=keyword&q=um10204&page=2&tab=All

    ...and can be found under "UM10204".

    There basically is no low limit to the clock (SCL), so low data rates may improve the chances of a long cable run. Of course, going differential transmission w/shielded cabling would help also.

    Loopy's idea of testing different lengths is sound; impirical data = good stuff.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2012-04-04 08:48
    rs485 would work nice here, although each device would need one of these - http://www.mouser.com/ProductDetail/Texas-Instruments/SN65LBC184D/?qs=sGAEpiMZZMutXGli8Ay4kMj2H7jHcXU%2fxNJDk7fKI7E%3d

    then just use the uart, although the driver would have to be modded to enable the drive line, or use the 555 trick.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-04-05 04:52
    The feasibility of testing distances is quite easy. I purchased 100' coil of telephone extension wire and used it for testing CANbus. You DO NOT have to uncoil it!!!! And though twisted pair is specified (with shielding), I found that the reliablity was 100% without the twisted pair and without shielding.

    And so, I set up a send loop on one end and a recieve and reply loop on the other with an LED that would go on whenever a reply was received. I ran such for about 3 months without any problems.

    I suppose a similar scheme could be provided for I2C. Having a counter for sent packets and another for received packet (using LCDs maybe) might be a nice touch.

    Nobody but you as the builder is going to know how reliable your scheme is. So create some bench tests.

    I doubt if you really need to slow down significantly and you may even create problems if you go extremely slow.
Sign In or Register to comment.