Volkswagen TDI Marine connect to NMEA2K?

I’ve done it with Arduino. I used the can bus which is standard VW protocol and wrote some code to get it to N2K. Shows all of the data that is on the multi function gauge plus some extra. I did try the OBD2 first but it uses k-line and I just couldn’t get the handshake to work. OBD would have been nice because you also get EGT.
Good afternoon!
I also want to make such a Can to Nmea2000 iterface. Maybe I could see a wiring diagram for it? Can the engine oil pressure be entered in the code line?
Does the code line work with other available arduino chips?
Thomas
 
Does anyone have a wiring diagram for a 2009 VW Marine 4.2 TDI engine? Unfortunately, I haven't found it anywhere yet. VW doesn't want to release it, and neither does Bosch. Cummins cannot identify the engine. Mercruiser does not even respond to the inquiry? Engine code: CEM

Hi Thomas
Which wiring diagram are you looking for? The engine or the instrument panel?

There is some basic information available here. I might have a contact name somewhere if you want.

Good afternoon!
I also want to make such a Can to Nmea2000 iterface. Maybe I could see a wiring diagram for it? Can the engine oil pressure be entered in the code line?
Does the code line work with other available arduino chips?
Thomas
I would think the code would work on most arduino chips that have 2 CAN ports. I don't think the CAN-Bus carries the oil pressure information. It certainly doesn't on the V6 Tdi. Basically you can only get the info that is listed in my code (torque, rpm, IAT, boost, coolant temp and fuel consumption)
 
Last edited:
Hi Thomas
Which wiring diagram are you looking for? The engine or the instrument panel?

available here. I might have a contact name somewhere if you want.


I would think the code would work on most arduino chips that have 2 CAN ports. I don't think the CAN-Bus carries the oil pressure information. It certainly doesn't on the V6 Tdi. Basically you can only get the info that is listed in my code (torque, rpm, IAT, boost, coolant temp and fuel consumption)
[/IDÉZET]
)

I am looking for a motor wiring diagram. Unfortunately, there is no electrical box for the motor. Want to install a VW Marine starter panel. It must be assigned to the 35-pin connector of the motor. There is an oil pressure sensor in the 4.2 TDI engine, but due to the lack of a wiring diagram, I don't know if its signal is analog or digital? Unfortunately, the wiring diagram for the 4.2 TDI is not listed on the Mercruiser website. I also want to install a Garmin chartplotter, for which I would need the NMEA200 gateway.
My contact information is: mesziszaki@gmail.com
 
I’m new on this forum .
I’m rico from the netherlands .
Don’t want to highjack this tread but i need some help too.
I have 2 vw marine 4.2 tdi engines from the year 2012 and i would like the engine data on my dual simrad screens .
Anyone knows what protocol ? Are there converters for sale ?
 
Helló!
Nincs hivatalos interfész a VW canbus és az NMEA 2000 között.
Vannak Arduino próbálkozások, amiket meg lehet tenni, de nem sok a megjeleníthető tartalom, és egy NMEA 2000 hálózatot is ki kell építeni. Az ELM 327 OBD interfészt tudnám ajánlani, amiben van bluetooth vagy wifi kapcsolat. A megjelenítő ANDROID szoftver a TOURQE szoftver, amely letölthető a Play Áruházból. Telefonon is működik, a műszerfal személyre szabható, és a hibanapló is törölhető.
Lehet, hogy létezik még VAG-com VCDS nevű Windows-verzió is, de ez inkább diagnosztikai megoldás.

Tamás...
 
Hello!
There is no official interface between VW canbus and NMEA 2000.
There are Arduino attempts that can be done, but there is not much content that can be displayed, and a NMEA 2000 network must also be built. I could recommend the ELM 327 OBD interface, which has a bluetooth or wifi connection. The display ANDROID software is the TOURQE software, which can be downloaded from the play store. It also works on the phone, the dashboard can be customized, and the error log can also be deleted.
There may even be a Windows version called VAG-com VCDS, but this is more of a diagnostic solution.

Thomas...
 
I’m new on this forum .
I’m rico from the netherlands .
Don’t want to highjack this tread but i need some help too.
I have 2 vw marine 4.2 tdi engines from the year 2012 and i would like the engine data on my dual simrad screens .
Anyone knows what protocol ? Are there converters for sale ?
Hi Ricco i also run 2 x 4.2 v8 TDI in my boat and would like to share any info with you , my engines came from the netherlands
 
