[arduino proj2] old CETREK rudder sensor turned into NMEA0183

vas

Well-Known Member
Joined
21 Jun 2011
Messages
8,200
Location
Volos-Athens
Visit site
hello,

having sorted (mostly) my first arduino project windlass -> GMI10/20 (proprietary AutoAnchor sentences showing rode deployed) I'm now thinking of a second one (which obviously will combine with the first one eventually) which is getting an old working CETREK rudder sensor to send NMEA sentences of it's whereabouts...

Unfortunately my Garmin GMI10 doesn't understand RSA sentences so I have to go NMEA2K, but lets first do the difficult bit of reading the sensor:

I measured 2.3KΩ ahead, 2.75kΩ port and 1.95kΩ starboard (tracking about 45deg off centre on both sides -which is a lot I know)
This is measuring between the black and the white cables. There's also a red which i'm leaving to its own devices (for now)

Am I right in thinking that I should pump some current on the red and measure current on the black - white combo and import it into an analogue pin on the arduino?
All my computing / electronics/ programming knowledge is experience based and I've burnt a few things learning... Since I don't have a few rudder sensors in stock to burn, I have to get it right first time hence me asking :D

5V cannot really harm can they?
System was probably running on 12V originally.

cheers

V.
 
ok, reply to myself :D

6V input gave me 3V ahead, 4V port, 2V starboard (for 45% angles - don't ask I just nicked daughters 45deg triangle from her desk)
It appears to be rather linear, so approx half the angle is indeed .5V difference.

I also tried with 5V (more like it if driven together with the arduino) gave me 2.6V ahead, 3.5V port and 1.7V starboard

So 5V it is, 0.9V either way for 45deg means 5deg are 0.1V

Will try the analogue in of the uno but wont have anything to report before getting it sending NMEA2K sentences as GMI doesn't understand IIRSA :(

cheers

V.
 
Last edited:
Or put a resister in between the 5v and the black, white to ground and measure the voltage at the black.
http://everycircuit.com/circuit/6160909882359808/voltage-divider

Though by the sounds off it the red does something clever so might be worth hunting down a circuit drawing.

ohh, that's a fancy bit of s/w to present the operation of a circuit, thanks!

I'll stick to simple things though, wired it up on my uno on 5V, GND, A0 and I get:

500 ahead
670 port (approx 45deg)
330 stbrd (approx 45deg)

that's good enough with a bit of maths I have decent accuracy. Only thing bugging me is that there is a slightly different rate of change going to port compared to going strbrd. Effectively going from 90port to 90stbrd I get measured 90port and only 80strbrd!

Considering I'm only going to be using that to check where the rudders are when getting ready for mooring or leaving, it hardly makes any difference, but still curious to figure out why. It is consistent with a slight deviation in both Ω values and Volts (which I've sorted/edited in the previous posts as I thought I was measuring something wrong.

any pointers to simple sketch that does NMEA2K 127245 ?
tbh I'd need a decent analysis of this sentence to start with and then a method to pump it down the N2K bus.

cheers

V.

PS sketch looks like that:

// Analogue input from an old CETREK rudder sensor. Fed with 5V
// Rudder sensor Output in Volts and rudderValue are as follows:
// 45deg port == 3.5V == 670
// 0deg == 2.6V == 500
// 45deg stbrd== 1.7V == 330
//

int rudderPin = A0; // // Rudder sensor to analogue pin A0
int rudderValue = 0; // variable storing the value
float rudderAngle = 0; // angle calculated (-45 to 45degrees)

void setup() {
// initialize serial communication:
Serial.begin(4800);
}

void loop() {
// read the value from the sensor:
rudderValue = analogRead(rudderPin);
rudderAngle = (rudderValue - 500 ) / 4 ;
Serial.println("RudderValue: " + String(rudderValue, DEC) + ", Angle: " + String(rudderAngle, DEC) );
delay(500);
}
 
Sounds a much simpler way to go, wonder if the black is the wiper on a variable resister between red and white then. If if works then great.

For someone who professed to not knowing much about all this malarkey you're certainly steaming ahead :cool:

Afraid I know nothing of nmea 2000.
 
A quick search for Arduino MNEA 2k shows some links to some relevant discussions and libraries - but I think it may be an area that is still in the early stages. My setup is all 0183, so can't give you any 2k help.
 
Sounds a much simpler way to go, wonder if the black is the wiper on a variable resister between red and white then. If if works then great.

For someone who professed to not knowing much about all this malarkey you're certainly steaming ahead :cool:

Afraid I know nothing of nmea 2000.

shouldn't it be the white in the middle of red and black? Not that it makes much of a difference, it works and that's enough for me ;)

