InqWind – Sensing the Wind

Back to InqWind Contents

This is the second installment for the DIY Marine Anemometer project. Use the link above to return to the first page with the project contents. This installment discusses the primary electronics being used in the project.

QMC5883L 3-Axis Magnetometer

QMC5883L 3-axis magnetometer

I’ll be using the ubiquitous QMC5883L 3-axis magnetometer. These are readily available for about $2 apiece from Amazon and you can probably get them cheaper on eBay and certainly direct from China vendors. As the name suggests, it measures magnetism in all three axes and is more typically used for making a digital compass. On the the good side, it is very sensitive. On the bad side… it is very sensitive. In other words in the way I’ll be using it, with a magnet flying around it, it responds very quickly to the magnet. But it also has a lot of digital processing noise along with picking up other wayward magnetic fields like the Earth and any motors or power wiring in the area. This image shows 30 seconds of data coming from all three axes at 10Hz. Note the range even though a magnet is not being moved around the sensor. The eventual goal is to drown out those other wayward magnetic fields by having the magnet strong enough and/or close enough so it is at least four or five orders of magnitude stronger than the other influences. The digital noise will still be there, but it too will be mitigated to some extent by the strong local magnet.

Sensor noise without a magnet around

WeMos ESP8266 D1R2 Mini

Bare ESP8266-12F and WeMos development board

I’ll be using an ESP8266 development board for testing, but for the end product, I’ll be using one of the bare ESP8266 boards and supplying other, more efficient circuitry for powering it. The on-board power converter is not very efficient. I also won’t need the USB capability as any upgrades of the software will be handled using Over-the-Air techniques. I surely don’t want to climb the mast to hookup a USB cable to upgrade it! For those that aren’t familiar with this chip, it is a 32 bit processor running 80 Mhz and has far more performance and memory available to it as compared to Arduino boards. It also has built in WiFi. It can even be used to host websites. You might notice this website documents a library that handles all that boiler plate for hosting a website along with many other features. I’ll be using that library during development just because it exposes a lot of functionality that makes developing projects a lot easier. You’ll see that in subsequent posts for this project. These ESP8266’s are inexpensive. These development boards typically run around $3 on Amazon, but these and the bare ESP8266 processors can be found for under $1 when bought in small quantities from China.

Magnets

5x5x5mm neodymium magnet

In the first test, I started to use some magnets I already had in my parts bin. It is a relatively tiny, 5mm x 5mm x 5mm neodymium magnet. These turned out to be way too strong. Even at 10 cm away from the sensor, it started to have a significant influence on it. At any range that I wanted to use, it fully saturated the sensor, causing it to overflow the data. This was the first lesson I learned about using magnets for this project. We want the magnetic force to be far stronger than the Earth’s field, but we can’t over drive the sensor either. The sensor is a 16bit sensor. This means that it will measure field strength values between -32768 to +32767. The units are not really important since we will be using the relative strengths of two of the axes. More about this in later posts. To reduce the strength, we need to either move the magnet further away, use a smaller magnet or use a weaker magnet. The first method is out of the question since we want to have a nice compact package for the final solution.

3x1mm neodymium magnet
3x1mm magnet glued to skewer

I ordered some more magnets to try out. I purchased some of the cheap toy-craft magnets (not shown). These use some king of near-black flexible material. They have adhesive on the back and can be cut up for use. I hadn’t given up on the neodymium magnet totally, so I purchased some really tiny ones. These round magnets measure 3mm in diameter and 1mm thick. Even knowing the size and checking a ruler, it still is surprising how small these things really are in person. They’re hard to work with using a knife and tweezers just to pry them apart. These turned out to be perfect for the job. They’re about the right strength to use most of the 16 bit scale when about a centimeter away from the sensor. They’re also extremely light helping to keep the full-up anemometer light weight. What really turned out to be advantageous for this testing phase was they are the same diameter as bamboo, Shish Kabob skewers.

Crash and Burn

Second failed test method

In my second test, knowing that the magnetic field propagates from one pole to the other, I placed the magnet on its edge directly above the magnetometer chip. The X and Y chip directions are in the plane of the chip. The Z-axis is vertically, passing through the magnet. I was hoping that the field would be passing through the chip. The idea would be to turn the disk magnet around this Z-axis and the X and Y sensors would vary with the angle.

The reason I wanted to try this orientation was there are going to be two of these chips and two of these magnets in the anemometer. The closer the magnets are to their respective chips… the less influence they should have on the other chip. Also, that the magnet isn’t moving around (except on its own axis) would also reduce this secondary noise. To test this theory, a fixture was designed and printed.

Design for Test Rig for Second Test
Assembled and Printed Test Rig for Second Test

This second test seemed to work to some degree. I was able to position the chip vertically to see what effects distance would have on the results. I believe the problem was the field is very tight and curved in the area. Alignment was critical and any jostling of the fixture and flexing of the plastic pivoting arm would end up coloring the results drastically. I decided this test was a failure as building this to such high tolerances and it stay within tolerance for a long and brutal life didn’t seem realistic.

Persistance

Fortunately, a more common, established configuration is available. In this third test, the sensor chip board is placed vertically at the center of the axis of rotation. This is the Y-axis of the chip. The board width thus defines the axle’s diameter. The magnet is placed so that it rotates around this perimeter while always pointing the S pole of the magnet toward the centered chip. This way, the X and Z values of chip should define the angle of the pointer.

Design for Test Rig for Third Test
Printed and Assembled Test Rig for Third Test

Summary of Current Status

Obviously, these test rigs don’t look much like anemometers. They’re only for proof of concept and to give me a testbed so I can develop the software. This third test is showing some promise and numbers are looking great. In the next installment, I’ll go over the software so far and the results. Stay tuned!

Inq

1 thought on “InqWind – Sensing the Wind”

  1. I’m here waiting with bated breath for the next installment. Thanks for sharing your thoughts and your progress. All of this is very appreciated as my multi-decade old B&G h1000 system is quite long in its teeth. I need to prepare for its eventual demise.

Leave a Comment

Your email address will not be published. Required fields are marked *