Electronic – Max Distance for 5V serial communications

communicationmicrocontrollerserial

I have an application where two different microcontrollers need to communicate. I was thinking that for simplicity, just use 5V instead of converting to RS232 levels. What in good practice would the max distance be for single ended communications? (0-5V). At what distance / conditions should I consider a differential driver / receiver?

Best Answer

RS232 is a (well, two) single-ended transmission standard, with a typically large voltage swing (-12V to 12V, 24V high to low (with a -3V to 3V dead Spot)). It's easy to get information on distance for RS232:

The RS-232 standard 9600bps port will drive 15 metres of shielded cable. More precisely, an RS-232 line driver will operate against a capacitance of up to 2500 picofarad with low enough skew to allow a 9600bps signal to be recovered.

If you select a cable with lower capacitance you can drive further distances. For example, ANSI/TIA/EIA-568-A unshielded twisted pair category 5 cable has a maximum capacitiance of 55pF per metre, so this popular "UTP cat 5" cable can be safely driven up to 45m. Beyond that you should check the cable manufacturers specifications for the actual "shunt capacitance" (a common figure is 47.5 pF/m, giving a maximum cable length of about 50m). However long runs of unshielded cable will pick up noise easily, as the RS-232 signals are not balanced. Some cable manufacturers offer shielded low capacitance cables which can be driven up to 100m.

With RS232, shielding and twisted pair both offer some noise filtering, allowing for higher speeds or longer distance.

TTL level serial/UART for your setup only has 5V swing. Combining The low voltage swing, you have to figure three things. One is cable resistance. All cables have resistance that adds up. While negligible at small distances, the longer the cable and higher the current, the more the voltage at one end changes compared to the other end.

Two is cable capacitance. The higher the capacitance, the more it resists changing from one voltage Level to the other. The higher the capacitance, the slower it changes and more rounded off the signal gets. So with higher speed and greater distance or capacitance, the signal will start to look less like a square wave and more like a sine wave.

Three is noise. Due to the lower voltage swing, lack of differential signaling, or error correction, the more it affects the communication. Shielding and twisted pair will help.

Based on that, I guess, not having found any good information online, that 5v 9600 bps, could do 50 feet/15 meters on generic UTP Cat 5 just fine.

In general, the faster the speed + the higher the capacitance + the smaller the voltage swing = the shorter the distance, before you even get into noise. There is no flat rule of thumb.