Hello World!
My crew broke the Fluxgate compass (Raymarine) on one of our yachts, I was wondering if it is possible to replace it with some arduino compass (GY 521 board with Arduino Uno)?
The original Fluxgate by Raymarine sends NMEA-0183 signal to the autopilot, has 5 wires: blue, red, green, yellow, screen
Anyone tried this before?
Hello yvautrin
Yes, this is possible.
There are constrains wrt rules, e.g. Wheel Mark, using a home made compass system?
Have a nice day and enjoy coding in C++.
thanks for your help, i have now the GY-521 working with the arduino!
Now the question is how do I make it work with my Raymarine unit...?
Hi,
I would be very reluctant to put experimenter components in a situation that can be basically life saving.
If you go this path, then you will have to find a way to interpret the GY-521 info and convert it to
NMEA-0183 communication format.
Also you will have to calibrate the 521 and possibly compensate for magnetic distortion around the boat.
My suggestion, go buy a new Raymarine Fluxgate compass. for peace of mind and naval safety.
Especially if it is the major component of an AUTOPILOT.
Tom....

It's not hard to interface to NMEA-0183, I've done it to add additional channels of data for MFDs on deck. But for something as important as a compass, I strongly agree with @TomGeorge - get a real one.
I of course will get a real one, but if you can help me with the code, i still would like to see it working and have a better understanding of the system!
Do you know which NMEA sentence the Raymarine system is sending? Once you have the compass heading (compensated for deviation & variation most likely), composing the sentence is pretty easy.
[edit]
It looks like it's most likely $GPHDT. So assuming you had your True heading in a variable hdg,
char sentence[80];
snprintf(sentence, 80, "$--HDT,%4.1f,T", hdg);
Serial.println(sentence);
Should do it.
The communications should be the easy part - keep in mind the Deviation on your boat - all the Fluxgate compass's I have seen also had a calibration mode to cancel out the Deviation - the compass/system was put in calibration mode and the boat driven in a circle a few times for the system to reduce the deviation.
Are you planning on having the calibration mode in your system?