NMEA 2000 Shield

sunnycoastgreg:

  1. engine load % appears incorrect?
  • for example when setting to 30% in simulator, NMEA bus displays 14% on BOTH MFD & actisense reader.
  1. engine fuel rate L/Hr
  • for example when setting 11.5L/Hr in simulator, NMEA bus displays 0.0052cu m/hr (5.2L/Hr) on actisense reader AND MFD displays 5.2L/Hr also.

the other engine parameters all appear to be OK ... the simulator values match MFD and nmea reader values.

also a couple of additional questions about simulator
3) DC status PGN 127506 - i can enable it in simulator, and see values on nmea bus reader
however it shows 246% for SOC ... and there doesnt appear any way to change this in simulator?
I assume its hard coded?
(MFD doesnt display... but this may be because it expects a value of 100% or less?)
4) Alternator voltage (engine PGN) - these are displayed on MFD and nmea reader - but i cant find anywhere to change these on simulator , once again Im assuming these are hard coded?

I'll try to check the errors above. Some values are just hard coded quicly to get some information to the bus.

eMTea:
I see there is a lot of people using N2k and arduino, so please, can you guide me to a place to start learning about protocol and hardware, because can-bus systems is new to me.

You do not need to study protocol - it is bit complex. Just take my library (GitHub - ttlappalainen/NMEA2000: NMEA2000 library for Arduino), check the examples and start to build your own systems.

OK, thanks for the good work you have done, and shares with the community. :slight_smile:

I will dig into this and see if I'm able to get familiar :stuck_out_tongue: I've built a sensor based system before, with i2c OLED screen, but this bus system is alot more complex.

What happens if there is two similar PGN's at the same network? If I send some data that is already broadcasted by another device?

quote “what happens if there is two similar PGN's at the same network? If I send some data that is already broadcasted by another device?”

... nodes on nmea200 broadcast messages at various intervals, the frequency is different
depending on the type of data. (eg engine specific data has a rapid update, whereas something like airtemp would be much slower)
the nodes displaying the respective data (eg MFD) will typically react to whatever is the last recieved data.
so if you have more than one node sending the same PGN data fields,
you would expect the mfd to flip back and forth between the differing values, depending
on the rate of change,
however the frequency and concuurency will likely create some weird and unpredictable behaviour.

... bottom line .. avoid this situation!
.. timos libraries allow data fields within specific PGNs to be “not sent” ... so you can avoid this situation occuring.
( & with the hardware and listener example sketch , and the actisense reader on PC,
its possible to monitor the nmea bus to determine exactly what PGNs and fields are being sent,
and hence then avoid duplication of any data)

To be strict each PGN has defined default update period. Like Engine rapid data has 100 ms and engine dynamic data 1000 ms. I am not sure about temperature PGNs, but if I remember right they are also 1000 ms.

Note also that some PGNs like 130312 Temperature, 130316 Temperature Extended Range has "Instance" field. So there can be several devices sending same PGN and there is no problem, if the instance field differs. Also engine rapid data PGN 127488 has instance field, but that is locked to your engine or generator.

On newer MFD:s one can also define, which device data they show. So there can be several devices sending Depth or GPS position and then you define on MFD, which one it uses. In that case MFD will lock data to device "Name", which is unique for all devices on the bus. Either on this case there is no harm for multiple devices sending same PGN. If I remember right, this locking is mandatory on certified devices.

Timo, i think you are partially correct in respect to defining source for certain PGNs,
and Im sure it varies from mfr to mfr.
Im only using my Raymarine Axion LH3 as basis for my view...
The LH3 allows user to lock the data source for depth, speed thru water, heading, GPS, wind, time & date.
Hence with multiple sources of same (above) PGN, its possible to select (lock) which
the MFD will use.
However I cant find any reference in LH3 for selecting or locking other PGN sources,
eg fuel tank, water tank, battery, environmental etc.
So one does need to be careful with some of these additional data sources to prevent a clash.

