Sonic Anemometer

4,290

38

22

Introduction: Sonic Anemometer

About: Finding a simple solution to a problem.

Most of the sensors in a weather station now use miniature electronic components to measure the environment. Light, pressure, temperature and humidity can all be quantified with sensors costing a few cents. The one last remaining element is wind speed and direction. Over the last few centuries, the rotating cup anemometer has reigned supreme. Three or four cups spin in the breeze to give an indication of air speed, granted there have been improvements in detecting the spin speed but the basic principal remains the same.
Wind speed may also be measured by detecting the change in the speed of sound caused by the air flow. The earliest attempt I found of applying this method comes from this article in Electronics, 1950. There are now appearing on the market, at a cost of hundreds or thousands of dollars, ultrasonic anemometers that measure wind using similar principles. The challenge of this Instructable was to make a sonic anemometer using hobbyist components costing only a few dollars

Supplies

The main components needed to make the ultrasonic anemometer are:
4 transducers removed from HC-SR04 ultrasonic range finders
3 CD4046B phase lock loop ICs
1 Piece of strip board
Various resistors and capacitors, see circuit diagram
1 2N2222 transistor or similar
1 Arduino Uno or similar
Arduino IDE for flashing and monitoring wind
Wood to make anemometer body
Sundries like wire, solder, screws, wood etc.<

Step 1: Wind Speeds

Understanding the expected range of wind speeds is a good place to start. The Beaufort scale in the picture tells us that average wind speeds can reach over 30 m/s although short term gusts can be higher. As the velocity of sound is 343 m/s, we can expect changes of about 10% in speed due to high winds.

Step 2: Proposed Design

The design for this anemometer is based on 3 ultrasonic receivers symmetrically arranged around a transmitter transducer. Sound waves from the 40 kHz transmitter radiate outwards to the 3 receivers 25 mm away. Under still air conditions, the sound waves will reach all the receivers at the same time.
The speed of sound increases at higher temperatures which makes the sound waves spread out faster and so there will be fewer waves between the transducers. As this design relies on a fixed number of waves between the transducers, the north receiver is phase locked to the sender. Any change in temperature will alter the sender frequency to keep the wavelength the same.

Step 3: How Does It Work

In calm conditions with no draughts, all three receivers will be experiencing the same part of the sound wave front from the central transmitter. The pictures show what will happen with a north or west wind. A north wind will compress the sound waves on the north side of the sender and spread them out on the south side. However, the phase lock loop will keep the phase constant on the north receiver. Thus only the two southerly sensors will show a phase change related to the wind strength.
A similar situation happens for a westerly wind. The sound waves are compressed on the west side of the transmitter and expand out to the east. With a phase locked north sensor, we can estimate the wind speed from the difference between the east and west sensor phase.
By measuring the change in wavelength or phase at the E and W sensors, we can work out the north and west components of wind velocity. With a little arithmetic, we can then calculate the wind speed and heading.

Step 4: Construction

The body of the anemometer is made from two pieces of wood held apart with 3 mm bolts. A piece of 18 mm thick fibre board was used for the main body of the anemometer with 16 mm holes drilled for the sensors. The reflector plate was a piece of 4 mm plywood and fixed above the sensors with 3 mm nuts and bolts. Nothing rocket science, other materials could be used instead provided they are rigid and don’t bend in the wind. A hexagonal shape was used for the body because it is easier to cut than a circle! In fact, a circular design with rounded edges would present a much better aerodynamic profile to the wind... beyond my skill set.
A conical lid was added to protect the electronics from the weather and dissuade birds from using it as a perch.

Step 5: Transducers

As these sensors are run continuously, there is no need for any special dynamic performance. In fact, the sensors used in this project were unsoldered from the cheap and cheerful HC-SR04 range finder widely available. The 4 transducers are push fitted into the holes and connecting leads soldered on to the terminals. As the exact position may need a slight adjustment to tune the system, ream the holes with sand paper to give a firm but not tight fit. There needs to be about 10 mm separation between the two plates.

