0

MPL3115A2 Altimeter Not Stable
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: MPL3115A2 Altimeter Not Stable

by TUTTLES MOWER on Wed Jan 10, 2018 11:13 am

I'm experiencing similar problems. was any solution found?- Michael
TUTTLES MOWER
 
Posts: 17
Joined: Tue Nov 19, 2013 8:48 pm

Re: MPL3115A2 Altimeter Not Stable

by adafruit2 on Wed Jan 10, 2018 2:02 pm

pleas try the suggestions we gave the OP!

adafruit2
Site Admin
 
Posts: 16334
Joined: Fri Mar 11, 2005 7:36 pm

Re: MPL3115A2 Altimeter Not Stable

by cavu on Mon Jan 22, 2018 7:14 am

i had a chance to run the sensor with the Sparkfun library for 50 hours continuously and it remains very stable and accurate. If i then switch back to the Adafruit library, i get the same high altitude mentioned above. Please try to duplicate the problem with your example code. thanks.

cavu
 
Posts: 23
Joined: Mon Jan 02, 2012 10:24 pm

Re: MPL3115A2 Altimeter Not Stable

by adafruit2 on Mon Jan 22, 2018 1:39 pm

huh! ok thats at least lets us know its the code, we'll set something up today

adafruit2
Site Admin
 
Posts: 16334
Joined: Fri Mar 11, 2005 7:36 pm

Re: MPL3115A2 Altimeter Not Stable

by real_dean on Wed Jan 24, 2018 4:54 pm

hello! please try with the most recent code here: https://github.com/adafruit/Adafruit_MPL3115A2_Library

I tested for a long time on an adafruit Metro and an adafruit Meto M0 and ran into no issues.

real_dean
 
Posts: 10
Joined: Mon Jun 30, 2014 11:20 am

Re: MPL3115A2 Altimeter Not Stable

by cavu on Thu Jan 25, 2018 1:09 pm

Thank you for testing it. I rebuilt my sketch using the SF library but let me test it on something other than the Arduino Uno. doubt it but that could be the issue.

cavu
 
Posts: 23
Joined: Mon Jan 02, 2012 10:24 pm

Re: MPL3115A2 Altimeter Not Stable

by adafruit2 on Thu Jan 25, 2018 1:14 pm

yeh we think it was some delays and the way we were querying the sensor (now fixed)

adafruit2
Site Admin
 
Posts: 16334
Joined: Fri Mar 11, 2005 7:36 pm

Re: MPL3115A2 Altimeter Not Stable

by wrightwx on Tue Apr 03, 2018 8:51 pm

I seem to have run into the same issue. I have a MPL3115A2 wired to a Feather 32u4 adalogger. I tried the updated script linked to this forum topic, but I still get an altitude of 216000m rather than 1340m (actual) after about the 10th reading. I also noticed the read rate increases by about 50% once the altitude switches to the erroneous value. I tried the Sparkfun script and the altitude error goes away, but now it throws an occasional temperature error of -1766F at about every 10th to 20th reading. I tried adding and changing delays, but that makes no difference. Actual temperature is 70.6F. Any thoughts? I also have a SHT31-D and BNO055 wired up to the same Adalogger and tested which have not given any error so far.

wrightwx
 
Posts: 11
Joined: Fri Mar 09, 2018 1:34 am

Re: MPL3115A2 Altimeter Not Stable

by wrightwx on Wed Apr 04, 2018 5:08 pm

So I have figured out that my issue is not the altitude, but the temperature sensor - or possibly in the code/communications. When I change the code (Sparkfun's - per previous discussion in this thread) to give the pressure and temperature separately (not calculating altitude), the pressure remains stable, but the temperature starts stable and with correct values, then reads "0.00" then "-1766.2F". Also, the refresh rate slows by half. When I convert this back to Celsius, it is "-999". Refreshing the connection or reloading the script fixes the temperature - temporarily until it starts throwing the -999 again. Running the code to just read pressure resolves this outside about every 50th to 100th reading comes in as "0.00". Running the code to just read temperature just delays the onset of the erroneous -999's by a minute or two. I have tried combinations of delays and they do not seem to make a difference when reading both pressure and temperature.

When I check the SparkFunMPL3115A2.cpp file, I see there are several ways to throw a "-999":

if(++counter > 600) return(-999); //Error out after max of 512ms for a read
if (Wire.requestFrom(MPL3115A2_ADDRESS, 3) != 3) { // Request three bytes return -999;
if (Wire.requestFrom(MPL3115A2_ADDRESS, 2) != 2) { // Request two bytes return -999;

I'm a bit new to this, so I'm hoping for some advice on resolving this. I have this wired to a Feather 32u4 Adalogger. Other sensors I am testing with the board don't give any errors. (SHT31-D, BNO055). System approach is I2C 3.3V logic.

wrightwx
 
Posts: 11
Joined: Fri Mar 09, 2018 1:34 am

Re: MPL3115A2 Altimeter Not Stable

by cavu on Wed Apr 04, 2018 5:40 pm

I'm pretty sure it's the Adafruit library and not related to the MPL3115A2 sensor though I can't figure out how Adafruit got it to work (see earlier chain). I've tried running multiple MPL3115A2 on different arduino boards and tweaked the sampling rate with the Adafruit software but all end up with the same problem. Right now I'm using it with the adafruit feather 32u4 and their 7 segment display with Sparkfun library and it runs fantastic. temperature, baro and altimeter are all extremely accurate and stable.

cavu
 
Posts: 23
Joined: Mon Jan 02, 2012 10:24 pm

Re: MPL3115A2 Altimeter Not Stable

by wrightwx on Wed Apr 04, 2018 6:17 pm

I am using the SparkFun sketch and library. When I used the Arduino sketch and library, the error appeared as 216000m altitude. I think it resulted from bad temperature readings. You need pressure and temperature to calculate altitude. I may end up using the temperature and humidity from my SHT31 instead. It is more correct, anyway, to add humidity to altitude calcualtion, since water has a different molecular weight than other air molecules. This makes it that much more accurate. I am ultimately launching this in a low-altitude rocket and need high frequency and accuracy.

wrightwx
 
Posts: 11
Joined: Fri Mar 09, 2018 1:34 am

Re: MPL3115A2 Altimeter Not Stable

by wrightwx on Wed Apr 04, 2018 6:20 pm

It could be the library as well. Now my BNO055 randomly starts throwing all zeroes at me after several minutes of good data. Similar symptoms.

wrightwx
 
Posts: 11
Joined: Fri Mar 09, 2018 1:34 am

Please be positive and constructive with your questions and comments.