Best Method for sending I2C code long distances (300 feet/100 meters) - Page 1
Forum section: electronics / beginners

author: K1JOS
author_rank: Regular Contributor
timestamp: May 30, 2014, 03:26:47 pm
content: I am erecting a 35 foot (11 meter) all-aluminum antenna mast in my backyard. The mast has an unusual integrated motor as part of the base that will rotate the mast/antenna but it provides no feedback for direction. The hard-wired controller is dumb only providing stop or go for clockwise or CCW direction. The antenna motor has safety stops tuning off power when it reaches a full turn mechanical stop. I would like to not only control power (CW or CCW switch) remotely but also know the direction (heading). I am thinking of using one of the triple-axis magnetometers for Arduino like LSM303 or HMC5883L. I went through the code examples and it seems straightforward but I know that I2C is not intended for long two wire transmission such as the 150 feet between my mast mount in the backyard and my workbench. Should I convert it to a pair of RS485 or maybe consider a fully wireless approach?thanks in advanceJerry K1JOS(PS - Power (12vdc) for the rotor and electronics will come from 2 deep cycle marine rechargeable (solar) batteries (like though used for fishing trolling motors). These are designed to run at a 40Amp draw for up to 2-3 hours and my rotor will be used for short bursts drawing only 7 amps @12vdc. I am looking at winter deep cycle for my single digit January-February days

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 30, 2014, 03:32:13 pm
content: If you're taking I2C off the board, you're doing it wrong.use RS485 or RS422 (over cat5) , which is designed for that sort of thing. talking to a local MCU.

author: K1JOS
author_rank: Regular Contributor
timestamp: May 30, 2014, 03:41:29 pm
content: Thanks Mike,So just two Arduinos with RS485 shields at both ends? Is the handshaking part of the RS485 device or does the Arduino (or MCU) need to monitor and manage that?Jerry

author: K1JOS
author_rank: Regular Contributor
timestamp: May 30, 2014, 03:45:05 pm
content: MikeAny suggestions for a wireless solution that will cover the 100meters from yard to home (line of sight through wood framed home)jerry

author: linux-works
author_rank: Super Contributor
timestamp: May 30, 2014, 04:07:48 pm
content: not sure about 100m but xbees (zigbees) can go pretty far and if you need to, it is possible to build a repeater (bridge, actually). it would be 2 back to back units, probably not even needing a cpu between them since its flow controlled and error controlled serial ascii. cross tx and rx and set them to different freq channels so the repeating happens on a different channel slot.

author: mazurov
author_rank: Frequent Contributor
timestamp: May 30, 2014, 04:11:50 pm
content: You may want to try i2c buffers ->http://www.nxp.com/documents/leaflet/75016081.pdf. 100m is still kind of marginal though.

author: linux-works
author_rank: Super Contributor
timestamp: May 30, 2014, 04:16:31 pm
content: one trick I use for running i2c between boxes (not very far, though; on the same rack or shelf) is to use firewire cables and connectors. you can find them from old pc tabs (pci cards or expansion tabs on the back of PCs). its nice that they have decent red/black wires for 5v/gnd, then there are 2 shielded wires for data and that works perfectly for clock/data on i2c.I love it when I don't have to make cables! and the connectors are cheap, somewhat easy to get, keyed and reliable enough. (I run i2c between audio boxes that I build, for remote control and a sort of 'management bus' between systems).one thing has to be asked: does your requirement have to run at full i2c speeds and does latency and 'buffering' matter for your app? if not, the store/forward method I mentioned would work, but if you need full i2c speed, xbee serial won't be fast enough to encapsulate that. now, if you bonded a bunch of them and muxed (time division) them, ....

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 30, 2014, 06:11:13 pm
content: Quote from: K1JOS on May 30, 2014, 03:45:05 pmTf you have to have cabling for power then little point doing wireless data. You can get high power Xbee modules though.

author: K1JOS
author_rank: Regular Contributor
timestamp: May 30, 2014, 10:28:45 pm
content: All DC power will be from Deep Cycle solar recyclable batteries. There will be a single coax for the antenna that is AC coupled and has special lightning protection but if at all possible it would make my life a lot lesss complex to not run AC or DC power to the far end of my backyard.... so a wireless control solution would be optimal.jerryK1JOS

author: Rigby
author_rank: Super Contributor
timestamp: May 30, 2014, 11:49:16 pm
content: Moteinos are dirt cheap, and transfer data hundreds of feet wirelessly.

author: linux-works
author_rank: Super Contributor
timestamp: May 31, 2014, 12:33:10 am
content: link for what rigby was referring to:http://lowpowerlab.com/blog/2012/12/20/moteino-the-wireless-low-power-low-cost-arduino-clone/thanks for that - I never heard of this before but it looks interesting.

author: Richard Crowley
author_rank: Super Contributor
timestamp: May 31, 2014, 01:34:31 am
content: Yes, the Moteinos are great. I'm a big fan. They will handle both the movement command direction, and the bearing position feedback. And you can throw in temperature and wind speed/direction almost for free.Although, for a fixed application like that, I would just run a Cat5 cable that would handle everything (including float-charge on the battery).

author: K1JOS
author_rank: Regular Contributor
timestamp: May 31, 2014, 02:46:12 am
content: thank you to all. The Moteino plus RFM69W/WH sounds like a winner with sleep mode, etc I could run CAT5 alongside the RF coax but I would have to deal with lightning suppression and digging up to bury 150 feet of CAT5 since my coax was buried several years ago before the lawn was planted. I don't think tacking it down onto the lawn for such a distance is a good idea and the wireless Moteino is worth a tryJerry

author: GreyWoolfe
author_rank: Unknown
timestamp: June 01, 2014, 12:41:45 pm
content: Why not use CAT5 plenum? you can use staples made from fence repair wire to hold it to the ground and, given some time, the grass will grow over it the same as if you laid 18ga wire down for radials.

author: Psi
author_rank: Super Contributor
timestamp: June 01, 2014, 12:54:18 pm
content: Ya should be able to find some cheap 433mhz modules that will work.If you do data integrity checking yourself in the arduino you can get away with using dumb TX/RX units.Of course, since this is an antenna mast, you need to consider harmonics if this is a RX antenna and your using wireless coms

author: fcb
author_rank: Super Contributor
timestamp: June 01, 2014, 12:59:01 pm
content: I'd look into using the existing COAX with a LP and HP filter to send DC & some low frequency control data (biphase/FSK/DTMF/whatever) half-duplex.Of course this advice might change if your just DXing and probably would change if your TXing 400W on LF.Direct Burial CAT5 and apologize to your better half??