NMEA 2000 Shield

Thank you for your reply. Here is my current code for this part :

 // ++++++++++++++++++++++++++++++++++++ Engine Parameters, Dynamic ++++++++++++++++++++++++++++++++++++
  updateRate = 500; // 2 * / s
  priorite = 5;
  PGN = 127489;  // Paramètres environnementaux bus NMEA 2000 (N2K)
  source = 35;   // Airmar = 35
  adresse = priorite * 67108864 + PGN * 256 + source;
  float tempwc =  95; //TWEng;  // Celsius  Engine Water Temp
  long tempwk =  100 * ( tempwc + 273.15 );
  long tempw1 = ( tempwk & 0b1111111100000000 ) >> 8;  // mise en forme format CAN 16bits
  long tempw2 =   tempwk & 0b0000000011111111;

  float PressEng = 200;  // Lecture capteur pression resolution = 8 bits pour essai.
  long PressEng_ = 20 * PressEng;
  long PressEng1 = ( PressEng_ & 0b1111111100000000 ) >> 8;  // mise en forme format CAN 16bits
  long PressEng2 =   PressEng_ & 0b0000000011111111;

  message.id = adresse;
  message.ide = 1;
  message.rtr = 0;
  message.dlc = 8;
  message.data[0] = 0;   //  SID 
  message.data[1] = 0;   //  Engine instance  8bits    0=Single Engine
  message.data[2] = 0;   //  doit etre  à 0 pour lecture 2 octets plus bas. Oil press = 0 si 255
  message.data[3] = PressEng2; //PressEng2;   
  message.data[4] = PressEng1; //PressEng1;   //  Oil   Press huile 1=0,3  2=0,5  3=0,8  4=1b  28=7,2b
  message.data[5] = 255;   //  ????
  message.data[6] = tempw2;   //  Temperature eau moteur - 16 bits (sonde DS18B20)
  message.data[7] = tempw1;   //  Temperature eau 
 /* Serial.print("TEMPERATURE EAU MOTEUR : ");
 Serial.print(tempw2);  Serial.print(" - ");

  message.data[1] = 1;  // 1 paquet supplémentaire
  message.data[2] = 0;  // Alternateur
  message.data[3] = 0;  // Alt
  message.data[4] = 0;  // Fuel rate
  message.data[5] = 0;  // Fuel rate
  message.data[6] = 1;  // Hour
  message.data[7] = 0;  // Hour
  message.data[8] = 0;  // Hour


  message.data[1] = 2;  // 1 paquet supplémentaire
  message.data[2] = 4;  // Hour
  message.data[3] = 0;  // Coolant press
  message.data[4] = 0;  // Coolant press
  message.data[5] = 0;  // Fuel press
  message.data[6] = 0;  // Fuel press
  message.data[7] = 0;  // reserved
  message.data[8] = 0;  // Discrete Status 1


  message.data[1] = 3;  // 1 paquet supplémentaire
  message.data[2] = 0;  // Discrete Status 1
  message.data[3] = 0;  // Discrete Status 2
  message.data[4] = 0;  // Discrete Status 2
  message.data[5] = 0;  // Percent Engine Load
  message.data[6] = 0;  // Percent Engine Torque



allen652: I am using non-certified NMEA2000 cabling products that I had manufactured for my current project. I have several available for sale below if interested. See images. 2 meter cable (Male to Female) - $7.5 each T adapter - $7 each Male rear panel mount connector - $5 each

I have found that NEMA2000 is hardware wise follows the older DEVICENET so many parts interchange with out issues.

Compliments, Beautiful Code. But I have to try to translate Arduino uno.

I did not see how you code: address = priority * 67108864 * 256 + PGN + source;

I should probably comment my code better (and more often).

jpjcb66: The first 3 bits of the id is the priority, the next 18 bits are the PGN, and the last 8 bits are the source address.
See the comments in my code above in void loop().

priority = 000
PGN = 011111001000000000
source = 00000000

00001111100100000000000000000 binary = 32636928 decimal

// send data:  id , extended frame, data length = 8, data buffer
  CAN0.sendMsgBuf(32636928L, 1, 8, stmp);


I understand ! You put "source" = 0x0 Code Airmar = 0x25 (35dec). There exists an array of manufacturer codes ? For example what is the Volvo Penta code ?

Your code is perfect, thank you infinitely. jp

Hi friends I want to read 2 periodic data from maretron WSO100 module. PGN #130306 for wind data & #130310 for environmental parameters. As I read this PGNs send periodically every 100 ms & 500 ms... I use LPC1768 controller and do this steps to read wind data: 1) set CAN Controller baud rate to 250 kbit/sec 2) set ID to 130306(0x01FD02) in extended format 3) read can receive buff... But I don't receive any data on bus!!! what should I do??? what's wrong??? please help me... Thanks a lot


Want to read NEMA2000 stream from a Garmin Depth founder with a Arduino Due.

Just this device on NEMA network.

Did someone have code reference ?



I'm about to buy a "triducer", the Airmar DST800. It's going to send depth/temp/speed via NMEA2000. As a java programmer with zero experience with Arduinos (but lot of time to spend on it), do you think I have a chance, using existing resources, to decode these informations and display it on a e-ink display shield ? I don't absolutely need a ready-to-use solution, and a simple "yes you can" would be much appreciated to preserve my motivation ^^ Of course, I'll be back later with more accurate questions ;)

Yes you can.
Only challenge is parsing the NMEA data stream to pick out the pertinent info.
And then sorting out the e-ink interface. Probably just another serial data stream?

Thank you CrossRoads, I have an idea about the parsing challenge, and I guess I can use some existing code that parse GPS datas and adapt it. The e-ink display does not scares me that much, because if I don't succeed, I still have other display options. I'll put my code somewhere on this forum if I reach my goal =) See you !

Hi All,

I have been trying to find NMEA2000 shield without success, so I wrote my own. It can act as listener only and forward data to PC in Actisense or clear text format. Or it can act as Termperature sensor node with automatic address claiming. Or as I am making it as a NMEA0183 combiner/ NMEA200 converter and sensor node.

Library works with Mega board with MCP2551 chip or with Due board with its internal CAN controller.

Anybody interested?

Great timing, I just signed up to this forum and started looking for a library today !

Please count me in.

I am building a LiFePo4 alternator regulator and an active charge/monitor BMS and would love to have a full NMEA2k interface to connect my Maretron/Raymarine network.




Here is the sketch I have written to display the battery voltage on my boat.
It sends the PGN 127508 thru the NMEA 2000 network.
The voltage (Only one battery, Battery number 1= instance 0) can be read on:

  • Raymarine A78 MFD
  • B&G Triton

The Arduino+Shield (Seeedunio) pack is directly powered by the 12v supply

The voltage is read by the A0 pin through a voltage divider made with 2 resistors

It works well and seems to be reliable, but sometime the INT red led turns on solid. However it keeps on running, the network does’nt hang up.


Voltmetre_N2K_V2S.ino (7.29 KB)

Voltmetre NMEA2000 Arduino sur A78 s .jpg

Voltmetre NMEA2000 Arduino sur Triton T41 s.jpg


You can find NMEA2000 library and samples on https://github.com/ttlappalainen. The best would be to use Arduino Due, since it needs only MCP2562 tranceiver for connecting to the bus. It also has 8 byte double for better calculations.

My own setup is running and it has also 3 NMEA0183 inputs for combiner and tranfer data to N2kBus. So with Arduino Due and 4 extra chips this replaces 4 devices: NMEA0183 combiner (e.g. Brookhouse), NME0183->N2k (Actisense), N2k->PC (Actisense), MOB device.


Good job Timo.

I have not understood everything but it is very interesting.

Amicalement. François


Can you provide any pictures or other details of your hardware setup? How you hooked everything together. VERY interested!


timolappalainen: Hi All,

I have been trying to find NMEA2000 shield without success, so I wrote my own. It can act as listener only and forward data to PC in Actisense or clear text format. Or it can act as Termperature sensor node with automatic address claiming. Or as I am making it as a NMEA0183 combiner/ NMEA200 converter and sensor node.

Library works with Mega board with MCP2551 chip or with Due board with its internal CAN controller.

Anybody interested?


Hello. Wanted to let you know I have just posted up a very rough cut of a NMEA-2000 / Alternator regulator bridge based on your lib. I made some extensions to include some additional PGNs - and once proofed out a bit will submit a pull back to your get-hub lib.

This bridge is intended to run on a Due, and takes the ASCII status strings from my Arduino based Alternator Regulator and send them out to the NMEA-2000 bus. At this point is is rather unproven as I lack some additional hardware (specifically, the NEMA-2000 display side), am not settled on which PGNs should be broadcasted, and I am not totally sure I have extended your libs correctly :o

Source, extended libs (draft form), as well as a bit more details here: http://arduinoalternatorregulator.blogspot.com/2015/09/very-rough-nmea-2000-bridge-source.html

Looking forward to perhaps getting this a bit more settled.

Hi PogCarr and thomasow,

I'll try to upgrade GitHub with pictures and extension as soon as possible. I have been a bit busy with othe project.


Hi all,

Now there is upgraded version of NMEA2000 library and some drawings under Documents in https://github.com/ttlappalainen/NMEA2000

I have to laugh when I see some of your posts describing yourselves as ‘beginners’. To me a lot of this is like a foreign language and you are experts compared to me!

Perhaps someone can help me if I describe where I am at and where I am trying to go

I have managed to set up an Arduino to create NMEA0183 sentences from analogue data, combine with NMEA0183 sentences from other instruments and transmit in NMEA0183 format.

I need to now translate that to NMEA2000 to feed a different network

From this thread I have managed to understand that I will need to buy or make a Canbus shield, to attach to the Arduino. Also that I will need to download and include various Libraries.

What i do not understand, nor can I find any obvious reference, is what I then have to do to convert the data obtained via N0183 to N2000?

Where is this step? Is it proprietary? Is everyone having to do their own reverse engineering, or is this staring me in the face somewhere that I have missed?

Unfortunately my knowledge of electronics is zero. I can connect one terminal to another, I can solder, I can construct but I have no understanding at all of what is happening inside the device! I struggle with simple concepts like transmission speed, capacitors, diodes, transistors etc.

I’ just want an idiots guide to try and get this working. It sounds like many of you have managed but I cannot make the jump from the sample sketches to the real thing.

For example if I have a simple wind sentence from NMEA0183


How do I get that data or part of that data, broadcast to N2000?

Thanks if anyone can help