NMEA 2000 Shield

Hi Timo.

I'm quite new with Arduino but your work seems to be huge and amazing.

I would like to use the NEMA 2000 library to make a remote control for an Raymarine EV100 Autopilot. This new generation of autopilots talks with seatalkNG which is, I think NMEA2000. I want to use a 433Mghz remote.

Have you ever try this ? Do you think it could be doable ?

In advance, thanks

Yes it is doable. I have the same problem. But there is big challence, since all autopilot control commands are proprietary. This means that there is no documentations about them. So this requires bus traffic spying and some knowledge of the NMEA2000 protocol, since you have to read messages bit by bit to find out how autopilor will be controlled.

I have older model SPX-10 and I would imagine they use same protocol. Last summer I did some spying and I think I found a way to send course command to pilot and the way how to turn pilot on/off. Anyway I have not tried that yet.

So now it depends very much about you total skills can you do it or not.

Thank you for your answer.

My skills in C/C++ are almost at zero :( . I will try to investigate all of this and I will at first try to do an NMEA0183 -> NMEA2000 converter to train... I'll tell you if I go further.

But have you used other languages? C/C++ is not the easiest to start.

In my repository there is also NMEA0183 library, which I have used for my NMEA0183 -> NMEA2000 converter. There is also ready example.

Hello Timo,

I made to proto types of can adapters now. One for the 2560 and the other for the DUE.

So now my plan is to get the DUE to send GPS data from a Blox NEO-6m (NMEA2K based GPS) on the NMEA2K bus. I have a MFD from Raymarine (Axiom 9") which shell show all analog data from the engine and use the new build external GPS reciever.

I think the best is to start to simulate the engine temp as first try and get it shown on the MFD.

My problem is that I am a bit confused about what hae to be used (libray) where and how. I found the NMEA2K sender example. I guess this is the one to use with the CAN shield to send the messages on the bus. BUT do I have to use a seperate Arduino to convert the analg signal to nmea2k message which than will be send through the DUE which is running the sender library?

I have read a lot of sites from this post but this made it more worth?! :astonished:

So like I wrote the plan is to grap all analog data signals from the engine and drop it to the MFD through nmea2k.

Lets say I have engine coolant temp, rpm, oil pressure, battary voltage/charge, gasoline/hr, tank level, rudder position and air temp in the engine room.

How would you organize this and what is to be used where? I meen for example 2560 for coolant temp behind the DUE which is running the sender?

Would be great if you could help me to understand the general setup!

Thank you and happy holidays to all!

Br

I rather prefer to take TemperatureMonitor as first example to make something work. You can run it either with Mega (2560) or DUE. It will compile on both without problems. Others have had problems with DUE to send data to bus for some reason, which is not yet clear for me. In any case load mcp_can and due_can libraries from my GitHub repository, since e.g. newest due_can on Collin repository does not work with NMEA 2000.

So in principle all your data "engine coolant temp, rpm, oil pressure, battery voltage/charge, gasoline/hr, tank level, rudder position and air temp in the engine room" can be collected with one board and send to bus. Practically this is not the point of NMEA 2000 bus. Instead you should have board there, where is you information to simplify cabling. So e.g. "engine coolant temp, rpm, oil pressure, air temp in the engine room" to one board near engine. Others could be on other board or what would be easiest if you think it on cabling view. E.g. I have NMEA 2000 cable going through the whole boat and in front I have depth/log device and on the other end there is autopilot. Other devices are between those. This is the idea of single bus system.

So you do not need to put 2560 behind DUE. Just simply read e.g. coolant temp on 2560 and send it to bus, if you have CAN BUS shield for 2560.

Anyway start with TemperatureMonitor and when you have that visible on MFD, continue developing. You can then find examples of other messages on example MessageSender.

Hey Timo,

thanks for your answer!

So since I would like to have an all in one solution later I think I start with the Due. For that I have build the "shield"m with the MCP2562 based on the pdf from the nmea library for the due.

When I try to compile the watertemp example with added nmea2000_due.h I get the error to use the mcp_can from collin. If I understood it right, I now edited the NMEA200_due.cpp and changed out the mcp_can from collin to the one from from your repository right (NMEA2000_mcp)?

If I do so I get a couple of error message reffering to the nmea2000_due complaining about can0 is not declared and so on. Aren’ t all those part of the due_can library from collin? He is also writing the can_common is neccessary to use that library.

I tried at last now to load this libraries with the tempmonitor:

#include <Arduino.h>
#include <NMEA2000_CAN.h> 
#include <N2kMessages.h>
#include <NMEA2000_due.h>
#include <NMEA2000_mcp.h>

Regards…

You do not need to touch any file under NMEA 2000 library. Either you do not need to edit TemperatureMonitor to get it running. It compiles and works as untouched for Due, Mega and Teensy 3.2-3.5.

  • Remember to load due_can from my github repository. Do not load anything from collin!
  • Remember to set right board. People often set “Arduino Duemilanove or Diecimila” for Due! It must be “Arduino Due (Programming port)”
  • Delete all duplicate libraries from your Arduino\Libraries path. So you can not have due_can-master and e.g. due_can-test paths there.

In you sample you have included both Mega and Due object for your code. #include <NMEA2000_CAN.h> does that automatically for you. So please do not touch code, before you know what you are doing.

Hey..

got it. It compiled well. Thx!

Next step than to get it shown on the MFD!

You wrote you have an autopilot installed? Is this a diy design? I am currently building as well an autopilot based on Jack E. design which is nice one with enhanced features also using nmea2k to get the course from gps/mfd.

If yours is diy. How did you solved the problem when the boat is comming into a dangerous situation where you have to react immidiate and take over to manual steering? I have a hydraulic steering today (26 foot cabincruiser).

Br..

No, I have Raymarine pilot. It has simple Standby button to release clutch. Also works with hydraulic systems.

Hello Tino,

I found OpenSkipper, which you also are the author for (nice thx!), and want to use it to simulate my MFD to avoid to take out all the cabling from the boat.

I have usb to ttl cable (ftdi ttl232r 3v3) or usb to RS232 cable. Now I thought to use this with the MCP2515 CAn shield (see picture) to get the data shown with OpenSkipper.

Do I have to use some kind of Arduino inbetween or can I “just” hook this up and I have the NMEA2000 bus on the PC?

MCP2515_can.png

It's Timo ;)

Your MCP2515_can board uses SPI for communication and PC does not have any SPI board. Either you USB-TTL cable does not help, since there is no sw handling that communication from PC. There are some options.

  1. Buy Actisense NGT-1 USB. This is the easiest, but expensive (180 € ?)

  2. Buy Arduino Mega board and wire your MCP2515_can board to that. Then use ActisenseListener example under my NMEA2000 library examples. Note that your board is made by Niren and it has 8 Mhz clock instead of default 16 MHz, so you have to set that for example.

  3. I prefer to by Teensy 3.2 and MCP2562 chip or "Teensy CAN-Bus Breakout Board Include Teensy 3.2". It is much more powerfull than Mega and so more usefull, if you decide to make some own devices to bus. With Teensy you also use ActisenseListener example.

Sorry for the “n”…

damn, I have seen the oscilator right after I posted the picture. I am not sure if I just can change that one out to 16mhz ( I have 8 peaces of this shield). The chip which should be the mcp2551 is on that board a (t)ja1050. Not sure if that can handle the bandwith. It`s written up to 1mbit. How ever, may I change both the oscilator and the tja1050 to mcp2551. I looked at the chinese to find the one with 16mhz. Looks like they just produce the once with 8 mhz and the 1050 to save money.

Which teensy are we talking about? I found several versions with different proc at mouser.

Is the Due still slower performing than the teensy once?

I made one for the due with mcp2562. Picture attached.

mcp2562_a.png

mcp2562_b.png

Who can help me? I am trying tu use the NMEA2000 lib, with arduino due, MCP2562 and a Lowrance HDS9 MFD. Example sketch ActisenseListener is working, I see all Messages from the MFD. Temperature Monitor is also working via USB and Actisense NMEA reader, but does not send data via can.

It should be OK to run mcp with 8 MHz clock. You just need to use

define USE_MCP_CAN_CLOCK_SET 8

before including NMEA2000_CAN.h

Due used more power and is much bigger board than Teensy. Teensy 3.2 can do a lot. Teensy 3.5 has SD card, if you need it.

If you have due, then try it with it. Now there are three cases with problems on sending data to bus from due. So I am not sure can there be something with newer Dues, since my old from 2 years back has no problem. Or is there some mix with libraries.

Good morning,

I have build up 2 mega's with the existing mcp2515 shields I have. Made the changes regarding the clock frequenz. The first one got the ActisenseListener flashed and on the other I tried several different like windsensor or temp sensor.

OpenSkipper is always finding the one with the sensor flashed on but I guess just through the com port. I get shown wind speed and angle in OS but it looks like there is nothing recived through the bus. Both H & L are connected through a short kabel (5 cm). I didn't used yet any termination resistor, can that be the reason?

You need to allways use terminating resistors!

Hello Timo, First I thank you verry much for your work on NMEA2000. Yes, teensy looks very good, I would rather take teensy today. But I use with the DUE the quadinput for an incremental poti, one of the two analog outputs and the Yun-Shield to transfer programs wireless. I tested with two DUE, both have the same problem. - First I had the fatal error: can_common.h: No such file or directory - Then test with clean environment, all libraries deleted, only due_can-master, NMEA2000_due-master, NMEA2000-master; fatal error was gone even though the libraries were the same. But can does not send.

Hey Libera-8,

same isseu here with two mega. Did you used termination resistors? I didn't used it so I will try now with termination resistor on both ends. have to be between 100-120 Ohm like I know on each end between H&L.

Had also the same problems with compiling errors. If you completly clean out all libraries and just install the once needed it is working just fine.

I will report soon if this was the problem, resistor..

Hei,

looks like it is working. NICE!

So no Resistors on the ends, no signal. And yes I should know that of course..