Introduction: Real Time Wind Direction and Speed

I wanted a better wind vane, one that displays graphically on a compass rose and has a real time display, not the usual display delayed by 2 to 3 minutes like the WMR968. You can't really get an idea of wind conditions and gusts with a consumer weather station. The reason those displays are delayed is that they are trying to save battery power and the related solar panel cost by transmitting infrequently. This unit is powered by the display unit. The display unit's modified USB battery bank can be recharged via USB, or just left plugged in to a USB power adapter.

I tried to keep costs lower than my previous wireless wind vane by using PVC sprinkler pipe rather than copper pipe. Also, by designing a wired system, that eliminates the wireless transmitter and receiver, instead using cheaper RS-485 transceivers. Wired systems can operate over greater distances and at greater speed without data dropouts that would be very annoying in the display unit. However, a wired unit can be dangerous in a lightning storm, so it may be better to construct my wireless weather vane https://www.instructables.com/id/Accurate-Wireless-Weather-Vane/ . Be sure to use best practices for anything that might conduct electricity in a storm.

Step 1: Parts

1 ea. MLX90316KDC-BDG rotary hall sensor link

1 ea. Adapter link

1 ea. N48 Neodymium Magnet Dia 1/4"x1/2" Diametrically Magnetized link

1 ea. 21/32 brass tube, hobby store or hardware store #8144

2 ea. Miniature deep groove ball bearing 625ZZ 5*16*5 mm link

1 ea. Arduino Pro Mini 5v, 16 Mhz for vane and Anemometer link

2 ea. SN75176 RS-485 transceiver link

1 ea. Davis replacement wind vane cups link

2 ea. miniature ceramic RC car bearings for anemometer- unsure of exactly the size used.

1 ea. brass tube to fit RC car bearings

1 ea. axle to fit Rc car bearings and anemometer cups.

1 ea. Hall sensor for Anemometer link

5 ft 3/4" PVC sprinkler pipe (in US= I.D. of pipe) (just something that will fit the electronics)

1 ea 3/4" PVC coupler

1 ea 3/4" PVC snap Tee (a Tee made to snap around existing PVC pipe without cutting it)

1 ea. 3/4" Copper pipe cap, hardware store

1 ea. 10-24 all thread rod, hardware store

1 ea. 10-24 coupler nut, hardware store

4 ea. 10-24 nuts, brass, hardware store

1 ea. aluminum sheet for vane (was spare from my 1946 Ercoupe engine cowl)

1 ea. 1/4" drive 12mm deep socket (or whatever weight is on hand- found this one in the street)

1 ea. 1/4" aluminum square rod for vane shaft ( could be round, or be a tube as well)

xx ft Cat 5e Ethernet cable (from vane to display), hardware store

2 ea. Cat 5e jack (one near vane, one in display), hardware store

2 ea. RJ45 Crimpable Connectors for CAT-5e, hardware store

1 ea. RJ-45 Crimping tool, hardware store

1 ea. Teensy 3.2 for display link

1 ea. 240 x 320 TFT module, ILI9341 controller link

Misc: solder, wire, capacitors, resistors, 30 minute epoxy, on/off switch, USB battery bank, FTDI USB to TTL serial adapter (for Pro Mini programming), Arduino IDE, soap dish for display enclosure.

Step 2: Construction

The vane sensor requires an inexpensive small Arduino to convert the Hall direction data to Serial (115200 baud) for transmission via the RS-485 chip. The Arduino also uses an interrupt routine to count revolutions of the wind cups ( a different hall sensor output), see the test1 sketch. The 240 x 320 color display is great, but unfortunately needs a bit more computing speed than the Uno (an Uno will work with the display, but the direction arrow flickers). Therefore, a Teensy 3.2 running 96 Mhz was chosen, and works great. The Teensy can be programmed with the Arduino IDE, see Instructables or www.pjrc.com/teensy . Modified libraries are available for interfacing the Teensy to the display, see Arduino Wind_Vane1 sketch.

