NMEA 2000 protocol guide

NMEA 2000 Protocol: A Technical Guide

NMEA 2000 is the communication protocol that lets modern marine electronics share data quickly and reliably on one network. This guide covers its structure, advantages, message format, network topology, how it differs from NMEA 0183 and where it is used.

4 min read
In this article 10
  1. What is NMEA 2000?
  2. Technical overview
  3. NMEA 2000 message structure
  4. Common PGNs
  5. NMEA 2000 vs NMEA 0183
  6. Applications
  7. Example Python code
  8. Conclusion
  9. Frequently asked questions
  10. Related guides

What is NMEA 2000?

NMEA 2000 (N2K) is a high-speed, multi-device marine network standard from the National Marine Electronics Association, built on CAN bus. It standardises data exchange between GPS units, AIS, radar, sensors, autopilots and engine systems.

Technical overview

1. Physical layer

  • Bus: CAN (Controller Area Network), based on ISO 11783 / J1939
  • Bit rate: 250 kbit/s
  • Cabling:

– Backbone: the main trunk running through the boat

– Drop cables: short cables from the backbone to each device (up to 6 m each)

– Terminators: a 120 Ω terminator at each end of the backbone

– Power: the network carries 12 V power for low-draw devices

  • Connectors: Micro-C or Mini-C (DeviceNet style)
  • Size: up to 50 physical devices (load equivalency limits apply)

2. Data format

  • Unlike the ASCII sentences of NMEA 0183, NMEA 2000 uses binary data.
  • Each message type is identified by a PGN (Parameter Group Number).
  • A single CAN frame carries 8 bytes of data. Larger messages use fast-packet (up to 223 bytes) or the ISO transport protocol (up to 1785 bytes).

NMEA 2000 message structure

The 29-bit CAN identifier and data field carry:

FieldDescription
Priority0 (highest) to 7 (lowest)
PGNUnique identifier of the message type
Source addressAddress of the sending device (claimed automatically)
DestinationTarget device, or 255 for broadcast
Data fieldUp to 8 bytes per frame
CRCChecked by the CAN hardware

Common PGNs

PGNMessageDescription
127250Vessel HeadingHeading data
127488Engine Parameters, Rapid UpdateEngine RPM, boost, trim
129025Position, Rapid UpdateLatitude and longitude
129029GNSS Position DataFull GNSS fix: position, altitude, satellites
130306Wind DataWind speed and direction

NMEA 2000 vs NMEA 0183

FeatureNMEA 0183NMEA 2000
Data formatASCII sentencesBinary (CAN bus)
Speed4800 bit/s (38400 for AIS)250 kbit/s
TopologyOne talker, several listenersMulti-device network
Message identitySentence ID (e.g. $GPRMC)PGN
Talkers per wireOneMany
ElectricalRS-422 (often RS-232 in practice)CAN, Micro-C/Mini-C

See the NMEA 0183 protocol guide for the sentence format.

Applications

NMEA 2000 is used wherever several marine devices must work together:

  • GPS and navigation systems
  • AIS (see the AIS guide)
  • Radar
  • Autopilots
  • Engine monitoring
  • Weather sensors
  • Depth and wind instruments

Example Python code

The CAN identifier is not the PGN itself: the PGN, priority, source and destination are packed into the 29-bit ID. This example reads frames from a SocketCAN interface on Linux (for example a USB-CAN adapter) and decodes the ID:

import can

# Listen to NMEA 2000 frames over SocketCAN (e.g. a USB-CAN adapter on can0)
def parse_id(can_id):
    priority = (can_id >> 26) & 0x7
    dp = (can_id >> 24) & 0x3          # EDP + DP bits
    pf = (can_id >> 16) & 0xFF         # PDU format
    ps = (can_id >> 8) & 0xFF          # PDU specific
    src = can_id & 0xFF
    if pf < 240:                       # PDU1: PS is the destination address
        pgn, dst = (dp << 16) | (pf << 8), ps
    else:                              # PDU2: broadcast, PS is part of the PGN
        pgn, dst = (dp << 16) | (pf << 8) | ps, 255
    return priority, pgn, src, dst

bus = can.interface.Bus(channel="can0", interface="socketcan")
for msg in bus:
    if not msg.is_extended_id:
        continue
    prio, pgn, src, dst = parse_id(msg.arbitration_id)
    print(f"PGN {pgn} prio {prio} src {src} dst {dst} data {msg.data.hex()}")

To decode the data fields, use a PGN database such as the open-source canboat project. Remember that many messages span several frames (fast-packet) and must be reassembled first.

Conclusion

NMEA 2000 provides fast, multi-device and reliable data communication on modern boats. Compared with NMEA 0183 it is a true network, and it has become the standard for marine automation, sensor integration and navigation.

Frequently asked questions

Can I connect NMEA 0183 devices to an NMEA 2000 network?

Yes, with a gateway that converts sentences to PGNs and back.

Why does my NMEA 2000 network not work?

Check that there are exactly two terminators, the backbone is powered once, and the drop cables are within length limits.

Is NMEA 2000 the same as SeaTalk NG or SimNet?

Those are brand versions of NMEA 2000 with different connectors; with adapter cables they work on the same network.

Found this useful?Share it with a friend or follow us on Instagram for new projects.

Similar Posts