two Arduino unos communicate at 320 feet apart

Discussion in 'Embedded Systems and Microcontrollers' started by steven334, Feb 26, 2012.

  1. steven334

    Thread Starter Member

    Aug 9, 2011
    37
    0
    Can I have two Arduino unos communicate over two wires via Tx and Rx for a distance of 320 feet.
    I don’t need high speed communication.
    Thank you
    steven
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,418
    3,355
    You say you don't need high speed communication. Speed is very critical. You must state what speed you plan on using.

    The simple answer is NO.

    Direct connection of TX and RX TTL pins will not cut it, neither will RS-232. You have to go with a differential communication system such as RS-422 or RS-485.
     
  3. steven334

    Thread Starter Member

    Aug 9, 2011
    37
    0
    Do I need any additional hardware to get two Arduino unos to communicate (One direction is all i need) using rs 422 or rs 485 protocol?
     
    Last edited: Feb 27, 2012
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    The two wires you need to use will have some mutual capacitance simple due to being two nearby pieces of metal. The longer the wire the more capacitance: double the length you double the capacitance.

    This is real capacitance, and makes your cable look like an RC network: it needs time to charge the receiver end for every data transition. Slow data is better, it gives time to "charge" the other end.

    Here's Wiki on cable length:

    The standard does not define a maximum cable length but instead defines the maximum capacitance that a compliant drive circuit must tolerate. A widely used rule of thumb indicates that cables more than 50 feet (15 m) long will have too much capacitance, unless special cables are used. By using low-capacitance cables, full speed communication can be maintained over larger distances up to about 1,000 feet (300 m). For longer distances, other signal standards are better suited to maintain high speed.

    Do you have 320 feet of cable and an oscilloscope? You could try this and see if it is OK at some slow data rate.

    Do think about data corruption. Just about anything electrical between here and there can glitch your data stream and make the received data incorrect, and with 1-way data the receiver cannot signal "I just got crap!"

    another thing to concider is Sparkfun sells some wireless RF Link Modules that may have just enough range to work. That eliminates the wire, always a good thing.
     
  5. magnet18

    Senior Member

    Dec 22, 2010
    1,232
    124
    What are you using them for?
    I'm curious, and this could help people find solutions to your problem.
     
  6. steven334

    Thread Starter Member

    Aug 9, 2011
    37
    0
    It is for telling the operator of a manually operated elevator that someone is calling for him.
    The elevator services 21 floors. Each floor has a button (hall call button).
    I want to wire one arduino to the hall call buttons ( I see the arduino only has 14 i/o lines so I need an idea on how to take inputs from 21 buttons)
    And I want a second arduino in the elevator cab with an LCD display that will tell the elevator operator he has a call.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    One thing. I am not a Arduino expert. But does not arduino now use a onboard USB to RS232 protocol signal converter. So the signals going in and out of the Arduino is now using the USB protocol. Hence using RS485 signal converters will just make a mess of the signals:eek:
     
  8. be80be

    Senior Member

    Jul 5, 2008
    431
    57
    The uno doesn't have to use the same rx tx that's on the USB it has a great software library
    And can easily use RS485 which is what the OP should use for this. I would use max485 and you have no problems at 340 feet . There are people who have use rs232 at 300 to 400 feet at 2400 baud but you'll have a lot noise to deal with. I wouldn't even try it. Run you some cat5 cable and use rs485

    Ps they don't have USB on the uno it uses a USB to serial that is bit banged on U8 chip that send data to the main chips uart which is still usable for UART But i would leave it for programming only. And use the software Uart
     
    Last edited: Feb 27, 2012
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    21 floors worth of wire is a lot of wire. And you'll need 42 floors worth of wire if you think about how this is going to connect from the top or bottom floor to a moving car.

    Now that I know the application my inclination would be to ditch the wire altogether. I would not be surprised to learn adding an extra wire to an elevator is a violation of the building code.

    I would look into using light as the communication medium, sort of a fancy TV remote control just using brighter LEDs. The car would have a sensor top and bottom. Each intermediate floor has two LEDs, one pointing up and one pointing down Each floor would also require and two receivers to detect another floor "talking." These extra sensors could also be used for the car to acknowledge a call request.
     
  10. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    Yes, RS-485 definitely. Or two RS-422 systems (4 wires total) for full-duplex communication. But it's got to be a balanced drive, not one wire per direction.

    Amateur work on an elevator system sounds like a poor plan, even if it's just something like a manual call device. I wouldn't want to trust my life to a setup modified by some guy who asks for advice on All About Circuits Forum.
     
  11. jimkeith

    Active Member

    Oct 26, 2011
    539
    99
    Also consider the more obscure RS423--it is a terminated, unbalanced line that can use the same protocol as RS232, but is intended for higher data rate, multi-drop and longer distances (4000')--not much hardware required to make the enhancement. Ground loop voltages can play havoc with such and also RS422 to a lesser degree, so optical isolation is recommended.

    http://pinouts.ru/SerialPorts/rs-423_pinout.shtml
     
  12. magnet18

    Senior Member

    Dec 22, 2010
    1,232
    124
    it has 20 I/O, the analog inputs can be set as digital outputs (and, I think, digital inputs, but I'm not sure on that)
     
  13. steven334

    Thread Starter Member

    Aug 9, 2011
    37
    0
    Regarding the reply suggesting LED Light communication.
    Please tell me more about the range I can get from an LED to a detector. And are you suggesting I use a separate Uno programmed to flash a LED with a distinct pattern for every floor.
     
  14. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    First off, there are very good off the shelf IR receiver modules that look for a pulse wave at some 40KHz of IR light to change the output. No IR, output high. IR at 40KHz, output low. (May work the other way round but that's the concept). Assuming each floor has access to some power you can just stack up several IR LEDs to generate enough intensity to go all 320 feet.

    You should be able to run those off the same serial data signals you were going to put on your wire.

    The car would need two such IR receivers, one to see floors above and one to see floors below. The output is simple digital data that could go to a Uno.

    Each floor needs some sort of micro, not necessarily a full blown Uno as it has just a few simple tasks to perform. Each floor needs LEDs to light up and down to point at the car, and perhaps two receivers too so it can block itself if another floor is transmitting, and perhaps to get an acknowledge signal from the car. Also it needs the user button (of course!) and LED output (feedback to tell person on the floor their call is active) (if they don't get feedback they WILL break your button pressing it too hard).

    It leaves open the question of how the call button micro knows the car has stopped for it to clear the feedback LED.
     
Loading...