This page last updated Jan 9, 2023
This section covers various topics related to NMEA2000 systems including:
- Building a NMEA2K Sniffer & Breakout Box
- NMEA2K Troubleshooting & Information
- Simrad SIMNET Information & Issues
- Arduino ESP32 NMEA2K Projects
DIY NMEA2K Sniffer
NMEA2000 is a CANBUS based network used to connect multiple sensors, controllers and displays in a marine environment. It was created by the NMEA and while it is an open standard, the details of it are not made public. This can make troubleshooting difficult unless you are willing to spend $$ for the commercial tools that are available for testing.
Lucky for us someone has made some open source code that runs on a Teensy, Arduino Due or an ESP32 that lets you build the hardware interface for less than $25.00.
My brother in-law was having issues with some of the instruments on his sailboat so I wanted to make an adapter that would let me not only see the NMEA2000 data but also let me easily check the voltage and termination resistance as these are common fault issues with the system.
I felt that perhaps using an isolated transceiver would be safest (after all its not my boat) but couldn’t find the ISO1050 in stock so I ended up ordering some MCP2562 chips. I looked around for any low cost isolated CANBUS interfaces but couldn’t find anything until I stumbled on this page:
In their examples they used the M5ATOM CANBUS interface that is isolated and already built. And it comes with a ESP32 processor. It seemed a bit pricey at $31.00 CA (I’m used to the really cheap AliExpress modules) but it’s isolated, small and already built so it was going to save me time.
Building the NMEA2000 Sniffer & Breakout
Above you can see what I put together. It has a standard NMEA2000 Micro connector that lets it connect into the network. I also added binding posts that break out the various signals. This lets me check the supply voltage level (should be between 9 and 15 V) and the termination resistance (should be around 60 Ohms but make sure you measure with the power off!!). I also added a 120 Ohm termination resistor for termination that I can switch on if needed.
The wiring was pretty simple and the M5ATOM controller just fit into the box I used. One complication is that the controller uses a USB Type-C connector and the supplied cable is too short to use. I could find a reasonably priced USB Type-C to Type-A cable so used a 2 meter USB Type-A extension cable. It makes for a nice compact device that should be able to take some abuse while working in the tight confines of the boat.
I simply cut a slot in the case to run the USB lead out. Due to the tight fit I just wrapped the M5ATOM module with Kapton tape (it has some metal bits I didn’t want to short out on the back of the bunding posts) and left it loose in the case. Once I put the cover on it was all held in place nicely.
For the ESP32 code I used the ActisenseListenerSender code on Andreas’s page (https://github.com/AK-Homberger/NMEA2000-Workshop/tree/main/Software/ActisenseListenerSender-ESP32) . The only change I needed to make was the GPIO pin assignments for the CANBUS transceiver connections. In the code example he uses GPIO4 & GPIO5:
#define ESP32_CAN_TX_PIN GPIO_NUM_5
#define ESP32_CAN_RX_PIN GPIO_NUM_4
For the M5ATOM CANBUS interface you need to change these to:
#define ESP32_CAN_TX_PIN GPIO_NUM_22
#define ESP32_CAN_RX_PIN GPIO_NUM_19
Using the NEMA2000 Sniffer
Here is some of the NMEA2K testing you can do with the sniffer:
Voltage Test – Ensure your NMEA2K system power supply is turned off. Plug the device into the NEMA2K port using the standard drop line cable (or a SimNet to NMEA2K cable). Connect your multimeter (set for DC Voltage) across the Red and Black power binding posts. Turn on your NMEA2K power. You should see a value around 12V. It will be higher if your electrical system is charging and lower if you are running of battery. While NMEA2K is tolerant of a supply as low as 9V, I would be concerned about bad cabling or connections if it was much below whatever your battery voltage is measuring at.
Termination Resistance Test – Ensure your NMEA2K system power supply is turned off (and leave it off for this test). Plug the device into the NEMA2K port using the standard drop line cable (or a SimNet to NMEA2K cable). Connect your multimeter (set for Resistance ) across the White and Blue CAN-L and CAN-H binding posts. You should see a value around 60 Ohms.
Each end of your NMEA2K needs a 120 Ohm termination resistor. If these are properly installed then you will get a combined resistance (both 120 Ohm resistors in parallel) of 60 Ohms. If one of the termination resistors is missing then you will see a resistance of around 120 Ohm.
If you see a much higher resistance (possibly 50K Ohms or higher) then you may be missing both terminator resistors. If you see a lower resistance (say 40 Ohms) then you may have 3 terminators. Both of these conditions are typically problematic though if your boat has SimNet cabling and you add a SimNet noise filter you are effectively adding a third terminator (YMMV).
If you really want to get into the details of the various things you can measure for then check out the Maretron manual for their N2KMeter tester as it goes into a fair bit of depth of what values are allowable for the various signals.
NMEA2000 Sniffer – First download and install the NMEA Reader software from Actisense. Connect the USB cable from the ESP32 module to your PC. Take a note of the COM port it uses (you can check this using the Windows Device Manager). Fire up the NMEA Reader app and select the correct COM port and set the speed rate to 115200.
Ensure your NMEA2K system power supply is turned off. Plug the device into the NEMA2K port using the standard drop line cable (or a SimNet to NMEA2K cable). Turn on the NMEA2K power supply.
You should now see the streaming NEMA2K data in the Data View window of NMEA Reader. You can see all the devices, the addresses they are using, the refresh rate and the various PGNs that they are using the send data. You can enable logging and it will save the data in a format that you can open later using the Actisense EBL Reader software.
NMEA0183 Sniffer – First download and install the NMEA Reader software from Actisense. Since the NMEA0183 system is not a bus style backbone like NMEA2K you may need to disconnect your NMEA0183 device data wires from whatever it is connected to and ensure it is powered up. Connect a RS485 or RS232 to USB interface to your PC (depends on the version of NMEA0183 you are dealing with). Connect the RX and GND leads of the interface to the TX and GND leads of the NMEA0183 device. Select the correct serial port of your interface in the adapter in the application and adjust the speed to match your system (typically 4800 or 9600). You should now be able to view the streaming NMEA0183 data.
Saving A Capture – You can log and save the NMEA2000 (or NMEA0183) data using the logging function of the NMEA Reader software and then review it later using the Actisense EBL Reader software.
NMEA2000 Troubleshooting & Information
Here are some NMEA2000 related sites I found helpful for troubleshooting, projects and general understanding:
Simrad SIMNET Information
A further complication in my brother in-laws boat is that it uses the SIMRAD SimNet cabling system. This does use NMEA2000 compatible signaling but uses proprietary connectors and cabling which are hard to find (and being phased out by SIMRAD). If you are dealing with a SimNet system, here are some links you may find handy:
If you are having issues with SIMNET connected devices (especially the mast head sensor) then take a look at these threads about a noise filter than SIMRAD released but doesn`t really talk about anywhere (though some equipment manuals mention it):
Apparently at some point Hanse started adding these to all their boats with SIMNET.
On my brother in-laws boat we had a strange related issue. The boat has a non-working Sonic Hub (a NMEA2000 connected media server) which we removed to have it repaired. Turns out they are no longer supported so he would have to replace it. With iPhones and Bluetooth speakers (and no need to the various multiple zones and other features of the Sonic Hub) we just left it removed. Shortly after that he started sporadically losing the masthead wind sensor data. A power cycle of the instruments always brought it back but it was becoming a pain. And naturally SIMRAD no longer supplies a SimNet model to replace it. The options seems to be either the wired B&G WS310 ( which would require a NMEA0183 cable run up the mast and a SimNet /NMEA0183 convertor installed) or a wireless B&G 320 (that doesn’t need cabling as it uses a solar cell for power, but would need a NMEA2K/SimNet cable). Either would be over $1000.00 CA to get installed.
We didn’t immediately realize the link between removing the Sonic Hub and the wind sensor issue. The existing masthead sensor does have a termination resistor built in (therefore has to be at one end of the SIMNETT network) but the Sonic Hub is connected to a joiner in the middle of the system. One we correlated the problems we put the non-functioning Sonic Hub back in place and the issues seemed to go away.
This lead to some more research and the purchase of a SIMRAD SIMNET Noise Filter. It was only $33.75 CA and took a few weeks to get delivered from a local dealer.
It is about 4 inches long and appears to be a SIMNET power cable (with termination resistor) with the cable cut short and an electrolytic capacitor put across the power leads.
We should have ordered 2 of them because while I wanted to pull it apart the one we had, (to see what it consists of) I didn`t want to possibly break it so I didn`t.
Anyways it is all working now but time will tell if this is a permanent fix. Unfortunately there is very little accurate documentation on how the SimNet cabling is done of this boat so I am working on tracing it all out to make a proper diagram. Which of course is complicated by the fact nothing is labelled (all the cables are black) and it is all hard to physically reach. A works in progress.
We have had the filter installed for several months and had no further problem with the masthead wind sensor data dropping out. So in our case it definitely helped. $40 for the filters was a lot cheaper than $1500 for a new sensor.
Arduino ESP32 NMEA2K Projects
There are also code examples to make your own devices to send or receive data from the NMEA2000 data bus. You can find the code on Timo Lappalaine’s GitHub page: https://github.com/ttlappalainen/NMEA2000
He has great documentation here:
I found some more code and an excellent workshop for making your own NMEA2000 interfaces on Andreas Koritnik’s GitHub site here:
It’s in German but Goggle Translate works fine on it.
You can also use a cheaper ESP32 module and a CANBUS transceiver chip. I built another version using a WEMOS style ESP32 module and a MCP2562 CANBUS driver.
In the board above I added a BME280 sensor that includes temperature, humidity and barometric pressure. I put this together as a prototype for the sniffer and then used it for testing with the BME280 code from Andreas’s NMEA22000 Workshop examples