Fuel tank, water tank, battery, environmental etc. PGNs works with instance field. E.g. Garmin GMI 20 can not either lock to specific source for those, but you can see different instances. Also GMI does not show anything selectable, if you do not have several instances available. But as you said one has to be carefull,but on the other hand why you would have several sensors on same tank? And if they are on different tank, they re different instances.

yes agree with all your points.

Im learning more about instances at present ... the reader and simulator are brilliant ... for
working out the details that the mfrs “leave out” ....
I just put up every data item i can on screens - and then use your simulator to work out
what shows what ...
one of the confusing things ive discovered, (at least in raymarine world) is that
instance “0” is typically shown as “xxxx 1”
eg battery voltage sent as instance 0 is shown as “Battery Voltage 1”
and instance 1 shows up as “battery voltage 2” ... and so on.
likewise engine instance 0 (port engine) displays as “alternator voltage 1” .

Im now imersing myself in understanding how your library works !
My plan is to inject onto NMEA a bunch of PGNs that are displayable on MFD,
but for which i dont have NMEA capable sensors (eg fuel tank, water tank, black tank, engine room temp, humidity and baro, domestic battery, generator battery, )
..let the fun begin!

sunnycoastgreg:
My plan is to inject onto NMEA a bunch of PGNs that are displayable on MFD,
but for which i dont have NMEA capable sensors (eg fuel tank, water tank, black tank, engine room temp, humidity and baro, domestic battery, generator battery, )
..let the fun begin!

Interesting, but how would you display these values, does you MFD or chartplotter allow you to customize it to display all these fields?

E.g. Garmin GMI 20 has definable pages for 4 values on each page. B&G vulcan has also configurable data values. So yes, MFDs should have them othervice they are not MFD - just SFD (Some Function Display).

timolappalainen:
E.g. Garmin GMI 20 has definable pages for 4 values on each page. B&G vulcan has also configurable data values. So yes, MFDs should have them othervice they are not MFD - just SFD (Some Function Display).

That I understand, but humidity and engine room temp, are those actual values existing in the n2k protocol?

nmea protocol has a few PGNs relevant for “temperatures”
PGN 130310 environmental
PGN 130311 environmental
(cant remember which of above has “air temp” , “humidity” its assumed this is outside humidity,
these are the PGNs typically used by a weather station/wind instrument)
and
PGN130312 extended temperature
PGN 130316 extended temperature
across above, they support a number of different temperature types (“cabin”, “engine room”, “refrigerator”
“freezer”, various “tanks”, “air duct”, “under bolts” ... and so on)

as timo says, it then becomes dependant on the display used (MFD, dedicated data display etc)
as to what PGNs it will support, and how it displays them (& any level of customisation ... eg renaming the way its displayed)

In my case Im interested in “engine” room data ..I dont have a weather station/wind sensor
so i will be using “humidity” to actually display the engine room humidity, and likewise “air temp”
for engine room temp - as my MFD (raymarine) doesnt support PGN instance for “engine room temp”
(later on .. I might build a small dedicated display and use timos arduino libraries to display a bunch PGNs that are not supported by my MFD)
from what i can see - nmea protocol only supports one humidity instance. but it certainly
supports multiple temp instances.

google the following
nmea technical bulletin PGN130316 feb 2015

.. it lists all the various source codes that corelate to the different temp types

If you are going to use my library, you will find possible values also in N2kMessages.h in tN2kTempSource enum definition.

Note also that 130316 is rather new PGN and old MFDs does not support it. You may need to use obsolete 130312 for temperature.

thx and noted,
a further check on my (very new) raymarine axiom - with the very latest lighthouse sw,
shows that it doesnt support either!! 130312 or 130316 (well at least according to the manual - which
ive already found one other PGN omission ... )
so at present i will likely have to fudge “engine room temp” to “air temp” PGN instance/source.
.. and hope that raymarine will add the additional PGNs over time .. ...
... its really making me think twice about a dedicated display (your library with a teensy and an OLED display) of the various PGNs that
are not supported! (eg exhaust gas temps , engine room temps, ...) .. anothet “to do list project”

It is very strange MFD, if it does not support 130312. And if it is new, it should read 130316, since 130312 and 130311 are obsolete. But maybe this is Raymarine logic.

How about 130311?

What do you mean with "air temp" PGN instance/source? PGN 130310, which is also obsolete.

Have you checked KBox: KBox | Hackaday.io

the (very latest - last month) Raymarine Lighthouse 3 sw lists support for only
PGN 130310 & 13011 ... 312, 316 not listed .. and yes agree it should support the new ones .. but doesnt appear to ... Im trying to get some clarity from them .
seems they are struggling with the feature set in the new LH3 (android? based OS)

To fudge a engine room temp - i was going to encode this as “air temp” (because i dont have a
environmental sensor on. my network)
... and hope that raymarine add support for 130316 in the future....

I looked at k-box - however my boat has multiple 24V battery banks ... and its analog inputs
are shown as “up to 23V ... way to low for a nominal 24V bank)
I also already have 2 NMEA0183 convertors on my 2k network,
likewise i have a autopilot with its own heading rate sensor.
..so im struggling with the value that k-box adds for me ?
I do like the inertial unit for pitch/roll, and barometer.
I dont see temp/humidity listed? which im also interested in.
so i will have another look at it ... perhaps its expandable ..

hi timo.
not sure where to put this question, its partly related to the arduino & nmea2k library,
but if I should put it elsewhere or start a new thread pls advise.

I want to capture a "log" from nmea2k data to be able to post process and then display
a selection of data to be able to plot fuel economy vs a range or parameters that
typically impact consumption. (eg eng RPM, eng load %, eng fuel rate, pitch and roll, true wind speed and direction,
fuel tank level, water tank level..)

using teensy listener/sender - with actisense reader and EBL reader I can display n2k data,
and capture logs in "ËBL format"
but i need to get data into excel or similar to be able to do some post process computations and
then graph data. EBL reader doesnt have any options to save out to excel or other formats?

Ive had a look at "openskipper" - which i note can ingest the data from actisense listener
in real time..
however im struggling with understanding how/if it could achieve what im trying to do?

is there a simpler way to get decoded nmea2k data from activelistener into "logged" excel format?
(i prefer excel because i need to write some formulas for computing average fuel rate, economy,
and then do some graphing) ... and I understand excel (but not xml . cs etc)

I have same problem. I have logged everything for 2-3 years with OpenSkipper. In main window with right click you can start Track. Unfortunately this log format is OpenSkipper specific - timestamp+N2k and I have not yet wrote a parser for that. I am going do, but when? I use OpenSkipper for logging, since I have it anyway open for providing data as web server.

One option would be to make own logger. Take a look in to the example DataDisplay2. You could clone that and format output to .csv and then just log terminal data. If you need quick temporary solution, this could be the fastest one.

Currently thread is OK, since it partially belongs to shield.

Hello!

I need to convert the RPM signal from gasoline to diesel.
The story:
I had last year a V8 gasoline engine in my boat but this year I have dropped that engine out and have put a 6 cylinder diesel engine.

Also, I bought a completely new set of instruments last year but for gasoline engines. (RPM)
I can choose on the RPM meter from 4 to 12 cylinder. With the V8 I had 8 pulses per RPM.
With the diesel engine, the puls is coming from the flywheel and give 1 puls per RPM like I know.
So now my plan is to convert the 1 puls up to 4 pulses per RPM so I get shown the correct RPM on the gasoline RPM meter.

Since Teensy or Arduino just can handle 3 V / 5 V max it have to go through a transistor as well I guess.

The same Teensy shell deliver the RPM sentence to the MFD as well I thought (EngineSpeed Rapid).

Can somebody help here with a code example for the pulse conversion?

Thank you!