Questions seem to come up on occasion about wiring
, and use of RS-232. Hopefully this article will help understand the issue and be of use for other folks setting up an NMEA
network on their own boats.
This discussion is explicitly about NMEA-0183 - not NMEA-0180, NMEA-0182, NMEA-2000, SeaTalk
, etc. I've tried to write this technically correct, but hopefully more or less understandable without getting too loose on the details. If I've been overly sloppy, please don't hesitate to call me on them.
Strictly speaking, the NMEA-0183 specification calls for an RS-422 differential transmission
What's thedifference between single-ended and differential transmission
"single-ended" means that the signal is transmitted over a single
wire. The receiving end has to determine the voltage of this signal, and to do so it needs a reference. In a single-ended system, a "signal ground" is used as a reference. The receiving end essentially measures the voltage on the wire relative to this signal ground.
RS-232 is single-ended. A transmit wire has voltage relative to the signal ground. Note that in the case of a bi-directional configuration (where a particular device is both sending and receiving), the signal ground can be shared between the two.
The problem with single-ended transmission is that it can be prone to noise
. For example, if the cable crosses over other cables
, voltage can be inducted from the other cables
and the receiving end may not be able to distinguish the right signal relative to signal ground. The same thing can happen if the signal ground is not stable.
Also, the RS-232 specification states that it is point-to-point, so technically speaking you can only have a single
talker and a single listener. In other words, you cannot connect more than two devices together.
A "differential" transmission system works by transmitting over two wires. When one wire sends a voltage, the other wire sends the opposite voltage. The receiving end detects a transmission by comparing the voltage differential between these two transmit wires, instead of using a signal ground.
A differential setup is much less prone to inductive noise
because an inducted voltage tends to affect both transmit wires in the same way. The receiving end doesn't care because it's only comparing the difference between the two wires - in other words, the inductive noise will increase (or decrease) the voltage in both wires, but the delta
between the two will remain nearly constant.
Note that a proper differential transmission needs no signal ground, and a bi-directional setup (where a device is both transmitting and receiving) is supposed to require 4 wires, as there is no common reference ground. Also note that many "NMEA-0183" devices are loose on this. For example, both fixed-mount Garmin GPS
units I have onboard only provide a single transmit and receive wire; power ground must be used for reference.
RS-422 uses differential transmission. Unlike RS-232, the specification allows for multiple listeners - but you can still only have a single talker. So, you can connect more than two devices together, but only one can be a transmitter, the rest must all be receivers.
So why can I plug
my NMEA-0183 GPS
into my computer's RS-232 and get data? You can argue it's either good engineering or just plain blind luck. RS-232 receivers detect the correct voltage, even though we've technically muddled things by using the power ground from the RS-422 transmitter as a signal ground on the RS-232 receiver. Using the power ground wire as a signal ground works because the RS-422 driver in the GPS bases it's transmit voltages from this ground. In other words, the combination of the right transmit leg of RS-422 and power ground is effectively the same thing as the combination of transmit on RS-232 and signal ground.
The unfortunate thing about loose adherence to RS-422 and not providing proper differential wiring
is a much lower noise threshold. Where a single-ended system will start to become unreliable after maybe a couple dozen feet if you are lucky, a differential system can be reliable for several thousand feet. In an electrically noisy environment
like a boat this can make a big difference.