Step 6: Circuit Diagram

Three phase lock loop 4046 ICs are used to set the sender frequency to 40 kHz and measure the received signal from the sensors. One 4046 is used in the phase lock loop and the other two ICs measure the phase from the remaining two receivers. The phase detectors output a string of pulses where the mark space ratio is proportional to the phase shift. These pulses are averaged by the RC filter and the voltage measured by a microcontroller to find the wind speed and direction. The circuit must be powered from a stable regulated power supply because the phase detector output is power supply sensitive.

Step 7: Circuit Board

The electronics are built on a piece of strip board and mounted above the sensors. In this anemometer, the filtered output from the phase detectors was wired to a separate Arduino which measured the output and calculated the wind speed and direction.

Step 8: Setup

The setup requires a basic oscilloscope to tune up the anemometer. Temporarily wire two 10k resistors in series across the voltage supply and connect pin 9 of the phase lock loop IC to this half voltage point. Adjust the variable resistor to make the output on pin 4 run at 40 kHz.
Now we need to measure the signal on the receiver transducers and fine tune the frequency for maximum output corresponding to the resonance frequency of the sensors. The reflector plate spacing can also be adjusted for the highest signal, about 10 mm is a good starting point.
Once there is a good signal from all three sensors, the phase lock loop can be reinstated. Check the output from the phase detectors to see if the mark space ratio is symmetrical, if not, the system can be adjusted by altering the reflector spacing or the sensor depth in the fibre board.
As a final operational test, blow some air into the anemometer with a cold hair dryer and make sure the two phase detectors give a change in output voltage.

Step 9: Calibration

So far, we have made an instrument that gives two voltages according to the wind strength and direction. The next step is to convert these readings into meaningful measurements of wind speed. As most of us do not have access to a calibrated wind tunnel, we can use the local weather forecast to provide a reference for the actual wind speeds. Another alternative is to get a reference wind speed from a traditional rotating cup anemometer. Select a windy day to take the calibration readings in an unsheltered position.
We need 3 sets of readings. The first measurements are the E and W sensor voltages in still air. Next we take the anemometer outside with the N sensor pointing into the wind and take another set of readings. Finally, we turn the anemometer anti-clockwise 90 degrees and take calibration measurements for the east direction.
To a first approximation, we can treat the design as orthogonal where the north wind component is proportional to the difference between the still air and sensor voltages in the wind. The east wind component is proportional to the difference between the two sensor voltages. Scaling factors and voltage offsets can now be calculated from the calibration points.
The final wind speed can be worked out using Pythagorus on the N and E vectors. Wind direction can be estimated using the atan2 function.
These rather tedious voltage measurements and calculations can easily be handled by a small microcontroller such as an Arduino.

Step 10: Arduino Monitor

Measuring the two output voltages and converting them into wind speed and direction is a convenient job for a microcontroller such as the Arduino. The internal ADC in the Arduino can be used to read the anemometer output although a separate module like the ADS1115 would make a more accurate job of the conversion.
The next step is to remove offset voltages and scale the readings using the calibration points to give the N and W components of wind speed. Finally, the readings are combined using Pythagorus for the wind speed and the arctan2 function for direction. The sketch listed below will use the calibration readings and calculate wind speed and direction from the anemometer output voltages.
When running the sketch, the serial monitor will display the raw ADC output as well as the calculated wind speed and bearing. These raw readings are useful when taking the calibration points.
Finally, the anemometer needs siting in the wind with the N sensor pointing north.

Step 11: Conclusions

This ultrasonic anemometer may be constructed for a few dollars using components and materials easily available to the hobbyist. After comparing this design with other DIY ultrasonic anemometers described on the internet, I believe this version represents about the simplest way to sonically measure wind speed and heading. For those interested in this rather specialised subject, there is plenty of scope to optimise and improve the design. For example, weatherproof sensors could be used with extra electronics to make up for their reduced sensitivity. Another idea is to include a heater to prevent freezing in the winter.
I hope you enjoyed looking at this Instructable and may even feel inspired to make your own sonic anemometer 😊

