Arduino Ultrasonic Anemometer Part 1: Getting started

This is the first of a series of posts to follow. I will describe my attempts to build an ultrasonic wind meter (anemometer) based on an Arduino Uno. By the time of writing, I have a working prototype but it will take me a while to catch up in this blog. So this is just the first post – more will follow soon.

Click here for an overview over this series of posts on the anemometer project:

The finished analog part of the circuit.
The finished analog part of the circuit.

Let me quickly outline the project: My aim is to build an ultrasonic anemometer based on a Arduino Uno board. Now what’s an anemometer? That’s just a fancy name for a wind meter. I want to be able to measure both wind speed and wind direction with high accuracy. Most wind meters are of the cup or vane variety. They turn wind into mechanical motion and then measure that motion to calculate wind speed and possibly direction. An ultrasonic anemometer on the other hand sends and receives ultrasonic pulses and measures the time-of-flight. From the time-of-flight (or the time difference, depending on your approach) you can then calculate the wind speed in a given direction. Add a second pair of senders and receivers at a 90-degree angle and you get both wind speed and direction. As so often, wikipedia gives a nice overview/introduction to the subject:

A preliminary setup to test the basic functionality of my circuit
A preliminary setup to test the basic functionality of my circuit

Surprisingly, there seem to be very few people out there who have done this before. Basically, there is this one brave guy named Carl who has built such an anemometer from scratch and put all the relevant infomation online.His project was published on and this is where I found it: All of his documentation can be found here: This material makes for an excellent starting point if you want to build your own. I’ve looked carefully at Carl’s schematics and have copied many of his ideas. I did end up changing quite a few things and will explain my reasons for doing so but the general approach is very much the same. Many thanks for sharing this with us, Carl.

The basic idea is simple: You send a ultrasonic pulse and measure the time until it arrives at a receiver located in some distance. Ultrasonic transducers often operate at 40kHz and so do mine. A transducer is a device capable of both sending and receiving a signal. It’s the kind of thing cars uses for their parking aids, telling you if there is an obstacle and at what distance.

The board for the digital part waiting for the components to be placed and soldered.
The board for the digital part waiting for the components to be placed and soldered.

In a 2-dimensional anemometer such as here, you will have 2 pairs of transducers for a total of 4. Let’s call them North, South, East and West for simplicity. You need to be able to send and receive pulses in all 4 directions: N->S, S->N, E->W and W->E. Not all at the same time but one after the other.

So you will need some kind of circuit to route your signals from and to any of the transducers. For example you want to send from the West transducers and receive from your East transducer or vice versa. Let’s call it the digital part even though the received signal is analog in nature. The PCB without components just above is the basis for this digital part. If you wonder who or what Jingling Ding is: That’s the name of my step daughter who helped me drawing and laying out this PCB in Eagle.

You will then need some more circuitry to process the received signal. This circuit is shared among the 4 transducers so only one can be listening at any point in time. That’s why the digital part needs to route the signal from the correct transducer to this signal processing circuit. The received signal is analog in nature and will be very weak compared to the transmitted one. So you will need quite a bit of amplification first. But this analog signal cannot directly be used by your arduino to measure the time of flight. You need some digital signal(s) that you can measure using the timer(s) on the arduino’s Atmega328 chip (in case of the Arduino Uno). Let’s call this the analog part. That’s what’s shown on the photo at the top of this page.

In my next post I will go through the details of the two circuits. Click here for the second post:

