Building a NMEA 0183 Wind Instrument

isailor_windUPDATED 09/08/2016. Following on from the last project, where I broadcast NMEA GPS data to iSailor, I wanted to send wind measurements as well. The mast in my Westsail 32 was out, and it was a perfect time to put a new wind vane on. The app iSailor now has an unlockable wind instrument display, meaning I could channel the measurements straight to it. Alternatively I could also send the data to a laptop running OpenCPN. Firstly I needed a wind vane to mount. In the same mind as the excellent Freeboard project, I decided to use a Peet Bros. Anemometer to mount at the top of the mast. The unit seems extremely reliable and simple, having only two magnetic reed switches inside. The timing between the switch pulses gives wind direction, and the frequency of pulses gives wind speed. It really doesn’t get much simpler than that, and this set-up only requires three wires to be run up the mast (eg. an audio cable).

nmea_wind_circuit_v4 With the anemometer installed, I used a 3.3V Arduino Pro Mini (or any other Arduino) to read the pulses. Peet Brothers kindly supplied the calibration data to convert the pulse timings into wind speed. It then took some trials and data analysis to work out the best error rejection and digital filtering for a stable output.

UPDATE: I have designed a small circuit board for this project which is available to buy on tindie. Alternatively for a small donation I can provide my code if you’d like to build one yourself.

Once the wind speed and direction is decoded by the Arduino, it can be sent out as a standard NMEA 0183 string. This string can be read by almost any marine equipment. I piped the data string into my Raspberry Pi NMEA Multiplexer which allows the data to be sent over WiFi. The iSailor app can then be unlocked to read the NMEA sentence and display a wind instrument! The data could also be sent to any existing instrument display that accepts NMEA 0183. So why pay over $1000 for a brand name wind instrument, when you can build a simple and rugged one for a fraction of the price!

EDIT: I should note that I did have some initial problems with the wind vane. I was not receiving all the direction pulses; many were not there. In the plot below the top trace shows what should be received, the bottom was my wind vane.

pulsesObviously the direction reed switch was not being engaged all the time. After some investigation I determined that the small piece of shielding metal in the cup assembly was not large enough to block the direction magnet. I ended up inserting another small piece of metal (in addition to what was there already) to better block the magnet’s effect on the reed switch (see picture below). I’d be curious to know if anyone else has this problem.

IMG_0382

 

Advertisements
This entry was posted in Projects, Sailing and tagged , , , , , , , , , . Bookmark the permalink.

19 Responses to Building a NMEA 0183 Wind Instrument

  1. This just gets the mind spinning. A magnet and a reed switch and very similar code could get engine/prop RPM for which there is an NMEA 0183 RPM sentence. There are cheap temperature probes for Arduino, so air (XDR), water (MTW), engine temps could be put into NMEA too. But what I want the most is to fire laser death beams at perched birds on my masthead.

  2. Rob42 says:

    In the freeboard project I also had some users with erratic response from the peet instrument. In the end the addition of 0.01uF caps across the wires (dir wire to gnd, speed wire to gnd) stabilised it a lot. I suspect some cables pick up noise depending on the boat. Also 5V works better than 3.3V

    Have a look at signalk.org too – thats the best solution to getting at boat data

    • Tom says:

      Good idea about adding a cap, that would definitely help with noise. Although I was having these problems on my bench, before it was near the boat.

      I really love the freeboard project and the work you’ve done, nice work!

    • DavePF says:

      +1 On that! It wasn’t working for me, than I add the two 10nF cap and BINGO !

  3. Daniel Marion says:

    If I understand well (I am not very good at this), the multiplexer is necessary to connect multiple instruments. If I have only one instrument, i.e. the Peet wind vane, is it possible to connect it directly to the RPi where it can be decoded as NMEA 0183 string and sent to iSailor via WI-FI? Thanks.

    • Tom says:

      Yes, what you say is correct. The multiplexer just allows multiple inputs and multiple outputs, so you can build the project with only one in and out on the RPi. I have also been playing with a dedicated Arduino with WiFi which may be more reliable than the RPi. Hopefully I’ll have time to post about it soon.

      • Daniel Marion says:

        Excellent! Thanks. I will find or build a routine on the RPi and also wait for your post. Not needed until ice melts on the lake… 🙂

      • Tom says:

        If you use the rather excellent kplex program on the RPi (described in one of my other posts) it will be a simple configuration file change.

  4. Daniel Marion says:

    Excellent suggestion! But maybe I am missing something basic… The Peet just sends pulses. How do we translate them into NMEA sentences? Thanks again and sorry to make you endure my ignorance.

  5. Daniel Marion says:

    OK! I got my answer reading your posts. Thanks.

  6. Pingback: DIY Marine Anemometer System | Mechinations

  7. yachtdrummer says:

    Is there a link anywhere for the software?

  8. Mike Rosendale says:

    It works very well. But I had to wire like this http://www.42.co.nz/freeboard/technical/interfacing/peetbrosanemometer.html
    rather than your diagram above.. Power and ground are reversed in your diagram.

  9. Franklin says:

    Hi
    Great project for little money!

    Would like to get in touch by email we the author. My mail is

    Thank you!
    Franklin

  10. Ole says:

    Wov googled and found this, i would so much like to get fuel flow in ny gps and gph, and when i have fuel flow and mph it is easy to get gph pr hour. There is maney fuel flow readers with puls out but none with nmea out.

    • Tom says:

      I too would like to know fuel flow. There are cheap flow meters on eBay and a very similar setup to the wind circuit would make it straight forward to get NMEA data out. Something I might have to look into…

    • yachtdrummer says:

      Pretty sure fuel flow is an N2k function only and not NMEA 0183

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s