You can support me by reading this article on Medium or you can buy me a beer here.
Introduction
Being a maker means having to measure things all the time. Usually, the things we measure are relatively straightforward — temperatures, voltages, currents, humidities. Usually, all you need is an off-the shelf sensor and an analog pin or an I2C bus on your microcontroller, a couple of lines of code, maybe a tutorial, and you are done.
But air velocity is different; there are few off-the shelf sensors that a maker would readily use:
Suppose you wanted to measure the airspeed of your model airplane? Or maybe you wanted to build a simple protection controller to automatically close your motorized awning when it gets windy? You could maybe use a 3D-printed propeller-type sensor, but these are fragile (trust me, I tried a lot), and moving parts are something to be avoided in any project.
Or maybe you are building something to do with ventilation and you need to measure air flow. While you might find an off-the-shelf sensor for air flow used for air-conditioning, I found these to be quite expensive and not particularly flexible.
Luckily, there is a maker-friendly answer to all these—Pitot tubes. If you never heard of them, I’m pretty sure you at least saw them before: it’s the pointy thing on the nose of most airplanes.

How Does It Work?
To put it simply, a Pitot tube (named after the inventor) is a tube that we insert into the flow of air with the opening pointing into the flow. The air pushes into the opening, producing a measurable pressure change. If we measure this change and know the density and physical properties of the gas, we can calculate the velocity of the flow of air. You can find a nice graphical explanation here.
How Do We Measure the Pressure Difference?
In conditions you are likely to encounter as a maker (roughly room temperature, roughly sea-level pressure, velocities not exceeding 100m/s), Pitot tubes produce rather small pressure differences (tens of millibars/hectopascals at most). Sensors for such low differential pressures with any kind of resolution/accuracy were rather expensive until the advent of MEMS-sensors, but the situation has changed dramatically since then.
You can now buy a Sensirion SDP differential pressure sensor with a pressure range of 125 or 500 Pa, I2C bus connection, some limited intelligence like averaging, and a couple of milliamps of power consumption for ~25€. This sensor, a couple of thin connection hoses to connect to the Pitot tube, and a very basic microcontroller are all you need.
How to Build a Practical Pitot Tube
If you clicked the explainer and the Wikipedia article above, you already know a Pitot tube is basically a stick with two holes or ports, one facing the airflow and one facing to the side. These ports are then connected to the differential pressure sensor by channels of some sort. You could simply point the two hoses coming from your sensor in the right directions, and it would already sort of work.
Of course, if you want any kind of accuracy, there are some things to consider:
- Positioning matters — you need to make sure the rest of your setup is not influencing the air velocity at the point of measurement. Imagine a car with a Pitot tube on the roof — the airflow along the hood, windshield, and roof will be quite different from the free airflow one meter higher or maybe one meter in front of the car. This is why jets have these tubes sticking forward on the nose — it’s the only place where the airflow hasn’t changed much yet.
- Direction matters — if the tube is not pointed straight into the airflow, you will have cosine losses, but you will also be adding pressure on the reference (side) port. Both will play havoc with your accuracy.
- Temperature matters — the calculation of air velocity depends on gas density and temperature. Gas density is again dependent on temperature and absolute pressure. So, depending on your application, you need to measure the temperature of the air near the tube. If you will be flying an airplane model, you should measure the absolute pressure as well.
An Example Design for 3D-Printing
Let me explain the above points using my first Pitot tube design:

As you can see, it is a simple pointed stick with one port on the pointed end and one on the side. At the back, there are two nipples to connect the sensor hoses.
It’s best explained by showing you the section view:

