DIY Sailing Instrument

Sep 13, 2015
61
Catalina 22 Eugene
I thought the ring of led's would show AWA, but they seem all lit up. Or are the two yellow ones in the green sector the angle? If so, this seems confusing (and a bit ugly) vs just having lit led's at the AWA itself.

Particularly if one is color blind!

Mark
So the way it works now by default (and its all open source so it can work any way someone wants).....

The instrument has 2 brightness values that can be set by the user the "background_brightness" and the "pointers_brightness".

By default I like my background fairly dim and the pointers fairly bright but my camera often "fixes" this due to its exposure controls.

The background is red to port and green to starboard with a yellow pixel indicating fore and aft. Then the white pixels just past 90 degrees are indicating the AWA. If you have both pointers enabled you get the background and then a blue pointer is added. AWA defaults to white and TWA defaults to blue.
 
Sep 13, 2015
61
Catalina 22 Eugene
So the way it works now by default (and its all open source so it can work any way someone wants).....

The instrument has 2 brightness values that can be set by the user the "background_brightness" and the "pointers_brightness".

By default I like my background fairly dim and the pointers fairly bright but my camera often "fixes" this due to its exposure controls.

The background is red to port and green to starboard with a yellow pixel indicating fore and aft. Then the white pixels just past 90 degrees are indicating the AWA. If you have both pointers enabled you get the background and then a blue pointer is added. AWA defaults to white and TWA defaults to blue.
So another way of replying to you.... If you set the background brightness to 0% and the pointer brightness to whatever you prefer then you get a look like this.
1770281393496.png


It also has a night mode where the green side of the background goes all red but its just kinda zombie code at the moment. Part of me likes that original look of the red and green which helps indicate the port and starboard sides of the boat and orient it to the boat. But also at night if you can't see a ring its hard to make out the pointer direction. During the day you can see the ring and it helps indicate direction more easily.

I'm kinda starting to like the thing I may need to make one to run all the time on my desk I may miss it once it moves to the boat.

And yes this is fake randomized wind.... Its not really blowing almost 30 knots outside right now.
 
Sep 13, 2015
61
Catalina 22 Eugene
Well I've got it generating good looking GPX files matching the format that I had said I planned. They so far seem to open up and plot properly in commercial tools... Still a bit of debug and polishing to be done I'm sure but so far seems generally functional...

Lots of really nice touches I was able to figure out that I didn't on the last version... Little niceties like using the GPS to set the on board RTC which then makes the files written have real last write times will be nice when looking at the files on the card....

I've also gotten Gemini to open the GPX files and it will plot things like speed and barometer and what not over time... The only data I have now is randomized so its not worth trying to make polars from it but it did offer to do so... So I think once I have real data it may be pretty easy to get polars done from the GPX folder and a bit of AI magic.

I must admit I kinda expected it to take longer to get it working this decently. I have had to move the GPS to the UART which requires a bit of soldering but it works MUCH better and keeps up to date on the current time more accurately via a slower UART than it can on the much faster I2C. Not sure why but it would get minutes behind after a day and I don't understand how it could ever get that far behind without the buffer overflowing somehow well before that.
 
Sep 13, 2015
61
Catalina 22 Eugene
I've now moved to a new GPS module that does a much better job pulling in satellites when indoors and makes debugging things easier for me.

I updated the readme to reflect it but if anyone is interested this is a great module that is really quite compact: https://www.sparkfun.com/sparkfun-gnss-receiver-sam-m8q-qwiic.html

I really like that it has the Qwiic connectors (those lil black connectors on either side) which allow for an I2C connection along with power and ground with no soldering required. But it also has a standard USB-C connector which allows you to use it on a PC or Mac and even works great plugged into a phone. I didn't want to have to take the connector off so I designed a recess into the face plate that the GPS plugs snugly into.

I also think it looks pretty sharp in that dark blue.
 

Attachments