Good bearings are key to the proper operation of both the vane and the anemometer. The vane bearings should have the metal bearing shields removed for less friction; clean out the grease with WD-40, then lubricate with a very light oil like the Liquid Bearings brand. The 625ZZ bearings fit into the 21/32" tubing tightly; you will notice that the brass tubing expands slightly as the bearings are pressed in. Luckily, the bearings edges are camphered so they will tend to push the tubing larger. Find a deep socket or similar to press the bearings in without pressing against the inner bearing race. Wrap the brass bearing assembly with tape to fit snugly into the 3/4" PVC pipe; a small screw drilled through the PVC pipe to the tape can secure the bearing assembly.

For the anemometer bearings I used 2 miniature ceramic RC car bearings and fit them into a brass tube with a method similar to that used for the larger vane bearings. The bearing assembly fits into a 1/2" PVC pipe elbow, drilled at the top to fit the bearing assembly- tape was used lower in the elbow to support the bottom of the bearing assembly in the elbow. The Hall sensor should be positioned so that the sensor lettering faces the rotating magnet. The hall device leads can be epoxied to the bearing assembly. Power and data wires connect through the 1/2" threaded plastic pipe nipple to the snap Tee (which covers the access hole to the Pro Mini and RS-485 board).

Cut the 10-24 allthread to about 12" in length, and attach the diametrically magnetized magnet. You can make it easier to align the magnet on the rod by epoxying a bit of wood to the allthread as a platform. Next, form a bit of tinfoil around the magnet, then epoxy just the tinfoil to the wood part. Finally, epoxy the magnet into the formed tinfoil, the foil prevents the magnet from moving to one side or the other due to magnetic attraction to the allthread.

Cut an access hole in the 3/4" PVC for the electronics. Install the sensor by epoxying a piece of shish kabob skewer across the bottom of the MLX90316 adapter, then epoxy the skewer with sensor in the PVC just above the access hole. Using the Arduino IDE, program the Pro Mini via the FTDI USB to serial adapter with the program Test1.ino.

For the display unit, cut a hole in a soap dish to fit the display and hot glue in place. Use a female header attached to a strip of perfboard, and wire per the circuit diagram. Epoxy the Ethernet receptacle to the bottom of the soap dish, and wire to the power and RS-485 board. Install a USB battery bank (or just a 5 volt power adapter jack) and power switch. Load the sketch wind_Vane1.ino along with the libraries into the Teensy 3.2.

Step 3: Testing and Installation

Testing was initially done with a Arduino Uno for the display, and was found to be too slow to make a real time arrow display for wind direction, so a Teensy 3.2 was substituted, subsequently the display changed to smooth and fast. Testing included using a Bluetooth wireless interface. Unfortunately, the wireless connection didn't work well at the higher data rate required for real time, too many data glitches at 115200 baud. Also wireless wasted far too much power, even using Bluetooth 4.0 (around 10 to 20 mA connected) plus the 50 mA of the position sensor and the 10mA of the Anemometer sensor. The wired interface solved both problems using one twisted pair for 5 volt power, and another twisted pair for the RS-485 data. I tested the connection over about 500 feet of Cat5e Ethernet cable (what was left of a 1000 foot reel) with no data errors.

The vane direction was calibrated by moving the allthread rod in the 10-24 coupler nut until north on the display corresponded to actual north, then securing that position with a lock nut. Wind speed can be calibrated by comparing with the original WMR968 value- more can be done later to refine the readings at low and high speeds, using a car speedometer to calibrate the anemometer.

The vane and anemometer connect to an ordinary straight piece of 3/4" PVC via the PVC coupler. The straight PVC then fit into the center of a 1-1/2" steel pipe secured to a sanitary vent with 2 stand off pipe clamps. The Ethernet cable receptacle connects to the Ethernet cable leading back to the display. The cable crimp connectors should be installed according to the standard Ethernet wiring guide (usually comes with the installation crimp tool). The use of a receptacle at the vane and at the display allows you to remove the devices and substitute a standard short Ethernet cable if necessary for testing or for addition of additional sensors.

The vane pointer on the display works great as a real time wind display, far better than consumer weather devices.

Comments

author
GunnarRacing (author)2017-06-01

fantastic

author
newcomer9747 (author)2017-02-03

Can you customize the display to show gusts or record wind chart?