I’ve done it with Arduino. I used the can bus which is standard VW protocol and wrote some code to get it to N2K. Shows all of the data that is on the multi function gauge plus some extra. I did try the OBD2 first but it uses k-line and I just couldn’t get the handshake to work. OBD would have been nice because you also get EGT.
Hi Keith are you running the standard elec system or is it customised , also wonder if you could point me in the right direction , in my multifunction display (tdi 4.2 v8) at times i loose rev counter display as well as temp display (they both drop out together and both return together) .... ?? could there be a common earth or power supply. usually the following day they are both back working
 
Hi Keith are you running the standard elec system or is it customised , also wonder if you could point me in the right direction , in my multifunction display (tdi 4.2 v8) at times i loose rev counter display as well as temp display (they both drop out together and both return together) .... ?? could there be a common earth or power supply. usually the following day they are both back working
Yes, I have the standard electrical system. The only customisation is a connection to the can-bus for my Arduino gateway to get data onto the chartpolotter via NMEA. I don't know why you are losing signal for the rev counter and temperature. As far as I recall they all share an earth on the can-bus side of things but perhaps there is a loose or damaged connection either on the back of the instrument panel or in the loom somewhere. Seems odd that you only lose those bits of data and not everything. Do you have an analogue termperature gauge as well? Is that working ok?
 
Last edited:
Yes, I have the standard electrical system. The only customisation is a connection to the can-bus for my Arduino gateway to get data onto the chartpolotter via NMEA. I don't know why you are losing signal for the rev counter and temperature. As far as I recall they all share an earth on the can-bus side of things but perhaps there is a loose or damaged connection either on the back of the instrument panel or in the loom somewhere. Seems odd that you only lose those bits of data and not everything. Do you have an analogue termperature gauge as well? Is that working ok?
Hi Keith , yes its weird .... i guess i cant rule out the multifunction display itself as thats both tach and temp , only happens on the port engine thank god , but it usually drops out if you have been running for say 1 hr then drop back to an idle for a while and you take a glance at the display and notice no tachometer as well as no temp ... its almost like its an .. up to operating temp thing (even though the engines hardly get warm anyway) 75 degree cels ....... wondering weather or not its an ECU connection
 
Hi Keith , yes its weird .... i guess i cant rule out the multifunction display itself as thats both tach and temp , only happens on the port engine thank god , but it usually drops out if you have been running for say 1 hr then drop back to an idle for a while and you take a glance at the display and notice no tachometer as well as no temp ... its almost like its an .. up to operating temp thing (even though the engines hardly get warm anyway) 75 degree cels ....... wondering weather or not its an ECU connection
I suppose you could swap the tacho over with the starboard engine and see if the fault follows. It wouldn’t surprise me if it was a fault in the display unit as mine jumped 945 hours on occasion after a 4 hr trip. They possibly aren’t the most reliable. I took a look at the wiring schematic for my V6 and the MFD gets its data from the engine ECU via can-bus. You’d expect to lose all info if it was an ECU or can-bus problem rather than just some metrics.
 
I suppose you could swap the tacho over with the starboard engine and see if the fault follows. It wouldn’t surprise me if it was a fault in the display unit as mine jumped 945 hours on occasion after a 4 hr trip. They possibly aren’t the most reliable. I took a look at the wiring schematic for my V6 and the MFD gets its data from the engine ECU via can-bus. You’d expect to lose all info if it was an ECU or can-bus problem rather than just some metrics.
yes agree ill take a close look at the MFD and see if we cant find something out of the ordinary in there , my wiring loom is new , actually everything is pretty much new so im ruling out corrosion on contacts , another glitch i have pop up fairly often is a ... SERVICE displayed in the MFD , so when working normally it displays neutral push the start button to start , if it displays SERVICE theres no starting the engine , not sure why it occasionally flashes this SERVICE but when it does its a no go situation .. ill then shut off batteries (battery swithches) for a minute of so and it usually resets and returns to the neutral display and you can start on go ..... again like the tach / temp situation its random and comes and goes as it pleases ..... frustrating
 
That’s interesting. I wonder if you have a failing relay somewhere. I experienced an intermittent problem on my Audi Q5 which turned out to be a failing relay which would intermittently cut the power supply to the can-bus system. For the sake of a relay it might be worth swapping out the one that serves the network side of things.
 