Microcontroller Contest

Participated in the
Microcontroller Contest

Be the First to Share

    Recommendations

    • Home Cooked Speed Challenge

      Home Cooked Speed Challenge
    • Robots Contest

      Robots Contest
    • Organization Contest

      Organization Contest

    22 Comments

    0
    omercancll
    omercancll

    7 weeks ago

    Hello there. I wanted to do this experiment myself, but I couldn't get stable results. Can you please help?
    My sensor voltage measurements always give a value of 1023, so there is always 5V. and the wind direction constantly values as 180 degrees. Sometimes the values change momentarily without any change in the environment. I couldn't understand why. I must be making a mistake somewhere. Any guesses about the reason?

    0
    Itrium
    Itrium

    Reply 7 weeks ago

    Hi, It sounds like the phase detectors are not receiving a signal and producing an output. The best (and maybe only) way to troubleshoot the system is to use a scope. Check the sender is giving an output and then each receiver is working. The depth of each receiver will need adjusting to give about a 90 degree phase shift. All a bit trial and error together with setting the reflector distance. Hope this helps.

    0
    omercancll
    omercancll

    Reply 6 weeks ago

    Thank you for your response. There are a few points that I don't understand.
    1.) What kind of changes do I need to make in the circuit to check the operation of the sensors?
    2.) I will change the distance between the sensors and the reflector until it achieves a phase shift of 90 degrees. Did I get right. If so, the height of each receiving sensor will be different.

    0
    Itrium
    Itrium

    Reply 6 weeks ago

    Hi, The first step is to make sure the Tx and Rx in the phase lock loop are working and tuned to resonance. If you look at this on a scope, you will see the phase lock and fix the frequency. Now it is a matter of adjusting the sound path length to put the phase at the centre of its range by moving the transducers or reflector.

    The wavelength of sound is about 8mm for these transducers and so it only takes a fraction of a mm to significantly change the phase. Moving the transducers slightly is the simplest way to move the phase angle to give the maximum measurement range. Again a scope is the best way to check the Rx are receiving the sound and giving a voltage proportional to phase.

    I hope this gives you a few more ideas.

    0
    omercancll
    omercancll

    Reply 6 weeks ago

    I did everything you said. I saw the transmitter and receiver sensors working on the oscilloscope. I set the phase difference of 90 degrees between the receivers. However, I am not getting the correct result. When I change the angle of the wind 180 degrees myself, the sensor measures 20 degrees change. In the wind speed measurement, the sensor shows that when the wind accelerates, the sensor decreases. When the wind accelerates, the sensor measures its fall. If you give me an e-mail address, I can send you videos and photos.

    0
    Itrium
    Itrium

    Reply 6 weeks ago

    Hi, You seem to be making good progress. You are actually detecting a change in wind speed which is the difficult part. The next step is converting the measured changes into an angle and wind speed. This is really a maths and software exercise. Unfortunately, I am tied up with other stuff at the moment and a bit short on time. However, a few further thoughts, does reversing the wind direction across a sensor cause the output to change in the opposite direction? This would show the sensor is measuring properly and it is more a problem of calibration. If you look at the comments, you will see someone picked up a typo in the sketch, this is corrected now in the write up.
    I have attached the patent outlining this measurement method, it is over 20 years old and is not now in force. The maths is quite heavy and so I have simplified the measurement into estimating the x and y components without all the stuff about correcting for the circular effects. Have a read and see if it is any help. If you are getting sensible wind speed measurements, the rest is maths and calibration!

    0
    BrunoRico
    BrunoRico

    2 months ago

    great project! will be very interesting the waterproof version (for boats, etc.)

    0
    Itrium
    Itrium

    Reply 2 months ago

    I am pleased you enjoyed this project. The weatherproof version looks much more complicated. These sensors are very insensitive and will need higher drive voltages and amplifiers on the receivers. Nothing insurmountable, just a lot of time and effort.

    0
    LukášM
    LukášM

    Reply 2 months ago

    For better sensitivity try MCP3424 with gain control and much better resolution (up to 18bit). In this case you can run it with 5V.
    I made 3D model of enclosure, it is available for free here:
    https://www.thingiverse.com/thing:4932834

    0
    RubenR36
    RubenR36

    Question 2 months ago on Step 6

    hi why did you use 7 v? why not 5 or 12 ?

    0
    Itrium
    Itrium

    Answer 2 months ago

    Hi, I used a 7V rail for the phase detectors to limit the output voltage which feeds into the arduino ADC. Other rail voltages are possible but you need to check that the voltage spec for the ADC is not exceeded.

    0
    RubenR36
    RubenR36

    Reply 2 months ago

    thanks for the answer, I will try to reproduce your project. By the way , I mean why not a lower voltage for example 5 volts? it is easy to find a linear regulator for 5 volts, it's not the case for a 7 volts supply.

    0
    Itrium
    Itrium

    Reply 2 months ago

    The 4046 should work ok with a 5 V rail but the output voltage will be lower. I suggest you get the 4046 detectors working first with 5 V and measure the voltage under different wind conditions and then decide if the arduino ADC gives enough resolution. If not, a separate ADC module like the ADS1115 will be more sensitive.
    A scope is essential for checking the transducers are working properly and the distance between them gives the best phase shift.

    0
    t24602460
    t24602460

    2 months ago

    I think there is an error in the northwind and eastwind calculations. Consider only northwind but similar logic applies to east.

    The calculation/equation in the sketch is
    northwind = (Vwest+Veast-Ecalm-Wcalm)*(Wnorth+Enorth-Ecalm-Wcalm)/windspeed;
    If you rewrite this the equivalent is
    northwind / (Vwest+Veast-Ecalm-Wcalm) = (Wnorth+Enorth-Ecalm-Wcalm) / windspeed
    This does not look like a proportional relationship. It should be
    northwind / (Vwest+Veast-Ecalm-Wcalm) = windspeed / (Wnorth+Enorth-Ecalm-Wcalm)
    Thus the code line in the sketch should be
    northwind = (Vwest+Veast-Ecalm-Wcalm) / (Wnorth+Enorth-Ecalm-Wcalm) * windspeed;

    If you do this and plug in the Xnorth calibrate values for Vwest and Veast, then the result matches the the calibrate value for windspeed.

    0
    Itrium
    Itrium

    Reply 2 months ago

    Hi, I agree, the / and * got swapped somehow, I need to correct the sketch.
    In an earlier comment, there is a link to the patent where this idea came from. The complete maths is quite involved and so I went for an approximate quick and dirty estimate of wind speed.

    0
    Mheffner28
    Mheffner28

    Question 6 months ago on Step 4

    This looks great, one quick question, is there max and minumum diameter of the 2 pieces of wood for the body? I am planning too make them circular as you mentioned for a little better performance and to make it a remote (solar powered) wireless unit! Thanks, Mike

    0
    Itrium
    Itrium

    Answer 6 months ago

    The idea is to get a representative sample of wind passing across the sensors. A large diameter would act as a resistance to the passing wind while a small diameter would introduce all kinds of eddies into the wind flow. The final choice was a mixture between a subjective what looks right and the shape of similar commercial anemometers found by googling. A calibration process covering different wind speed could correct for these geometry effects but we are back to wind tunnels again.

    0
    Mheffner28
    Mheffner28

    Reply 6 months ago

    Thanks, I understand the physics involved, however there is no dimension shown on your diagram for the body pieces. I am estiamting a circle with a diameter of 90mm based in a "visual" estimate. Is this a good estimate or too big?

    0
    edelstahlfreak
    edelstahlfreak

    Question 6 months ago on Step 5

    Hi ,is there any experience of how precisely and what minimum wind speeds can be measured?