May 17, 2004
6,110
Beneteau Oceanis 37 Havre de Grace
I really like that it has the Qwiic connectors (those lil black connectors on either side) which allow for an I2C connection along with power and ground with no soldering required.
After a few iterations of fixing my mediocre solder joints I became a fan of the Qwiic system too.
 
Oct 26, 2008
6,432
Catalina 320 Barnegat, NJ
Count me as an advocate for using electronics to the greatest extent that makes you happy and I'm completely fascinated by this discussion. I don't have the knowledge to contribute to the technical aspects of this discussion, but one point stood out to me. The revelation that the system cost just $300 made me think what a bargain that commercially available systems really are. I'm assuming that the cost is primarily for materials and doesn't factor your considerable time and education to perform this work.

Consider the major players like Raymarine and B&G. They have to purchase land, build factories, hire employees (employees with technical and managerial backgrounds), train employees, provide benefits to employees (to keep them happy). They have to source materials and design systems, fund their research & development, pay for marketing and sales. They have to be accountable for warranty considerations & they have to pay TAXES. And foremost they have to make their stockholders happy with profits and dividends or all their financing disappears.

I'm simply amazed at this point how the prices for today's advanced electronics have not increased nearly as significantly as the advances.

Your shade tree efforts are admirable and your curiosity and enthusiasm is infectious. It all goes to show that stimulation of the brain is really what drives the advances in electronics. It's not just a mindless quest in commercialism. It's what the market wants and supports.

I will also note that in the advancing years of many of us (me included), brain stimulation is important. Keeping up with advancing products is part of it for enjoyment and health.
 

colemj

.
Jul 13, 2004
1,036
Dolphin Catamaran Dolphin 460 Mystic, CT
I'm simply amazed at this point how the prices for today's advanced electronics have not increased nearly as significantly as the advances.
This is a good point. We did a complete electronics refit in 2012. Then we got different boat and did another electronics refit in 2020 with most of the new stuff being the 3-4 generation advancements of the old stuff. Better form factors, better functionality, better power draw, better components, etc.

The price for each component, bought from the same reseller, was the same as what I paid 8yrs earlier for the older models in absolute terms. In relative terms, the dollar was worth 41% less in 2012, so the new electronics were relatively cheaper than the old.

I agree with you that modern electronics are a good deal, and continue to stay that way. Having said that, we also make room for inexpensive stuff like OpenCPN, tablet apps, etc.

And some of the shade-tree efforts like in this thread do find their way into commercial products. Wakespeed alternator regulators and Pelagic autopilots come immediately to mind, and I'm sure I could come up with others if I thought more about it.

Mark
 
  • Like
Likes: brett_howard
Sep 13, 2015
61
Catalina 22 Eugene
After a few iterations of fixing my mediocre solder joints I became a fan of the Qwiic system too.
Personally I have no problems soldering being that by my day job I'm an electrical engineer so soldering comes pretty naturally to me. But the dream of someone else trying to make one of these has me trying to keep the amount of soldering to a bare minimum. The V1 wind instrument was a very difficult build so I'm trying to do better this time!
 
Sep 13, 2015
61
Catalina 22 Eugene
Count me as an advocate for using electronics to the greatest extent that makes you happy and I'm completely fascinated by this discussion. I don't have the knowledge to contribute to the technical aspects of this discussion, but one point stood out to me. The revelation that the system cost just $300 made me think what a bargain that commercially available systems really are. I'm assuming that the cost is primarily for materials and doesn't factor your considerable time and education to perform this work.

Consider the major players like Raymarine and B&G. They have to purchase land, build factories, hire employees (employees with technical and managerial backgrounds), train employees, provide benefits to employees (to keep them happy). They have to source materials and design systems, fund their research & development, pay for marketing and sales. They have to be accountable for warranty considerations & they have to pay TAXES. And foremost they have to make their stockholders happy with profits and dividends or all their financing disappears.

