MPL3115A2 test program and sensor stability

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
allenmshapiro
 
Posts: 26
Joined: Tue Nov 11, 2014 6:37 pm

MPL3115A2 test program and sensor stability

Post by allenmshapiro »

1. I have downloaded the zipped library for the MPL3115A2 and installed it in the Arduino software.
2. I wired the Arduino Uno using the information noted on the product page using the I2C protocols.
3. I used the test program that was part of that download (testmpl3115a2.ino) to test the barometric sensor.
4. In observing the data printed to the Serial Monitor, the following information is printed in executing the first 2 loops:

Adafruit_MPL3115A2 test!
C4
Writing $26 = 0xB9
Writing $13 = 0x7
Writing $26 = 0x39
0.17 Inches (Hg)
Writing $26 = 0xB9
145.19 meters
24.25*C
C4
Writing $26 = 0xB9
Writing $13 = 0x7
Writing $26 = 0x39
29.49 Inches (Hg)
Writing $26 = 0xB9
145.19 meters
24.25*C

5. I am confused by the lines that start with "Writing"
6. What is the source and meaning of these lines? They are not listed as "Serial.print" statements in the code.
7. I am assuming that these lines are an artifact of the code in the library. Can these written lines on the Serial Monitor be suppressed? If so, how would I go about doing that?

A second question I have regarding the operation of the MPL3115A2 is the stability of the sensor measurements.

8. In the listing above from the Serial Monitor, you will see that the first barometric reading is 0.17 inches (Hg), the next barometric reading is 29.49 Inches (Hg). The latter reading is correct. In observing subsequent data printed to the Serial Monitor, I have noticed that occasionally the barometric sensor reading reverts back to something near 0.17 Inches (Hg). Is there a reason for this fluctuation? And, should I expect such fluctuations in the sensor readings?
9. This issue of sensor stability is of great concern to me because I will be using automated means of processing the data from a large number of sensors and would like to avoid using a filtering algorithm that removes spurious data.
10. Any assistance in addressing this issue would be greatly appreciated.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: MPL3115A2 test program and sensor stability

Post by adafruit_support_mike »

The lines that begin with "Writing ..." come from the write8() function in the file Adafruit_MPL3115A2.cpp.

They provide debugging information, to make sure the chip is being configured correctly and is getting the right commands. We use the examples for troubleshooting hardware problems here in the forums, and that kind of information helps us locate problems quickly.

To get rid of them, comment out lines 200 and 201 in the file Adafruit_MPL3115A2.cpp.

WRT the pressure reading dropping to 0.17, it's possible that the code is reading the sensor before a conversion is finished. Try increasing the delay between polling steps from 250ms to 255ms.

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

Return to “General Project help”