I’m a noob, hopefully I’m just doing something wrong. Received the MPL3115A2 sensor breakout. I have it connected to my Mini Arduino Pro per the hookup guide https://learn.sparkfun.com/tutorials/mp … kup-guide?, but without the logic level converter because my Arudino is 3.3V
Running the SparkFunAltimeter code provided in the library, the sensor says I’m at altitude -5480 feet, and temp 242. Since I’m neither in a mine shaft nor currently boiling, the readings are wrong.
I’m using the Vcc pin on my arudino mini pro https://www.arduino.cc/en/pmwiki.php?n= … ardProMini to power the sensor. Is that pin not supposed to power other chips? Do I need to calibrate the sensor somehow? Any advice would be appreciated! Thank you!
If the Arduino Pro Mini that you have is the 3.3V model, then it is OK to power the sensor from the Arduino Vcc pin.
For the other issues, I suggest to contact Sparkfun Technical Support, but in the meantime, try the other examples.
Read the barometric pressure, and tell us what you get. It won’t be the same as reported by your nearby airport or weather station, because those readings are corrected to sea level, as mentioned in the “getting started” guide.
I think I just figured out my issue. The arduino pro mini is being powered by a Solarbotics TTLyFTDI connector https://solarbotics.com/product/39240/ which normally supplies 5V. I made a small solder bridge that should make it run 3.3 V, but that doesn’t seem to be working. I’m measuring the FTDI chip still giving 5V to the pro mini. I imagine if I get a true 3.3V power source the sensor will read correctly.
Thank you for responding to my plea for help though! I really appreciate it!
Unfortunately, you may have cooked the pressure sensor by applying 5V. It is a 3.3V only device and although it has a voltage regulator, the I/O pins must not be exposed to 5V.
jremington -
Thank you so much for your help in the arduino forum showing me how to measure the arduino’s voltage internally! Unfortunately, now I’m swinging back around to this problem.
I’m making an altitude recorder to go in a model rocket. I’m using:
-
Arduino Pro Mini, 328P, 3.3V 8MHz
-
SparkFun MPL3115A2 pressure sensor
-
SparkFun OpenLog
-
240mAh Lipo battery
My actual elevation is about 1,000 ± 50 feet. Each trial took place in my basement, not moving. The first 3 trials after I got the pressure sensor working (after switching to Sparkfun’s 3.3v FTDI Basic board) the altitude it gave me was almost perfect, about 1,042 ± 10 feet. (See LOG00010)
Four tests later (when I reduced 2 buttons down to 1 button on the breadboard), the sensor was telling me around 1,130 feet. (See LOG00014 - please ignore debugging text)
By the 6th test (when I made the 1 button use an interrupt), the sensor read about 1381 feet. (See LOG00016)
The next record I still have is LOG00024. On pretty much every test I’ve run since then the sensor reads somewhere between 760-ish and 700-ish feet. LOG00046 is the most recent - formatting is off, but the voltage is finally accurate (thank you!).
Another piece of info for troubleshooting this: Earlier this month I was rummaging through my electronics stuff and came across a second MPL3115A2 SparkFun sensor that I’d ordered years ago. I’ve swapped out the original sensor I was using with this old one I found, and the old one consistently gives readings about 100 feet higher than the current one. See LOG00013 and LOG00043 - each of which used the same breadboard setup as the previous log.
So in summary, every time I run the sensor the output stays consistent +/- 5 feet (although the first reading is consistently high), but each test run differs +/- 50 feet, all of which is a good 200 feet away from accurate.
How can I increase the accuracy of this sensor? Thank you!!!
Can someone tell me if my pressure sensors are both malfunctioning?
I have 2 MPL3115A2 Pressure Sensors. I’ll refer to them by their purchase date.
-
One was purchased in 2014. I don’t think I ever used it before, but I’ve moved three times since then so it’s possible it could have received a physical shock at some point.
-
The other was purchased in 2020. When I first hooked it up it was exposed to 5v so there’s reason to suspect it was damaged. However, it outputs data appropriately and the temperature sensor works great.
Neither sensor ever seems to settle on an altitude reading. All these test were performed inside.
I left the 2020 sensor on for 30 mins and recorded the data. Vcc was constant the whole time, and the temperature never varied by more than 1 degree. Altitude varied by 16 feet. Graph of 2020 sensor results: See LOG00057 attached
https://flic.kr/p/2jdbhe5
I did the same test with the 2014 sensor. Again, Vcc was constant the whole time, and temperature never varied more than 1 degree. Altitude varied by 34 feet. Graph of 2014 sensor results, see LOG00058 attached
I thought maybe there’s a problem with my setup somehow, so then I tested the 2014 sensor using an arduino Uno and recording the data via the IDE’s Serial Monitor. (I also turned off my AC trying to eliminate interference.) Altitude varied by 29 feet. Graph of 2014 sensor w. arduino Uno, see attached LOG-2014Sen…
Are both of these sensors most likely damaged?
They could be defective depending on the environment and storage. However, if they’re getting consistent margins of error then you could just account for them in the code.
My apologies. Since I can’t get attachments or the image tag to work I’ll link to images on flickr.
2020 sensor on for 30 mins and recorded the data. Vcc was constant the whole time, and the temperature never varied by more than 1 degree. Altitude varied by 16 feet. Graph: https://flic.kr/p/2jdbhe5
2014 sensor, same test as above. Again, Vcc was constant the whole time, and temperature never varied more than 1 degree. Altitude varied by 34 feet. Graph: https://flic.kr/p/2jd7ed4
2014 sensor test using an arduino Uno and recording the data via the IDE’s Serial Monitor. (No AC.) Altitude varied by 29 feet. Graph: https://flic.kr/p/2jd7e6W Computer went to sleep towards the end.
KansasBot - Unfortunately the margin of error is not consistent at all. Hopefully the graphs will be viewable now. The [datasheet says the sensor is factory calibrated but does mention that you can add adjustments using volatile registers.](https://cdn.sparkfun.com/datasheets/Sensors/Pressure/MPL3115A2.pdf#G1004816)
In order to use a pressure sensor as an altimeter, you have to calibrate it nearly every day to the current altitude (and sometimes more often). The local air pressure varies with the weather, and that can translate into hundreds of feet change in the calculated altitude, from one day to the next and sometimes even from hour to hour.
Most people calibrate their sensors by calculating the “sea level pressure” corresponding to their current measured pressure and known altitude, which is then used as the reference altitude. That is what airports and pilots do.
Each one of my 30 minute tests has a sort of roller coaster effect at the beginning that can’t possibly reflect a real change in air pressure. If that part is inaccurate, it takes about 500,000ms (over 8 minutes) before I can trust the data coming in. (SorryI Just realized I didn’t label my axis. That’s the kind of thing I usually chide my students about. All time is measured in milliseconds.) Is that typical for a sensor like this?
I tried running both sensors simultaneously and then graphing their output. https://flic.kr/p/2jdsBkp For what it’s worth I always set the oversample rate to the recommended 128 for both sensors.
It looks like after about 8 minutes both sensors are more or less tracking together. The 2014 sensor definitely seems to take 8 minutes to read properly. The 2014 sensor might only need 5 minutes or so.
Is this expected behavior for the MPL3115A2? I can make the raw data available if anyone is interested.
I’ve never seen a problem like that, and would not trust the data either. The sensor may have been damaged.
This is the one I use and it works very well: https://www.pololu.com/product/2126
Pololu designs include level shifters, so you can’t damage the sensor with voltage mismatch.
Those sensors use barometric pressure to determine Altitude. Any change in pressure can affect the altitude readings. They’re calibrated in the factory with a reference point of a vaccum. So the environment and weather can really affect these modules. What you need to do is run reference data from local data (weather channel, known altitude, etc) and use that to offset and calibrate your data. The modules seem to be functioning correctly.