Code Monkey home page Code Monkey logo

clipperduet2n2k's Introduction

NASA Clipper Duet Echo Sounder/Log to NMEA2000 converter (ClipperDuet2N2k) ⛵ 🛠️

(German HOWTO)

Intro

ClipperDuet2N2k project is about retrofitting1 a NASAmarine Clipper Duet echo sounder/log with NMEA2000.

It makes use of an ESP32 equipped with a CAN transceiver to read the LCD controller's data and recompute usable values for water depth, speed and distance logs to be send into the NMEA2000 CAN network.

See my chaotic test setup2 below: Test setup showing Clipper Duet connected to NMEA2000 bus

HOWTO

Prerequisites

Hardware needed:

  • NASAmarine Clipper Duet (in case there are different versions around: the LCD controller must be an HT1621 and the LCD segment/com layout must be the same as in this implementation)
  • ESP32 module with a CAN transceiver3
  • a power supply module for the ESP32 which runs with the ca. 12V of your boat. It should deliver either 5V or 3.3V depending on your ESP32 module

Software needed:

  • ClipperDuet2N2k firmware (maybe as an already compiled binary ready for upload)
  • some means of uploading the firmware to the ESP32

The firmware is written for the ESP32. It makes use of PlatformIO with the Arduino framework.

Additional libraries:

Clipper Duet modification

You need to attach SPI MOSI, CLK, CS and GND wires of the ESP32 to the Clipper Duet front pcb.

Connection schema: showing solder connections to the ESP32 SPI pins

It's easiest to directly solder wires to the pins of the through-hole technique PIC microcontroller on the back side of the front pcb.

It is unknown if there are different hardware revisions of the Clipper Duet around. Check yours to have the same ht1621 type of LCD controller and the same LCD layout.

The firmware expects these connections (Arduino style pin numbering):

  • GPIO_NUM_12 (SPI MOSI) to HT1621 DATA which is on pin 4 of the PIC
  • GPIO_NUM_13 (SPI MISO) stays unconnected
  • GPIO_NUM_14 (SPI CLK) to HT1621 WR which is pin 5 of the PIC
  • GPIO_NUM_27 (SPI CS) to HT1621 CS which is pin 7 on the PIC
  • GND of the ESP32 is connected to GND on the Clipper Duet, this can be found e.g. on pin 8 of the PIC
  • CAN transceiver TX pin is on GPIO_NUM_5 of the ESP32
  • CAN transceiver RX pin is on GPIO_NUM_4 of the ESP32

The ESP32 is experienced to have 5V tolerance on the GPIO pins above. Considering the cheapness of the ESP32 modules, there is no level converter used.

A power supply for the ESP32 is needed. Most ESP32 modules want either 3.3V or 5V. The on-board 5V regulator of the Clipper Duet should not be used, as the ESP32 could draw too much power even without WIFI - YMMV.

First start

ClipperDuet2N2k firmware needs no special setup or configuration by the user.

Before real use, you should have at least once set your Clipper Duet into configuration mode (hold Illum key depressed while powering on) and confirm all the adjustments (keel offset, gain threshold, paddle wheel calibration value, units). ClipperDuet2N2k will read those settings and save it into its non-volatile memory, so that settings like the keel offset are known to the unit and can be sent in NMEA2000 sentences.

Without this configuration step, a keel offset of -3m is used as default for safety.

Usage

ClipperDuet2N2k will send NMEA2000 sentences for depth, speed, trip and total log.

Other NMEA2000 devices like chart plotters or MFDs are able to display these values. The units used on the NASA Clipper Duet can be adjusted to free will, values will automatically be converted to the base units of the respecticve NMEA2000 sentences.

Due to the nature of implementation, only the values shown are constantly sent out via NMEA2000. As unit conversion takes place using double float values, there might be minor rounding errors. This choice was made to ease development, as the NMEA2000 library also uses double floats.

