We replaced our 40 year old Norwegian built Sabb H2 diesel engine with a 5kw Thunderstruck electric motor conversion kit . To keep a touch of the old, I decided to convert the tachometer to a digitally connected display for engine RPM, wind speed, vessel speed and battery state of charge.

The first challenge was to intercept the Thunderstruck CAN messages and extract the RPM from the appropriate packets. This was a brute-force reverse engineering of the CAN packet stream from the Sevcon motor controller to the Thunderstruck display.

The next challenge was driving the tachometer to represent a value. After a lot of effort I discovered that a short 12v pulse to the tachometer between 100Hz and 5000Hz represents the full scale range. This can be done by changing the Arduino PWM frequency on an output pin. To deliver 12v from the output pin I used a L293D.

I added a SSD1306 OLED to replace the RMP units region on the faceplate and display the units of the selected reading.

Then a small ring of WS2812b to back-light the display in a colour matching the reading. I use consistent colouring on all digital displays across the boat; blue for vessel speed, green for wind speed, red for battery SoC. A small 3D print holds everything in place inside the original tachometer housing.

As this is on a boat where there is water and motion I decided to use an APDS9930 proximity and intensity sensor to toggle between the 4 different readings. Unfortunately the proximity sensor didn't work through the display Perspex cover so this is mounted in the top right corner of the square bezel surround of the display. I use the APDS9930 light intensity sensor to set the backlight intensity with an over-ride if the boat's instrument light switch is on (at night time).

Our on-boat network uses RFM69 915 MHz ISM radio, so I use the wonderful Low Power Labs Moteino with the RadioHead library. 

This was all pre-Claude (old fashioned RE of CAN messages!), though I later used Claude to remove an annoying hang related to the i2C bus comms.

Though its a small part of the overall boat's instrumentation, it is great to have this old tachometer still part of our sailing experiences.

The Arduino emon_Tachometer.ino sketch is part of the larger emon_Suite library available on Github.