Project tutorial
How to Use NMEA-0183 with Arduino

How to Use NMEA-0183 with Arduino © GPL3+

How to connect GPS, SONAR, sensors, auto pilot units etc. in ships and boats via NMEA 0183 to Arduino.

  • 251 views
  • 0 comments
  • 1 respect

Components and supplies

About this project

NMEA-0183 is an electrical standard to connect GPS, SONAR, sensors, auto pilot units etc. in ships and boats. In difference to the newer NMEA 2000 standard (based on CAN) the NMEA 0183 is based on EIA RS422 (some older and/or simple systems use RS-232, or a single wire).

I want to show you how to connect an Arduino UNO (or any other Arduino) to any NMEA-0183 device with differential output. Although the standard calls for isolated inputs and outputs its useful to use our RS422/RS485 Arduino Shield with isolated interface.

Connection to NMEA 0183

In the picture below you can see a typical device with differential output. The terminals are NMEA OUT+ and NMEA OUT- or TX+ or TX-. The NMEA IN+ and NMEA IN- wires are optional.

If you have a single transmit wire from your device (most likely labeled TX or NMEA OUT or something like that), then your device uses the RS-232 protocol. In this case you will need a simple RS232 converter.

Jumper Setting

  • UART RX to position 2
  • UART TX to position 3
  • Voltage to position 5V

DIP Switch Setting

Firmware

You can find a lot of different NMEA-0183 software stacks for Arduino. A very good solution is the NMEA library by Justin R Cutler

https://github.com/jrcutler/NMEA0183

It's necessary needed to change the pins for the software UART to pin 2 and 3!TakecarethatthebaudrateofthesoftwareuartisthesameasinyourNMEAdevice-typical4800Baud.

Test Run

After compilation and uploading the program will decode incoming NMEA protocols. You can open the serial monitor to see the decoded protocols.

If you have no NMEA device at home, you can also use a Simulator on your PC and a simple USB to RS485 adaptor instead of a real device.

Code

NMEA 0183 demoArduino
Parsing NMEA 0183 protocols
#include <NMEA0183.h>

// matches Zihatec RS422/RS485 shield
SoftwareSerial gps(2, 3);
NMEA0183 nmea;

void setup()
{
  while (!Serial);
  Serial.begin(115200);
  gps.begin(4800);
  Serial.println("NMEA0183 parser test");
}

void loop()
{
  if (gps.available())
  {
    char c = gps.read();
    if (nmea.update(c))
    {
      Serial.print("NMEA0183 sentence accepted (");
      Serial.print(nmea.getFields());
      Serial.print(" fields): ");
      Serial.write(nmea.getSentence());
      Serial.println();
    }
  }
}

Comments

Similar projects you might like

Motion Following Motorized Camera Base

Project tutorial by Lindsay Fox

  • 115,503 views
  • 70 comments
  • 297 respects

Version 2.0 Advanced Attendance System (Without Ethernet)

Project tutorial by GadgetProgrammers

  • 16,826 views
  • 45 comments
  • 64 respects

Arduino Sunflower: An Electronic Sun-Dancer

Project tutorial by SURYATEJA

  • 6,330 views
  • 4 comments
  • 19 respects

Auto-Turret with Pixy and Nerf Gun

Project tutorial by RobotGeek Projects Team

  • 6,145 views
  • 0 comments
  • 21 respects

Ambient Light Sensor Using Photo Resistor and LED Lights!

Project tutorial by DCamino

  • 3,653 views
  • 4 comments
  • 18 respects

HEARTBEAT SENSOR project

Project tutorial by SURYATEJA

  • 2,923 views
  • 0 comments
  • 0 respects
Add projectSign up / Login