Just curious how it was determined that >3000 would be the right value to expect from the airspeed sensor to indicate that it's connected. I have a APM 1.0 running 2.12 and MPXV7002DP sensor, and after trying 4 different BECs, I can only achieve an output >3000 with 1 bec. The lowest output I got was 2950. I've changed the value to 2940 to make sure things work for me, but I'm curious as to how it was set at 3000.

Views: 1090

Reply to This

Replies to This Discussion

Basically, I took a big stack of APM boards and a big stack of 7002 and 5004 sensors and tested all the combinations, creating a spreadsheet of all the results. Typical values for the "no airspeed" were in the 2700s. 5004s were in the 1300s when they were connected and 7002s were all in the 3000-3200 range.


I did all these under USB power. Maybe these values are all highly influenced by input voltage, and some ESCs give different voltage?


I could easily drop the threshold to 2900. Would that work for you?

The logic for autodetect of airspeed sensor presence seems inverted to me.  In APM 2.12 test.pde and system.pde there is the code...


if ((adc.Ch(AIRSPEED_CH) > 2000) && (adc.Ch(AIRSPEED_CH) < 3000)) {

   airspeed_enabled = false;


  airspeed_enabled = true;



The idea is to detect the zero offset voltage of about Vcc/2 when the sensor is connected.  But in that case, airspeed_enabled should be set to true when the condition is satisfied, not in the "else".

That'd work for me, but I'd hate to special case my situation. The load on my board affects the values returned. I'm also running a uBlox, compass, current, and XBee P900.

APM w/ only airspeed
Connected: 2990
Disconnected: 2880

APM w/ all sensors and xbee
Connected: 2940
Disconnected: 2810

Just for reference, here's all the BECs I tried:

http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=... (only one that worked, but could be a red herring as it probably doesn't do true 5V)
Disconnected airspeed sensors should be in the 2700 range. If it's below 2000 or above 3000 that means that an sensor is connected. I may change that upper bound to 2900.

OK.  I didn't know that about a disconnected sensor.  But, a connected sensor that has a zero offset of Vcc/2 (such as the ratiometric MPXV7002DP ) will have an ADC reading of...


((Vcc/2)/Vcc)*4096 = 2048


and so will be shown as disabled.  Isn't that a problem?

Bob, that's not the case for any sensor I've tested. My test results are as shown earlier in this thread.
I have not tested the MPXV7002DP. I was reading from the spec sheet where it makes a point of having a 2.5 volt output at zero pressure (assuming 5 volt supply).

I am using a MicroBridge sensor that has a range of 0 to 250 Pa over a 0.5 volt to 4.5 volt output. I'm using it, even though that device will only measure up to 45 MPH. I'm flying an EasyStar and that speed range matches that plane pretty well, and I will get better readings in the low speed range.

I have an MPXV7002DP. I'll hook it up and check to see if it matches the spec sheet.

Thanks for your patience.

I just measured my MPXV7002DP.

With 5.06 volts in, analog reads 2.45 volts, which is pretty close to the spec sheet.

I measured this open circuit with a DVM.

I guess the "sensor unconnected" readings that you get from the ADC has something to do with internal couplings of nearby voltages. That's probably been as repeatable as your tests have shown because the surrounding voltages are also quite predictable.


BTW: with that ratio (2.45/5.06), the sensor connected reading that I would expect is 1983, and that would yield airspeed_enabled = true, as desired.

Has anyone seen the case where disconnected the airspeed reading is 4095? That is what I am getting. If I test it with a DMM, no sensor connected, the airspeed analog pin on the Oilpan is reading 4.55 volts. Not sure why the ADC is reporting this as 4095, I'd think it should be closer to 3600-3700, but either way, it's higher than what I'd expect. Chris mentioned it in another thread that disconnected readings should be closer to 3.5 volts.

I've tested my airspeed sensor (MPXV7002 from DIYDrones store) and it works as expected (when not connected to APM). With no pressure difference it gives me a reading of around 2.5 volts on the DMM, and it changes appropriately as I blow into it.

But, not surprisingly, when I connect it to the Oilpan, now the resting voltage of 2.5 goes up to 3.7, I guess because the analog pin is already close to 5. Strangely, the ADC reading still shows 4095, so I guess closer to the ADC chip the voltage must still be high.

Unless there is some screwball way for the ADS7844 ADC chip to set its pins to outputs, the only thing I can imagine causing this behavior is a short in the analog line. From all that I can see, no short is detectable. However, I can't see much since my board is semi-permanently installed within my EasyStar fuse... Also, you would think a straight short would read 5.1 volts, which is my source.

It's a long shot, but before I cut all this apart just wondered if there were any other possibility I missed? Anyone else seen this behavior? 

Looking at the data sheet for the ADC, I see that given the reference of 3.3v, anything above that would indeed result in a maxed out reading (4095), so my reading is at least making sense given what the ADC is measuring.

That still leaves the question why there is ~4.5 volts on the ADC airspeed channel when the sensor isn't even connected. I can detect absolutely no short... All the other ADC channels seem to be responding correctly, and APM can even fly my plane just fine, so it would seem unlikely I've fried the ADC chip. Likewise, my airspeed sensor works fine off-board, so I can't detect any obvious problem there either.

I may have pulled the last of my hair out.... I suppose I can manually disable the airspeed sensor and just fly without it for now.


Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service