MPL3115A2 getting bad data for altitude

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
theficus
 
Posts: 7
Joined: Tue Sep 30, 2014 10:13 pm

MPL3115A2 getting bad data for altitude

Post by theficus »

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

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?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MPL3115A2 getting bad data for altitude

Post by adafruit_support_rick »

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 [email protected] with a link to this thread for a replacement

User avatar
cavu
 
Posts: 41
Joined: Mon Jan 02, 2012 10:24 pm

Re: MPL3115A2 getting bad data for altitude

Post by cavu »

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?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MPL3115A2 getting bad data for altitude

Post by adafruit_support_rick »

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

I can't explain this behavior, except as a hardware problem. Please email [email protected] with a link to this post for a replacement MPL3115A2

User avatar
cavu
 
Posts: 41
Joined: Mon Jan 02, 2012 10:24 pm

Re: MPL3115A2 getting bad data for altitude

Post by cavu »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MPL3115A2 getting bad data for altitude

Post by adafruit_support_rick »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”