Here, you can see the two channels connecting the ports to the nipples. The chamfers are there to keep the bridging to a minimum. The nipples are a long way away from the ports to avoid any influence on the air velocity, e.g. when holding it.
3D-printing is a fantastic way to make Pitot tubes; you can make the necessary channels and everything in one easily printed piece.
The Actual Measurement
Once you have the Pitot tube connected to the differential pressure sensor, the next step is calculating the actual air velocity.
The Assumptions
I’m assuming ~2–5% accuracy with good repeatability, and a refresh rate in the order of a second or so is enough for your needs here. If you need more, it’s time for a deep dive, sorry. 😅
BTW, did you know: 5% is the difference between a measurement and an indication. Once you go above 5% accuracy, you are measuring things.
Of course, we are talking about volumetric air flow here. But in most practical cases, multiplying the mass air flow by the fixed air density value in your working conditions should give you a useful value.
The Algorithm
It involves several steps:
The pressure signal can be a bit noisy. E.g. with the Sensirion SDP810 sensor, the sampling rate can be up to ~2 kHz, which covers even a part of the audio spectrum and is sure to be noisy. A good antidote to noise is averaging, but the good news is, the sensor can do averaging already. It does full averaging for 25 ms and then exponential smoothing after that. As long as you aren’t worried about noise with frequencies under about 40 Hz, this is good enough. If you need to go even lower, read the average every 25 ms and do exponential smoothing yourself. Here is a good primer. It’s really simple to code and covers the majority of »we need to filter noisy input data« use cases, so you need it in your toolbox in any case.
You need temperature info. Temperature influences both the Mach velocity and gas density, both factors in the calculation. The Sensirion sensors include a temperature readout, so as long as the sensor is somewhat close to the Pitot tube, this should suffice. If not, add an DS18B20 sensor close to the sensing port of the Pitot tube.
You need absolute static (environment) pressure info. If you will never leave ground, assuming the pressure to be 1013hPa (mbar) is good enough, unless you live above about 500m of elevation. If you do, take the value from here. If you are flying a (model) airplane, you will need to have an absolute air pressure sensor on board too.
Once you have all this data, the formula to use is (C++, Arduino):
v=(a0+((t)*css))*sqrt(5*(pow((fabs(p)/p0*k)+1,0.2857)-1));
, where:a0
is the speed of sound in m/s,t
is the temperature of the air at the input port,css
is the temperature coefficient of the speed of sound (at given absolute pressure, 0.606 at sea level; this is a non-linear relationship, but the value given should be good enough for atmospheric pressures given our assumptions),p
is the measured pressure difference (Pa),p0
is the absolute pressure (Pa).k
is the Pitot tube coefficient, basically the measure of how much your measuring setup is influencing the airflow around the measuring ports. The good news is: If you positioned the Pitot tube well ahead of the rest of the hardware and did a reasonable job at directing and designing the Pitot tube, you can just say there should not be more than 2% of random influences, and you can setk = 0.98
. Or you could take your setup for a ride in the car and calibrate it or at least check your assumptions. But keep in mind — getting the accuracy above 2% will involve some serious work.
The result is given in m/s.
Don’t forget the conversion factors! E.g., with the SDP810, divide the raw pressure value by 240 and the raw temperature value by 200 to get Pascals and °C.
The Hidden Bonus — No Calibration Required
If you look at the above formula, there is only one calibration coefficient, and it is one that we can at least partially omit. So if you built the system well, and you need only a reasonable accuracy (a few percent), no calibration is needed. This is a major advantage compared to other types of sensors, like Venturi or fan-type, etc.
What About the Flow Rate?
Model airplanes are cool and all, but I think the average maker will be more interested in measuring air flows, e.g. for ventilation, air conditioning, burner control, carburetors, etc.
Some examples:
If you are building a ventilation system with heat recuperation, you need the ingoing and outgoing airflows to be about equal, or you are wasting heat that could be recuperated.
If you are doing air conditioning, it’s good to have some idea about how clogged your filters are. If a clean filter gives you 100 m3/h of flow at a certain fan power level, a measurement of only 80 m3/h over a certain time means it’s time to clean or replace the filter.
Burners and carburetors have one job: keeping the ratio of mass flow of air to mass flow of fuel constant. Modern fuel injection systems use a MAF sensor to do this, and this should be the first thing you try, but if that is not an option, measure the air flow at least.
So How Can I Measure Airflow Using a Pitot Tube?
How to Calculate the Flow Rate?
Once you have the air velocity, calculating the flow is easy: the air flow is simply the product of the average air velocity and the cross-section area of the flow channel. A duct with 1 m2 of area and 1 m/s of average air velocity will thus have exactly 1 m3/s of air flow.
Surely There Is a Catch?
Note the italicized averages above. Airflow velocity inside a duct is not constant across the whole area. At the edges (near the walls of the duct), it will be slower due to air friction with the duct walls. The average velocity is thus the highest in the center of the duct and slowest at the walls. The place where we measure it clearly matters — putting the Pitot tube in the center will give values that are too high, and putting it near the walls will result in values that are too low. So how do we account for this?
One way is to use an engineering approximation — at a certain airspeed and a certain temperature, the average airspeed will be the measured airspeed in the center times a certain coefficient that you would get from engineering tables. But this is not very accurate, both because your airspeeds and temperatures vary and because there are other factors at play — maybe your duct is not straight or there is more roughness (dust) on the bottom than on the top of the duct. Maybe your duct is weird in some other way? Wouldn’t it be nice if we could measure the average air velocity directly?
The Averaging Pitot Tube
It turns out that we can do that, at least mostly. The answer is the averaging Pitot tube. It sounds complicated, but it is simply a normal Pitot tube with several input and reference ports. These ports are connected to a larger cavity (one for the inputs and one for the reference), so the air pressure in the cavity is roughly the average of all the air pressures at individual ports.
Again, it’s easiest to explain with a couple of pictures. The averaging Pitot tube is installed to span the whole width of a duct:

It has several ports over the whole width, which are connected by a large averaging chamber, which gives us an average over the individual port pressures and thus an average pressure difference:

Some designs use a cross shape to average over the height AND width of the channel.
The pressures at the output nipples should roughly correspond to the average air velocity. We can calculate it using the formula in the previous section and then simply multiply with the (known) duct area, giving us the air flow.
Still, this is not a cure-all. You should have reasonably laminar flow in the duct to achieve any accuracy. In practice, this means you should try to put the tube at the end of a long straight duct, and avoid things that cause turbulence, like elbows.
A Practical Example of a Measurement System
To help you see how to put all of this together, I set up a Github repository with the STEP files for the two Pitot tubes and the code for an Arduino based measuring device I built.

From these humble beginnings, I went on to build a balanced-flow ventilation system for my home. It still works after several years. 🥳
Here is the testing setup I used for it. Note the measuring gear (averaging Pitot tube, hoses, and the measuring device) on the leftmost side of the duct. And on the right there are the 3D-printed impellers I was testing:

Let me know if you are interested in this in the comments.