NMEA2000 and ESP32

First of all, a few important notes that you should definitely pay attention to.

NMEA2000 is increasingly replacing NMEA0183 as the standard. Unfortunately, NMEA2000 is a very complex protocol and for a long time it was hardly possible to realize your own projects. That has changed with the NMEA2000 library by Timo Lappalainen (https://github.com/ttlappalainen/NMEA2000).

The library supports different microcontrollers, including the ESP32. The ESP32 from Espressiv is very powerful and, thanks to WLAN and CAN bus interface, ideal for your own projects.

The projects described here use the NMEA2000 library and the ESP32 (ESP32 NODE MCU). Programming is very easy in the Arduino development environment.

The projects are documented in detail on GitHub (including hardware and software): https://github.com/AK-Homberger.

The following projects have been implemented so far and can easily be copied or modified / expanded:

  • NMEA2000 to NMEA0183 WiFi Gateway
  • NMEA2000 M5Stack Data Display
  • NMEA2000 Data Transmitter
  • NMEA2000 Data Recorder

The essential components for the trade fair were put together on a demo board. This allows the interaction of the components to be clearly illustrated:

The Seatalk autopilot remote control is also included on the demo board, but is explained on a separate page (https://open-boat-projects.org/diy-fernbedienung-fur-autopilot-raymarine/).

The simulator board is only for the trade fair and is used for demonstration purposes. It receives simulated data from a PC via USB-serial, converts them into NMEA2000 PGNs and sends them to the CAN bus. The simulator was built with the ActisenseListenerSender realized by Timo Lappalainen. The WiFi gateway receives the NMEA2000 data from the CAN bus and thus supplies other exhibits on the exhibition stand with simulated data.

NMEA2000 to NMEA0183 WiFi Gateway

  • The WiFi gateway receives the data from the NMEA2000 CAN bus and converts it to NMEA0183.
  • The NMEA0183 data are provided via WLAN (NMEA0183 via TCP, port 2222).
  • The data can be displayed / used by many components. For example: OpenCPN, AVnav, tablet with NMEA software, ...).
  • The gateway also delivers the data in JSON format. The data can then be viewed wirelessly with the M5Stack data display.
  • The project on GitHub also contains a NMEA0183 multiplexer (serial input for AIS data) and voltage / temperature monitoring. However, these functions are optional.

WiFi gateway prototype:

M5Stack and AVnav on 7 ”car radio with data from the WiFi gateway:


NMEA2000 M5Stack Data Display

  • The M5Stack is a finished product with an ESP32 and housing. The integrated display, the built-in rechargeable battery and the buttons make it particularly suitable for displaying NMEA data.
  • The version of the Data displays (top left) receives the data wirelessly from the WiFi gateway in JSON format.
  • The data types can easily be expanded. So far, the following data is displayed: LAT / LON, COG, SOG, heading, STW, rudder angle, water depth, triplog, sumlog and the data from the NMEA2000 data transmitter: temperature, diesel tank and engine speed.
  • On GitHub A version of the display is also available that reads and displays the data directly from the NMEA2000 bus. Optionally, the M5Stack module also functions as a WiFi gateway. This means that an NMEA2000 to NMEA0183 WLAN gateway can be implemented without soldering.

NMEA2000 Data Transmitter

  • The NMEA2000 Data Transmitter measures different values in the boat (here temperature, tank level, engine speed) and sends them as NMEA2000 data.
  • This NMEA2000 data can be received and displayed by almost all modern multifunctional displays.
  • The temperature is measured by a DS18B20 sensor (can be easily expanded with additional sensors).
  • The circuit on GitHub is designed for a TGT 200 tank sensor from Philippi (resistance 5-180 Ohm).
  • The engine speed is measured on the alternator (terminal W).
  • The circuit and the program can easily be expanded for further measurement data.
  • For the demo board, the tank level and the engine speed are simulated using potentiometers.

NMEA2000 Data Recorder

  • The NMEA2000 Data Recorder reads all data from the NMEA2000 bus and saves it on an SD card.
  • The data can be saved in different formats: NMEA0183, Seasmart, Actisense).
  • In addition to the ESP32 (here Node MCU), only an SD card and a CAN bus transceiver are required.
  • An M5Stack module can also be used as an option. This already contains an SD card reader.
  • The data recorder is not included on the demo board.