Converting Analog diesel engine instruments to digital

Jun 17, 2022
378
Hunter 380 Comox BC
For anyone interested in re-doing their instruments on the binnacle, there are a few good options for removing the tach, hour meter, coolant temp gauge, etc... from primary view (still should be installed somewhere) and rely on N2K to send engine data to your plotter / instruments.

1. Actisense EMU-1: Converts directly to NMEA 2000. Requires an additional Actisense tool to program it.

2. AOS Engine Gateway Single Engine Gateway – NMEA2000 Much cheaper than the Actisense solution (unclear how it's programmed, I asked for the manual but they wouldn't send it)

3. ESP32 microcontroller that receives analogue/digital data and sends it to Signal K, which sends it to N2K. ESP32 microcontroller (Google Search) If you have a CerboGX or OpenPlotter or a Raspbery Pi on your boat and you like to tinker, you can use a small ESP32 microcontroller to convert your analog data and send it to SignalK (SignalK can be installed on the CerboGX with the OS Large firmware update option). Then make a simple CerboGX- N2K cable (don't connect the power pin!) so that SignalK can send the info to your N2K / STNG network. Total investment (if you have the Cerbo GX) is well under $100.

1764745694047.png


This also allows you to use cheap waterproof "OneWire" sensors for engine compartment, exhaust elbow, alternator temp monitoring... it's very customizable. This version sends fuel consumption data (estimated from know RPM / fuel consumption values) based on RPM and engine load as % based on Yanmar published torque/fuel curves. The ESP32 uses a tiny amount of power and sends the data to the CerboGX via wifi. It will not affect the accuracy of your tach / coolant temp gauges.

1764744928701.png


You'll need to install VS Code on your computer to build the code and upload it to the ESP32. After the first load, later code changes can be sent via OTA (wifi) from your computer.

GitHub - cram001/esp32-Yanmar-ADC The code is still in alpha release (just started on engine testing) but the basics are working. I'll post pictures once my dash is rebuilt and the values are on the chart plotter.

With a CAN adapter board with built-in isolator, it should also be possible to directly convert the data to N2K, bypassing the SignalK step.... (SN65HVD230). However, that adds a lot of complexity (and memory requirements). If you want to go direct to N2K, maybe best to use one of the commercial products above. If you're willing to go through SignalK and you want to customize your ADC, then the ESP32 might be a good option for you.

There are several other projects such as:
GitHub - Boatingwiththebaileys/ESP32-code: SensESP32 Engine mointor code v2 (from YouTube fame! )
 
Last edited:
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
Nice project. I’m doing something similar but with a Raspberry Pi Pico instead of an ESP. The Pico is using an RFM69 module to send the data back to a Pi running SignalK, and that Pi has a Yacht Devices USB adapter to put the data on the N2K network. I think over the winter I’m going to update the Pico to send the data over Bluetooth so the RFM module isn’t needed anymore. WiFi feels a little heavy for the simple telemetry data.
 
  • Like
Likes: marcham
Aug 17, 2013
1,090
Pearson P30 202 Ottawa/Gatineau
Nice project. I’m doing something similar but with a Raspberry Pi Pico instead of an ESP. The Pico is using an RFM69 module to send the data back to a Pi running SignalK, and that Pi has a Yacht Devices USB adapter to put the data on the N2K network. I think over the winter I’m going to update the Pico to send the data over Bluetooth so the RFM module isn’t needed anymore. WiFi feels a little heavy for the simple telemetry data.
Can you give more detail on using the pi to do the is please?
I would love to have the info on my atomic 4 easily displayed
 

jssailem

SBO Weather and Forecasting Forum Jim & John
Oct 22, 2014
23,777
CAL 35 Cruiser #21 moored EVERETT WA
I understood maybe 50% of this and can figure out another 20% but that leaves me woefully ill equipped to implement. I admire the ingenuity and the multiple options.

Which leads me to the quandary. Do I need this much detail of my boat engine to go sailing?
 
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
Can you give more detail on using the pi to do the is please?
I would love to have the info on my atomic 4 easily displayed
The Pi end itself is pretty easy - SignalK takes care of the data formatting and interfacing to the NMEA network. Getting the data to the pi is the somewhat harder part. That’s where I use the Pico with temperature sensors clipped onto my thermostat housing and exhaust elbow, and a pulse sensor to read RPMs. I have documented most of what I put together at GitHub - davidasailor/PiForBoat.
 
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
Which leads me to the quandary. Do I need this much detail of my boat engine to go sailing?
To go sailing, probably not. But when the wind dies and we need to motor for a couple hours to get someplace I like to have the visibility. Our Yanmar didn’t come with any temperature sensors, only alarms, so the extra level of detail is nice to have. For example one afternoon it gave me an early warning of our impeller losing a blade. I saw temperatures starting to rise and I was able to slow down the engine, get home, and replace the impeller before the overheat alarm ever went off. Mine also sends me a notification when my bilge pump runs, which once helped me know I had a leaky hose connection.
 
  • Like
Likes: jssailem
Aug 17, 2013
1,090
Pearson P30 202 Ottawa/Gatineau
Ok, consider me curious, I already have a pi, can you explain how the pico comes in to play? Where do you read the info? Can you send the info on a plotter (Raymarine)???
I do not know much about this.
If you can explain or send me where to go look for the info it would be very appreciated
A big thank you in advance
 
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
Ok, consider me curious, I already have a pi, can you explain how the pico comes in to play? Where do you read the info? Can you send the info on a plotter (Raymarine)???
I do not know much about this.
If you can explain or send me where to go look for the info it would be very appreciated
A big thank you in advance
The Pico basically lets me collect sensor data from places that are too far to reach the Pi. The Pi sits behind my DC panel where it can connect to the NMEA bus and tank monitors, but that's pretty far from the engine and batteries. So I put the Pico in the aft cabin where it can reach the engine and batteries, and then it sends the data wirelessly to the Pi. If you have one central location where you can collect all of the data you want you could put the Pi there and do without the Pico. I think SignalK has plugins to interface directly with some temperature sensors so that part would be pretty easy. There is some soldering to integrate sensors, so you'd need to be prepared for that - this isn't really an out-of-the-box solution like some commercial yacht monitoring systems.

In my case I can read the data either on my chartplotter or on my phone. The chartplotter gets the data from the NMEA bus, where the Pi injects it with the Yacht Devices adapter (NMEA to usb: NMEA 2000 USB Gateway). If your Raymarine plotter is SeaTalk NG based then that should work fine, since SeaTalk NG is NMEA 2000 based. The Pi also sends the data back to a database on a workstation in my house, and my phone can connect to that to see dashboards and get alerts.
 
  • Like
Likes: fred1diver
Jun 17, 2022
378
Hunter 380 Comox BC
Nice project. I’m doing something similar but with a Raspberry Pi Pico instead of an ESP. The Pico is using an RFM69 module to send the data back to a Pi running SignalK, and that Pi has a Yacht Devices USB adapter to put the data on the N2K network. I think over the winter I’m going to update the Pico to send the data over Bluetooth so the RFM module isn’t needed anymore. WiFi feels a little heavy for the simple telemetry data.
I played around with Bluetooth at the boat .... I did not find the signal consistent enough for measuring/sending RPM. It's fine for measuring a tank volume (resistance) every few minutes. ESP32 uses extremely low current, even when using wifi to connect to SK. It also skip the overhead that is present on a RPI (ESP32 doesn't need an operating system)... making it ideal for this application, using very little memory. Depending on the board, the chip is designed to operate from -40 to 125 deg C .(RPI needs to be kept under 85C ... which is risky in some engine bays)... ideal for a marine environment, in case it's located in an engine bay! The boards are only $8, compared to $15 for the RPI nano 2... Flash is also availlable at 16MB for the ESP32 (my current project uses less than 1 MB, including debugging code!).