My engine gateway is based around this little board which has a Teensy 3.6 arduino board with two Can-bus ports. You will need to download the Arduino IDE programme for your computer and install a couple of extra libraries including from Timo Lappalainen's github. Specifically you will need:
  • The teensyduino library from pjrc.com. (When you load this it is best to uncheck the FlexCAN library tickbox as you will need a different FlexCAN library instead - see below)
And from Timo's github:
  • NMEA2000-master library
  • NMEA2000-teensy library
  • FlexCAN-library-master
Once you get these up and running you should be able to set the IDE for a Teensy 3.6 at 96Mhz and upload my code and then connect your device to the boat network. I connected into the engine can-bus using the spare connector on the back of the engine control panel. If you do this you will need a Molex 40325 plug and 2 pins for can high and can low. It is a 22 pin connection usually used for the extension cable to a flybridge panel. Pin 22 is can high and pin 17 is can low.

Here is my working code - just copy and paste into the IDE:
Code:
// Convert VW Marine ECU canbus data to N2k. Oct 2019
// based on Collin80 and Timo Lappalainen code and Paulg25 on ybw
// Set for Teensy 3.6 at 96Mhz

#include <Arduino.h>
#include <NMEA2000_CAN.h>  // Chooses right CAN library and creates                                                                                                                                                                                                                                                                                                               suitable NMEA2000 object
#include <N2kMessages.h>
#include <NMEA2000_teensy.h>
#include <FlexCAN.h>


#ifndef __MK66FX1M0__
#error "Teensy 3.6 with dual CAN bus is required to run this example"
#endif

// List below N2k messages your device will transmit.
const unsigned long TransmitMessages[] PROGMEM = {127488L, 127489, 0}; //engine rapid and dynamic

static CAN_message_t msg; //sets up a storage buffer?
static uint8_t hex[17] = "0123456789abcdef";

#define EngineTimeout 5000 //perhaps not in global?


//-----------------------------------------------------------------------------------------
void setup() {

  delay(5000);
  // Set Product information
  NMEA2000.SetProductInformation("000300", // Manufacturer's Model serial code
                                 200, // Manufacturer's product code
                                 "Arduino VW Gateway",  // Manufacturer's Model ID
                                 "1.1 (2019)",  // Manufacturer's Software version code
                                 "1.A (2019)" // Manufacturer's Model version
                                );
  // Det device information
  NMEA2000.SetDeviceInformation(303030, // Unique number. Use e.g. Serial number.
                                160, // Device function=engine gateway.
                                50, // Device class=propulsion.
                                443 // Just choosen free from code list - VDO
                               );

  // Uncomment 2 rows below to see, what device will send to bus. Use e.g. OpenSkipper or Actisense NMEA Reader
  //Serial.begin(115200); // uncomment to send to serial for PC use
  //NMEA2000.SetForwardStream(&Serial); // uncomment to send to serial - default is Actisense format for PC use

  // If you want to use simple ascii monitor like Arduino Serial Monitor, uncomment next line
  //NMEA2000.SetForwardType(tNMEA2000::fwdt_Text); // uncomment to send to serial as plain text - overides above Actisense format

  // If you also want to see all traffic on the bus use N2km_ListenAndNode instead of N2km_NodeOnly below
  NMEA2000.SetMode(tNMEA2000::N2km_NodeOnly, 22);

  //NMEA2000.SetDebugMode(tNMEA2000::dm_Actisense); // Uncomment this, so you can test code without CAN bus chips on Arduino Mega
  // Comment out next line for Actisense PC use
  NMEA2000.EnableForward(false); // Disable all forward messaging from N2K bus to USB (=Serial) - default is True. Comment for PC use

  NMEA2000.ExtendTransmitMessages(TransmitMessages);
  NMEA2000.Open();

  //Can0 should be automatically set at default 250kbs for N2k
  Can1.begin(500000); //set baud for VW ECU.
  Can1.setListenOnly (true); //hopefully set listen only mode. Set after begin()
}
/*Engine frames
    Byte                     data    factor                expected range
    0x280 byte 1 =           torque  (*0.39)%              (0-100% limit 493Nm)
    0x280 byte 2low&3high =  rpm     (*0.25)/min           (typ range 0-4500)
    0x288 byte 1 =           coolant ((*0.75)-48)C         (typ range 20-100)
    0x380 byte 1 =           IAT     ((*0.75)-48)C         (typ range 20-50)
    0x480 byte 2&3 =         fuel consumption ul           (idling 0.42-0.82 l/h)
    0x588 byte 4 =           boost (*0.01)bar or (*1000)Pa (1010 to 2295 mbar)
*/
//variable     data type       data                N2k expected units  resolution
double torque = N2kDoubleNA;  //torque            % (1% increment)
double rpm = N2kDoubleNA;     //rpm
double coolant = N2kDoubleNA; //coolant temp      K (0.1K)
double fuel_consumption = N2kDoubleNA;    //fuel rate         l/h (0.1 l/h)
double boost = N2kDoubleNA;   //boost pressure    Pa (100Pa) 1bar = 100,000Pa
unsigned long LastRPM = 0;
#define EngineTimeout 5000 //perhaps in global?

