A cheap and simple wind direction sensor

A project log for Southampton Sailing Robot

This project aims to build a 1m autonomous sailing boat to compete in the World Robotic Sailing Championship (WRSC)

NanosebNanoseb 08/11/2016 at 21:490 Comments

For an autonomous sailing boat application the wind direction sensor is a key component because the sail settings as well as the sailing strategy rely on the direction of the wind. We have chosen an affordable, simple and easy to waterproof solution based on a magnetometer (we are actually using a complete IMU, but only utilise the magnetometer part) and magnets.

Two magnets are placed on the moving part of the wind vane so they rotate with the wind vane over the magnetometer which is located on the wind vane mast. Having the magnetometer fixed to the boat allows it to be waterproofed easily.

In order for it to work properly, the distance between the magnets and the magnetometer has to be trimmed so that the magnetometer doesn't saturate but the magnetic field created by the magnets is large enough to overpower the earth one.

The orientation of the magnets is also important, it has to create a moving magnetic field on the sensor when the wind vane is in rotation (and of course if you are using several magnets be sure they add their magnetic field to one another).

The rest is done on the software side, a calibration is needed to account for the position of the magnets, their orientation and the magnetometer. We have used a standard magnetometer calibration method (see our github), to get the wind direction a simple arctangent of the 2 (X and Y) normalised components of the magnetic field will give the wind direction.

With this solution we have estimated the precision to be about 5° to 10°, it is good enough for our application. To improve this value one can couple another magnetometer attached to the boat to subtract the magnetic field of the earth.