17 thoughts on “Arduino Ultrasonic Anemometer Part 1: Getting started”

  1. Lukas,
    The version2 from Carl he mentioned, this one is not working either.
    The mods you made are these done on the version 2 from Carl?
    Because I have version 1 from Carl and I would like to give it unother try to get the system working.
    So that means I must make the version 2 PCB,s with your mods. This will work is this correct?
    ps. This is my second replay because I wrote the arduino forum and carl47 till latest comment.

  2. Hi Theo

    Thanks for your comment. I’ve used Carl’s project report (that 31 pages PDF file named ProjectReport.pdf from the zip file that I have linked above) as my starting point. From all I know this is the (working) version he had originally built and and submitted to

    I have drawn my schematic from scratch and haven’t even looked at Carl’s PCB layout. I basically looked closely at his circuit, liked many of his ideas but then drew my own schematics and layouts.

    I have a working prototype sitting here in front of me so the circuit as posted here work with the following limitations:
    – As I wrote and can be seen on the photos I’ve messed up some signals on the digital board and had to correct his manually. The schematic and board I’ve uploaded (RevA) are what I have used so they still include those mistakes. I’ll upload a corrected RevB when I get time.
    -On the analog board I had to change some component values to get the desired gain. But the design works and the layout is correct.

    As I write this, I’m already working on a second version that comes as a standard Arduino Uno sized shield. So there is only one board that you just stack on the Arduino. I have the PCB here but haven’t put any components on it yet so I can’t tell for sure if it will actually work.

    So as you see, the project is a bit ahead of my blog posts but I’m trying hard to catch up.

  3. I want more about components,which specific types of transducers,size etc

    basically nature of the tranceducer
    please suggest

  4. i believe it works but in what way? does the wind blow the US waves away? Also. as the speed of sound through air isnt there a temperature compensation necessary?

    1. Yes, speed of sound varied considerably with temperature and this needs to be compensated for. But this is quite easy to do by just measuring the temperature (there is a temperature sensor on the shield) and doing the math with the adjusted speed of sound.

  5. I don’t understand why there is an additional temperature sensor necessary.
    If you do two measurements of time-of-flight, one in forward direction and one in backward direction, you get t_plus = r/(c+v) and t_minus = r/(c-v) with distance r, speed of sound c and windspeed v. Now you have two equations for two unknowns.
    => c=r/2(1/t_plus+1/t_minus) and v=r/2(1/t_plus-1/t_minus)

    So you don’t have to take c(T) into account and no need to measure temperature T. Instead you get c for free and from the inverse function T(c) you can calculate the virtual temperature T of the air!

    1. Hi Martino. You are correct, if you consider only one axis, you have two equations with two unknowns – perfect. With two axis, things get a bit more involved: You now have 4 equations with 3 unknowns (because the two temperatures have to be identical). So you have an over-defined set of equations for which you need to find the best solution (say, least squares). I’m not particularly familiar with this kind of math but it it probably means doing some Householder transformations on a matrix and the like. And you need to make sure your approach is numerically stable. Probably doable but not straight forward to do in a 8bit microcontroller.
      So, to start with it’s probably sensible to measure temperature and have only one equation per axis (using the difference in the time-of-flight). Nevertheless, if you have some ideas or insights how this kink of over-determined system of equations should/could be solved I’m very interested

  6. Hi Lukas,

    I just wanted to ask you a couple of questions about ultrasonic anemometer. Since you have completed it and gone through many testings and etc., I wanted to ask about 4052 multiplex/switch IC. I’ve seen some projects where people implement this directly with transducers without any driver IC such as 368 or any other as you did. I read something that certain MCUs can drive them directly with enough current. Does that make any sense to you ? or is it necessary to use driver IC for some other reason?


    1. Hi Sam.
      Yes, that kind of makes sense, a micro with relatively powerful outputs (something that can sink source >10mA, say) could be used directly but that doesn’t mean it’s the best choice. With the mosfet drivers I use in my later designs I have a 12V amplitude and a source/sink current at least 2 orders of magnitude better than any microcontroller. Really depends on what the signal/noise ratio you need.

      1. Hi Lukas,

        Thank you for your answer.
        Have you got any schematics that I could have a look at? to understand how signal routing works on a concept that was actually working for you. I found some PDF files that you left here, but they seem to be old ones that you changed already. I want to build one using Mbed Cortex M3 and I am a bit lost on how to drive them properly using 4052s and some sort of driver ICs. By the way, I want to build one using regular components and micro as you did.


  7. hi.
    Thank you for information on your anemometer sensor.
    I am an Iranian student and I have chosen this sensor for my undergraduate project.
    I need this file””
    Access is closed. Please help me.

  8. Hey, it’s a great project. I was wondering why you didn’t use the HCSR04 Ultrasonic sensors which are commonly available and used in most of the ultrasonic Arduino projects. Using those may have eliminated all the digital circuitry you used. Maybe I am wrong. Can you explain?

    1. Hi
      The sensors on that module might be very similar but the distance-sensing is a simpler application since the accuracy required in terms of time-of-flight is much less demanding.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.