Engine Run Hours to NMEA2k

Daverw

Well-Known Member
Joined
2 Nov 2016
Messages
3,050
Location
Hull
Visit site
I’m looking at ways to get engine run hours into my system, cannot see any thing off the shelf to do this. Thinking of Raspberry pie or ardinio as possibilities, any other ideas or solutions ?
 
You can use an Arduino running Timo Lappalainen's NMEA2000 library and send out PGN127489

GitHub - ttlappalainen/NMEA2000: NMEA2000 library for Arduino

void SetN2kPGN127489(tN2kMsg &N2kMsg, unsigned char EngineInstance, double EngineOilPress, double EngineOilTemp, double EngineCoolantTemp, double AltenatorVoltage,
double FuelRate, double EngineHours, double EngineCoolantPress=N2kDoubleNA, double EngineFuelPress=N2kDoubleNA,
int8_t EngineLoad=N2kInt8NA, int8_t EngineTorque=N2kInt8NA,
tN2kEngineDiscreteStatus1 Status1=0, tN2kEngineDiscreteStatus2 Status2=0);

A Pi is overkill. I run this library as part of a project on an ESP32 dev board (using their native IDF development environment rather than Arduino) here...

GitHub - miniwinwm/BlueBridge: Sharing boat data across NMEA0183/NMEA2000/Bluetooth/IoT/MQTT with Android anchor watcher app and webpage.
 
Last edited:
Looking at the following
Relay to input the DI for engine running
Arduino ( not sure which one)
Canbus transceiver board
Drop cable to backbone
 
Looking at the following
Relay to input the DI for engine running
Arduino ( not sure which one)
Canbus transceiver board
Drop cable to backbone
Timo's NMEA2000 library isn't trivial so you need a suitable Arduino supported processor with sufficient oomph & memory. I used an ESP32 DevKitC board successfully. It doesn't have a lot of pins but you don't need that. Bluetooth & WiFi are built in if that's of interest.

Here's the circuit diagram of my project. You would need to add the Canbus line driver U5 to the dev board and your input circuitry to detect engine running. You also need a voltage regulator as the power lines on NMEA2000 are 12V. U4 and it's associated passive components provide that.

BlueBridge/hw/BlueBridge - Project.pdf at master · miniwinwm/BlueBridge

When I did it the various connectors, adapters and cables for NMEA2000/SeatalkNG cost more than everything else combined.
 
Last edited:
The issue with hours run is the need for persistent memory so next time the boat is switched on, you have the previous figure. I haven't explored your code, but how are you storing that data?
 
Two ways of going about it I guess. Similar to light aircraft which have a Hobbs meter (similar to Yanmar B20) which simply displays the time that the engine 12v control panel was powered. The other is RPM based (tacho time) where the rpm is divided by the average cruise rpm to display tacho hours which is how a lot of rental companies charge (and base engine maintenance on).

tacho.jpg
 
Last edited:
The issue with hours run is the need for persistent memory so next time the boat is switched on, you have the previous figure. I haven't explored your code, but how are you storing that data?
My project doesn't measure or record engine hours but most microcontrollers have non volatile memory that can be used. The only difficulty is ensuring data integrity if the power is removed during a write operation. There are standard techniques for implementing this.
 
Two ways of going about it I guess. Similar to light aircraft which have a Hobbs meter (similar to Yanmar B20) which simply displays the time that the engine 12v control panel was powered. The other is RPM based (tacho time) where the rpm is divided by the average cruise rpm to display tacho hours which is how a lot of rental companies charge (and base engine maintenance on).

I think the OP is wanting a way to get the data and convert to NMEA2000 so it can be displayed on their existing system display. If they were just looking for a two wire hours counter I could oblige for the cost of postage (Chinese panel meter never fitted).
 
I think the OP is wanting a way to get the data and convert to NMEA2000 so it can be displayed on their existing system display. If they were just looking for a two wire hours counter I could oblige for the cost of postage (Chinese panel meter never fitted).
Sure, I understand that but was just presenting two ways of measuring "engine hours" so the info could be "hours powered" or "total revolutions divided by cruising rpm/60" to get hours at equivalent cruising rpm.
 
Timo's NMEA2000 library isn't trivial so you need a suitable Arduino supported processor with sufficient oomph & memory. I used an ESP32 DevKitC board successfully. It doesn't have a lot of pins but you don't need that. Bluetooth & WiFi are built in if that's of interest.

Here's the circuit diagram of my project. You would need to add the Canbus line driver U5 to the dev board and your input circuitry to detect engine running. You also need a voltage regulator as the power lines on NMEA2000 are 12V. U4 and it's associated passive components provide that.

BlueBridge/hw/BlueBridge - Project.pdf at master · miniwinwm/BlueBridge

When I did it the various connectors, adapters and cables for NMEA2000/SeatalkNG cost more than everything else combined.
Is this what would be a good starting point
XTVTX ESP-32 DevKitC ESP-32 Development Board NodeMCU-32 ESP-WROOM 32D CP2102 Chip Successor module of the ESP-32 DevKit compatible with IDE XTVTX ESP-32 DevKitC ESP-32 Development Board NodeMCU-32 ESP-WROOM 32D CP2102 Chip Successor module of the ESP-32 DevKit compatible with IDE: Amazon.co.uk: Business, Industry & Science
 
Is this what would be a good starting point
XTVTX ESP-32 DevKitC ESP-32 Development Board NodeMCU-32 ESP-WROOM 32D CP2102 Chip Successor module of the ESP-32 DevKit compatible with IDE XTVTX ESP-32 DevKitC ESP-32 Development Board NodeMCU-32 ESP-WROOM 32D CP2102 Chip Successor module of the ESP-32 DevKit compatible with IDE: Amazon.co.uk: Business, Industry & Science
Hopefully yes. Not tried that one with the new processor, but it looks very similar to the DevKitC that I used. For £7 it's worth a punt. Hopefully the Arduino environment supports it if that's what you want to use.
 
Well started looking at this but before I go too far just need to make sure that nmea2k has a PNG that includes relevant run hours,
 
Top