Invalid water depth readings shown as "out" on the Clipper Duet are also sent as invalid value on NMEA2000, so other bus devices can detect false or missing readings. The keel offset configured in your Clipper Duet is sent as a negative offset in the water depth NMEA2000 sentence (your frontend display will most likely automatically account for this offset).

Beware that the update rate of the Clipper Duet and the small delay during data preparation adds up to the display delays on your frontend device. Also there are some bad implementations by some manufactures who preferred nice rolling values over fast update rates.

The trip and total distance log are sent in one NMEA2000 sentence. When showing the trip value, the trip distance and the last known total log are sent. When showing the total log, the trip and total values are sent only if they have been displayed less than 60s apart. If a the unit has read a system time/GNSS time (PGN 126992, 129029) from the NMEA2000 bus, this time is used to form a timestamp for the distance log sentence.

Configuration and calibration is done as usual by manually adjusting the settings via the buttons on the NASA Clipper Duet. Setting changes in the Clipper Duet are read by the ClipperDuet2N2k (see "First start").

For convenience, NMEA2000 traffic is output on the serial port in ActiSense format. So the ClipperDuet2N2k could be also used as a NMEA2000 to (USB-)serial gateway (with or without being connected to a Clipper Duet).

Firmware update

In case the firmware was compiled with OTA firmware update capability (WITH_OTA defined), ClipperDuet2N2k starts a WIFI access point when the Clipper Duet is in configuration mode. The access point will appear with a SSID ClipperDuet2N2k-..._.

You can access the update web page via going to clipperduet2n2k.local or 192.168.4.1 in the web browser of your device connected to the ClipperDuet2N2k-... access point.

As soon as configuration mode is left, ClipperDuet2N2k will reboot without WIFI.

Attention: Make sure your settings are configured correctly after a firmware upgrade! Non-volatile-memory might have been overwritten by the update.

Implementation insights

The PIC microcontroller of the Clipper Duet tells the HT1621 LCD controller which segments should be on depending on the values to be displayed.

Pulseview screenshot of SPI-like communication of the PIC mcu with the HT1621 LCD controller

The segment/com lines have been explored by writing a test software which make the LCD controller highlight single segments, so that a map of the segments and common planes could be made.

LCD segment layout

The ESP32 reads the communications of the PIC microcontroller with the HT1621. The PIC periodically sends data for the entire display memory of the LCD controller.

ClipperDuet2N2k ESP32 maps this display memory back to the 5 digits plus some symbols. The digits and symbols are then used to deduce the values, units and state of the Clipper Duet. The assembled data is then translated into standard NMEA2000 sentences and written to the CAN bus.

Shallow depth and speed alarm settings are read by the ClipperDuet2N2k, but as there is no well-known NMEA2000 PGN, no sentence with these values is sent.

Firmware Development Info

Versioning scheme is major.minor.patch Version data is included via the version.py pre:-script run by PlatformUIO

The N2K software version is shown as

  • major.minor.patch.0 for tags
  • major.minor.patch.num_of_additional_commits for commits
  • 0.major.minor.patch for a "dirty" build

N2k software version also shows build date. The format seems to be the one which is used in Timo Lappalainen's library, so I'll stick to it.

A full "git describe --allways --dirty" version string is included in the binary in NMEA2000.SetInstallationDescription1.

The elegantWebpage.h has been compiled from the ui/ folder of the elegantOTA library. Logo and favicon was changed.

Hardware Development Info

Clipper Duet is a simple device which is more on the cheaper end of the price range of depth sounders. ClipperDuet2N2k accounts for this and tries to keep things simple.

Following this KISS principle, the hardware was just thrown together using modules which were lying around.

Footnotes

Footnotes

  1. I reverse-engineered the schematics and partially recreated the PCBs in KiCAD. Link will follow once I uploaded this.

  2. The test setup consisted of a NASA Clipper Duet with an ESP32 devboard connected via a CAN transceiver to a marine MFD (in this case a Raymarine St70, which btw. is not recommended due to a number of bugs).

  3. A TI SN65HV231 was used, as it operates on 3.3V

clipperduet2n2k's People

Contributors

speters avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.