mystical sensor MPL3115

Showing results for 
Search instead for 
Did you mean: 

mystical sensor MPL3115

Contributor I

Hello, developers!

Now i make a project " portable weather station" based on MPL3115. Primary functions: display current time, e-kompass, pressure, altitude, temperature and weather forecast. its a batterry-operated devices, and components must have minimal Supply Current. when I found a MPL3115 i been really excited, because this IC have all what i need. But now my project is has stalled.

Firstly, i wrote a source code as datasheet recomendations, for set and change mode of MPL3115, read registers and display the results. i test code and sensor at LPC-812 MBED board (because i like LPCXpresso) and sensor board is powered from LPC-812 (3.3 Volt). and I got the some results (pressure, temperature and altitude).

Next, i reading a AN3914 ("Modern Altimeter and Barometer System using the MPL115A") and start to adaptation this algorithm for  MPL3115.

for  make a weather forecast i need to get  pressure change per 1 hour. for this, i chose a 3-hours/180 minutes interval for collected samples in FIFO every ~20 minutes. User should be able get a weather forecast at any time, so program must compare oldest and newest samples (for example, now is 11-10 AM, oldest sample was obtained at 8-00 AM, newest samples at 11-00 AM. i compare  this samples, divided and get a pressure change per 1 hour. then i make a weatern pattern and display it. next samples update will be at 11-20 AM. )

but i get a first STOP: bytes, reading from FIFO, "deleted from the front of the FIFO buffer" (page24 DS). so if I read values ​​from the buffer, I lost them. and if i make a weather pattern as in the above example at 11-10AM, at 11-20 AM i can't get the data from FIFO. next possibility for 1 hour pressure change i will get only via 1 hour!  all the collected data (from 8-20 AM to 11-20 AM) will be LOST!

So. this way is not work.:smileyshocked:

Ok, AN3914 have another faster way to make a weather forecast (page 6)! all i need - it's a  pressure and current altutude (MPL3115 must give all of this). i must calculate "ideal pressure" Pweather (for good sunny day) for current altitude by using the equation: Pweather = (101.3 * exp(((float)(CurrentAltitude))/(-7900))). and compare current pressure with "ideal".

i wrote a code: set Altimeter mode and get a current altitude, set Barometer mode and get a current pressure, calculate and display result of weather pattern. i live in area at 56—178 meters of sea level. i start the test and get a second STOP  :

sensor's PCB is on the table at room temperature (22-24 C) and does not move. source code don't change.  in the morning i have altitude=102 meters, in the dinner =32 meters, in the evening 0 meters. i turn on Debugger and see: when  I read data registers in Altimeter mode, OUT_P_MSB Register= 0xFF, so i get incorrect data from sensor . But i get correct temperature data in this reading operation (i make a cycle read 5 bytes from sensor at one procedure).

So,this way does not inspire confidence...:smileysad:

I just have to find a shaman! Because I can not find understanding with this really fine sensor.

May be anybody help me?

Best regards, Ellis

Labels (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hi Ellis,

We have some code examples and other documentation available in Freescale communities, perhaps it can be useful:



0 Kudos