Also can you say hook the lan cable to a Ubiquity repeater and increase the range several kilometers?

author
jbike (author)newcomer97472017-02-04

Yes, I probably could show gusts on a bar type display, maybe have a button to select that. I should implement the touch screen function so I wouldn't need the extra button.

The LAN cable I used is a standard cable, but the data carried is not in Ethernet format- it is serial data and power, no IP headers etc. However, it could be standard Ethernet if i bought a Ethernet shield for it and wrote some sort of simple web page for the data. Then it could hook up to the repeater.

author
newcomer9747 (author)jbike2017-02-05

That would be great! Favorited you in case there are updates in this aspect. By the way how can I change the units to metric?

author
jbike (author)newcomer97472017-02-05

Thanks for the Favorite. To change to KPH from MPH, edit the Wind_Vane1.ino file so wind_Spd is 1.61 times what it was. wind_Spd=values[1] / 3.11; should do that. Also change tft.print ("KPH"); instead of MPH.

author
newcomer9747 (author)jbike2017-02-06

The Teensy 3.2 link you gave runs on 72Mhz CPU, but in your description you stated 96Mhz. Does that mean it will require overclocking the Teensy? If so how to go about doing that?

Also for the MLX90316KDC-BDG sensor link, there are 3 results from Mouser. Which is the correct one to use? Also the results from Mouser seems to have 16 leads instead of 8 in your pictures. The wiring diagram showing the MLX90316 connections are not labeled.

Edit: Sorry for deleting and replying because there is no edit option for replies.

author
jbike (author)newcomer97472017-02-06

The Arduino Boards Manager has an overclock default for the Teensy 3.2. I programmed it with that default, because the display uses all the speed it can get to display the wind pointer graphic smoothly.

I used the

482-90316KDCBDG100RE

The RE means Reel, like the item is placed in a tape and reel package instead of a tube or other way to protect it. All three are 8 pin SOIC packages. They do sell a 16 pin dual die package version, but not the 3 items shown. The picture at Mouser doesn't reflect the real SOIC -8 package. One of the 3 is individually way cheaper, but you have to buy 1,040 of them at a time, so forget that one.


author
newcomer9747 (author)jbike2017-02-07

Thanks for clearing that up! How about the MLX sensor diagram? The pins are not labeled in the diagram. I can work out the Vss and Gnd but not the other 3 pins.

Also, is it possible to scale the system to display multiple setups? If so, can I use a single Teensy board to run multiple setups?

Another thing are these 3 the same pro mini with the link you gave and can be used:
http://www.lelong.com.my/arduino-pro-mini-atmega32...
http://www.lelong.com.my/arduino-pro-mini-bte14-02...
http://www.lelong.com.my/pro-mini-atmega328-5v-16m...

author
jbike (author)newcomer97472017-02-07

You have to wire the MLX according to page 38 of

https://www.melexis.com/-/media/files/documents/da... Most of the wiring and the capacitor are on the SOIC-8 adapter board, so only 5 wires come off the board +5 volts(pin1), Ground (pin8), SCK ( pin 4), SS (pin 3) and the MOSI-MISO (pin 5). Pins 2 and 6 are ground (test modes) an pin 7 has a 0.1uF cap connected to ground.

Yes, one teensy3.2 could hook up to 3 wind vanes because the incoming data is serial (from the Arduino Pro Mini(s)), and Teensy 3.2 has Serial 1, 2 and 3 port pins See

https://www.pjrc.com/teensy/td_uart.html

All Pro Minis in your link would work the same. I think mine looked more like the first one.

author
newcomer9747 (author)jbike2017-02-07

Thanks again for being patient with me. I have got most parts in my shopping basket now but I can't find the 1/4x1/2 neo magnet locally. Would 6mm x 16mm (height) work just as fine?

author
jbike (author)newcomer97472017-02-07

If the magnet is diametrically magnetized it would work. Most cylindrical magnets are not polarized that way- a common cylinder magnet has north on one end and south on the other end. A diametrically magnetized magnet has north on one half (lengthwise) and south on the other half. So on the ends, that magnet has both north and south poles. Therefore the hall device can track north and south as the magnet is rotated.