mystical sensor MPL3115

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mystical sensor MPL3115

2,654 Views
ellisfeguson
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...Smiley Sad

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

1,671 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Ellis,

We have some code examples and other documentation available in Freescale communities, perhaps it can be useful: https://community.freescale.com/community/sensors/content?filterID=contentstatus%5Bpublished%5D~obje...

Regards,

Jose

0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-251777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Emystical%20sensor%20MPL3115%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-251777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20developers!%3C%2FP%3E%3CP%3ENow%20i%20make%20a%20project%20%22%20portable%20weather%20station%22%20based%20on%20MPL3115.%20Primary%20functions%3A%20display%20current%20time%2C%20e-kompass%2C%20pressure%2C%20altitude%2C%20temperature%20and%20weather%20forecast.%20its%20a%20batterry-operated%20devices%2C%20and%20components%20must%20have%20minimal%20Supply%20Current.%20when%20I%20found%20a%20MPL3115%20i%20been%20really%20excited%2C%20because%20this%20IC%20have%20all%20what%20i%20need.%20But%20now%20my%20project%20is%20has%20stalled.%3C%2FP%3E%3CP%3EFirstly%2C%20i%20wrote%20a%20source%20code%20as%20datasheet%20recomendations%2C%20for%20set%20and%20change%20mode%20of%20MPL3115%2C%20read%20registers%20and%20display%20the%20results.%20i%20test%20code%20and%20sensor%20at%20LPC-812%20MBED%20board%20(because%20i%20like%20LPCXpresso)%20and%20sensor%20board%20is%20powered%20from%20LPC-812%20(3.3%20Volt).%20and%20I%20got%20the%20some%20results%20(pressure%2C%20temperature%20and%20altitude).%3C%2FP%3E%3CP%3ENext%2C%20i%20reading%20a%20AN3914%20(%22Modern%20Altimeter%20and%20Barometer%20System%20%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%20line-height%3A%201.5em%3B%22%3Eusing%20the%20MPL115A%22)%20%3C%2FSPAN%3Eand%20start%20to%20adaptation%20this%20algorithm%20for%26nbsp%3B%20MPL3115.%3C%2FP%3E%3CP%3Efor%26nbsp%3B%20make%20a%20weather%20forecast%20i%20need%20to%20get%26nbsp%3B%20pressure%20change%20per%201%20hour.%20for%20this%2C%20i%20chose%20a%203-hours%2F180%20minutes%20interval%20for%20collected%20samples%20in%20FIFO%20every%20~20%20minutes.%20User%20should%20be%20able%20get%20a%20weather%20forecast%20at%20any%20time%2C%20so%20program%20must%20compare%20oldest%20and%20newest%20samples%20(for%20example%2C%20now%20is%2011-10%20AM%2C%20oldest%20sample%20was%20obtained%20at%208-00%20AM%2C%20newest%20samples%20at%2011-00%20AM.%20i%20compare%26nbsp%3B%20this%20samples%2C%20divided%20and%20get%20a%20pressure%20change%20per%201%20hour.%20then%20i%20make%20a%20weatern%20pattern%20and%20display%20it.%20next%20samples%20update%20will%20be%20at%2011-20%20AM.%20)%3C%2FP%3E%3CP%3Ebut%20i%20get%20a%20%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CSTRONG%3Efirst%20STOP%3C%2FSTRONG%3E%3C%2FSPAN%3E%3A%20bytes%2C%20reading%20from%20FIFO%2C%20%22deleted%20from%20the%20front%20of%20the%20FIFO%20buffer%22%20(page24%20DS).%20so%20if%20I%20read%20values%20%E2%80%8B%E2%80%8Bfrom%20the%20buffer%2C%20I%20lost%20them.%20and%20if%20i%20make%20a%20weather%20pattern%20as%20in%20the%20above%20example%20at%2011-10AM%2C%20at%2011-20%20AM%20i%20can't%20get%20the%20data%20from%20FIFO.%20next%20possibility%20for%201%20hour%20pressure%20change%20i%20will%20get%20only%20via%201%20hour!%26nbsp%3B%20all%20the%20collected%20data%20(from%208-20%20AM%20to%2011-20%20AM)%20will%20be%20LOST!%3C%2FP%3E%3CP%3ESo.%20this%20way%20is%20not%20work.%3Asmileyshocked%3A%3C%2FP%3E%3CP%3EOk%2C%20AN3914%20have%20another%20faster%20way%20to%20make%20a%20weather%20forecast%20(page%206)!%20all%20i%20need%20-%20it's%20a%26nbsp%3B%20pressure%20and%20current%20altutude%20(MPL3115%20must%20give%20all%20of%20this).%20i%20must%20calculate%20%22ideal%20pressure%22%20Pweather%20(for%20good%20sunny%20day)%20for%20current%20altitude%20by%20using%20the%20equation%3A%20Pweather%20%3D%20(101.3%20*%20exp(((float)(CurrentAltitude))%2F(-7900))).%20and%20compare%20current%20pressure%20with%20%22ideal%22.%3C%2FP%3E%3CP%3Ei%20wrote%20a%20code%3A%20set%20Altimeter%20mode%20and%20get%20a%20current%20altitude%2C%20set%20Barometer%20mode%20and%20get%20a%20current%20pressure%2C%20calculate%20and%20display%20result%20of%20weather%20pattern.%20i%20live%20in%20area%20at%2056%E2%80%94178%20meters%20of%20sea%20level.%20i%20start%20the%20test%20and%20get%20a%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3E%3CSTRONG%3E%20second%20STOP%3C%2FSTRONG%3E%3C%2FSPAN%3E%26nbsp%3B%20%3A%3C%2FP%3E%3CP%3Esensor's%20PCB%20is%20on%20the%20table%20at%20room%20temperature%20(22-24%20C)%20and%20does%20not%20move.%20source%20code%20don't%20change.%26nbsp%3B%20in%20the%20morning%20i%20have%20altitude%3D102%20meters%2C%20in%20the%20dinner%20%3D32%20meters%2C%20in%20the%20evening%200%20meters.%20i%20turn%20on%20Debugger%20and%20see%3A%20when%26nbsp%3B%20I%20read%20data%20registers%20in%20Altimeter%20mode%2C%20OUT_P_MSB%20Register%3D%200xFF%2C%20so%20i%20get%20incorrect%20data%20from%20sensor%20.%20But%20i%20get%20correct%20temperature%20data%20in%20this%20reading%20operation%20(i%20make%20a%20cycle%20read%205%20bytes%20from%20sensor%20at%20one%20procedure).%3C%2FP%3E%3CP%3ESo%2Cthis%20way%20does%20not%20inspire%20confidence...%3CIMG%20id%3D%22smileysad%22%20class%3D%22emoticon%20emoticon-smileysad%22%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fi%2Fsmilies%2F16x16_smiley-sad.png%22%20alt%3D%22Smiley%20Sad%22%20title%3D%22Smiley%20Sad%22%20%2F%3E%3C%2FP%3E%3CP%3EI%20just%20have%20to%20find%20a%20shaman!%20Because%20I%20can%20not%20find%20understanding%20with%20this%20really%20fine%20sensor.%3C%2FP%3E%3CP%3EMay%20be%20anybody%20help%20me%3F%3C%2FP%3E%3CP%3EBest%20regards%2C%20Ellis%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-251777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EPressure%20Sensors%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-251778%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20mystical%20sensor%20MPL3115%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-251778%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Ellis%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EWe%20have%20some%20code%20examples%20and%20other%20documentation%20available%20in%20Freescale%20communities%2C%20perhaps%20it%20can%20be%20useful%3A%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fcommunity%2Fsensors%2Fcontent%3FfilterID%3Dcontentstatus%5Bpublished%5D~objecttype~objecttype%5Bdocument%5D%26amp%3Bquery%3DMPL3115A2%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.freescale.com%2Fcommunity%2Fsensors%2Fcontent%3FfilterID%3Dcontentstatus%255Bpublished%255D~objecttype~objecttype%255Bdocument%255D%26amp%3Bquery%3DMPL3115A2%3C%2FA%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EJose%3C%2FP%3E%3C%2FLINGO-BODY%3E