Keep us up to date with your progress! :)
 
Last edited:
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
I played around with Bluetooth at the boat .... I did not find the signal consistent enough for measuring/sending RPM. It's fine for measuring a tank volume (resistance) every few minutes. ESP32 uses extremely low current, even when using wifi to connect to SK. It also skip the overhead that is present on a RPI (ESP32 doesn't need an operating system)... making it ideal for this application, using very little memory. Depending on the board, the chip is designed to operate from -40 to 125 deg C .(RPI needs to be kept under 85C ... which is risky in some engine bays)... ideal for a marine environment, in case it's located in an engine bay! The boards are only $8, compared to $15 for the RPI nano 2... Flash is also availlable at 16MB for the ESP32 (my current project uses less than 1 MB, including debugging code!).
That’s good to know. This season I switched from an RFM based DIY temperature sensor in my refrigerator to a Govee BLE one and it’s worked well. That’s what got me thinking BLE could work from the Pico, and it would be nice to not have the extra point of failure of the RFM modules. But if the Pico BLE isn’t reliable enough for more frequent measurements like RPMs that would be a problem.
 
  • Like
Likes: marcham
Mar 27, 2024
31
Hunter 39 Wickford
That is great. Thank you for sharing with us. This is on my list for this winter so thank you! I look forward to seeing the updates as you progress.
 
  • Like
Likes: marcham
Aug 17, 2013
1,090
Pearson P30 202 Ottawa/Gatineau
So many questions, I don’t know where to start, but I definitely want to learn more, what sensors can I use?
my engine is an atomic 4 so very basic, no real sensors on the engine.
If I install sensors, what do I physically connect them to?

I have no trouble soldering and basic coding (very basic, but willing to learn)


what I would like to achieve is being able
To know temp and rpm’s from the engine at the helm, at the moment no info at all.

if I could monitor fuel, water and waste tank, I would be so happy
 
