Go Down

Topic: NMEA 2000 Shield (Read 300415 times) previous topic - next topic

lundpetersen

Hi All,

I have used timolappalainen's great project and have it working on my Arduino Due. I have created a simple circuit that measures the voltage of my batteri and outputs it on NMEA2000 to my Lawrence HDS 9 Gen3 MFD. It works like a charm.

My plan is to transfer my analogue gauges to my MFD - the first was the voltage. I also need to transfer Fuel Level, Tachometer (RPM's), and Speedometer. Ultimately I also want to use the DUE as NMEA0183 to NMEA2000 for my Furuno 4800 Radio with AIS so I don't need to have any NMEA0183 connected to my MFD's.

My question is, do anyone have a good link to a circuit I can studdy to figure out how to make my DUE read the input from the Tachometer from my engine? Its an old Mercury engine - and it is definitely analogue. Any good ideas/links to articles about others that has done this on Arduino?

timolappalainen

Hi,

Have you checked e.g. http://cr4.globalspec.com/thread/53842/Getting-a-RPM-Signal-From-the-Alternator ?

Alternative way is to use e.g. reflective sensor e.g. http://fi.farnell.com/omron-electronic-components/eesy313/photomicrosensor-reflect-4-4mm/dp/2301884?ost=eesy313&selectedCategoryId=&categoryNameResp=Kaikki%2Bluokat&searchView=table&iscrfnonsku=false

That of coarse requires that you need to build support forsensor to engine. But with it you will allways get true RPM, which does not need calibration like using W.

I am building fuel flow meter, where I would include reflective sensor for RPM and other engine information.

I have also ready NMEA0183->NMEA2000 converter for GPS. By modifying selected messages, you could easily modify that for your own purposes.

I also prefere to have several boxes instead of trying to put all functionalities to same. I have started to use Teensy 3.2 or up in most my devices. Teensy 3.2 is smaller and requires less power that DUE. You can find some documents on example https://github.com/ttlappalainen/NMEA2000/tree/master/Examples/TeensyActisenseListenerSender

Tlam

Hi,

I have develope FUSION LINK server

Please help me construct CAN message for CAN.sendMsgBuf() function.

PGN 130820

The first two data bytes of any message will contain Proprietary Parameter Group Structure with the
following format

11 bit - value of 419
2 bit - value of 3
3 bit - value of 4

These fields combine to give the value 0x99A3

timolappalainen

Are you using NMEA2000 library or do you really want to use directly mcp_can library?

Tlam

I successfully use your library, thank you very much.


But it useless for FUSION LINK PGNs. I want use directly mcp_can.

But I can't construct right message.

Tlam

And , are you have any information about PGN 130820 ? )

timolappalainen

Why it is useless? You can send or parse any message with library. You just need to write message build or parser program to your own file. N2kMessages contains most used messages, but nothing prevents you write you own messages.

130830 is proprietary message and its contents depends of manufacturer and I do not have any other information of it execpt that first two bytes contains manufacturer code and and industry code (4=maritime).

But for library you can have message builder function like others in N2kMessages:
void SetN2kPGN130830FusionLink(tN2kMsg &N2kMsg, ???) {
    N2kMsg.SetPGN(130830L);
    N2kMsg.Priority=3;
    N2kMsg.Add2ByteUInt(0x99A3); // Fusion link
    N2kMsg.Add???
}

But there is no way to write more, if you do not know the content os Fusion Link message.

Note that 0x99A3 can be also constructed  4 << 13 || 3 << 11 || 419

Tlam

#127
Dec 16, 2016, 08:36 pm Last Edit: Dec 16, 2016, 09:25 pm by Tlam
Thank you for help and idea ! ))

But very difficult for me...

timolappalainen

With library you can make much more easily any N2k system, since it takes care of several things required on communication on N2k bus. In N2kMessages you will find common PGN build and parser routines, which you can use as sample to build your own. In examples MessageSender, WindMonitor or Temperature monitor you find how to send data to the bus. And e.g. example DataDisplay2 shows how to read PGNs.

If you do not have description for PGN 130830 data content, you have to spy it by recording data on bus and mark changes made on sender side. You can not do that "reverse engineering" if you do not have devices from original manufacturer.

Tlam

I successfully use library for many selfmaid devices. Engine monitor, fuel level and battery monitor.

Now I have idea to make audio server on arduino that controlled from raymarine mfd.

I don't have device for reverse engineering and fully information about proprietary PGNs(

But some pieces of information looks are possible for some experiments.


Tlam

May be somebody have information about proprietary entertainment PGNs ?

Tlam

#131
Dec 18, 2016, 12:28 pm Last Edit: Dec 18, 2016, 12:33 pm by Tlam
Hi Timo,


I have a question about NMEA2000.SetN2kCANMsgBufSize();

When I provide argument value more than 2 , device hold. What happened ?


1 or 2 work correctly

timolappalainen

What device you use and how much memory used it says after compilation?

I tested example ActisenseListener on Arduino Mega with 20 and it works. 30 does not. Note that this allocates memory dynamically and one tN2kCANMsg eats about 243 bytes memory. So 5 will eat 1.2 kB. For Mega my test says 7.8 kB free after compilation. So 30 takes 7.3 kB and remaining 0.5 kB is not enough for other local variables and also Mega hangs. So I would expect that you have device where even 3 is too much.

Dazzler

I'm struggling with the basics.  I have a Due connected to the W7 PC running Arduino IDE 1.6.12, as per Timo's instructions for the NMEA 2000 library. I have edited the temperature sketch, uploaded it to the Due and started Actisense NMEAReader and selected the com port, all as per instructions.
But I see nothing in NMEA reader.  The only output I can see is if I uncomment the serial.print line in SendN2kTemperature and start the Serial monitor.
I've followed Timo's instructions to the letter but have failed at the first hurdle.  Is there any other config  I should have done?

timolappalainen

Hi,

Due to library portability changes we had to remove Serial as default output stream. This is documented on Readme Changes section. So it should start to work, if you add line
  NMEA2000.SetForwardStream(&Serial);
after
Serial.begin(115200);

I'll add this to example for next release.

Go Up