NMEA 2000 Shield

Hey guys...
My plan is to use a Garmin GFS10 for fuel consumption and level alongside an Arduino DUE faced with Engine Data Acquisition ( It's and older boat, not fuel injected ) and everything is analog. With that being said I would like to use this as an performance tracking tool and as backup if one of those gauges start to "lie".

Would like to add the following items into the NMEA2000 Stream with the DUE.

  • Engine RPM ( I will have to devise a simple circuit as the only signal I have is from the coil )
  • Engine Water Temp
  • Port Exhaust Temp
  • Starboard Exhaust Temp
  • Water Temp / Speed ( Using Mercruiser 859223 Unit )
  • Heading / Compass
  • Trim / Tilt

I'm going to be using an Lowrance Elite 7Ti as an display unit.

Hi Guys,

I have not followed this forum for a while, since I should get messages by email and I have not got any until now. So I have thought this has been dead. Here are some late answers.

Please check arduino library on GitHub - ttlappalainen/NMEA2000: NMEA2000 library for Arduino . It has been developed more and used by several projects. Under documents there are drawings to make own devices and how to start with library. Under examples there are ready code e.g. for sending some temperatures.

Adrculda:
So for sending engine RPM you just use:
SetN2kEngineParamRapid(N2kMsg, EngineInstance, RPM);
NMEA2000.SendMsg(N2kMsg);

For engine water temp you need to use
SetN2kEngineDynamicParam(N2kMsg, 1,N2kDoubleNA,N2kDoubleNA,EngineWaterTemp,N2kDoubleNA,N2kDoubleNA,N2kDoubleNA);
NMEA2000.SendMsg(N2kMsg);

And for temperatures as in example TemperatureMonitor.ino
SetN2kTemperature(N2kMsg, 1, 1, N2kts_ExhaustGasTemperature, ExhaustTempPort);
NMEA2000.SendMsg(N2kMsg);
SetN2kTemperature(N2kMsg, 1, 2, N2kts_ExhaustGasTemperature, ExhaustTempStarboard);
NMEA2000.SendMsg(N2kMsg);

Hobbe1979:
PGN 60928 is only for address claiming and it will be done only when requested. So that should ne be sent frequently. Unfortunately some units expects it. E.g. my Garmin GMI 20 does not.

Dick3:
In NMEA2000 library there is ready function SetN2kRudder. If you need to know how data is build, read code on N2kMessages.cpp.

Enzycal:
Yes you can. It is almost the same as my sample schematic: https://github.com/ttlappalainen/NMEA2000/blob/master/Documents/ArduinoMega_CAN_with_MCP2515_MCP2551.pdf

Hello,

My goal is to get speed information from Raymarine a67 and display it in another display/meter.

Problem is that when Raymarine contacts satellites, NMEA messages ends from Raymarine and Raymarine don´t receve any messages from AT90CAN128.

When Raymarine is tested indoors and it can´t get satellites, system shows work just fine.
For example it ansewers ISO reguest speed IDE: 59904 Data: 128259 (speed), even without address claim.

What would be the solution?

  1. Should i pay attension something in address claim?
    (Field informations, Device instance, Manufacturercode etc.)

  2. Should Product Information(126996) be send, even Raymarine or ohter nodes don´t request it?
    (Tryed to send, but Raymarine not seems to understand message)

  3. Or should i give up and by Actisense NGT-1 ISO? Could it be the solution of this project. Any experiences from Actisence?

Harware setup:
-AT90CAN128
-MCP2551
-Raymarine a67

Thanks,

Jukka Penttinen

Hi jukkap,

First do you use my NMEA2000 library with NMEA2000_avr?
Have you tested just listen traffic on bus by using example ActisenseListener and do you get it right?
What is your other display?

  1. I have tested a lot with Garmin GMI 20 and it seem to be rather flexible. With my current address claiming code it works fine. But some other system required that address claiming should be sent every 2 sec. So who can say about Raymarine does it accept only registered manufacturer instead my default 2046, which is the highest possible value.

  2. In principle there is no need to send product information without request. Devices should register devices on the bus by address claiming and if they are interested about sender, then they should request product information.

  3. I have NGT-1 ISO and it is good. After writing NMEA2000 library I have done everything with with it and NGT is just as a spare on boat.

If you are located in near Turku I would be interested to test your MFD with Arduinos.

So...

Went Ahead and Ordered a waterproof enclosure and will be using an AMP seal connector for the sensor inputs from the engine.

Does anyone know what the part number for the NMEA2000 connectors are ??
I'm almost sure TE / AMP would be the one to supply them...

Look at these from digikey:

APC1760-ND $4.24

waterproof O-ring and mounting nut included.

Rfritz:
Look at these from digikey:

APC1760-ND $4.24

waterproof O-ring and mounting nut included.

Thank you :slight_smile:

I've tried to build the TemperatureMonitor program for mega it gives the error message:

C:\Users\Nils\Documents\Arduino\libraries\NMEA2000_mcp-master/NMEA2000_mcp.h:62:84: error: 'MCP_16MHz' was not declared in this scope ...

If I build it with due settings it works. Unfortunately I don't have a duo board.
If I try to define MCP_16MHz

#ifndef MCP_16MHz
#define MCP_16MHz 1
#endif

I get:

C:\Users\Nils\Documents\Arduino\libraries\NMEA2000_mcp-master\NMEA2000_mcp.cpp:60:148: error: no matching function for call to 'MCP_CAN::MCP_CAN()'...

I think I have followed the instruction in Arduino NMEA2000 library
02.02.2016 pdf file
Does anybody know what can be wrong?

I tested with latest libraries and seem to work.

Note that you should not use original Seed studio can bus shield library. MCP_16MHz has been defined in developed version of CAN_BUS_Shield library in file mcp_can_dfs.h on line 250. If you do not have that, delete your Arduino\libraries\CAN_BUS_Shield-master and download it from GitHub - peppeve/CAN_BUS_Shield: Can Bus Mcp2515 8/16 MHz oscillator and install it.

Hi Timo,

Here is some deteails what I forgot mention.

timolappalainen:
First do you use my NMEA2000 library with NMEA2000_avr?

No. When I start this project I found some C CAN example from AvrFreaks harwared with AT90CAN128.
For me Adruino isn´t so familar yet, but maybe I should exlore it.

timolappalainen:
Have you tested just listen traffic on bus by using example ActisenseListener and do you get it right?

I have´n test bus any other device but follow bus traffic from Raymerine. Raymarine stops sending messages when it reachs satellites.
Now I´m gonna order Actisence so I can listen bus traffic and maybe get proceed this project by that.

timolappalainen:
What is your other display?

My plan is to get old Sumlog knotmeter to display speed from Raymarine == Retrometer :wink:

Here is some tests what I´m done whit my devices.

Raymerine gets AddClaim SpeedReguest Traffic on bus
Satellites done Tx + Rx (checked from Raymarine)

F F F T
F T T T
T T F F
And correction my previous message: I have to AddressClaim before can get or send any messages on bus.
So, thats seems to be OK.

Summary: I get that Actisense and see how does it works then.
Tanks for all so far. I raport results when I get that Actisense.

PS: Timo, I live in Vaasa and sail under WSF. Let me know if you are sailing here Kvarken.

You could try with my library before ordering NGT-1. If you just load my library, stuff for avr and try with example ActisenseListener, you should be able to see all traffic on bus with Actisense NMEA Reader.

Ok.

Maybe i should test it. Do I have to do some modifications to code when i use AT90CAN128 prosessor?

timolappalainen:
I tested with latest libraries and seem to work.

Note that you should not use original Seed studio can bus shield library. MCP_16MHz has been defined in developed version of CAN_BUS_Shield library in file mcp_can_dfs.h on line 250. If you do not have that, delete your Arduino\libraries\CAN_BUS_Shield-master and download it from GitHub - peppeve/CAN_BUS_Shield: Can Bus Mcp2515 8/16 MHz oscillator and install it.

Thanks, change of library did the trick!

JukkaP. I have not tested avr chips, but thomasonw used them and made the code. On library readme it says: "To use avr processors internal CAN you need also NMEA2000_avr library and avr_can library, which you can download from GitHub - thomasonw/avr_can: Object oriented canbus library for Atmel AVR CPUs used with the Arduino IDE.". So if you have selected avr board, the #include <NMEA2000_CAN.h> in example ActisenseListener should automatically select right libraries for you - you must have installed them ofcoarse.

Example ActisenseListener does not show itself on bus at all - it simply listens. To send some data e.g. temperatures, there is example TemperatureMonitor, which should work as well. I have tested all examples with DUe and Mega boards by using both Garmin GMI20 and NMEAReader. Some examples has been also tested with Teensy boards. I do not have avr boards, but thomasonw developed something by using my library.

Hi all,

For building NMEA2000 devices, check this link: KBox | Hackaday.io
It has build in several hw components for boating solutions. Available code has been build by using my NMEA2000 library.

Hi,

I'm new to these foruns. First of all thanks to everyone for sharing the information. I'm trying to send data from Arduino battery monitor example sketch to my N2k bus consisting of Garmin 720, 2 GMI10, one VHF 300i and 1 Airmar Intelliducer. I have one MCP2515 controller with TJA1050 transceiver working at 8 Mhz. From what I've realized the library is set for 16 Mhz as default. How can I change it to 8Mhz?

Thanks for your answers,

Gibas

Hi,

You should edit beginning of you BatteryMonitor sample with #define USE_MCP_CAN_CLOCK_SET 8:
...
#include <Arduino.h>
//#define N2k_CAN_INT_PIN 21
#define USE_MCP_CAN_CLOCK_SET 8
#include <NMEA2000_CAN.h> // This will automatically choose right CAN library and create suitable NMEA2000 object
#include <N2kMessages.h>
...

Hi,

As described in the begining of NMEA200_Can.h file.... I don't know how I've missed it. Thanks for your fast reply.

Regards,

Pedro

Hi!

I have trouble with 127506 PGN DC Detailed status.

I write any value of field 3 and display - "0%" !!!

Hi,

Which display you use? Do you have right type for value?

There is example MessageSender, which also sends that message as sample. I just tested that with NMEA Reader and it shows values as they have been set on sample code. One can test MessageSender code with single board by setting NMEA2000.EnableForward(true); on setup and then opening NMEA Reader to board port. You can test your code in this way too.