UPDATED 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).
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: There is some more info on the board I made here (no longer available). The Arduino source code is here. If you find any of this useful, please consider providing a small donation!
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.
Obviously 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.
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.
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
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!
+1 On that! It wasn’t working for me, than I add the two 10nF cap and BINGO !
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.
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.
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… 🙂
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.
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.
OK! I got my answer reading your posts. Thanks.
Pingback: DIY Marine Anemometer System | Mechinations
Is there a link anywhere for the software?
All good. Paypal donation got the software 3c. thank you.
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.
Which software version are you using. Maybe there is an active high and active low versions.
Great project for little money!
Would like to get in touch by email we the author. My mail is
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.
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…
Pretty sure fuel flow is an N2k function only and not NMEA 0183
How feasible do you feel it would be to send the pulses wirelessly via a solar powered RF chip?
A good idea, but not trivial. You need low power circuitry to read the pulses at the masthead and transmit the values down periodically. There are some interesting Bluetooth Low Energy chips out now that could probably manage it.
How much are you charging for your code, I have ordered the parts and Im going to try the Bluetooth idea.
I know you posted this a longer while ago but I’ve got a working version of this that uses Adafruit’s Feather M0 with a 915Mhz LoRA radio. You could also do it with their lower end radio but the LoRA was something I wanted to play with anyway… I don’t have a lot of diagrams and what not but the code is posted here: https://github.com/Brett-Howard/BTHMasthead/blob/master/BTHMasthead.ino. Some of the code present here was based off Tom’s excellent work. Also if you look at my other projects I’ve got the receiver piece that than receives the wireless and makes NMEA0183 and I’ve also got a full wind instrument that does MUCH more than just display the results. Also the NMEA0183 transmitter that I’m about to go and test sends the sentences necessary to make a Raymarine ST1000/ST2000 (and possibly others) able to steer to a wind course.
I have been thinking of this modified to use MQTT as i have a few other things in mind, without using any NMEA system.
Hi Tom, this is very cool. I would like to ask two questions:
-How do you manage to read wind direction with only two reed switches? I always thought those wind vanes would work with rotational hall effect sensors…
-Do you think I can leave my navigation system as it is and just extract NMEA data to send to a web server? Putting the raspberry pi just in the middle, not replacing any device or display.
Hi Leon, many vanes do use hall effect sensors. On the Peet Bros vane, the wind speed is calculated from the time between wind pulses (one period). The direction is calculated by a direction pulse which somewhere between each wind pulse. If the direction pulse comes in at say 50% of the wind pulse period, then this is mapped to 0 to 360 degrees. So 50% = 180 degrees.
NMEA is a single talker, multiple listener system. So you could definitely set up a Raspberry Pi to listen in. Some good info here: http://www.actisense.com/wp-content/uploads/2017/07/NMEA-0183-Information-sheet-issue-4-1-1.pdf
Hi Tom, thank you for your quick reply and the explanation. I am quite new to this world, this might have been straightforward for others. I am looking for a sensor that I can hook up to 433 Mhz RF transmitter. Considering the power budget – I guess the Peet Bros vane requires a continuous measurement with continuous current draw. I would probably look more into rotary position hall sensor and sample the absolut position (direction) as well as turn of anemometer (speed) every 1/1000 sec. Or am I missing something here? Thanks for sharing the link, it looks promising. In your IoT Boat Monitor project – did you use the MKR1000 instead of ESP32 or Raspberry pi for any particular reason?
I think the Peet Bros vane could work quite easily with a low power transmitter. Although one disadvantage is that at low wind speeds, you would be waiting longer for dir/speed pulses to arrive. Really the microcontroller does not need to be running most of the time. It can sleep while waiting for the next interrupt, in order to save power.
No particular reason for using the MKR1000, both ESP32 and RPi could be used just as well.
Thanks so much for your work! How did you mount the anemometer to the mast?
I used an old wind vane mount, and retro-fitted the Peet Bros vane to it.
I donated, how do I get the code?
hello very good job i want to make one but i have arduino uno and the code it for arduino mini pro
i don t understand the programation things what s the road to take the code into arduino uno
sorry its my ide not pstring librairy thinks a lot test when the anemometer arrive have a good day
Google the pin deferences change the pin numbers and change your chip on the arduino compiler. Recompile.
I like to use a standalone indicators with wind speed and direction.
10nF did it for me – thanks for the tip!
Does anyone know what’s the smallest measurable wind speed?