was steaming, now I'm seriously stuck!
Bought a whole load of arduino bits and bobs, 2-3 different CAN BUS boards/shields plus and arduino due (which I'm not keen on as it's a 3.3V board only!). Probably spent 80euro on all that but now I have to wait for the end of the month before they start arriving from CN giving me plenty of time to formulate the s/w part..

A quick search for Arduino MNEA 2k shows some links to some relevant discussions and libraries - but I think it may be an area that is still in the early stages. My setup is all 0183, so can't give you any 2k help.

yep a few discussions, a few PDFs from builders explaining how their h/w works and a couple of CSV files form guys logging their boats using an Actisense reader/converter.
I can post links to whoever wants it as now lack of basic computing knowledge kicks me hard...
FE, I have the sentence I have to recreate (as an example) and it goes like this comma delimited set of values:

Sequence #,Month_Day_Year_Hours_Minutes_Seconds_msTicks,PGN,Processed PGN,Name,Manufacturer,Remote Address,Local Address,Priority,Single Frame,Size,Packet
17,6_21_2015_16_11_14_24932192,127245,Processed,Rudder,Unknown Manufacturer,1,255,2,1,8,0x00F8FF7F5FB8FFFF

I don't care about the fields other than the last one. We see it's got a size of 8 and it's an 18 char thing (I assume HEX???)
on that 0x00F8FF7F5FB8FFFF I know that we have the following fields:

1 Rudder Instance (value 0 to 15)
2 Direction Order (set to 0 as no order provided)
3 NMEA Reserved (set to logic "1"s )
4 Angle Order (set to 0x7FFF equivalent to "Not Available")
5 Position (signed rudder angle in units of 0.0001 radians)
6 NMEA Reserved (set to logic "1"s)

of which only 5 is something to calculate.
Fck me if I understand what these 18 chars refer to...
Fck me if I understand why size is 8 but there are only 6 fields in there...

Further the two chars in bold on the 18char string are the only ones that changed in the log session so I assume it's the value of the rudder hidden there. From analysing the log I'd hazard a guess that
0x00F8FF7F5FB8FFFF is dead ahead
and
0x00F8FF7F3BB8FFFF is prt or stbrd (dunno and don't care now!)

If I get through this hurdle, I feel I have some chances of sending the right data to the bus. Mind I've noticed that the NMEA0183 sentences can be dodgy but system still runs, I mean nothing complains if checksum is missing, wonder how flexible N2K implementation is...

Any ideas welcomed as always

cheers

V.

PS. annoyingly the GPSMAP 751 also doesn't do the NMEA0183 rudder sentence,..
 
just to start closing various threads,

wired the old CETREK rudder sensor to the arduino DUE, gave it 3.3V, changed a bit the code, used Timo's libraries and happily works as a N2K device for my GMI10. So success!
All the bits are integrated in a single program (currently just over 400lines) that atm does wind and tank measurements (dummy values atm), CETREK rudder, AutoAnchor NMEA0183 (work fine)

I'll post updates to a central thread I started just in order to keep things tidy. Obviously code will be available to whoever wants it, just give me sometime to sort out a few more bits so that it makes more sense and there's a bit more commenting to help...

cheers

V
 
Top