I'm simply amazed at this point how the prices for today's advanced electronics have not increased nearly as significantly as the advances.

Your shade tree efforts are admirable and your curiosity and enthusiasm is infectious. It all goes to show that stimulation of the brain is really what drives the advances in electronics. It's not just a mindless quest in commercialism. It's what the market wants and supports.

I will also note that in the advancing years of many of us (me included), brain stimulation is important. Keeping up with advancing products is part of it for enjoyment and health.
Appreciate the kind words! I fully understand what it takes to bring electronic products to market. I've been an electrical engineer for decades. Thus why on this project I'm just buying the electronics and I'm just having fun doing the software and mechanical design work. Keeping the mind fresh and playing around with fun stuff is what its all about on this one!
 
Apr 25, 2024
828
. . .
What's crazy to me is how quick and cheap it is to produce custom PCBs. I actually, just today, received some custom PCBs I designed for a non-marine related device. I just needed one, but the minimum order was 5. I designed them and got them printed and delivered, for $6.48 USD. And, these are circular PCBs, two-sided, and the quality seems excellent. That means that for the price of a latté, people printed my design, tested it, packaged it, sent it across the world (from China) and put it in my mailbox - all in about 10 days.

I've done this with other projects in the past 2-3 years or so. 10-20 years ago, I don't think I could get it done for less than $500.

1771134385769.jpeg
 
  • Like
Likes: dmax
Sep 13, 2015
61
Catalina 22 Eugene
Designing and having PCBs built is what I do all the time as my day job. I've got decades of experience making boards and so while I agree it is cool that its getting cheaper that is the only part of this project I've been avoiding. Even getting full assemblies is way cheaper than its been in the past. And I'm sure I could make this thing WAY cheaper if I made my own PCBs but that part isn't as exciting or new to me... Making it do what I want on the boat and playing with the software is well more rewarding to me.
 
Sep 13, 2015
61
Catalina 22 Eugene
1771558847640.png


I've implemented some known tests and proven out that we're calculating average speed weighted true wind direction properly and I've done some checks that true wind before that are accurate... The GPS seems to be doing very well with 9 sats and an HDOP that is usually much less than the 2.3 you see here... But the unit now outputs this table every 15 seconds or so to help with debugging and seeing the status of all the things at once (you can't see all this on the OLED in real time). But you can view many of these things in the different modes...

I've also updated things so that all the pitch and heel and both GPS and barometric elevations are written to the GPX file.... So it should have a lot of data for viewing and analyzing later on.....
 
Sep 13, 2015
61
Catalina 22 Eugene
This is probably too much for most but I've kinda put together my user manual for how to operate this thing.... It takes a bit of setup to calibrate the compass and what not but once its installed the basics is that you can just go for a sail and when you're done you press the mode button one time and goes into a logbook stats mode where it reads out the information about your sail in an automatic scrolling page mode... The way I operate it is that its plugged in via USB-C to a switch that I turn on/off when I got for a sail. But then in the background it creates tons of logs for later analysis and nerdery and the GPX files are VERY detailed... All of this is functional and ready to be tested on the boat this summer already. Gemini has been very helpful in writing the Python code and its been way faster to redo this the whole thing took me like 9 months to write in C++. I've gotten this and the mechanical design done in like 1.5-2 months this time? Either I've improved or AI is very helpful... or probably a bit of both....


Operation Manual
Hardware Controls
The instrument uses a 3-button interface to navigate menus and adjust settings.

