Part 1: Arduino Rudder Reference LED Gauge for Raymarine

SHARE

Kool Project Summary:

This project explains how to build a rudder angle indicator (direction of turn indicator) using 5 LEDs, an Arduino Uno, and a Raymarine Z230 or M81105 rudder reference transducer. The circuit diagram and the sketch (program) to upload to the Arduino is provided below. The LEDs give you a quick visual summary of what position your rudder is in, and when it is dead center (white LED illuminates on its own). It should be fairly easy to adapt this project for a Garmin GRF10 rudder feedback sensor,  Simrad, Hummingbird, B&G, etc, or any resistive rudder angle sensor you want to use.

Difficulty Level:

Easy (basic familiarity with an Arduino is needed, tons of great info online).

Theory:

A rudder reference transducer is like a potentiometer in that when it turns it varies the resistance (ohms) through the circuit. The Arduino (computer) measures the resistance change as the transducer moves by using a voltage divider like an ohm-meter does. By identifying the values of your particular reference unit you can build non-overlapping ranges of ohms (resistance) that correspond to the direction you are turning. A hall effect sensor like Jack Edwards used to build his autopilot would work instead of the Raymarine transducer and would be less expensive. You would have to adapt the code to read voltage change. I picked a marine grade transducer because it is designed to be splashed with saltwater from the bilge area. Keep this in mind as you plan out your project.

The work is pretty much done for you in the provided program. You will have to tweak the ohm values (in the arduino sketch) for variable R2 to match your specific transducer and rudder center point after everything is installed on your boat. To do this you can just open up the serial monitor window that is included in the free Arduino software you install on your computer, and watch the values as you manually move the rudder. You then tweak the code and re-upload it to the Arduino.  Test, test, test….

Project Justification:

Knowing the position of the rudder provides instant feedback when you are maneuvering your boat in a tricky situation. Knowing when your rudder is dead center makes steering easier and safer. Many autopilots no longer use a physical rudder sensor and have moved to virtual sensors. This has left more boaters without any kind of rudder angle indicator.

A dedicated display head that interfaces with a rudder reference unit costs hundreds of dollars. This project costs less than US $40 not including the transducer. If you can’t afford an autopilot or a dedicated gauge, you now have another option. An Arduino also provides an upgrade path for future projects like remote switching, temperature monitor, boat level gauge, autopilot, or whatever you can dream up.

As I explore the Arduino in future projects I hope to connect it to an IOS / Android Control App. This will allow me to move to a second helm and still see a turn indicator and other data by looking at my phone.  Longer term I hope to have the Arduino send Signal K formatted messages to an iKommunicate gateway to convert the data into NMEA 2000 format for display on a chart-plotter. An Arduino gives you lots of flexibility and options that a proprietary piece of hardware won’t. Of course it is just plain fun to tinker with this stuff!

Parts List:

  • Arduino Uno – US $10
  • *12V DC to 5V DC Power Supply – US $5
  • USB Cable for Arduino – usually included with Arduino
  • Arduino Uno Case – US $5
  • Starter Kit (LEDs wires, resistors, breadboard) – US $10 – $20
  • Raymarine Rudder Reference Transducer – US $100 on eBay (shop around)
  • Housing for LEDs – be creative, I used a retro wooden quill pen case
  • Cat 5 cable (copper core) – Great for longer wire runs.
  • Software for your Mac or PC – free

*don’t forget a fuse when connecting to your DC system

Installation:

The rudder reference unit is attached to the rudder using the instructions that come with it from Raymarine. The cable from the rudder reference containing four wires is run to the helm where the Arduino is located. You will need to mount the 5 LEDs in something permanent (to replace the breadboard shown in the photo below) and also terminate the rudder reference there using just the green and blue wires. I’m planning to mount the LEDs in a wooden pen case that hinges open and is hollow inside.  Use all red LEDs if you cruise at night!

Operation:

As we steer the boat and the rudder moves port lock to starboard lock, the LED’s light in sequence with the white LED illuminating when the rudder is exactly centered.  By turning on two adjacent LEDs we can divide turning range into 9 unique positions (see video above).

Circuit Diagram: (click to enlarge)

Circuit Diagram Z230 for rudder reference

Arduino Sketch (program):

//This is the code to make the arduino function as an ohmmeter and rudder sensor
//This code will display the voltage that drops across rudder sensor along with its resistance
//use blue and green wires on rudder sensor, other wires not needed
//Blue/Green —– Anti clockwise stop —- 1.66k ohm +/- 10%
//Blue/Green —- Clockwise stop —– 3.3k ohm +/- 10%
//open serial console to see the values
//thanks to how to build an ohm meter tutorial at http://learningaboutelectronics.com/Articles/Arduino-ohmmeter.php
//note you will have to adjust the range values for variable R2 depending on the range of your own setup once installed//–copy and paste the code below–int analogPin= 0;
int raw= 0;
int Vin= 5;
float Vout= 0;

//next line for float R1 should be changed to 4700 if using 4.7k ohm resister, 1000 for 1k ohm resister
//this resister is close to the upper range of the resistance for the raymarine Z230 / M81105

float R1= 4700;
float R2= 0;
float buffer= 0;

void setup()
{
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
}

void loop()
{
raw= analogRead(analogPin);
if(raw)
{

buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
R2 = R2 / 1000;

Serial.print(“Vout: “);
Serial.println(Vout);
Serial.print(“R2: “);
Serial.println(R2);

//make far red show for wheel lock to port
if (R2 > 3.5) {
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
digitalWrite(13, LOW);
}

//make 2 reds show for next range
if ((R2 < 3.51) && (R2 > 3.22)) {
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(13, LOW);
}

//make red show for next range
if ((R2 < 3.23) && (R2 > 2.93)) {
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
digitalWrite(13, LOW);
}

//make white and red show for next range
if ((R2 < 2.94) && (R2 > 2.65)) {
digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
digitalWrite(13, LOW);
}

//make white light show for center range
if ((R2 > 2.56) && (R2 < 2.66)) {
digitalWrite(11, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
}

//make white and green show for next range
if ((R2 < 2.57) && (R2 > 2.29)) {
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(13, LOW);
}

//make green show for next range
if ((R2 < 2.30) && (R2 > 2.02)) {
digitalWrite(11, LOW);
digitalWrite(12, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(13, LOW);
}

//make 2 green show for next range
if ((R2 < 2.03) && (R2 > 1.75)) {
digitalWrite(11, LOW);
digitalWrite(12, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(13, HIGH);
}

//make far green show for wheel lock to starboard
if (R2 < 1.76) {
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(13, HIGH);
}

delay(1000);
}
}

//end

LEAVE A COMMENT