May 17, 2004
5,890
Beneteau Oceanis 37 Havre de Grace
So many questions, I don’t know where to start, but I definitely want to learn more, what sensors can I use?
my engine is an atomic 4 so very basic, no real sensors on the engine.
If I install sensors, what do I physically connect them to?

I have no trouble soldering and basic coding (very basic, but willing to learn)


what I would like to achieve is being able
To know temp and rpm’s from the engine at the helm, at the moment no info at all.

if I could monitor fuel, water and waste tank, I would be so happy
For temperature the easiest thing is probably DS18B20 sensors like High Temp Waterproof DS18B20 Digital Temperature Sensor. I have three of those - one just sitting in the cabin, one clamped to my exhaust elbow with an insulated hose clamp, and one strapped to my thermostat housing. Those are pretty well supported so the software part is pretty easy on any microcontroller or the Pi itself.

An RPM sensor will depend on your alternator since you don’t have an existing tach. My alternator has a tach output wire that gives a square wave with a frequency related to the rpm’s. I tied into that with an opto-isolator to get the voltage in a range my Pico can handle. Then the Pico reads the number of pulses per second to calculate RPMs.

For tank levels I tie into my existing sensors that went to a display panel. Since you don’t have existing sensors you’d need to add one to each tank. I don’t know what the best options are for that but I know some do exist.
 
Jun 17, 2022
378
Hunter 380 Comox BC
The commercial products I listed in post 1 assume your engine has analogue sensors (temp, pressure) and switches for low oil pressure, high coolant temp.

The code I wrote for the ESP 32 and the hardware sits in between analogue gauges and their respective sensors and "intercepts" the signal, just like the commercial products do.

However, I have not written it as a replacement for gaugues. Nor are my circuits designed to work as replacements for the analog gauges. The coolant temp sender is resistive, the gauge injects voltage and the current passing through the sender determines needle deflection. The RPM sensor produces a high voltage pulse (varies with RPM). Without the load of the RPM gauge, it could cause the digital interface to malfunction.

For temps (engine room, exhaust elbow), I secure a DS18B20 temp sensor. They are dirt cheap, resist to high temps and can have multiple wired in parallel on the same circuit, this is great as it avoids pulling 6 wires to get 2 sensors in the same area (just need 3 wires: pos, neg and data).

Some engines use the alternator, others use a magnetic pickup for the RPM signal. The hardware required to intercept that signal is different (still, under $10 of bits and pieces).

Oil pressure can be tricky to monitor accurately and to avoid damaging the sender, many engines require a damper to stabilize oil pressure to the sender.

There are many different systems for tank level sensors. Some are easy to read, some are more complex.

The easiest path would be to strap some DS18B20 sensors to various areas (oil filter, fresh water pump, exhaust elbow).... you can have several on the same circuit. Reading these with an ESP32 is super simple, all the code exists, just have to install it and then' you'd have 5 wires to connect:
DS18B20 sensor: pos,neg, signal
Then a 10-20V to 5V adapter to provide stable 5V to the ESP 32. With 4 gauges and an ESP32, you're looking at about$50. BUT, the ESP32 has to send the data to something!

If you have signalK (running on a Raspbery Pi with Open CPN, or a CerboGX), then it's easy. If you don't have signalK, then your ESP32 (or RPI, or Arduino) needs an additional board and software to convert that data to NMEA2000 format. That significantly increases complexity.

The ESP32 is very approachable to learn (or relearn) to program if you want to customize some features. Basically, we download preexisting code blocks, and either use them as is or tweak as we wish. The development environments can be from basic to very complex. The most approachable one is Arduino IDE. If you`ve ever written turbo pascal, MS VBA, it will seem approachable:
1765256378943.png


For more complex projects, Microsoft VS Code IDE has a bit more options to leverage, including a built-in AI assistant (debugging, writing functions, etc..).

Chat GPT 5 is excellent to assist with small coding projects. You tell it what you have, what you want to do and it starts spitting out code. When things don`t compile, just give it the error codes and it finds the fault pretty quickly....

1765256528047.png


If you google ESP32 programming on google, there are hundreds of step by step videos.

ESP32 + DS18B20 temp sensors is probably the simplest project to do, as it`s just a question of cop-paste existing code, compile, send the code to the ESP32 via USB ... connect a few wires and you`re set.

Another option, if you don`t want to send the data to SignalK and then onwards to NMEA2000, is the ESP32 can become a wifi hotspot. You then connect to it with your phone and it can display, via web page, all the data it has access to.

The UI for setting up the ESP32, (passwords), connecting to wifi, etc... is built-in. Nothing really to program except choose what fields to display.

Here`s an example of a simple ESP32 project, with the associated web page:

1765256721318.png
 
Last edited:
Jun 17, 2022
378
Hunter 380 Comox BC
A few more ready to install ESP32 scripts for boaters..: