Now onto trying to get the differential pressure sensor to do... something. I have the Ardupilot Shield alone with both 3.3v and 5v attached. Analog 3 on the Shield is connected to analog 0 on an Atmega328. Took some trial and error to get the code to read something meaningful (I'm new to this, obviously), and after that was on to road testing. I got the pitot tube from an R/C website, but don't remember which. Here's some redneck engineering at its finest:

/yes, that's masking tape (duct leaves residue) and a stickLiving in the desert, it was windy today. About 25mph with 33mph gusts. Fortunately it was traveling due east, and all the roads are N-S-E-W. So I did a few trials east and west (head and downwind) at the same velocity, then the same thing for north and south (crosswind). I played around with the data for a little bit, and found that the best results came from averaging each run, and then splitting the difference with its opposite. Came up with this graph of results:

Since there was a significant beta with respect to the airflow on the north/south runs, you can see that the pressure difference is less. Makes sense to me at least. So for the fit, I chose the headwind/downwind curve. Something I've noticed about real aircraft (analog and digital birds), you need about 40kts to get a decent airspeed. Same applies to this model. Here's my code:int analogPin = 0;int pressure;float velocity;void setup(){Serial.begin(9600);}void loop(){pressure = analogRead(analogPin);velocity = 2.15314 * (float)pressure - 509.48572;if (velocity < 40){velocity = 0;}Serial.print("Counts: ");Serial.print(pressure);Serial.print(", velocity est: ");Serial.print(velocity);Serial.println("mph");delay (1000);}Now the only thing remaining is to be able to read the GPS data, put it into an algorithm and then I'll be able to calculate the wind speed and direction while the aircraft is flying (one of my primary goals for this system). But considering what I've learned today, higher velocity will equate to more accurate wind speed measurements, so I'll have to account for this when building the airframe. Also, probably going to go out and repeat this test when there's no wind out.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Hey Bryan,
    I was trying to take a look at your Windspeed Algorithm spread sheet to see how you are doing it. It seems to only be numbers. Would you be willing to share some more info on that with me?
  • Clarence and Chris, there are two ports on the Shield to measure the difference between the pressures. Even if the reading is not a direct comparison, its still comparing the two pressures to a reference, which does the same thing. This looks like a pressure sensor that is essentially a membrane separating the two pressure ports and a strain gauge to measure the deflection. That's just a guess tho.
  • 3D Robotics
    Clarence, technically you're right, but in practice there doesn't seem to be much difference. The cockpits aren't airtight, so the heat doesn't seem to lead to much if any pressure increase.
  • So I could be wrong, but I do not think you should think of the differential pressure sensor as a pitiot tube. A pitot tube takes the static and pressure from the same air flow, but with the shield one pressure is read from the flow while the other is taken inside the cockpit, which is full of hot electronics. Just a thought
  • And you're correct. Got the compass module up and running in a previous post I believe has since been deleted. Here's the algorithm I made up to get windspeed and direction. Highlighted in yellow is the input from the sensors needed, with red being the final solution. The true airspeed calculation isn't perfect but its a pretty good approximation.

    Windspeed Algorithm.xls
  • Once you have established a good airspeed while flying and GPS is giving you course over ground (with respect to true north) and speed over ground, I don't see how you can compute wind speed and direction. I would argue that you also need true heading (the angle of the aircraft's longitudinal axis with respect to true north) which is not available unless you have some form of heading reference, ie, a compass.
  • I agree with you. I wanted to mention it for those who didn't know about the possible errors !
  • I have a couple aero degrees, this is a first guess so I can get something that's reasonable. Yes, this data will only be accurate mask taped to my car like that. Out in the freestream, it'll still be pretty close, but probably reading a little slower than it should. Plus, the silicon hose I'm using right now is long and flapping in the wind, both of which are certainly not helping things (the farther the sensor is away from the pitot tube, the less reactive it is).
  • The flow around your car is pretty complex. The Pitot tube may not be far enough, it may be parallel to the road, but you may be at an angle from the flow.

    Here's some explications about Pitot Tube errors. The errors may occur because of the boundary effect, compressibility (...not in our case), relative wind angle (the one that may influence your data) and the installation:

    The error is not that big for the relative wind... There is less than 10% of error for ±20 deg flow.

    By the way, it is a good RedNeck testing experience!! :)
    Pitot Static Tubes | United Sensor Corp.
    United Sensor stainless steel Pitot - Static probes sense total and static pressures at the same point in a moving fluid.
  • By using actual data reading straight out of the analog pin and interpolating from there, I think that takes care of the offset. Yes, theoretically the v = sqrt((2dp)/rho), but I'm just making a fit out of experimental data. I doubt the pressure sensor is linear, plus I'm not sitting at std day sea level and a bunch of other stuff, so who knows what it'd do (without a lot of math). Definitely agreeing with you on the 40mph, but I'm setting that as the threshold to ignore all readings below that for now. I'm hoping to get the UAV to do at least 70, so that should take care of it, even in a stiff wind.
This reply was deleted.