0

MPL3115A2 getting bad data for altitude
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MPL3115A2 getting bad data for altitude

by theficus on Tue Sep 30, 2014 10:18 pm

I am using an MPL3115A2 with an Arduino and it's otherwise working fine for barometric pressure and temperature. Altitude is returning odd values though, even if I use the sample code.

Here's a sample output from the MPL3115A2 example:

Code: Select all | TOGGLE FULL SIZE
C4
Writing $26 = 0xB9
Writing $13 = 0x7
Writing $26 = 0x39
77.61 Inches (Hg)
Writing $26 = 0xB9
65523.62 meters
24.25*C
C4
Writing $26 = 0xB9
Writing $13 = 0x7
Writing $26 = 0x39
30.05 Inches (Hg)
Writing $26 = 0xB9
65523.50 meters
24.25*C
C4
Writing $26 = 0xB9
Writing $13 = 0x7
Writing $26 = 0x39
30.05 Inches (Hg)
Writing $26 = 0xB9
65523.37 meters
24.31*C


The first pressure reading is way off but it is fine in subsequent readings. The altitude never seems to be right, though.

Is this just a bad sensor?

theficus
 
Posts: 1
Joined: Tue Sep 30, 2014 10:13 pm

Re: MPL3115A2 getting bad data for altitude

by adafruit_support_rick on Wed Oct 01, 2014 10:20 am

That is weird. The module does the altitude calculation using the same pressure reading (in pascals) as it uses for the barometric pressure.

We can replace the module. Please email support@adafruit.com with a link to this thread for a replacement

adafruit_support_rick
 
Posts: 35058
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MPL3115A2 getting bad data for altitude

by cavu on Sat Dec 16, 2017 11:16 am

I'm having a similar problem. For a day or two, the module works perfectly, accurate and stable. Then it starts to return altitude of 214975.18 feet (adjusted from meters). The temperature and BARO continue to be correct. The program i wrote is relatively simple and returns to an LCD but i get the same readings from the serial monitor. When i load your example sketch (output to serial only) it also reads correct temp, baro but meters is 65523.94 (same as ft. adjusted above). Disconnected for a few days and reboot, all is good again....for a few days.
Suggestions?

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

Re: MPL3115A2 getting bad data for altitude

by adafruit_support_rick on Mon Jan 08, 2018 11:13 am

Sorry - I've been offline for a few weeks.

I can't explain this behavior, except as a hardware problem. Please email support@adafruit.com with a link to this post for a replacement MPL3115A2

adafruit_support_rick
 
Posts: 35058
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MPL3115A2 getting bad data for altitude

by cavu on Mon Jan 08, 2018 9:14 pm

Did you actually try to duplicate the problem using your example code and running it for 24 hours?
thank you

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

Re: MPL3115A2 getting bad data for altitude

by adafruit_support_rick on Tue Jan 09, 2018 7:32 pm

No. The library code is extremely simple. It just reads 20 bits over I2C, converts it to floating point, divides by 16, and reports it. So it winds up essentially being a 16-bit value. 65523.94 is very close to the max value of a 16-bit integer (i.e., 65535), so I have to believe that the sensor is sending over solid '1' bits. That's a hardware problem.

adafruit_support_rick
 
Posts: 35058
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Please be positive and constructive with your questions and comments.