Physical ButtonFunctionDescription
TOPUPCycle Backwards through pages or Increase values.
MIDDLEMODEShort Press: Cycle Main Modes (WIND $\to$ STATS $\to$ SENSORS $\to$ SETTINGS).
Long Hold: Trigger actions (e.g., "SAVE CONFIG", "CALIBRATE IMU") or enter Edit Mode.
BOTTOMDOWNCycle Forwards through pages or Decrease values.
Main Menu Modes
1. WIND MODE
Displays the primary sailing data. Use UP/DOWN to cycle through the four available views:

  • APPARENT ONLY
    • Display: Shows Apparent Wind Speed (AWS).
    • Pointers: Shows Apparent Wind Angle (AWA) only.
  • TRUE ONLY
    • Display: Shows True Wind Speed (TWS).
    • Pointers: Shows True Wind Angle (TWA) only.
  • APPARENT + TRUE (Combined A)
    • Display: Shows Apparent Wind Speed (AWS).
    • Pointers: Shows BOTH Apparent (White) and True (Blue) wind angles simultaneously.
  • TRUE + APPARENT (Combined T)
    • Display: Shows True Wind Speed (TWS).
    • Pointers: Shows BOTH Apparent (White) and True (Blue) wind angles simultaneously.
2. STATS (LOGBOOK) MODE
Displays historical data for the current voyage. Use UP/DOWN to cycle through the 4 logbook pages:

  • Page 1: Voyage Status
    • Start Time: When the boat left the geofence.
    • End Time: When the boat returned (or current time if active).
  • Page 2: Wind History
    • Avg AWS: Average Apparent Wind Speed.
    • Avg TWD: Average True Wind Direction (Speed-weighted).
    • Max AWS: Highest recorded gust.
  • Page 3: Sea State
    • Barometer: Current pressure trend (inHg or hPa).
    • Max Heel: Maximum recorded heel angle.
  • Page 4: Performance
    • TRIP: Odometer (Nautical Miles traveled since start).
    • MAX SOG: Maximum Speed Over Ground.
    • AVG SOG: Average Speed Over Ground.
3. SENSORS MODE
Raw data inspector for debugging. * GPS: Lat/Lon, Fix Quality (FQ), HDOP. * IMU: Compass Heading, Pitch, Roll. * System: Battery Voltage, Internal Temp.

IMU Calibration (Compass & Level)
To ensure the compass heading and heel angle are accurate, the BNO055 sensor occasionally needs calibration.
You will usually only need to do this once for each time you move the location the instrument is installed. It accounts for metal objects and other electrical fields in the vicinity of the instrument.

  1. Enter Calibration Mode:
    • Navigate to SENSORS mode using the MODE button.
    • Use UP/DOWN to scroll to the screen labeled CALIBRATE.
    • The display will show a status code like: S:0 G:0 A:0 M:0.
  2. Interpret the Status Codes:
    • S (System): Overall calibration status (0 = Uncalibrated, 3 = Fully Calibrated).
    • G (Gyro): Rotational sensor.
    • A (Accel): Tilt/Gravity sensor.
    • M (Mag): Compass/Magnetometer.
  3. Perform Calibration Motions:
    • To Calibrate Gyro (G): Place the instrument on a stable surface and let it sit completely still for a few seconds. G should jump to 3 quickly.
    • To Calibrate Magnetometer (M): Pick up the unit and move it in a "Figure 8" motion in the air, or rotate it 360° around each axis. M will increase to 3 once it maps the local magnetic field.
    • To Calibrate Accelerometer (A): Rotate the unit slowly in 45° increments, pausing for a second at each angle. Placing it on 6 different sides (like a die) often works best.
  4. Save the Profile:
    • Once the system shows S:3 (or you are satisfied with the individual sensors), LONG HOLD the MODE button.
    • The screen will flash SAVED!.
    • This writes the calibration offsets to IMUCAL.json on the SD card so they are loaded automatically on the next boot.
4. SETTINGS MODE
Adjust system preferences. * Brightness: Adjust OLED and Pixel Ring intensity. * Save: Write current settings to config.txt on the SD card.