//for fuel consumption calculations
uint16_t fuel_last = 0; //unsigned int 16bits 0-65535
unsigned long time_last = 0; //unsigned 4 bytes
#define FUEL_AVG_BUFFER 10
double fuel_buffer[FUEL_AVG_BUFFER]; // buffer locations will be 0 - 9
size_t fuel_pointer = 0; //represents size of something in no. of bytes

//---------------------------------------------------------------------
void PollEngineCAN() { //function to poll engine data
  CAN_message_t inMsg;

  if (Can1.available() > 0) {
    Can1.read(inMsg); //read message into inMsg
    switch ( inMsg.id ) { //a type of if process that can check for multiple conditions

      case 0x280:
        torque = ( inMsg.buf[1] * 0.39 );
        rpm = ((( inMsg.buf[3] << 8) + inMsg.buf[2]) / 4);
        LastRPM = millis(); //timestamp the last rpm reading
        break;

      case 0x288:
        coolant = (( inMsg.buf[1] * 0.75) + 225.15); //convert from C to K (-48 + 273.15 = 225.15)
        break;

      case 0x480: {
          double fuel_used;
          uint16_t fuel_now = ( ( (inMsg.buf[3] & 0b01111111) << 8 ) + inMsg.buf[2] );  // get current fuel reading
          unsigned long time_now = millis();                  // get curent time

          if ( time_last != 0 ) {   //if time not equal to 0
            if ( fuel_now >= fuel_last ) {           // to allow for roll over
              fuel_used = fuel_now - fuel_last;
            } else {
              fuel_used = ( fuel_now + (32767 - fuel_last) );
            }

            double time_elapsed = time_now - time_last;

            // fuel_used is in ul, so we need devide it with 1e6 to get litres.
            // time_elapsed is ms, so divide it with 3.6e6 to get hours.
            // fuel_rate = ( (fuel_used / 1e6) / ( time_elapsed/3.6e6 ) );
            double fuel_rate = (fuel_used / time_elapsed) * 3.6;

            fuel_buffer[fuel_pointer] = fuel_rate;      // store latest reading in buffer (10 deep).
            fuel_pointer++;                             // increment buffer pointer ready for next time

            if ( fuel_pointer == FUEL_AVG_BUFFER ) fuel_pointer = 0;   // if end of buffer reached, point to start

            double fuel_average = 0;
            for ( size_t i = 0; i < FUEL_AVG_BUFFER; i++ ) {       // do this 10 times
              fuel_average += fuel_buffer[i];       // add all 10 numbers stored in buffer
            }        
            fuel_consumption = fuel_average / FUEL_AVG_BUFFER;
          }
          time_last = time_now;
          fuel_last = fuel_now;
        }
        break;

      case 0x588:
        boost = ( inMsg.buf[4] * 1000 ); //convert from bar to Pa (*0.01 x 100,000 = 1000)
        break;
    }
  }
}
//---------------------------------------------------------------------------------
void SendN2kEngineRapid() //N2k function to send data
{
  static unsigned int NextSendTime = 5000;
  if ( NextSendTime < millis() )
  {
    NextSendTime += 100;
    tN2kMsg N2kMsg;

    SetN2kEngineParamRapid(N2kMsg, 0, rpm, boost);
    NMEA2000.SendMsg(N2kMsg);
  }
}
//---------------------------------------------------------------------------------
void SendN2kEngineDynamic() //N2k function to send data
{
  static unsigned int NextSendTime = 5000;
  if ( NextSendTime < millis() )
  {
    NextSendTime += 500;
    tN2kMsg N2kMsg;

    SetN2kEngineDynamicParam(N2kMsg, 0, N2kDoubleNA, N2kDoubleNA, coolant,
                             N2kDoubleNA, fuel_consumption, N2kDoubleNA, N2kDoubleNA, N2kDoubleNA, N2kInt8NA, torque);
    NMEA2000.SendMsg(N2kMsg);
  }
}
//-----------------------------------------------------------------------------------------
void loop()
{
  NMEA2000.ParseMessages();
  PollEngineCAN();
  if ( LastRPM + EngineTimeout > millis() ) {
    SendN2kEngineRapid();
    SendN2kEngineDynamic();
  }
}

