9

I am building a project in which two Arduinos will be linked by three wires: TX an RX for serial communication and a common GND. What would be the maximum length of the wires here before communication gets affected?

I am using an Arduino Mega R3 on one side and an Arduino Mini on the other one.

I have no particular requirement for the Baud rate, I could use the lowest one if this helps in any way.

0

2 Answers 2

4

You need to specify

  • The order of range you are interested in - is it in the order of metres, tens of metres, kilometers or interstate ?:-) . ALL are possible with suitable compromise.

  • How you intend to connect to the circuit - direct Arduino pins, high/low buffer, differential drivers, ...

If you use 5V/0V "unipolar" then at say 9600 baud you can get many metres with suitable drivers. If you use an Arduino pin directly wire resistance and inductance will start to matter as range increases.

At 300 baud you can achiever hundreds of metres with twisted pair cables. As range increases aspects like cross-talk from the other circuit and external noise increase in importance. At longer ranges having 4 wires with signal + ground twisted together in each case helps BUT it is likely that at ranges of interest 2 wires plus ground will work OK.

If you are prepared to use enough voltage and slow enough signalling you can signal over thousands of miles - as was done with very early telegraph cables. The thousands of volts needed and signalling speeds of perhaps a few bits per second will be a disincentive in most cases.

7
  • The distance I would like to cover is approximately 40-50 metres from inside our house to the gate outside. My intention was to connect the relevant Arduino pins directly with a cable that I found from a previous intercom installation.
    – hobie
    Mar 24, 2015 at 12:07
  • 2
    Some danger to Arduino with longish runs of cable. Induction, leakage, electrostatic charge. (Lightning & ground rise from power fault only maybe but ...). Reverse clamp diodes to power supply rails on all lines a good idea. Basic driver IC a VERY good idea. Even an xx74xx14 hex Schmitt inverter IC at each end would be useful. (where xx is varies with family). Proper line drivers even better but that's a start. IF your Arduino is valuable use a buffer. Mar 25, 2015 at 2:00
  • Thanks everyone for the comments and suggestions. In order to find out if I can cover the given distance (ca. 40m) with a simple connection, I gave it a try with two Arduino Uno, respectively set up as a sender and receiver. The boards are directly connected via the TX/RX lines (pins 0 and 1) at 9600 bits per second. The sender sends out a test string every second while the receiver is listening for incoming data. I am using an existing line (no info about the quality/specs of this cable. Anyway, the sender/receiver pair seems to work without any problem at this distance and configuration.
    – hobie
    Mar 30, 2015 at 11:12
  • Thanks, would you have any particular suggestion / link to an IC or driver chip?
    – hobie
    Feb 28, 2016 at 20:54
  • @hobie At 50 metres and 9600 baud you can probably achieve OK results (try it and see) with almost any 5V digital driver IC and even just digital output ICs. A useful starting point are the Schmitt trigger CMOS inverters typically 74xxx14, CDxxx14, MM.....14. Look for Schmitt triggered inverters, avoid the lowest drive power ones. Mar 1, 2016 at 15:26
0

This is not exactly what you are asking for but it would be robust and available at low cost in the form of arduino modules. The way I would do it is use a Can Driver and receiver on each end. They are inexpensive differential line drivers. There is nothing that prevents using Async at whatever baud you want up to about 1 megabaud. Run a wire for ground it helps. You will wind up using 5 conductors or 2.5 pairs of wire. Ethernet cable should work fine. You can send some power over the spare wires if you like. You also have the option of using some of the automatic CAN drivers that automatically switch to transmit mode when data is sent and receive otherwise, this will keep you to three wires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.