Automated Features ("Zero-Touch" Logging)
The instrument is designed to require no manual interaction during a typical day sail.

  1. Auto-Start: When the boat moves >350mfrom the "Home" coordinates (defined in config.txt), the system detects a "Voyage Start."
    • Trip Odometer resets to 0.0 NM.
    • Max/Avg stats are cleared.
    • A new GPX track file is created on the SD card. Format: (YYYY)_MM-DD_HHhMMm.gpx Example: (2026)_02-19_19h13m.gpx
  2. Auto-Log: While sailing, the system logs position, wind, and performance data to the GPX file every 1-5 seconds. (Configurable via config.txt on the SD card)
  3. Auto-End:When the boat returns within the home radius, the voyage is marked as complete.
    • This means that your sail and wind statistics won't rot away as you sit at the dock talking to a friend. The stats are locked once you cross the geofence to home.
    • A summary is written to voyage_log.csv.
    • The GPX file is closed.
Visual Indicators (Clock Page)
  • FQ: 0 = No GPS Fix.
  • FQ: 1 = Standard 3D Fix.
  • FQ: 2 = DGPS/SBAS Fix (High Precision - WAAS/EGNOS active).
Configuration (/sd/config.txt)
If you put a blank SD card into the unit it will create a file for you with default values. You can then edit this file to configure the instrument to your preferences. This file controls the behavior of the instrument. All lines must be formatted as KEY=VALUE.

Navigation & Orientation
  • BowOffset (Default: 0)
  • Description: Degrees to add to the wind angle. Use this if the wind sensor is not mounted perfectly parallel to the boat's centerline (e.g., set to 5 if twisted 5° to the right).
  • MagVariance (Default: 14)
  • Description: Magnetic declination for your region. This is added to the magnetic compass reading to calculate True Heading and True Wind Direction. (e.g., 14 is typical for the Pacific Northwest).
Geofencing & Automation
  • HomeLat / HomeLon
  • Description: The decimal coordinates of your home marina or mooring. This is the center point for the automation circles.
  • HomeStatRadius (Default: 350)
  • Description: Radius in meters. When you cross this line outbound, the trip stats (Odometer, Max Speed, etc.) are reset. When you cross it inbound, the voyage log is saved.
  • HomeGPSRadius (Default: 50)
  • Description: Radius in meters. GPX logging to the SD card is disabled while inside this circle to save storage space while at the dock.
Logging & Time
  • GPXLogging (Default: True)
  • Description: Master switch to enable/disable writing GPX track files to the SD card.
  • GPXLoggingRate (Default: 1)
  • Description: Seconds between log entries. Recommended: Set to 5 or 10 to reduce file size and system load.
  • TrackName (Default: "Uncomfortably Level")
  • Description: The name of the track written into the GPX file header (visible in mapping software like OpenCPN or Google Earth).
  • LocalUTCTimeDelta (Default: -8)
  • Description: Time zone offset from UTC in hours (e.g., -8 for PST, -5 for EST).
Sensor Tuning & Filtering
  • SpeedMAD (Default: 5)
  • Description: "Moving Average Depth" window size. This is the number of recent wind samples kept in the buffer for smoothing. Higher numbers = smoother wind speed but more lag. Lower numbers will give less lag but look jittery. At ~10 knots you can expect about 5 updates per second so the default of 5 smooths and averages 1 second of readings. This feels about right.
  • DirectionFilter (Default: 250)
  • Description: Smoothing factor for wind direction (0-1000). Lower numbers make the needle move slower and smoother; higher numbers make it more responsive to gusts.
  • WindUpdateRate (Default: 1000)
  • Description: Interval (in ms) to process wind data from the masthead unit.
  • GPSUpdateRate (Default: 1000)
  • Description: Interval (in ms) to poll the GPS for position updates.
  • BaroRefAlt (Default: 114)
  • Description: Your current altitude in meters (usually your home dock altitude). This is used to calibrate the barometer to report Sea Level Pressure correctly.