Good luck
where did you find VM pgn id and its parsing?
 
It was some time ago so my memory is a little hazy now. The pgn's for the N2K side of things came from Timo's github repository and associated arduino forum posts. As for the VW can-bus data this took some research on various car forums and also some VW documents I found on line. It is pretty standard stuff for all of their vehicles so can be read by a lot of OBD2 scanners. I also used a digital data 'sniffer' /oscilloscope to see what data streams were being broadcast on the engine can-bus. This is all in hex so needed a bit of interpreting. There was more info available via k-line (such as EGT) but I just couldn't get a handshake to work on my arduino code.
 
It was some time ago so my memory is a little hazy now. The pgn's for the N2K side of things came from Timo's github repository and associated arduino forum posts. As for the VW can-bus data this took some research on various car forums and also some VW documents I found on line. It is pretty standard stuff for all of their vehicles so can be read by a lot of OBD2 scanners. I also used a digital data 'sniffer' /oscilloscope to see what data streams were being broadcast on the engine can-bus. This is all in hex so needed a bit of interpreting. There was more info available via k-line (such as EGT) but I just couldn't get a handshake to work on my arduino code.
I am looking into reading mercury and Suzuki but i can't seem to find any id to parse marine engines.

The id you've found looks different from multilink that volvo has or yamaha.

Do you suggest using the same id for marine as for vehicle?
Because i am looking into something basic like rpm and engine hours.
 
I'm not sure about Suzuki and Yamaha. Certainly the VW derived engine used the same protocol as their road vehicles so that was fairly simple. As far as I am aware the Suzuki diagnostic system (SDS) for their outboards is closely aligned to their motorbike protocol which I think uses KWP-2000 (k-line). I did start to look into building a converter for my Suzuki outboard but it was too complex for my basic understanding and ability. There was however quite a bit of info on some Suzuki bike websites and possibly Github. Let me know if youy get anywhere because I would still be quite interested. Modern Suzuki outboards have N2K built in so that is much simpler to connect up.
 
Last edited:
I'm not sure about Suzuki and Yamaha. Certainly the VW derived engine used the same protocol as their road vehicles so that was fairly simple. As far as I am aware the Suzuki diagnostic system (SDS) for their outboards is closely aligned to their motorbike protocol which I think uses KWP-2000 (k-line). I did start to look into building a converter for my Suzuki outboard but it was too complex for my basic understanding and ability. There was however quite a bit of info on some Suzuki bike websites and possibly Github. Let me know if youy get anywhere because I would still be quite interested. Modern Suzuki outboards have N2K built in so that is much simpler to connect up.
I have successfully used an Obd2 library from arduino with my car Suzuki swift 2007 with esp32-s3-mini + l9637d. I read rpm, speed and something else just from the example code.
Wondering the web I have found that Suzuki marine (df90, df140, df115) ecm has 2 pins on the plug for communication that by color ( y, o/y) are related to sds, but haven't found yet what they mean by function: k-line, l- ine or can h, canl. I am pretty sure its k and l lines. The pins are 20, 21.

I do think and hope like you that the basic information should have the same id for rpm, throttle and speed, yet keep in mind that in df90 service manual its stated " you cant use sds and digital gauge simultaneously, only i use one at a time".

By the way, if i recall correctly someone on arduino forum said about motorcycles honad and Yamaha are similar on k-line functionality but both different from Suzuki.
Suzuki asks for echo yamah and Honda sniff.

Let me know if your find anything else.
 
Top