Display & Units
  • TempUnits (Default: "F")
  • Description: Temperature display units ("F" or "C").
  • BaroUnits (Default: "inHg")
  • Description: Barometric pressure units ("inHg" or "hPa").
  • BackgroundPixelBrightness (Default: 0.025)
  • Description: Brightness (0.0 - 1.0) of the static Port/Starboard colors on the LED ring.
  • PointerPixelBrightness (Default: 1.0)
  • Description: Brightness (0.0 - 1.0) of the active wind pointer LEDs.
GPX Log Format
The instrument creates standard GPX 1.1 files compatible with most mapping software (OpenCPN, Google Earth, etc.). However, to capture the full sailing telemetry, it utilizes a custom <extensions> block for data not supported by the standard GPX schema.

Standard GPX Tags
TagDescriptionUnit
<trkpt lat="..." lon="...">GPS Latitude and Longitude.Decimal Degrees
<ele>Barometric Altitude (derived from BMP280).Meters
<time>UTC Timestamp.ISO 8601 (Z)
<speed>Speed Over Ground (SOG).Meters/Second
<course>Course Over Ground (COG).Degrees (True)
Custom Sailing Extensions
These fields are located inside the <extensions> block of each track point.

TagDescriptionUnit
<gps_ele>Raw Altitude from GPS (Ellipsoid height).Meters
<hdop>Horizontal Dilution of Precision (GPS Accuracy).Lower is better
<sats>Number of satellites used for the fix.Count
<aws>Apparent Wind Speed (Filtered).Knots
<awa>Apparent Wind Angle.Degrees (0-359)
<tws>True Wind Speed (Calculated).Knots
<twa>True Wind Angle (Calculated).Degrees (0-359)
<heading>Magnetic Compass Heading (IMU).Degrees
<heel>Heel Angle (Roll).Degrees (Positive = Port up?)
<pitch>Pitch Angle.Degrees
<baro>Barometric Pressure.inHg (default)
 
Last edited:
May 17, 2004
6,110
Beneteau Oceanis 37 Havre de Grace
Very nice work!

Gemini has been very helpful in writing the Python code and it’s been way faster to redo this the whole thing took me like 9 months to write in C++. I've gotten this and the mechanical design done in like 1.5-2 months this time? Either I've improved or AI is very helpful... or probably a bit of both....
I think Python is pretty well suited for a task like this and helps getting the code done faster. I know my Python logging app is about 10% of the complexity and code count of my original implementation in Java, and does more.
 
Sep 13, 2015
61
Catalina 22 Eugene
Very nice work!


I think Python is pretty well suited for a task like this and helps getting the code done faster. I know my Python logging app is about 10% of the complexity and code count of my original implementation in Java, and does more.
Appreciated. When I get a chance to debug for a week or so at the lake I'll take a video explaining it and I'm hoping to see if I can get on Hack a Day or something. I also just ordered some solar panels to redo the mast head enclosure with a new solar panel and what not. I'll probably keep the C++ at the mast head because its going to be better at lower power states and I've already got a bunch of time into getting that lower power already.

Mostly the first version I wasn't ever sure enough about water ingression to leave it outside. Now I think I want to try my hand at making something fully water proof and self contained so that you don't have to run any wires down the mast. At the moment I've already got a wire so the drive forcing me to do it is low. But the interest in a new 3D printed design sounds somewhat fun. I'm amazed at how much I've gotten done in a short time. But it also doesn't seem like the government is rushing to approve budgets even for military defense design work so I remain furloughed. Oh well I'm having fun and it'll be warm soon enough!
 
Sep 13, 2015
61
Catalina 22 Eugene

A quick video of things looking functional.

Got a small version of the mast head enclosure put together kinda... Now working on a slightly larger version that can hold a bigger solar panel and a bigger battery... I still need to get to the boat and grab the old mast head piece to figure out what the power consumption was so that I can calculate what kinda battery life each size will give.... The bigger version with better cable glands is almost done printing out on the 3D printer and its already obsolete as I've come up with an idea to make installing the cable gland easier with some alignment pins.